diff --git a/CMakeExternals/Boost.cmake b/CMakeExternals/Boost.cmake
index bf50d36881..323448f549 100644
--- a/CMakeExternals/Boost.cmake
+++ b/CMakeExternals/Boost.cmake
@@ -1,343 +1,343 @@
 #-----------------------------------------------------------------------------
 # Boost
 #-----------------------------------------------------------------------------
 
 include(mitkFunctionGetMSVCVersion)
 
 #[[ Sanity checks ]]
-if(DEFINED BOOST_ROOT AND NOT EXISTS ${BOOST_ROOT})
-  message(FATAL_ERROR "BOOST_ROOT variable is defined but corresponds to non-existing directory")
+if(DEFINED Boost_ROOT AND NOT EXISTS ${Boost_ROOT})
+  message(FATAL_ERROR "Boost_ROOT variable is defined but corresponds to non-existing directory")
 endif()
 
 string(REPLACE "^^" ";" MITK_USE_Boost_LIBRARIES "${MITK_USE_Boost_LIBRARIES}")
 
 set(proj Boost)
 set(proj_DEPENDENCIES )
 set(Boost_DEPENDS ${proj})
 
-if(NOT DEFINED BOOST_ROOT AND NOT MITK_USE_SYSTEM_Boost)
+if(NOT DEFINED Boost_ROOT AND NOT MITK_USE_SYSTEM_Boost)
 
   #[[ Reset variables. ]]
   set(patch_cmd "")
   set(configure_cmd "")
   set(install_cmd "")
 
-  set(BOOST_ROOT ${ep_prefix})
-  set(Boost_DIR "${BOOST_ROOT}/lib/cmake/Boost-1.82.0")
+  set(Boost_ROOT ${ep_prefix})
+  set(Boost_DIR "${Boost_ROOT}/lib/cmake/Boost-1.82.0")
 
   if(WIN32)
-    set(BOOST_LIBRARYDIR "${BOOST_ROOT}/lib")
+    set(BOOST_LIBRARYDIR "${Boost_ROOT}/lib")
   endif()
 
   #[[ If you update Boost, make sure that the FindBoost module of the minimum
       required version of CMake supports the new version of Boost.
 
       In case you are using a higher version of CMake, download at least the
       source code of the minimum required version of CMake to look into the
       right version of the FindBoost module:
 
         <CMAKE_INSTALL_DIR>/share/cmake-<VERSION>/Modules/FindBoost.cmake
 
       Search for a list called _Boost_KNOWN_VERSIONS. If the new version is
       not included in this list, you have three options:
 
         * Update the minimum required version of CMake. This may require
           adaptions of other parts of our CMake scripts and has the most
           impact on other MITK developers. Yet this is the safest and
           cleanest option.
 
         * Set Boost_ADDITIONAL_VERSIONS (see the documentation of the
           FindBoost module). As Boost libraries and dependencies between
           them are hard-coded in the FindBoost module only for known versions,
           this may cause trouble for other MITK developers relying on new
           components of Boost or components with changed dependencies.
 
         * Copy a newer version of the FindBoost module into our CMake
           directory. Our CMake directory has a higher precedence than the
           default CMake module directory. Doublecheck if the minimum required
           version of CMake is able to process the newer version of the
           FindBoost module. Also, DO NOT FORGET to mention this option right
           above the call of cmake_minimum_required() in the top-level
           CMakeLists.txt file AND in this file right above the set(url)
           command below so if we update the minimum required version of CMake
           or use another option in the future, we do not forget to remove our
           copy of the FindBoost module again. ]]
 
   set(url "${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/boost_1_82_0.tar.gz")
   set(md5 f7050f554a65f6a42ece221eaeec1660)
 
   if(MITK_USE_Boost_LIBRARIES)
 
      #[[ Boost has a two-step build process. In the first step, a bootstrap
          script is called to build b2, an executable that is used to actually
          build Boost in the second step.
 
          The bootstrap script expects a toolset (compiler) argument that is
          used to build the b2 executable. The scripts and their expected
          argument format differ between Windows and Unix. ]]
 
     if(WIN32)
 
       mitkFunctionGetMSVCVersion()
 
       if(VISUAL_STUDIO_VERSION_MINOR EQUAL 0)
 
         #[[ Use just the major version in the toolset name. ]]
         set(bootstrap_args vc${VISUAL_STUDIO_VERSION_MAJOR})
 
       elseif(VISUAL_STUDIO_VERSION_MAJOR EQUAL 14 AND VISUAL_STUDIO_VERSION_MINOR LESS 20)
 
         #[[ Assume Visual Studio 2017. ]]
         set(bootstrap_args vc${VISUAL_STUDIO_VERSION_MAJOR}1)
 
       elseif(VISUAL_STUDIO_VERSION_MAJOR EQUAL 14 AND VISUAL_STUDIO_VERSION_MINOR LESS 30)
 
         #[[ Assume Visual Studio 2019. ]]
         set(bootstrap_args vc${VISUAL_STUDIO_VERSION_MAJOR}2)
 
       elseif(VISUAL_STUDIO_VERSION_MAJOR EQUAL 14 AND VISUAL_STUDIO_VERSION_MINOR LESS 40)
 
         #[[ Assume Visual Studio 2022. ]]
         set(bootstrap_args vc${VISUAL_STUDIO_VERSION_MAJOR}3)
 
       else()
 
         #[[ Fallback to the generic case. Be prepared to add another elseif
             branch above for future versions of Visual Studio. ]]
         set(bootstrap_args vc${VISUAL_STUDIO_VERSION_MAJOR})
 
       endif()
 
     else()
 
       #[[ We support GCC and Clang on Unix. On macOS, the toolset must be set
           to clang. The actual compiler for all of these toolkits is set
           further below, after the bootstrap script but before b2. ]]
 
       if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
         set(toolset gcc)
       elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR APPLE)
         set(toolset clang)
       endif()
 
       if(toolset)
         set(bootstrap_args --with-toolset=${toolset})
       endif()
 
       #[[ At least give it a shot if the toolset is something else and let
           the bootstrap script decide on the toolset by not passing any
           argument. ]]
 
     endif()
 
     #[[ The call of b2 is more complex. b2 arguments are grouped into options
         and properties. Options follow the standard format for arguments while
         properties are plain key-value pairs. ]]
 
     set(b2_options
       --build-dir=<BINARY_DIR>
       --stagedir=<INSTALL_DIR>
       --ignore-site-config #[[ Build independent of any site.config file ]]
       -q #[[ Stop at first error ]]
     )
 
     if(APPLE AND CMAKE_OSX_SYSROOT)
 
       #[[ Specify the macOS platform SDK to be used. ]]
       list(APPEND b2_options --sysroot=${CMAKE_OSX_SYSROOT})
 
     endif()
 
     foreach(lib ${MITK_USE_Boost_LIBRARIES})
       list(APPEND b2_options --with-${lib})
     endforeach()
 
     set(b2_properties
       threading=multi
       runtime-link=shared
       "cxxflags=${MITK_CXX${MITK_CXX_STANDARD}_FLAG} ${CMAKE_CXX_FLAGS}"
     )
 
     if(CMAKE_SIZEOF_VOID_P EQUAL 8)
       list(APPEND b2_properties address-model=64)
     else()
       list(APPEND b2_properties address-model=32)
     endif()
 
     if(BUILD_SHARED_LIBS)
       list(APPEND b2_properties link=shared)
     else()
       list(APPEND b2_properties link=static)
     endif()
 
     list(APPEND b2_properties "\
 $<$<CONFIG:Debug>:variant=debug>\
 $<$<CONFIG:Release>:variant=release>\
 $<$<CONFIG:MinSizeRel>:variant=release>\
 $<$<CONFIG:RelWithDebInfo>:variant=release>")
 
     if(WIN32)
 
       set(bootstrap_cmd if not exist b2.exe \( call bootstrap.bat ${bootstrap_args} \))
       set(b2_cmd b2 ${b2_options} ${b2_properties} stage)
 
     else()
 
       set(bootstrap_cmd #[[ test -e ./b2 || ]] ./bootstrap.sh ${bootstrap_args})
       set(b2_cmd ./b2 ${b2_options} ${b2_properties} stage)
 
       #[[ We already told Boost if we want to use GCC or Clang but so far we
           were not able to specify the exact same compiler we set in CMake
           when configuring the MITK superbuild for the first time.
           For example, this can be different from the system default
           when multiple versions of the same compiler are installed
           at the same time.
 
           The bootstrap script creates a configuration file for b2 that should
           be modified if necessary before b2 is called.
           We look for a line like
 
             using gcc ;
 
           and replace it with something more specific like
 
             using gcc : : /usr/bin/gcc-7.3 ;
 
           We use the stream editor sed for the replacement but since macOS is
           based on BSD Unix, we use the limited but portable BSD syntax
           instead of the more powerful GNU syntax. We also use | instead of
           the more commonly used / separator for sed because the replacement
           contains slashes.
 
           2021/06/15: The custom project-config.jam does not work well with
           SDK paths on macOS anymore, so we use a custom project-config.jam
           only on Linux for now. ]]
 
       if(toolset AND NOT APPLE)
         set(configure_cmd sed -i.backup "\
 s|\
 using[[:space:]][[:space:]]*${toolset}[[:space:]]*$<SEMICOLON>|\
 using ${toolset} : : ${CMAKE_CXX_COMPILER} $<SEMICOLON>|\
 g"
           <SOURCE_DIR>/project-config.jam
         )
       endif()
 
     endif()
 
   endif()
 
   if(WIN32)
     set(dummy_cmd cd .)
   else()
     set(dummy_cmd true) #[[ "cd ." does not work reliably ]]
   endif()
 
   if(NOT patch_cmd)
     set(patch_cmd ${dummy_cmd}) #[[ Do nothing ]]
   endif()
 
   if(NOT configure_cmd)
     set(configure_cmd ${dummy_cmd}) #[[ Do nothing ]]
   endif()
 
   if(WIN32)
     set(install_cmd
       if not exist $<SHELL_PATH:${ep_prefix}/include/boost/config.hpp>
       \( ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost <INSTALL_DIR>/include/boost \)
     )
   else()
     set(install_cmd
       # test -e <INSTALL_DIR>/include/boost/config.hpp ||
       ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost <INSTALL_DIR>/include/boost
     )
   endif()
 
   ExternalProject_Add(${proj}
     URL ${url}
     URL_MD5 ${md5}
     PATCH_COMMAND ${patch_cmd}
     CONFIGURE_COMMAND ${configure_cmd}
     BUILD_COMMAND ""
     INSTALL_COMMAND ${install_cmd}
   )
 
   ExternalProject_Add_Step(${proj} bootstrap
     COMMAND ${bootstrap_cmd}
     DEPENDEES patch
     DEPENDERS configure
     WORKING_DIRECTORY <SOURCE_DIR>
   )
 
   ExternalProject_Add_Step(${proj} b2
     COMMAND ${b2_cmd}
     DEPENDEES bootstrap
     DEPENDERS build
     WORKING_DIRECTORY <SOURCE_DIR>
   )
 
   if(WIN32)
 
     #[[ Reuse already extracted files. ]]
 
     set(stamp_dir ${ep_prefix}/src/Boost-stamp)
 
     configure_file(
       ${CMAKE_CURRENT_LIST_DIR}/extract-Boost.replacement.cmake
       ${stamp_dir}/extract-Boost.replacement.cmake
       COPYONLY)
 
     ExternalProject_Add_Step(${proj} pre_download
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/Boost-pre_download.cmake
       DEPENDEES mkdir
       DEPENDERS download
       WORKING_DIRECTORY ${stamp_dir}
     )
 
   endif()
 
   set(install_manifest_dependees install)
 
   if(MITK_USE_Boost_LIBRARIES)
 
     if(WIN32)
 
       #[[ Move DLLs from lib to bin directory. ]]
 
       ExternalProject_Add_Step(${proj} post_install
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/Boost-post_install-WIN32.cmake
         DEPENDEES install
         WORKING_DIRECTORY <INSTALL_DIR>/lib
       )
 
       set(install_manifest_dependees post_install)
 
     elseif(APPLE)
 
       #[[ Boost does not follow the common practice of either using rpath or
           absolute paths for referencing dependencies. We have to use the
           install_name_tool to fix this. ]]
 
       ExternalProject_Add_Step(${proj} post_install
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/Boost-post_install-APPLE.cmake
         DEPENDEES install
         WORKING_DIRECTORY <INSTALL_DIR>/lib
       )
 
       set(install_manifest_dependees post_install)
 
     endif()
 
   endif()
 
   ExternalProject_Add_Step(${proj} install_manifest
     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/Boost-install_manifest.cmake
     DEPENDEES ${install_manifest_dependees}
     WORKING_DIRECTORY ${ep_prefix}
   )
 
 else()
 
   mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
 
 endif()
diff --git a/CMakeExternals/Poco.cmake b/CMakeExternals/Poco.cmake
index 9a3ccd0794..e81f01376e 100644
--- a/CMakeExternals/Poco.cmake
+++ b/CMakeExternals/Poco.cmake
@@ -1,103 +1,103 @@
 #-----------------------------------------------------------------------------
 # Poco
 #-----------------------------------------------------------------------------
 
 if(MITK_USE_Poco)
 
   # Sanity checks
   if(DEFINED Poco_DIR AND NOT EXISTS ${Poco_DIR})
     message(FATAL_ERROR "Poco_DIR variable is defined but corresponds to non-existing directory")
   endif()
 
   set(proj Poco)
   set(proj_DEPENDENCIES )
   set(${proj}_DEPENDS ${proj})
 
   if(NOT DEFINED ${proj}_DIR)
 
     set(additional_cmake_args )
     if(CTEST_USE_LAUNCHERS)
       list(APPEND additional_cmake_args
         "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
       )
     endif()
 
     mitk_query_custom_ep_vars()
 
     set(ssl_args
       -DENABLE_CRYPTO:BOOL=OFF
       -DENABLE_NETSSL:BOOL=OFF
       -DENABLE_NETSSL_WIN:BOOL=OFF
     )
 
     if(OpenSSL_FOUND)
       set(ssl_args
         -DENABLE_CRYPTO:BOOL=ON
         -DENABLE_NETSSL:BOOL=ON
         -DFORCE_OPENSSL:BOOL=ON
       )
 
       if(OPENSSL_ROOT_DIR)
         list(APPEND ssl_args
           "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}"
         )
       endif()
     endif()
 
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
-      GIT_REPOSITORY https://github.com/pocoproject/poco.git
-      GIT_TAG poco-1.12.4-release
+      GIT_REPOSITORY https://github.com/mitk/poco.git
+      GIT_TAG 7a7d81fd049088d93e42d0f7b8f7f7d5d1af3708 # poco-1.12.4-patched
       CMAKE_GENERATOR ${gen}
       CMAKE_GENERATOR_PLATFORM ${gen_platform}
       CMAKE_ARGS
         ${ep_common_args}
         ${additional_cmake_args}
         ${ssl_args}
         -DENABLE_ACTIVERECORD:BOOL=OFF
         -DENABLE_ACTIVERECORD_COMPILER:BOOL=OFF
         -DENABLE_APACHECONNECTOR:BOOL=OFF
         -DENABLE_CPPPARSER:BOOL=OFF
         -DENABLE_DATA:BOOL=OFF
         -DENABLE_DATA_MYSQL:BOOL=OFF
         -DENABLE_DATA_ODBC:BOOL=OFF
         -DENABLE_DATA_POSTGRESQL:BOOL=OFF
         -DENABLE_DATA_SQLITE:BOOL=OFF
         -DENABLE_ENCODINGS:BOOL=OFF
         -DENABLE_ENCODINGS_COMPILER:BOOL=OFF
         -DENABLE_FOUNDATION:BOOL=ON
         -DENABLE_JSON:BOOL=ON
         -DENABLE_JWT:BOOL=OFF
         -DENABLE_MONGODB:BOOL=OFF
         -DENABLE_NET:BOOL=ON
         -DENABLE_PAGECOMPILER:BOOL=OFF
         -DENABLE_PAGECOMPILER_FILE2PAGE:BOOL=OFF
         -DENABLE_PDF:BOOL=OFF
         -DENABLE_POCODOC:BOOL=OFF
         -DENABLE_PROMETHEUS:BOOL=OFF
         -DENABLE_REDIS:BOOL=OFF
         -DENABLE_SEVENZIP:BOOL=OFF
         -DENABLE_TESTS:BOOL=OFF
         -DENABLE_UTIL:BOOL=ON
         -DENABLE_XML:BOOL=ON
         -DENABLE_ZIP:BOOL=ON
         ${${proj}_CUSTOM_CMAKE_ARGS}
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}
         ${${proj}_CUSTOM_CMAKE_CACHE_ARGS}
       CMAKE_CACHE_DEFAULT_ARGS
         ${ep_common_cache_default_args}
         ${${proj}_CUSTOM_CMAKE_CACHE_DEFAULT_ARGS}
       DEPENDS ${proj_DEPENDENCIES}
      )
 
     set(${proj}_DIR ${ep_prefix})
     mitkFunctionInstallExternalCMakeProject(${proj})
 
   else()
 
     mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
 
   endif()
 
 endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd5ce7718a..704c4e583e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,1418 +1,1422 @@
 #[[ When increasing the minimum required version, check if Boost_ADDITIONAL_VERSIONS
     in CMake/PackageDepends/MITK_Boost_Config.cmake can be removed. See the first
     long comment in CMakeExternals/Boost.cmake for details. ]]
 
 set(MITK_CMAKE_MINIMUM_REQUIRED_VERSION 3.18)
 cmake_minimum_required(VERSION ${MITK_CMAKE_MINIMUM_REQUIRED_VERSION})
 
 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19 AND CMAKE_VERSION VERSION_LESS 3.19.2)
   message(FATAL_ERROR "\
 CMake v${CMAKE_VERSION} is defective [1]. \
 Please either downgrade to v3.18 or upgrade to at least v3.19.2.\n\
 [1] https://gitlab.kitware.com/cmake/cmake/-/issues/21529")
 endif()
 
 #-----------------------------------------------------------------------------
 # Policies
 #-----------------------------------------------------------------------------
 
 #[[ T28060
 
     https://cmake.org/cmake/help/v3.18/policy/CMP0091.html
     https://cmake.org/cmake/help/v3.18/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
 
     We pass CMP0091 to all external projects as command-line argument:
       -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=OLD
  ]]
 cmake_policy(SET CMP0091 OLD)
 
+if(POLICY CMP0135)
+  cmake_policy(SET CMP0135 NEW) # https://cmake.org/cmake/help/v3.24/policy/CMP0135.html
+endif()
+
 #-----------------------------------------------------------------------------
 # 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 2023.04.99)
   include_directories(SYSTEM ${MITK_SUPERBUILD_BINARY_DIR})
 endif()
 
 #-----------------------------------------------------------------------------
 # MITK Extension Feature
 #-----------------------------------------------------------------------------
 
 set(MITK_EXTENSION_DIRS "" CACHE STRING "")
 
 unset(MITK_ABSOLUTE_EXTENSION_DIRS)
 
 foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
   get_filename_component(MITK_ABSOLUTE_EXTENSION_DIR "${MITK_EXTENSION_DIR}" ABSOLUTE)
   list(APPEND MITK_ABSOLUTE_EXTENSION_DIRS "${MITK_ABSOLUTE_EXTENSION_DIR}")
 endforeach()
 
 set(MITK_DIR_PLUS_EXTENSION_DIRS "${MITK_SOURCE_DIR}" ${MITK_ABSOLUTE_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_ABSOLUTE_EXTENSION_DIRS})
   set(MITK_CMAKE_EXTENSION_DIR "${MITK_EXTENSION_DIR}/CMake")
   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(CTest)
 include(CMakeParseArguments)
 include(FindPackageHandleStandardArgs)
 
 # MITK macros
 include(mitkFunctionGetGccVersion)
 include(mitkFunctionCheckCompilerFlags)
 include(mitkFunctionSuppressWarnings) # includes several functions
 include(mitkMacroEmptyExternalProject)
 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()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
   mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
 else()
   set(GCC_VERSION 0)
 endif()
 
 set(MITK_CXX_STANDARD 17)
 
 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++<std> flag for targets.
 # However, compile flag checks also need to be done with -std=c++<std>.
 # The MITK_CXX<std>_FLAG variable is also used for external projects
 # build during the MITK super-build.
 mitkFunctionCheckCompilerFlags("-std=c++${MITK_CXX_STANDARD}" MITK_CXX${MITK_CXX_STANDARD}_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)
 
 mark_as_advanced(
   MITK_XVFB_TESTING
   MITK_FAST_TESTING
   MITK_BUILD_ALL_APPS
 )
 
 #-----------------------------------------------------------------------------
 # Set UI testing flags
 #-----------------------------------------------------------------------------
 if(MITK_XVFB_TESTING)
   set(MITK_XVFB_TESTING_COMMAND "xvfb-run" "--auto-servernum" CACHE STRING "Command and options to test through Xvfb")
   mark_as_advanced(MITK_XVFB_TESTING_COMMAND)
 endif(MITK_XVFB_TESTING)
 
 # -----------------------------------------
 # Other options
 set(MITK_CUSTOM_REVISION_DESC "" CACHE STRING "Override MITK revision description")
 mark_as_advanced(MITK_CUSTOM_REVISION_DESC)
 
 set_property(GLOBAL PROPERTY MITK_EXTERNAL_PROJECTS "")
 
 include(CMakeExternals/ExternalProjectList.cmake)
 
 foreach(MITK_EXTENSION_DIR ${MITK_ABSOLUTE_EXTENSION_DIRS})
   set(MITK_CMAKE_EXTERNALS_EXTENSION_DIR "${MITK_EXTENSION_DIR}/CMakeExternals")
   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_ABSOLUTE_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)
 
 # -----------------------------------------
 # Qt version related variables
 
 option(MITK_USE_Qt5 "Use Qt 5 library" ON)
 
 if(MITK_USE_Qt5)
   if(WIN32)
     set(MITK_QT5_MINIMUM_VERSION 5.12.9)
   else()
     set(MITK_QT5_MINIMUM_VERSION 5.12)
   endif()
   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 2022)
           list(APPEND _compilers "msvc2019" "msvc2017") # Binary compatible
         elseif (CMAKE_MATCH_0 EQUAL 2019)
           list(APPEND _compilers "msvc2017") # Binary compatible
         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})
 endif()
 
 # -----------------------------------------
 # Custom dependency logic
 
 if(WIN32 AND Qt5_DIR)
   set(_dir_candidate "${Qt5_DIR}/../../../../../Tools/OpenSSL/Win_x64")
   get_filename_component(_dir_candidate ${_dir_candidate} ABSOLUTE)
   if(EXISTS "${_dir_candidate}")
     set(OPENSSL_ROOT_DIR "${_dir_candidate}")
   endif()
 endif()
 
 find_package(OpenSSL)
 
 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 OR MITK_USE_httplib)
   if(NOT OpenSSL_FOUND)
     set(openssl_message "Could not find OpenSSL (dependency of C++ REST SDK and cpp-httplib).\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 either install Win32 OpenSSL:\n"
                           "  https://slproweb.com/products/Win32OpenSSL.html\n"
                           "Or use the Qt Maintenance tool to install (recommended):\n"
                           "  Developer and Designer Tools > OpenSSL Toolkit > OpenSSL 64-bit binaries\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()
 
 find_package(Git REQUIRED)
 
 #-----------------------------------------------------------------------------
 # 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(mitkFunctionAddManifest)
 include(mitkFunctionAddCustomModuleTest)
 include(mitkFunctionCheckModuleDependencies)
 include(mitkFunctionCompileSnippets)
 include(mitkFunctionConfigureVisualStudioUserProjectFile)
 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(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
 #-----------------------------------------------------------------------------
 
 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)
 #-----------------------------------------------------------------------------
 
 if(OpenSSL_FOUND AND WIN32)
   #[[ On Windows, CMake is able to locate the link libraries for OpenSSL but it
       does not look for the corresponding DLLs that we need to copy to our
       binary directories and include in packaging.
 
       Setting these paths manually is cumbersome so we try to use a simple
       heuristic to automatically set them:
 
         - Based on the link libraries (usually located in a lib folder),
           try to find the "../bin" binary directory.
         - Use the base file names of the link libraries to find corresponding
           DLLs like "<base name>*.dll", that usually are named like
           "<base name>-1_1-x64.dll" or similar.
    ]]
   set(openssl_ssl_dll "")
   set(openssl_crypto_dll "")
 
   if(OPENSSL_SSL_LIBRARY AND EXISTS "${OPENSSL_SSL_LIBRARY}")
     get_filename_component(openssl_bin_dir "${OPENSSL_SSL_LIBRARY}" DIRECTORY)
     get_filename_component(openssl_bin_dir "${openssl_bin_dir}" DIRECTORY)
     set(openssl_bin_dir "${openssl_bin_dir}/bin")
 
     if(EXISTS "${openssl_bin_dir}")
       get_filename_component(openssl_ssl_basename "${OPENSSL_SSL_LIBRARY}" NAME_WE)
       file(GLOB openssl_ssl_dll "${openssl_bin_dir}/${openssl_ssl_basename}*.dll")
       list(LENGTH openssl_ssl_dll num_findings)
       if(num_findings GREATER 1)
         set(openssl_ssl_dll "")
       endif()
 
       get_filename_component(openssl_crypto_basename "${OPENSSL_CRYPTO_LIBRARY}" NAME_WE)
       file(GLOB openssl_crypto_dll "${openssl_bin_dir}/${openssl_crypto_basename}*.dll")
       list(LENGTH openssl_crypto_dll num_findings)
       if(num_findings GREATER 1)
         set(openssl_crypto_dll "")
       endif()
     endif()
   endif()
 
   set(MITK_OPENSSL_SSL_DLL "${openssl_ssl_dll}" CACHE FILEPATH "")
 
   if(DEFINED CACHE{MITK_OPENSSL_SSL_DLL} AND NOT MITK_OPENSSL_SSL_DLL AND openssl_ssl_dll)
     set(MITK_OPENSSL_SSL_DLL "${openssl_ssl_dll}" CACHE FILEPATH "" FORCE)
   endif()
 
   set(MITK_OPENSSL_CRYPTO_DLL "${openssl_crypto_dll}" CACHE FILEPATH "")
 
   if(DEFINED CACHE{MITK_OPENSSL_CRYPTO_DLL} AND NOT MITK_OPENSSL_CRYPTO_DLL AND openssl_crypto_dll)
     set(MITK_OPENSSL_CRYPTO_DLL "${openssl_crypto_dll}" CACHE FILEPATH "" FORCE)
   endif()
 
   if(MITK_OPENSSL_SSL_DLL AND EXISTS "${MITK_OPENSSL_SSL_DLL}" AND MITK_OPENSSL_CRYPTO_DLL AND EXISTS "${MITK_OPENSSL_CRYPTO_DLL}")
     foreach(config_type ${CMAKE_CONFIGURATION_TYPES})
       execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${MITK_BINARY_DIR}/bin/${config_type}")
       configure_file("${MITK_OPENSSL_SSL_DLL}" "${MITK_BINARY_DIR}/bin/${config_type}/" COPYONLY)
       configure_file("${MITK_OPENSSL_CRYPTO_DLL}" "${MITK_BINARY_DIR}/bin/${config_type}/" COPYONLY)
     endforeach()
 
     MITK_INSTALL(FILES
       "${MITK_OPENSSL_SSL_DLL}"
       "${MITK_OPENSSL_CRYPTO_DLL}"
     )
   endif()
 endif()
 
 # 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 applications
 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)
 
 if(NOT MITK_FAST_TESTING)
   if(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")
     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_CXX${MITK_CXX_STANDARD}_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} -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-deprecated-copy
     -Wno-array-bounds
     -Wno-cast-function-type
     -Wno-maybe-uninitialized
     -Wno-error=stringop-overread
     -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_ABSOLUTE_EXTENSION_DIRS})
   set(MITK_PACKAGE_DEPENDS_EXTENSION_DIR "${MITK_EXTENSION_DIR}/CMake/PackageDepends")
   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.74 1.74.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)
   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()
 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()
 
 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)
   # 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& e)
       {
         fprintf(stderr, \"%s\\n\", e.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 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_ABSOLUTE_EXTENSION_DIRS})
   get_filename_component(MITK_ROOT_FOLDER "${MITK_EXTENSION_DIR}" NAME)
   set(MITK_MODULES_EXTENSION_DIR "${MITK_EXTENSION_DIR}/Modules")
   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)
 
 set(MITK_DOXYGEN_OUTPUT_DIR "${PROJECT_BINARY_DIR}/Documentation/Doxygen" CACHE PATH
   "Output directory for doxygen generated documentation.")
 
 if(MITK_USE_BLUEBERRY)
   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_ABSOLUTE_EXTENSION_DIRS})
     set(MITK_PLUGINS_EXTENSION_DIR "${MITK_EXTENSION_DIR}/Plugins")
     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")
     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
 #-----------------------------------------------------------------------------
 
 set(MITK_DOXYGEN_ADDITIONAL_INPUT_DIRS)
 set(MITK_DOXYGEN_ADDITIONAL_IMAGE_PATHS)
 
 foreach(MITK_EXTENSION_DIR ${MITK_DIR_PLUS_EXTENSION_DIRS})
   set(MITK_DOXYGEN_ADDITIONAL_INPUT_DIRS "${MITK_DOXYGEN_ADDITIONAL_INPUT_DIRS} \"${MITK_EXTENSION_DIR}\"")
   set(MITK_DOXYGEN_ADDITIONAL_IMAGE_PATHS "${MITK_DOXYGEN_ADDITIONAL_IMAGE_PATHS} \"${MITK_EXTENSION_DIR}\"")
 endforeach()
 
 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")
   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_ABSOLUTE_EXTENSION_DIRS})
   set(MITK_APPLICATIONS_EXTENSION_DIR "${MITK_EXTENSION_DIR}/Applications")
   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/MITKConfig.cmake.in b/MITKConfig.cmake.in
index 530ee7c6e3..4e7ef7c55b 100644
--- a/MITKConfig.cmake.in
+++ b/MITKConfig.cmake.in
@@ -1,314 +1,314 @@
 if(CMAKE_VERSION VERSION_LESS @MITK_CMAKE_MINIMUM_REQUIRED_VERSION@)
   message(FATAL_ERROR "MITK requires at least CMake Version @MITK_CMAKE_MINIMUM_REQUIRED_VERSION@")
 endif()
 
 # The MITK version number
 set(MITK_VERSION_MAJOR "@MITK_VERSION_MAJOR@")
 set(MITK_VERSION_MINOR "@MITK_VERSION_MINOR@")
 set(MITK_VERSION_PATCH "@MITK_VERSION_PATCH@")
 set(MITK_VERSION_STRING "@MITK_VERSION_STRING@")
 
 #-----------------------------------------------------------------------------
 # C++ language standard
 #-----------------------------------------------------------------------------
 
 set(MITK_CXX_STANDARD @MITK_CXX_STANDARD@)
 
 #-----------------------------------------------------------------------------
 # Include required CMake scripts
 #-----------------------------------------------------------------------------
 
 # Update the CMake module path
 set(MITK_CMAKE_MODULE_PATH "@MITK_SOURCE_DIR@/CMake")
 list(APPEND CMAKE_MODULE_PATH ${MITK_CMAKE_MODULE_PATH})
 
 # Standard CMake macros
 include(CMakeParseArguments)
 include(FeatureSummary)
 include(FindPackageHandleStandardArgs)
 include(GenerateExportHeader)
 
 # Include MITK macros
 include(MacroParseArguments)
 include(mitkFunctionAddManifest)
 include(mitkFunctionAddCustomModuleTest)
 include(mitkFunctionCheckMitkCompatibility)
 include(mitkFunctionCheckModuleDependencies)
 include(mitkFunctionConfigureVisualStudioUserProjectFile)
 include(mitkFunctionCreateBlueBerryApplication)
 include(mitkFunctionCreateCommandLineApp)
 include(mitkFunctionCreateModule)
 include(mitkFunctionCreatePlugin)
 include(mitkFunctionCreateProvisioningFile)
 include(mitkFunctionCreateWindowsBatchScript)
 include(mitkFunctionGetLibrarySearchPaths)
 include(mitkFunctionInstallAutoLoadModules)
 include(mitkFunctionInstallCTKPlugin)
 include(mitkFunctionInstallProvisioningFiles)
 include(mitkFunctionInstallThirdPartyCTKPlugins)
 include(mitkFunctionOrganizeSources)
 include(mitkFunctionUseModules)
 include(mitkMacroCreateExecutable)
 include(mitkMacroCreateModuleTests)
 include(mitkMacroFindDependency)
 include(mitkMacroGenerateToolsLibrary)
 include(mitkMacroGetPMDPlatformString)
 include(mitkMacroInstall)
 include(mitkMacroInstallHelperApp)
 include(mitkMacroInstallTargets)
 include(mitkMacroMultiplexPicType)
 
 #-----------------------------------------------------------------------------
 # MITK flags and directories
 #-----------------------------------------------------------------------------
 
 # MITK compiler flags
 set(MITK_C_FLAGS "@MITK_C_FLAGS@")
 set(MTTK_C_FLAGS_DEBUG "@MITK_C_FLAGS_DEBUG@")
 set(MITK_C_FLAGS_RELEASE "@MITK_C_FLAGS_RELEASE@")
 set(MITK_CXX_FLAGS "@MITK_CXX_FLAGS@")
 set(MTTK_CXX_FLAGS_DEBUG "@MITK_CXX_FLAGS_DEBUG@")
 set(MITK_CXX_FLAGS_RELEASE "@MITK_CXX_FLAGS_RELEASE@")
 
 # MITK linker flags
 set(MITK_EXE_LINKER_FLAGS "@MITK_EXE_LINKER_FLAGS@")
 set(MITK_SHARED_LINKER_FLAGS "@MITK_SHARED_LINKER_FLAGS@")
 set(MITK_MODULE_LINKER_FLAGS "@MITK_MODULE_LINKER_FLAGS@")
 
 # MITK specific directories
 set(MITK_SOURCE_DIR "@MITK_SOURCE_DIR@")
 set(MITK_BINARY_DIR "@MITK_BINARY_DIR@")
 set(MITK_CMAKE_DIR "@MITK_CMAKE_DIR@")
 
 # MITK output directories
 set(MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY "@MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
 set(MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY "@MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY@")
 set(MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY "@MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
 
 #-----------------------------------------------------------------------------
 # Miscellaneous variables
 #-----------------------------------------------------------------------------
 
 # Internal version numbers, used for approximate compatibility checks
 # of a MITK development version (non-release).
 set(MITK_VERSION_PLUGIN_SYSTEM 2) # dropped legacy BlueBerry plug-in CMake support
 
 set(MITK_DATA_DIR "@MITK_DATA_DIR@")
 set(UTILITIES_DIR "@UTILITIES_DIR@")
 set(REGISTER_QFUNCTIONALITY_CPP_IN "@REGISTER_QFUNCTIONALITY_CPP_IN@")
 set(MITK_DOXYGEN_TAGFILE_NAME "@MITK_DOXYGEN_TAGFILE_NAME@")
 set(MITK_LEGACY_EXPORT_MACRO_NAME 1)
 
 set(DCMTK_CMAKE_DEBUG_POSTFIX @DCMTK_CMAKE_DEBUG_POSTFIX@)
 
 # Get the canonical name of the directory to avoid potential case mismatch,
 # e.g. in the drive letter on Windows.
 get_filename_component(CMAKE_CURRENT_LIST_DIR_REALPATH ${CMAKE_CURRENT_LIST_DIR} REALPATH)
 if(CMAKE_CURRENT_LIST_DIR_REALPATH STREQUAL MITK_BINARY_DIR)
   set(MITK_EXTERNAL_PROJECT_PREFIX @MITK_EXTERNAL_PROJECT_PREFIX@)
 endif()
 
 set(MITK_MODULES_PACKAGE_DEPENDS_DIR "@MITK_MODULES_PACKAGE_DEPENDS_DIR@")
 if(MODULES_PACKAGE_DEPENDS_DIRS)
   list(APPEND MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
   list(REMOVE_DUPLICATES MODULES_PACKAGE_DEPENDS_DIRS)
 else()
   set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
 endif()
 
 #-----------------------------------------------------------------------------
 # External dependencies
 #-----------------------------------------------------------------------------
 
 list(APPEND CMAKE_PREFIX_PATH "@MITK_EXTERNAL_PROJECT_PREFIX@")
 
 # -----------------------------------------
 # Qt variables and dependencies
 
 set(MITK_USE_Qt5 @MITK_USE_Qt5@)
 
 if(MITK_USE_Qt5)
   set(MITK_QT5_MINIMUM_VERSION @MITK_QT5_MINIMUM_VERSION@)
   set(MITK_QT5_COMPONENTS @MITK_QT5_COMPONENTS@)
   mitkMacroFindDependency(Qt5 ${MITK_QT5_MINIMUM_VERSION} COMPONENTS ${MITK_QT5_COMPONENTS})
 endif()
 
 # -----------------------------------------
 # Special Python variables
 
 set(MITK_USE_Python3 @MITK_USE_Python3@)
 if(MITK_USE_Python3)
   set(PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@" CACHE FILEPATH "")
   set(PYTHON_INCLUDE_DIR "@PYTHON_INCLUDE_DIR@" CACHE PATH "")
   set(PYTHON_LIBRARY "@PYTHON_LIBRARY@" CACHE FILEPATH "")
   set(PYTHON_INCLUDE_DIR2 "@PYTHON_INCLUDE_DIR2@" CACHE PATH "")
 
   mitkMacroFindDependency(Python3 COMPONENTS Interpreter Development NumPy)
 endif()
 
 # -----------------------------------------
 # Special Boost variables
 
 set(MITK_USE_Boost_LIBRARIES @MITK_USE_Boost_LIBRARIES@)
 set(MITK_USE_SYSTEM_Boost @MITK_USE_SYSTEM_Boost@)
-set(BOOST_ROOT "@BOOST_ROOT@" CACHE PATH "")
+set(Boost_ROOT "@Boost_ROOT@" CACHE PATH "")
 set(BOOST_LIBRARYDIR "@BOOST_LIBRARYDIR@" CACHE PATH "")
 set(Boost_ADDITIONAL_VERSIONS 1.74 1.74.0)
 
 # We need this later for a DCMTK workaround
 set(_dcmtk_dir_orig "@DCMTK_DIR@")
 
 # -----------------------------------------
 # External dependencies from the superbuild
 # or injected from somewhere else via
 # <project>_DIR variables.
 
 @MITK_CONFIG_EXTERNAL_PROJECTS@
 
 # Ensure the MITK module path comes first
 set(CMAKE_MODULE_PATH ${MITK_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})
 
 # -----------------------------------------
 # Special handling for DCMTK
 
 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()
 
 # -----------------------------------------
 # Special handling for DCMQI
 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()
 
 # -----------------------------------------
 # Special handling for Boost
 
 if(MITK_USE_Boost)
   link_directories(${Boost_LIBRARY_DIRS})
 endif()
 
 # -----------------------------------------
 # Special handling for OpenIGTLink
 
 if(MITK_USE_OpenIGTLink)
   link_directories(${OpenIGTLink_LIBRARY_DIRS})
 endif()
 
 # -----------------------------------------
 # Internal project dependencies
 
 set(CppMicroServices_DIR "@CppMicroServices_DIR@")
 mitkMacroFindDependency(CppMicroServices)
 
 set(MITK_USE_BLUEBERRY @MITK_USE_BLUEBERRY@)
 if(MITK_USE_BLUEBERRY)
 
   set(MITK_PLUGIN_USE_FILE "@MITK_PLUGIN_USE_FILE@")
   if(MITK_PLUGIN_USE_FILE)
     if(EXISTS "${MITK_PLUGIN_USE_FILE}")
       include("${MITK_PLUGIN_USE_FILE}")
     endif()
   endif()
 
   set(MITK_PLUGIN_PROVISIONING_FILE "@MITK_EXTAPP_PROVISIONING_FILE@")
   set(MITK_PROVISIONING_FILES
       "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}"
       "${MITK_PLUGIN_PROVISIONING_FILE}")
 
 endif()
 
 set(BLUEBERRY_USE_QT_HELP @BLUEBERRY_USE_QT_HELP@)
 if(BLUEBERRY_USE_QT_HELP AND DOXYGEN_VERSION VERSION_LESS "1.8.7")
   message("Setting BLUEBERRY_USE_QT_HELP to OFF because Doxygen version 1.8.7 or newer not found.")
   set(BLUEBERRY_USE_QT_HELP OFF)
 endif()
 
 set(BLUEBERRY_QTPLUGIN_PATH "@BLUEBERRY_QTPLUGIN_PATH@")
 
 set(QT_HELPGENERATOR_EXECUTABLE "@QT_HELPGENERATOR_EXECUTABLE@")
 set(QT_COLLECTIONGENERATOR_EXECUTABLE "@QT_COLLECTIONGENERATOR_EXECUTABLE@")
 set(QT_ASSISTANT_EXECUTABLE "@QT_ASSISTANT_EXECUTABLE@")
 set(QT_XMLPATTERNS_EXECUTABLE "@QT_XMLPATTERNS_EXECUTABLE@")
 
 
 #-----------------------------------------------------------------------------
 # MITK sub-project variables
 #-----------------------------------------------------------------------------
 
 # External SDK directories
 set(MITK_PMD_SDK_DIR @MITK_PMD_SDK_DIR@)
 
 # MITK ToF use variables
 
 set(MITK_TOF_PMDCAMCUBE_AVAILABLE @MITK_USE_TOF_PMDCAMCUBE@)
 if(MITK_TOF_PMDCAMCUBE_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
   option(MITK_USE_TOF_PMDCAMCUBE "Enable support for PMD Cam Cube" @MITK_USE_TOF_PMDCAMCUBE@)
   mark_as_advanced(MITK_USE_TOF_PMDCAMCUBE)
 endif()
 
 set(MITK_TOF_PMDCAMBOARD_AVAILABLE @MITK_USE_TOF_PMDCAMBOARD@)
 if(MITK_TOF_PMDCAMBOARD_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
   option(MITK_USE_TOF_PMDCAMBOARD "Enable support for PMD Cam Board" @MITK_USE_TOF_PMDCAMBOARD@)
   mark_as_advanced(MITK_USE_TOF_PMDCAMBOARD)
 endif()
 
 set(MITK_TOF_PMDO3_AVAILABLE @MITK_USE_TOF_PMDO3@)
 if(MITK_TOF_PMDO3_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
   option(MITK_USE_TOF_PMDO3 "Enable support for PMD =3" @MITK_USE_TOF_PMDO3@)
   mark_as_advanced(MITK_USE_TOF_PMDO3)
 endif()
 
 set(MITK_TOF_KINECT_AVAILABLE @MITK_USE_TOF_KINECT@)
 if(MITK_TOF_KINECT_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
   option(MITK_USE_TOF_KINECT "Enable support for Kinect" @MITK_USE_TOF_KINECT@)
   mark_as_advanced(MITK_USE_TOF_KINECT)
 endif()
 
 set(MITK_TOF_MESASR4000_AVAILABLE @MITK_USE_TOF_MESASR4000@)
 if(MITK_TOF_MESASR4000_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
   option(MITK_USE_TOF_MESASR4000 "Enable support for MESA SR4000" @MITK_USE_TOF_MESASR4000@)
   mark_as_advanced(MITK_USE_TOF_MESASR4000)
 endif()
 
 if(MITK_USE_IGT)
   #include("${MITK_DIR}/mitkIGTConfig.cmake")
 endif()
 
 #-----------------------------------------------------------------------------
 # Import MITK targets and set custom properties
 #-----------------------------------------------------------------------------
 
 if(NOT MITK_EXPORTS_FILE_INCLUDED)
   if(EXISTS "@MITK_EXPORTS_FILE@")
     set(MITK_EXPORTS_FILE_INCLUDED 1)
     include("@MITK_EXPORTS_FILE@")
   endif()
 endif()
 
 # Set properties on exported targets
 @MITK_EXPORTED_TARGET_PROPERTIES@
 
 #-----------------------------------------------------------------------------
 # Install rules
 #-----------------------------------------------------------------------------
 
 # Install rules for ToF libraries loaded at runtime
 if(EXISTS "@MITK_BINARY_DIR@/mitkToFHardwareInstallRules.cmake")
   include("@MITK_BINARY_DIR@/mitkToFHardwareInstallRules.cmake")
 endif()
diff --git a/Modules/Core/include/mitkBaseGeometry.h b/Modules/Core/include/mitkBaseGeometry.h
index 833189965d..4d00557d8d 100644
--- a/Modules/Core/include/mitkBaseGeometry.h
+++ b/Modules/Core/include/mitkBaseGeometry.h
@@ -1,752 +1,763 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkBaseGeometry_h
 #define mitkBaseGeometry_h
 
 #include "mitkOperationActor.h"
 #include <MitkCoreExports.h>
 #include <mitkCommon.h>
 
 #include "itkScalableAffineTransform.h"
 #include "mitkNumericTypes.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;
 
   //##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 describes
   //## 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 usually 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 subclass 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);
 
       // ********************************** 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 ((continuous!)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 referring 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);
 
         const GeometryTransformHolder *GetGeometryTransformHolder() const;
 
+    //##Documentation
+    //## @brief One to one mapping of axes to world orientations.
+    //##
+    //## The result is stored in the output argument that must be an array of three int values.
+    //## The elements of the array will be the axis indices that correspond to the sagittal,
+    //## coronal and axial orientations, in this order. It is guaranteed that each axis will
+    //## be mapped to different orientations.
+    //##
+    //## @param axes Output argument that will store the axis indices for each orientation.
+    void MapAxesToOrientations(int axes[]) const;
+
   protected:
     // ********************************** Constructor **********************************
     BaseGeometry();
     BaseGeometry(const BaseGeometry &other);
     ~BaseGeometry() override;
 
     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);
 
       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 being 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 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 coordinateEps Tolerance for comparison of all spatial aspects (spacing, origin and grid alignment).
   * You can use mitk::eps in most cases.
   * @param directionEps Tolerance for comparison of all directional aspects (axis). 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 coordinateEps,
     ScalarType directionEps,
     bool verbose = false);
 
   /**
   * @brief Equal A function comparing two geometries for being identical.
   *
   * @ingroup MITKTestingAPI
   *
   * This is an overloaded version that uses a single tolerance for spatial and directional aspects. For more details,
   * see the other overloaded version.
   *
   * @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 = mitk::eps,
                              bool verbose = false);
 
   /**
   * @brief Equal A function comparing two transforms (TransformType) for being identical.
   *
   * @ingroup MITKTestingAPI
   *
   * The function compares the IndexToWorldTransform (elementwise).
   *
   * The parameter eps is a tolarence value for all methods which are internally used for comparison.
   * @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 being identical.
   *
   * @ingroup MITKTestingAPI
   *
   * The function compares the bounds (elementwise).
   *
   * The parameter eps is a tolarence value for all methods which are internally used for comparison.
   * @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);
 
   /**
   * @brief A function checks if a test geometry is a sub geometry of
   * a given reference geometry.
   *
   * Sub geometry means that both geometries have the same voxel grid (same spacing, same axes,
   * origin is on voxel grid), but the bounding box of the checked geometry is contained or equal
   * to the bounding box of the reference geometry.\n
   * By this definition equal geometries are always sub geometries of each other.
   *
   * The function checks the spacing, origin, axis vectors, extents, the matrix of the
   * IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.
   *
   * The parameter eps is a tolerance value for all methods which are internally used for comparison.
   * @param testGeo Geometry that should be checked if it is a sub geometry of referenceGeo.
   * @param referenceGeo Geometry that should contain testedGeometry as sub geometry.
   * @param coordinateEps Tolerance for comparison of all spatial aspects (spacing, origin and grid alignment).
   * You can use mitk::eps in most cases.
   * @param directionEps Tolerance for comparison of all directional aspects (axis). 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 comparisons are true. False otherwise.
   */
   MITKCORE_EXPORT bool IsSubGeometry(const mitk::BaseGeometry& testGeo,
     const mitk::BaseGeometry& referenceGeo,
     ScalarType coordinateEps,
     ScalarType directionEps,
     bool verbose = false);
 
   /**
   * @brief A function checks if a test geometry is a sub geometry of
   * a given reference geometry.
   *
   * This is a overloaded version that uses a single tolerance for spatial and directional aspects. For more details,
   * see the other overloaded version.
   *
   * @param testGeo Geometry that should be checked if it is a sub geometry of referenceGeo.
   * @param referenceGeo Geometry that should contain testedGeometry as sub geometry.
   * @param eps Tolarence for comparison (both spatial and directional). 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 otherwise.
   */
   MITKCORE_EXPORT bool IsSubGeometry(const mitk::BaseGeometry& testGeo,
     const mitk::BaseGeometry& referenceGeo,
     ScalarType eps = mitk::eps,
     bool verbose = false);
 
 } // namespace mitk
 
 #endif
diff --git a/Modules/Core/include/mitkPlaneGeometry.h b/Modules/Core/include/mitkPlaneGeometry.h
index 0fec6a0794..81a0c3c0e1 100644
--- a/Modules/Core/include/mitkPlaneGeometry.h
+++ b/Modules/Core/include/mitkPlaneGeometry.h
@@ -1,608 +1,606 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkPlaneGeometry_h
 #define mitkPlaneGeometry_h
 
 #include <MitkCoreExports.h>
 
 #include <mitkAnatomicalPlanes.h>
 #include <mitkBaseGeometry.h>
 #include <mitkRestorePlanePositionOperation.h>
 
 #include <vnl/vnl_cross.h>
 
 namespace mitk
 {
   template <class TCoordRep, unsigned int NPointDimension>
   class Line;
   typedef Line<ScalarType, 3> Line3D;
 
   /**
    * \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
    */
 
   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);
 
     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 AnatomicalPlane
     * (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,
                                          AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
                                          ScalarType zPosition = 0,
                                          bool frontside = true,
                                          bool rotated = false,
                                          bool top = true);
 
     /**
     * \brief Initialize a plane with orientation \a AnatomicalPlane
     * (default: axial) with respect to \a BaseGeometry (default: identity).
     * Spacing also taken from \a BaseGeometry.
     *
     * \param geometry3D
     * \param top if \a true, create plane at top, otherwise at bottom
     * (for AnatomicalPlane Axial, for other plane locations respectively)
     * \param planeorientation
     * \param frontside
     * \param rotated
     */
     virtual void InitializeStandardPlane(const BaseGeometry *geometry3D,
                                          bool top,
                                          AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
                                          bool frontside = true,
                                          bool rotated = false);
 
     /**
     * \brief Initialize a plane with orientation \a AnatomicalPlane
     * (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,
                                          AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
                                          ScalarType zPosition = 0,
                                          bool frontside = true,
                                          bool rotated = false,
                                          bool top = true);
 
     /**
     * \brief Initialize plane with orientation \a AnatomicalPlane
     * (default: axial) given width, height and spacing.
     *
     */
     virtual void InitializeStandardPlane(ScalarType width,
                                          ScalarType height,
                                          const Vector3D &spacing,
                                          AnatomicalPlane planeorientation = AnatomicalPlane::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=1e-6);
 
     /**
     * \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 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 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 if 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
diff --git a/Modules/Core/src/DataManagement/mitkBaseGeometry.cpp b/Modules/Core/src/DataManagement/mitkBaseGeometry.cpp
index 55ea6e4b07..6a3a8352e7 100644
--- a/Modules/Core/src/DataManagement/mitkBaseGeometry.cpp
+++ b/Modules/Core/src/DataManagement/mitkBaseGeometry.cpp
@@ -1,1101 +1,1185 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 <iomanip>
 #include <sstream>
 #include <bitset>
 
 #include <vtkMatrix4x4.h>
 #include <vtkMatrixToLinearTransform.h>
 
 #include "mitkApplyTransformMatrixOperation.h"
 #include "mitkBaseGeometry.h"
 #include "mitkGeometryTransformHolder.h"
 #include "mitkInteractionConst.h"
 #include "mitkMatrixConvert.h"
 #include "mitkModifiedLock.h"
 #include "mitkPointOperation.h"
 #include "mitkRestorePlanePositionOperation.h"
 #include "mitkRotationOperation.h"
 #include "mitkScaleOperation.h"
 #include "mitkVector.h"
 #include "mitkMatrix.h"
 
 mitk::BaseGeometry::BaseGeometry()
   : Superclass(),
     mitk::OperationActor(),
     m_FrameOfReferenceID(0),
     m_IndexToWorldTransformLastModified(0),
     m_ImageGeometry(false),
     m_ModifiedLockFlag(false),
     m_ModifiedCalledFlag(false)
 {
   m_GeometryTransform = new GeometryTransformHolder();
   Initialize();
 }
 
 mitk::BaseGeometry::BaseGeometry(const BaseGeometry &other)
   : Superclass(),
     mitk::OperationActor(),
     m_FrameOfReferenceID(other.m_FrameOfReferenceID),
     m_IndexToWorldTransformLastModified(other.m_IndexToWorldTransformLastModified),
     m_ImageGeometry(other.m_ImageGeometry),
     m_ModifiedLockFlag(false),
     m_ModifiedCalledFlag(false)
 {
   m_GeometryTransform = new GeometryTransformHolder(*other.GetGeometryTransformHolder());
   other.InitializeGeometry(this);
 }
 
 mitk::BaseGeometry::~BaseGeometry()
 {
   delete m_GeometryTransform;
 }
 
 void mitk::BaseGeometry::SetVtkMatrixDeepCopy(vtkTransform *vtktransform)
 {
   m_GeometryTransform->SetVtkMatrixDeepCopy(vtktransform);
 }
 
 const mitk::Point3D mitk::BaseGeometry::GetOrigin() const
 {
   return m_GeometryTransform->GetOrigin();
 }
 
 void mitk::BaseGeometry::SetOrigin(const Point3D &origin)
 {
   mitk::ModifiedLock lock(this);
 
   if (origin != GetOrigin())
   {
     m_GeometryTransform->SetOrigin(origin);
     Modified();
   }
 }
 
 const mitk::Vector3D mitk::BaseGeometry::GetSpacing() const
 {
   return m_GeometryTransform->GetSpacing();
 }
 
 void mitk::BaseGeometry::Initialize()
 {
   float b[6] = {0, 1, 0, 1, 0, 1};
   SetFloatBounds(b);
 
   m_GeometryTransform->Initialize();
 
   m_FrameOfReferenceID = 0;
 
   m_ImageGeometry = false;
 }
 
 void mitk::BaseGeometry::SetFloatBounds(const float bounds[6])
 {
   mitk::BoundingBox::BoundsArrayType b;
   const float *input = bounds;
   int i = 0;
   for (mitk::BoundingBox::BoundsArrayType::Iterator it = b.Begin(); i < 6; ++i)
     *it++ = (mitk::ScalarType)*input++;
   SetBounds(b);
 }
 
 void mitk::BaseGeometry::SetFloatBounds(const double bounds[6])
 {
   mitk::BoundingBox::BoundsArrayType b;
   const double *input = bounds;
   int i = 0;
   for (mitk::BoundingBox::BoundsArrayType::Iterator it = b.Begin(); i < 6; ++i)
     *it++ = (mitk::ScalarType)*input++;
   SetBounds(b);
 }
 
 /** Initialize the geometry */
 void mitk::BaseGeometry::InitializeGeometry(BaseGeometry *newGeometry) const
 {
   newGeometry->SetBounds(m_BoundingBox->GetBounds());
 
   newGeometry->SetFrameOfReferenceID(GetFrameOfReferenceID());
 
   newGeometry->InitializeGeometryTransformHolder(this);
 
   newGeometry->m_ImageGeometry = m_ImageGeometry;
 }
 
 void mitk::BaseGeometry::InitializeGeometryTransformHolder(const BaseGeometry *otherGeometry)
 {
   this->m_GeometryTransform->Initialize(otherGeometry->GetGeometryTransformHolder());
 }
 
 /** Set the bounds */
 void mitk::BaseGeometry::SetBounds(const BoundsArrayType &bounds)
 {
   mitk::ModifiedLock lock(this);
 
   this->CheckBounds(bounds);
 
   m_BoundingBox = BoundingBoxType::New();
 
   BoundingBoxType::PointsContainer::Pointer pointscontainer = BoundingBoxType::PointsContainer::New();
   BoundingBoxType::PointType p;
   BoundingBoxType::PointIdentifier pointid;
 
   for (pointid = 0; pointid < 2; ++pointid)
   {
     unsigned int i;
     for (i = 0; i < m_NDimensions; ++i)
     {
       p[i] = bounds[2 * i + pointid];
     }
     pointscontainer->InsertElement(pointid, p);
   }
 
   m_BoundingBox->SetPoints(pointscontainer);
   m_BoundingBox->ComputeBoundingBox();
   this->Modified();
 }
 
 void mitk::BaseGeometry::SetIndexToWorldTransform(mitk::AffineTransform3D *transform)
 {
   mitk::ModifiedLock lock(this);
 
   CheckIndexToWorldTransform(transform);
 
   m_GeometryTransform->SetIndexToWorldTransform(transform);
   Modified();
 }
 
 void mitk::BaseGeometry::SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform)
 {
   // security check
   mitk::Vector3D originalSpacing = this->GetSpacing();
 
   mitk::ModifiedLock lock(this);
 
   CheckIndexToWorldTransform(transform);
 
   m_GeometryTransform->SetIndexToWorldTransformWithoutChangingSpacing(transform);
   Modified();
 
   // Security check. Spacig must not have changed
   if (!mitk::Equal(originalSpacing, this->GetSpacing()))
   {
     MITK_WARN << "Spacing has changed in a method, where the spacing must not change.";
     assert(false);
   }
 }
 
 const mitk::BaseGeometry::BoundsArrayType mitk::BaseGeometry::GetBounds() const
 {
   assert(m_BoundingBox.IsNotNull());
   return m_BoundingBox->GetBounds();
 }
 
 bool mitk::BaseGeometry::IsValid() const
 {
   return true;
 }
 
 void mitk::BaseGeometry::SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing)
 {
   PreSetSpacing(aSpacing);
   _SetSpacing(aSpacing, enforceSetSpacing);
 }
 
 void mitk::BaseGeometry::_SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing)
 {
   m_GeometryTransform->SetSpacing(aSpacing, enforceSetSpacing);
 }
 
 mitk::Vector3D mitk::BaseGeometry::GetAxisVector(unsigned int direction) const
 {
   Vector3D frontToBack;
   frontToBack.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction).as_ref());
   frontToBack *= GetExtent(direction);
   return frontToBack;
 }
 
 mitk::ScalarType mitk::BaseGeometry::GetExtent(unsigned int direction) const
 {
   assert(m_BoundingBox.IsNotNull());
   if (direction >= m_NDimensions)
     mitkThrow() << "Direction is too big. This geometry is for 3D Data";
   BoundsArrayType bounds = m_BoundingBox->GetBounds();
   return bounds[direction * 2 + 1] - bounds[direction * 2];
 }
 
 bool mitk::BaseGeometry::Is2DConvertable()
 {
   bool isConvertableWithoutLoss = true;
   do
   {
     if (this->GetSpacing()[2] != 1)
     {
       isConvertableWithoutLoss = false;
       break;
     }
     if (this->GetOrigin()[2] != 0)
     {
       isConvertableWithoutLoss = false;
       break;
     }
     mitk::Vector3D col0, col1, col2;
     col0.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(0).as_ref());
     col1.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(1).as_ref());
     col2.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(2).as_ref());
 
     if ((col0[2] != 0) || (col1[2] != 0) || (col2[0] != 0) || (col2[1] != 0) || (col2[2] != 1))
     {
       isConvertableWithoutLoss = false;
       break;
     }
   } while (false);
 
   return isConvertableWithoutLoss;
 }
 
 mitk::Point3D mitk::BaseGeometry::GetCenter() const
 {
   assert(m_BoundingBox.IsNotNull());
   Point3D c = m_BoundingBox->GetCenter();
   if (m_ImageGeometry)
   {
     // Get Center returns the middel of min and max pixel index. In corner based images, this is the right position.
     // In center based images (imageGeometry == true), the index needs to be shifted back.
     c[0] -= 0.5;
     c[1] -= 0.5;
     c[2] -= 0.5;
   }
   this->IndexToWorld(c, c);
   return c;
 }
 
 double mitk::BaseGeometry::GetDiagonalLength2() const
 {
   Vector3D diagonalvector = GetCornerPoint() - GetCornerPoint(false, false, false);
   return diagonalvector.GetSquaredNorm();
 }
 
 double mitk::BaseGeometry::GetDiagonalLength() const
 {
   return sqrt(GetDiagonalLength2());
 }
 
 mitk::Point3D mitk::BaseGeometry::GetCornerPoint(int id) const
 {
   assert(id >= 0);
   assert(this->IsBoundingBoxNull() == false);
 
   BoundingBox::BoundsArrayType bounds = this->GetBoundingBox()->GetBounds();
 
   Point3D cornerpoint;
   switch (id)
   {
     case 0:
       FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[4]);
       break;
     case 1:
       FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[5]);
       break;
     case 2:
       FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[4]);
       break;
     case 3:
       FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[5]);
       break;
     case 4:
       FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[4]);
       break;
     case 5:
       FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[5]);
       break;
     case 6:
       FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[4]);
       break;
     case 7:
       FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[5]);
       break;
     default:
     {
       itkExceptionMacro(<< "A cube only has 8 corners. These are labeled 0-7.");
     }
   }
   if (m_ImageGeometry)
   {
     // Here i have to adjust the 0.5 offset manually, because the cornerpoint is the corner of the
     // bounding box. The bounding box itself is no image, so it is corner-based
     FillVector3D(cornerpoint, cornerpoint[0] - 0.5, cornerpoint[1] - 0.5, cornerpoint[2] - 0.5);
   }
   return this->GetIndexToWorldTransform()->TransformPoint(cornerpoint);
 }
 
 mitk::Point3D mitk::BaseGeometry::GetCornerPoint(bool xFront, bool yFront, bool zFront) const
 {
   assert(this->IsBoundingBoxNull() == false);
   BoundingBox::BoundsArrayType bounds = this->GetBoundingBox()->GetBounds();
 
   Point3D cornerpoint;
   cornerpoint[0] = (xFront ? bounds[0] : bounds[1]);
   cornerpoint[1] = (yFront ? bounds[2] : bounds[3]);
   cornerpoint[2] = (zFront ? bounds[4] : bounds[5]);
   if (m_ImageGeometry)
   {
     // Here i have to adjust the 0.5 offset manually, because the cornerpoint is the corner of the
     // bounding box. The bounding box itself is no image, so it is corner-based
     FillVector3D(cornerpoint, cornerpoint[0] - 0.5, cornerpoint[1] - 0.5, cornerpoint[2] - 0.5);
   }
 
   return this->GetIndexToWorldTransform()->TransformPoint(cornerpoint);
 }
 
 mitk::ScalarType mitk::BaseGeometry::GetExtentInMM(int direction) const
 {
   return this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction).magnitude() *
          GetExtent(direction);
 }
 
 void mitk::BaseGeometry::SetExtentInMM(int direction, ScalarType extentInMM)
 {
   mitk::ModifiedLock lock(this);
 
   ScalarType len = GetExtentInMM(direction);
   if (fabs(len - extentInMM) >= mitk::eps)
   {
     AffineTransform3D::MatrixType::InternalMatrixType vnlmatrix;
     vnlmatrix = m_GeometryTransform->GetVnlMatrix();
     if (len > extentInMM)
       vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) / len * extentInMM);
     else
       vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) * extentInMM / len);
     Matrix3D matrix;
     matrix = vnlmatrix;
     m_GeometryTransform->SetMatrix(matrix);
 
     Modified();
   }
 }
 
 bool mitk::BaseGeometry::IsInside(const mitk::Point3D &p) const
 {
   mitk::Point3D index;
   WorldToIndex(p, index);
   return IsIndexInside(index);
 }
 
 bool mitk::BaseGeometry::IsIndexInside(const mitk::Point3D &index) const
 {
   bool inside = false;
   // if it is an image geometry, we need to convert the index to discrete values
   // this is done by applying the rounding function also used in WorldToIndex (see line 323)
   if (m_ImageGeometry)
   {
     mitk::Point3D discretIndex;
     discretIndex[0] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[0]);
     discretIndex[1] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[1]);
     discretIndex[2] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[2]);
 
     inside = this->GetBoundingBox()->IsInside(discretIndex);
     // we have to check if the index is at the upper border of each dimension,
     // because the boundingbox is not centerbased
     if (inside)
     {
       const BoundingBox::BoundsArrayType &bounds = this->GetBoundingBox()->GetBounds();
       if ((discretIndex[0] == bounds[1]) || (discretIndex[1] == bounds[3]) || (discretIndex[2] == bounds[5]))
         inside = false;
     }
   }
   else
     inside = this->GetBoundingBox()->IsInside(index);
 
   return inside;
 }
 
 void mitk::BaseGeometry::WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
 {
   mitk::Vector3D tempIn, tempOut;
   const TransformType::OffsetType &offset = this->GetIndexToWorldTransform()->GetOffset();
   tempIn = pt_mm.GetVectorFromOrigin() - offset;
 
   WorldToIndex(tempIn, tempOut);
 
   pt_units = Point3D(tempOut);
 }
 
 void mitk::BaseGeometry::WorldToIndex(const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const
 {
   // Get WorldToIndex transform
   if (m_IndexToWorldTransformLastModified != this->GetIndexToWorldTransform()->GetMTime())
   {
     if (!m_InvertedTransform)
     {
       m_InvertedTransform = TransformType::New();
     }
     if (!this->GetIndexToWorldTransform()->GetInverse(m_InvertedTransform.GetPointer()))
     {
       itkExceptionMacro("Internal ITK matrix inversion error, cannot proceed.");
     }
     m_IndexToWorldTransformLastModified = this->GetIndexToWorldTransform()->GetMTime();
   }
 
   // Check for valid matrix inversion
   const TransformType::MatrixType &inverse = m_InvertedTransform->GetMatrix();
   if (inverse.GetVnlMatrix().has_nans())
   {
     itkExceptionMacro("Internal ITK matrix inversion error, cannot proceed. Matrix was: "
                       << std::endl
                       << this->GetIndexToWorldTransform()->GetMatrix()
                       << "Suggested inverted matrix is:"
                       << std::endl
                       << inverse);
   }
 
   vec_units = inverse * vec_mm;
 }
 
 void mitk::BaseGeometry::WorldToIndex(const mitk::Point3D & /*atPt3d_mm*/,
                                       const mitk::Vector3D &vec_mm,
                                       mitk::Vector3D &vec_units) const
 {
   MITK_WARN << "Warning! Call of the deprecated function BaseGeometry::WorldToIndex(point, vec, vec). Use "
                "BaseGeometry::WorldToIndex(vec, vec) instead!";
   this->WorldToIndex(vec_mm, vec_units);
 }
 
 mitk::VnlVector mitk::BaseGeometry::GetOriginVnl() const
 {
   return GetOrigin().GetVnlVector();
 }
 
 vtkLinearTransform *mitk::BaseGeometry::GetVtkTransform() const
 {
   return m_GeometryTransform->GetVtkTransform();
 }
 
 void mitk::BaseGeometry::SetIdentity()
 {
   mitk::ModifiedLock lock(this);
 
   m_GeometryTransform->SetIdentity();
   Modified();
 }
 
 void mitk::BaseGeometry::Compose(const mitk::BaseGeometry::TransformType *other, bool pre)
 {
   mitk::ModifiedLock lock(this);
   m_GeometryTransform->Compose(other, pre);
   Modified();
 }
 
 void mitk::BaseGeometry::Compose(const vtkMatrix4x4 *vtkmatrix, bool pre)
 {
   mitk::BaseGeometry::TransformType::Pointer itkTransform = mitk::BaseGeometry::TransformType::New();
   TransferVtkMatrixToItkTransform(vtkmatrix, itkTransform.GetPointer());
   Compose(itkTransform, pre);
 }
 
 void mitk::BaseGeometry::Translate(const Vector3D &vector)
 {
   if ((vector[0] != 0) || (vector[1] != 0) || (vector[2] != 0))
   {
     this->SetOrigin(this->GetOrigin() + vector);
   }
 }
 
 void mitk::BaseGeometry::IndexToWorld(const mitk::Point3D &pt_units, mitk::Point3D &pt_mm) const
 {
   pt_mm = this->GetIndexToWorldTransform()->TransformPoint(pt_units);
 }
 
 void mitk::BaseGeometry::IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
 {
   vec_mm = this->GetIndexToWorldTransform()->TransformVector(vec_units);
 }
 
 void mitk::BaseGeometry::ExecuteOperation(Operation *operation)
 {
   mitk::ModifiedLock lock(this);
 
   vtkTransform *vtktransform = vtkTransform::New();
   vtktransform->SetMatrix(this->GetVtkMatrix());
   switch (operation->GetOperationType())
   {
     case OpNOTHING:
       break;
     case OpMOVE:
     {
       auto *pointOp = dynamic_cast<mitk::PointOperation *>(operation);
       if (pointOp == nullptr)
       {
         MITK_ERROR << "Point move operation is null!";
         return;
       }
       mitk::Point3D newPos = pointOp->GetPoint();
       ScalarType data[3];
       vtktransform->GetPosition(data);
       vtktransform->PostMultiply();
       vtktransform->Translate(newPos[0], newPos[1], newPos[2]);
       vtktransform->PreMultiply();
       break;
     }
     case OpSCALE:
     {
       auto *scaleOp = dynamic_cast<mitk::ScaleOperation *>(operation);
       if (scaleOp == nullptr)
       {
         MITK_ERROR << "Scale operation is null!";
         return;
       }
       mitk::Point3D newScale = scaleOp->GetScaleFactor();
       ScalarType scalefactor[3];
 
       scalefactor[0] = 1 + (newScale[0] / GetMatrixColumn(0).magnitude());
       scalefactor[1] = 1 + (newScale[1] / GetMatrixColumn(1).magnitude());
       scalefactor[2] = 1 + (newScale[2] / GetMatrixColumn(2).magnitude());
 
       mitk::Point3D anchor = scaleOp->GetScaleAnchorPoint();
 
       vtktransform->PostMultiply();
       vtktransform->Translate(-anchor[0], -anchor[1], -anchor[2]);
       vtktransform->Scale(scalefactor[0], scalefactor[1], scalefactor[2]);
       vtktransform->Translate(anchor[0], anchor[1], anchor[2]);
       break;
     }
     case OpROTATE:
     {
       auto *rotateOp = dynamic_cast<mitk::RotationOperation *>(operation);
       if (rotateOp == nullptr)
       {
         MITK_ERROR << "Rotation operation is null!";
         return;
       }
       Vector3D rotationVector = rotateOp->GetVectorOfRotation();
       Point3D center = rotateOp->GetCenterOfRotation();
       ScalarType angle = rotateOp->GetAngleOfRotation();
       vtktransform->PostMultiply();
       vtktransform->Translate(-center[0], -center[1], -center[2]);
       vtktransform->RotateWXYZ(angle, rotationVector[0], rotationVector[1], rotationVector[2]);
       vtktransform->Translate(center[0], center[1], center[2]);
       vtktransform->PreMultiply();
       break;
     }
     case OpRESTOREPLANEPOSITION:
     {
       // Copy necessary to avoid vtk warning
       vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
       TransferItkTransformToVtkMatrix(
         dynamic_cast<mitk::RestorePlanePositionOperation *>(operation)->GetTransform().GetPointer(), matrix);
       vtktransform->SetMatrix(matrix);
       matrix->Delete();
       break;
     }
     case OpAPPLYTRANSFORMMATRIX:
     {
       auto *applyMatrixOp = dynamic_cast<ApplyTransformMatrixOperation *>(operation);
       vtktransform->SetMatrix(applyMatrixOp->GetMatrix());
       break;
     }
     default:
       vtktransform->Delete();
       return;
   }
   this->SetVtkMatrixDeepCopy(vtktransform);
   Modified();
   vtktransform->Delete();
 }
 
 mitk::VnlVector mitk::BaseGeometry::GetMatrixColumn(unsigned int direction) const
 {
   return this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction).as_ref();
 }
 
 mitk::BoundingBox::Pointer mitk::BaseGeometry::CalculateBoundingBoxRelativeToTransform(
   const mitk::AffineTransform3D *transform) const
 {
   mitk::BoundingBox::PointsContainer::Pointer pointscontainer = mitk::BoundingBox::PointsContainer::New();
 
   mitk::BoundingBox::PointIdentifier pointid = 0;
 
   unsigned char i;
   if (transform != nullptr)
   {
     mitk::AffineTransform3D::Pointer inverse = mitk::AffineTransform3D::New();
     transform->GetInverse(inverse);
     for (i = 0; i < 8; ++i)
       pointscontainer->InsertElement(pointid++, inverse->TransformPoint(GetCornerPoint(i)));
   }
   else
   {
     for (i = 0; i < 8; ++i)
       pointscontainer->InsertElement(pointid++, GetCornerPoint(i));
   }
 
   mitk::BoundingBox::Pointer result = mitk::BoundingBox::New();
   result->SetPoints(pointscontainer);
   result->ComputeBoundingBox();
 
   return result;
 }
 
 const std::string mitk::BaseGeometry::GetTransformAsString(TransformType *transformType)
 {
   std::ostringstream out;
 
   out << '[';
 
   for (int i = 0; i < 3; ++i)
   {
     out << '[';
     for (int j = 0; j < 3; ++j)
       out << transformType->GetMatrix().GetVnlMatrix().get(i, j) << ' ';
     out << ']';
   }
 
   out << "][";
 
   for (int i = 0; i < 3; ++i)
     out << transformType->GetOffset()[i] << ' ';
 
   out << "]\0";
 
   return out.str();
 }
 
 void mitk::BaseGeometry::SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix)
 {
   m_GeometryTransform->SetIndexToWorldTransformByVtkMatrix(vtkmatrix);
 }
 
 void mitk::BaseGeometry::SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix)
 {
   m_GeometryTransform->SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkmatrix);
 }
 
 void mitk::BaseGeometry::IndexToWorld(const mitk::Point3D & /*atPt3d_units*/,
                                       const mitk::Vector3D &vec_units,
                                       mitk::Vector3D &vec_mm) const
 {
   MITK_WARN << "Warning! Call of the deprecated function BaseGeometry::IndexToWorld(point, vec, vec). Use "
                "BaseGeometry::IndexToWorld(vec, vec) instead!";
   // vec_mm = m_IndexToWorldTransform->TransformVector(vec_units);
   this->IndexToWorld(vec_units, vec_mm);
 }
 
 vtkMatrix4x4 *mitk::BaseGeometry::GetVtkMatrix()
 {
   return m_GeometryTransform->GetVtkMatrix();
 }
 
 bool mitk::BaseGeometry::IsBoundingBoxNull() const
 {
   return m_BoundingBox.IsNull();
 }
 
 bool mitk::BaseGeometry::IsIndexToWorldTransformNull() const
 {
   return m_GeometryTransform->IsIndexToWorldTransformNull();
 }
 
 void mitk::BaseGeometry::ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry)
 {
   // If Geometry is switched to ImageGeometry, you have to put an offset to the origin, because
   // imageGeometries origins are pixel-center-based
   // ... and remove the offset, if you switch an imageGeometry back to a normal geometry
   // For more information please see the Geometry documentation page
 
   if (m_ImageGeometry == isAnImageGeometry)
     return;
 
   const BoundingBox::BoundsArrayType &boundsarray = this->GetBoundingBox()->GetBounds();
 
   Point3D originIndex;
   FillVector3D(originIndex, boundsarray[0], boundsarray[2], boundsarray[4]);
 
   if (isAnImageGeometry == true)
     FillVector3D(originIndex, originIndex[0] + 0.5, originIndex[1] + 0.5, originIndex[2] + 0.5);
   else
     FillVector3D(originIndex, originIndex[0] - 0.5, originIndex[1] - 0.5, originIndex[2] - 0.5);
 
   Point3D originWorld;
 
   originWorld = GetIndexToWorldTransform()->TransformPoint(originIndex);
   // instead could as well call  IndexToWorld(originIndex,originWorld);
 
   SetOrigin(originWorld);
 
   this->SetImageGeometry(isAnImageGeometry);
 }
 
 void mitk::BaseGeometry::PrintSelf(std::ostream &os, itk::Indent indent) const
 {
   os << indent << " IndexToWorldTransform: ";
   if (this->IsIndexToWorldTransformNull())
     os << "nullptr" << std::endl;
   else
   {
     // from itk::MatrixOffsetTransformBase
     unsigned int i, j;
     os << std::endl;
     os << indent << "Matrix: " << std::endl;
     for (i = 0; i < 3; i++)
     {
       os << indent.GetNextIndent();
       for (j = 0; j < 3; j++)
       {
         os << this->GetIndexToWorldTransform()->GetMatrix()[i][j] << " ";
       }
       os << std::endl;
     }
 
     os << indent << "Offset: " << this->GetIndexToWorldTransform()->GetOffset() << std::endl;
     os << indent << "Center: " << this->GetIndexToWorldTransform()->GetCenter() << std::endl;
     os << indent << "Translation: " << this->GetIndexToWorldTransform()->GetTranslation() << std::endl;
 
     auto inverse = mitk::AffineTransform3D::New();
     if (this->GetIndexToWorldTransform()->GetInverse(inverse))
     {
       os << indent << "Inverse: " << std::endl;
       for (i = 0; i < 3; i++)
       {
         os << indent.GetNextIndent();
         for (j = 0; j < 3; j++)
         {
           os << inverse->GetMatrix()[i][j] << " ";
         }
         os << std::endl;
       }
     }
 
     // from itk::ScalableAffineTransform
     os << indent << "Scale : ";
     for (i = 0; i < 3; i++)
     {
       os << this->GetIndexToWorldTransform()->GetScale()[i] << " ";
     }
     os << std::endl;
   }
 
   os << indent << " BoundingBox: ";
   if (this->IsBoundingBoxNull())
     os << "nullptr" << std::endl;
   else
   {
     os << indent << "( ";
     for (unsigned int i = 0; i < 3; i++)
     {
       os << this->GetBoundingBox()->GetBounds()[2 * i] << "," << this->GetBoundingBox()->GetBounds()[2 * i + 1] << " ";
     }
     os << " )" << std::endl;
   }
 
   os << indent << " Origin: " << this->GetOrigin() << std::endl;
   os << indent << " ImageGeometry: " << this->GetImageGeometry() << std::endl;
   os << indent << " Spacing: " << this->GetSpacing() << std::endl;
 }
 
 void mitk::BaseGeometry::Modified() const
 {
   if (!m_ModifiedLockFlag)
     Superclass::Modified();
   else
     m_ModifiedCalledFlag = true;
 }
 
 mitk::AffineTransform3D *mitk::BaseGeometry::GetIndexToWorldTransform()
 {
   return m_GeometryTransform->GetIndexToWorldTransform();
 }
 
 const mitk::AffineTransform3D *mitk::BaseGeometry::GetIndexToWorldTransform() const
 {
   return m_GeometryTransform->GetIndexToWorldTransform();
 }
 
 const mitk::GeometryTransformHolder *mitk::BaseGeometry::GetGeometryTransformHolder() const
 {
   return m_GeometryTransform;
 }
 
+void mitk::BaseGeometry::MapAxesToOrientations(int axes[]) const
+{
+  auto affineTransform = this->GetIndexToWorldTransform();
+  auto matrix = affineTransform->GetMatrix();
+  matrix.GetVnlMatrix().normalize_columns();
+  auto inverseMatrix = matrix.GetInverse();
+
+  bool mapped[3] = {false, false, false};
+
+  // We need to allow an epsilon difference to ignore rounding.
+  const double eps = 0.0001;
+
+  for (int orientation = 0; orientation < 3; ++orientation)
+  {
+    auto absX = std::abs(inverseMatrix[0][orientation]);
+    auto absY = std::abs(inverseMatrix[1][orientation]);
+    auto absZ = std::abs(inverseMatrix[2][orientation]);
+
+    // First we check if there is a single maximum value. If there is, we found the axis
+    // that corresponds to the given orientation. If there is no single maximum value,
+    // we choose one from the the two or three axes that have the maximum value, but we
+    // need to make sure that we do not map the same axis to different orientations.
+    // Equal values are valid if the volume is rotated by exactly 45 degrees around one
+    // axis. If the volume is rotated by 45 degrees around two axes, you will get single
+    // maximum values at the same axes for two different orientations. In this case,
+    // the axis is mapped to one of the orientations, and for the other orientation we
+    // choose a different axis that has not been mapped yet, even if it is not a maximum.
+
+    if (absX > absY + eps)
+    {
+      if (absX > absZ + eps)
+      {
+        // x is the greatest
+        int axis = !mapped[0] ? 0 : !mapped[1] ? 1 : 2;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+      else
+      {
+        // z is the greatest OR x and z are equal and greater than y
+        int axis = !mapped[2] ? 2 : !mapped[0] ? 0 : 1;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+    }
+    else if (absY > absX + eps)
+    {
+      if (absY > absZ + eps)
+      {
+        // y is the greatest
+        int axis = !mapped[1] ? 1 : !mapped[2] ? 2 : 0;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+      else
+      {
+        // z is the greatest OR y and z are equal and greater than x
+        int axis = !mapped[2] ? 2 : !mapped[1] ? 1 : 0;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+    }
+    else
+    {
+      if (absZ > absX + eps)
+      {
+        // z is the greatest
+        int axis = !mapped[2] ? 2 : !mapped[0] ? 0 : 1;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+      else
+      {
+        // x and y are equal and greater than z OR x and y and z are equal
+        int axis = !mapped[0] ? 0 : !mapped[1] ? 1 : 2;
+        axes[orientation] = axis;
+        mapped[axis] = true;
+      }
+    }
+  }
+
+  assert(mapped[0] && mapped[1] && mapped[2]);
+}
+
 bool mitk::Equal(const mitk::BaseGeometry::BoundingBoxType &leftHandSide,
                  const mitk::BaseGeometry::BoundingBoxType &rightHandSide,
                  ScalarType eps,
                  bool verbose)
 {
   bool result = true;
 
   BaseGeometry::BoundsArrayType rightBounds = rightHandSide.GetBounds();
   BaseGeometry::BoundsArrayType leftBounds = leftHandSide.GetBounds();
   BaseGeometry::BoundsArrayType::Iterator itLeft = leftBounds.Begin();
   for (BaseGeometry::BoundsArrayType::Iterator itRight = rightBounds.Begin(); itRight != rightBounds.End(); ++itRight)
   {
     if ((!mitk::Equal(*itLeft, *itRight, eps)))
     {
       if (verbose)
       {
         MITK_INFO << "[( Geometry3D::BoundingBoxType )] bounds are not equal.";
         MITK_INFO << "rightHandSide is " << setprecision(12) << *itRight << " : leftHandSide is " << *itLeft
                   << " and tolerance is " << eps;
       }
       result = false;
     }
     itLeft++;
   }
   return result;
 }
 
 bool mitk::Equal(const mitk::BaseGeometry &leftHandSide,
                  const mitk::BaseGeometry &rightHandSide,
                  ScalarType coordinateEps,
                  ScalarType directionEps,
                  bool verbose)
 {
   bool result = true;
 
   // Compare spacings
   if (!mitk::Equal(leftHandSide.GetSpacing(), rightHandSide.GetSpacing(), coordinateEps))
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] Spacing differs.";
       MITK_INFO << "rightHandSide is " << setprecision(12) << rightHandSide.GetSpacing() << " : leftHandSide is "
                 << leftHandSide.GetSpacing() << " and tolerance is " << coordinateEps;
     }
     result = false;
   }
 
   // Compare Origins
   if (!mitk::Equal(leftHandSide.GetOrigin(), rightHandSide.GetOrigin(), coordinateEps))
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] Origin differs.";
       MITK_INFO << "rightHandSide is " << setprecision(12) << rightHandSide.GetOrigin() << " : leftHandSide is "
                 << leftHandSide.GetOrigin() << " and tolerance is " << coordinateEps;
     }
     result = false;
   }
 
   // Compare Axis and Extents
   for (unsigned int i = 0; i < 3; ++i)
   {
     if (!mitk::Equal(leftHandSide.GetAxisVector(i), rightHandSide.GetAxisVector(i), directionEps))
     {
       if (verbose)
       {
         MITK_INFO << "[( Geometry3D )] AxisVector #" << i << " differ";
         MITK_INFO << "rightHandSide is " << setprecision(12) << rightHandSide.GetAxisVector(i) << " : leftHandSide is "
                   << leftHandSide.GetAxisVector(i) << " and tolerance is " << directionEps;
       }
       result = false;
     }
 
     if (!mitk::Equal(leftHandSide.GetExtent(i), rightHandSide.GetExtent(i), coordinateEps))
     {
       if (verbose)
       {
         MITK_INFO << "[( Geometry3D )] Extent #" << i << " differ";
         MITK_INFO << "rightHandSide is " << setprecision(12) << rightHandSide.GetExtent(i) << " : leftHandSide is "
                   << leftHandSide.GetExtent(i) << " and tolerance is " << coordinateEps;
       }
       result = false;
     }
   }
 
   // Compare ImageGeometry Flag
   if (rightHandSide.GetImageGeometry() != leftHandSide.GetImageGeometry())
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] GetImageGeometry is different.";
       MITK_INFO << "rightHandSide is " << rightHandSide.GetImageGeometry() << " : leftHandSide is "
                 << leftHandSide.GetImageGeometry();
     }
     result = false;
   }
 
   // Compare FrameOfReference ID
   if (rightHandSide.GetFrameOfReferenceID() != leftHandSide.GetFrameOfReferenceID())
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] GetFrameOfReferenceID is different.";
       MITK_INFO << "rightHandSide is " << rightHandSide.GetFrameOfReferenceID() << " : leftHandSide is "
                 << leftHandSide.GetFrameOfReferenceID();
     }
     result = false;
   }
 
   // Compare BoundingBoxes
   if (!mitk::Equal(*leftHandSide.GetBoundingBox(), *rightHandSide.GetBoundingBox(), coordinateEps, verbose))
   {
     result = false;
   }
 
   // Compare IndexToWorldTransform Matrix
   if (!mitk::Equal(*leftHandSide.GetIndexToWorldTransform(), *rightHandSide.GetIndexToWorldTransform(), directionEps, verbose))
   {
     result = false;
   }
   return result;
 }
 
 bool mitk::Equal(const mitk::BaseGeometry& leftHandSide,
   const mitk::BaseGeometry& rightHandSide,
   ScalarType eps,
   bool verbose)
 {
   return Equal(leftHandSide, rightHandSide, eps, eps, verbose);
 }
 
 bool mitk::Equal(const mitk::BaseGeometry::TransformType &leftHandSide,
                  const mitk::BaseGeometry::TransformType &rightHandSide,
                  ScalarType eps,
                  bool verbose)
 {
   // Compare IndexToWorldTransform Matrix
   if (!mitk::MatrixEqualElementWise(leftHandSide.GetMatrix(), rightHandSide.GetMatrix(), eps))
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D::TransformType )] Index to World Transformation matrix differs.";
       MITK_INFO << "rightHandSide is " << setprecision(12) << rightHandSide.GetMatrix() << " : leftHandSide is "
                 << leftHandSide.GetMatrix() << " and tolerance is " << eps;
     }
     return false;
   }
   return true;
 }
 
 bool mitk::IsSubGeometry(const mitk::BaseGeometry& testGeo,
   const mitk::BaseGeometry& referenceGeo,
   ScalarType coordinateEps,
   ScalarType directionEps,
   bool verbose)
 {
   bool result = true;
 
   // Compare spacings (must be equal)
   const auto testedSpacing = testGeo.GetSpacing();
   if (!mitk::Equal(testedSpacing, referenceGeo.GetSpacing(), coordinateEps))
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] Spacing differs.";
       MITK_INFO << "testedGeometry is " << setprecision(12) << testedSpacing << " : referenceGeometry is "
         << referenceGeo.GetSpacing() << " and tolerance is " << coordinateEps;
     }
     result = false;
   }
 
   // Compare ImageGeometry Flag (must be equal)
   if (referenceGeo.GetImageGeometry() != testGeo.GetImageGeometry())
   {
     if (verbose)
     {
       MITK_INFO << "[( Geometry3D )] GetImageGeometry is different.";
       MITK_INFO << "referenceGeo is " << referenceGeo.GetImageGeometry() << " : testGeo is "
         << testGeo.GetImageGeometry();
     }
     result = false;
   }
 
   // Compare IndexToWorldTransform Matrix (must be equal -> same axis directions)
   if (!Equal(*(testGeo.GetIndexToWorldTransform()), *(referenceGeo.GetIndexToWorldTransform()), directionEps, verbose))
   {
     result = false;
   }
 
   //check if the geometry is within or equal to the bounds of reference geomentry.
   for (int i = 0; i<8; ++i)
   {
     auto testCorner = testGeo.GetCornerPoint(i);
     bool isInside = false;
     mitk::Point3D testCornerIndex;
     referenceGeo.WorldToIndex(testCorner, testCornerIndex);
 
     std::bitset<sizeof(int)> bs(i);
     //To regard the coordinateEps, we subtract or add it to the index elements
     //depending on whether it was constructed by a lower or an upper bound value
     //(see implementation of BaseGeometry::GetCorner()).
     if (bs.test(0))
     {
       testCornerIndex[2] -= coordinateEps;
     }
     else
     {
       testCornerIndex[2] += coordinateEps;
     }
 
     if (bs.test(1))
     {
       testCornerIndex[1] -= coordinateEps;
     }
     else
     {
       testCornerIndex[1] += coordinateEps;
     }
 
     if (bs.test(2))
     {
       testCornerIndex[0] -= coordinateEps;
     }
     else
     {
       testCornerIndex[0] += coordinateEps;
     }
 
     isInside = referenceGeo.IsIndexInside(testCornerIndex);
 
     if (!isInside)
     {
       if (verbose)
       {
         MITK_INFO << "[( Geometry3D )] corner point is not inside. ";
         MITK_INFO << "referenceGeo is " << setprecision(12) << referenceGeo << " : tested corner is "
           << testGeo.GetCornerPoint(i);
       }
       result = false;
     }
   }
 
   // check grid of test geometry is on the grid of the reference geometry. This is important as the
   // boundingbox is only checked for containing the tested geometry, but if a corner (one is enough
   // as we know that axis and spacing are equal, due to equal transfor (see above)) of the tested geometry
   // is on the grid it is really a sub geometry (as they have the same spacing and axis).
   auto cornerOffset = testGeo.GetCornerPoint(0) - referenceGeo.GetCornerPoint(0);
   mitk::Vector3D cornerIndexOffset;
   referenceGeo.WorldToIndex(cornerOffset, cornerIndexOffset);
   for (unsigned int i = 0; i < 3; ++i)
   {
     auto pixelCountContinous = cornerIndexOffset[i];
     auto pixelCount = std::round(pixelCountContinous);
     if (std::abs(pixelCount - pixelCountContinous) > coordinateEps)
     {
       if (verbose)
       {
         MITK_INFO << "[( Geometry3D )] Tested geometry is not on the grid of the reference geometry. ";
         MITK_INFO << "referenceGeo is " << setprecision(15) << referenceGeo << " : tested corner offset in pixels is "
           << pixelCountContinous << " for axis "<<i;
       }
       result = false;
     }
   }
 
   return result;
 }
 
 bool mitk::IsSubGeometry(const mitk::BaseGeometry& testGeo,
   const mitk::BaseGeometry& referenceGeo,
   ScalarType eps,
   bool verbose)
 {
   return IsSubGeometry(testGeo, referenceGeo, eps, eps, verbose);
 }
diff --git a/Modules/Core/src/DataManagement/mitkPlaneGeometry.cpp b/Modules/Core/src/DataManagement/mitkPlaneGeometry.cpp
index 30d2f6829b..585d7f9c1a 100644
--- a/Modules/Core/src/DataManagement/mitkPlaneGeometry.cpp
+++ b/Modules/Core/src/DataManagement/mitkPlaneGeometry.cpp
@@ -1,975 +1,929 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkPlaneGeometry.h"
 #include "mitkInteractionConst.h"
 #include "mitkLine.h"
 #include "mitkPlaneOperation.h"
 
 #include <itkSpatialOrientationAdapter.h>
 
 #include <vtkTransform.h>
 
 #include <vnl/vnl_cross.h>
 
 namespace mitk
 {
   PlaneGeometry::PlaneGeometry() : Superclass(), m_ReferenceGeometry(nullptr) { Initialize(); }
   PlaneGeometry::~PlaneGeometry() {}
   PlaneGeometry::PlaneGeometry(const PlaneGeometry &other)
     : Superclass(other), m_ReferenceGeometry(other.m_ReferenceGeometry)
   {
   }
 
   bool PlaneGeometry::CheckRotationMatrix(mitk::AffineTransform3D *transform, double epsilon)
   {
     bool rotation = true;
 
     auto matrix = transform->GetMatrix().GetVnlMatrix();
     matrix.normalize_columns();
 
     auto det = vnl_determinant(matrix);
     if (fabs(det-1.0) > epsilon)
     {
       MITK_WARN << "Invalid rotation matrix! Determinant != 1 (" << det << ")";
       rotation = false;
     }
 
     vnl_matrix_fixed<double, 3, 3> id; id.set_identity();
     auto should_be_id = matrix*matrix.transpose();
     should_be_id -= id;
     auto max = should_be_id.absolute_value_max();
     if (max > epsilon)
     {
       MITK_WARN << "Invalid rotation matrix! R*R^T != ID. Max value: " << max << " (should be 0)";
       rotation = false;
     }
 
     return rotation;
   }
 
   void PlaneGeometry::CheckIndexToWorldTransform(mitk::AffineTransform3D *transform)
   {
     this->CheckRotationMatrix(transform);
   }
 
   void PlaneGeometry::CheckBounds(const BoundingBox::BoundsArrayType &bounds)
   {
     // error: unused parameter 'bounds'
     // this happens in release mode, where the assert macro is defined empty
     // hence we "use" the parameter:
     (void)bounds;
 
     // currently the unit rectangle must be starting at the origin [0,0]
     assert(bounds[0] == 0);
     assert(bounds[2] == 0);
     // the unit rectangle must be two-dimensional
     assert(bounds[1] > 0);
     assert(bounds[3] > 0);
   }
 
   void PlaneGeometry::IndexToWorld(const Point2D &pt_units, Point2D &pt_mm) const
   {
     pt_mm[0] = GetExtentInMM(0) / GetExtent(0) * pt_units[0];
     pt_mm[1] = GetExtentInMM(1) / GetExtent(1) * pt_units[1];
   }
 
   void PlaneGeometry::WorldToIndex(const Point2D &pt_mm, Point2D &pt_units) const
   {
     pt_units[0] = pt_mm[0] * (1.0 / (GetExtentInMM(0) / GetExtent(0)));
     pt_units[1] = pt_mm[1] * (1.0 / (GetExtentInMM(1) / GetExtent(1)));
   }
 
   void PlaneGeometry::IndexToWorld(const Point2D & /*atPt2d_units*/, const Vector2D &vec_units, Vector2D &vec_mm) const
   {
     MITK_WARN << "Warning! Call of the deprecated function PlaneGeometry::IndexToWorld(point, vec, vec). Use "
                  "PlaneGeometry::IndexToWorld(vec, vec) instead!";
     this->IndexToWorld(vec_units, vec_mm);
   }
 
   void PlaneGeometry::IndexToWorld(const Vector2D &vec_units, Vector2D &vec_mm) const
   {
     vec_mm[0] = (GetExtentInMM(0) / GetExtent(0)) * vec_units[0];
     vec_mm[1] = (GetExtentInMM(1) / GetExtent(1)) * vec_units[1];
   }
 
   void PlaneGeometry::WorldToIndex(const Point2D & /*atPt2d_mm*/, const Vector2D &vec_mm, Vector2D &vec_units) const
   {
     MITK_WARN << "Warning! Call of the deprecated function PlaneGeometry::WorldToIndex(point, vec, vec). Use "
                  "PlaneGeometry::WorldToIndex(vec, vec) instead!";
     this->WorldToIndex(vec_mm, vec_units);
   }
 
   void PlaneGeometry::WorldToIndex(const Vector2D &vec_mm, Vector2D &vec_units) const
   {
     vec_units[0] = vec_mm[0] * (1.0 / (GetExtentInMM(0) / GetExtent(0)));
     vec_units[1] = vec_mm[1] * (1.0 / (GetExtentInMM(1) / GetExtent(1)));
   }
 
   void PlaneGeometry::InitializeStandardPlane(mitk::ScalarType width,
                                               ScalarType height,
                                               const Vector3D &spacing,
                                               AnatomicalPlane planeorientation,
                                               ScalarType zPosition,
                                               bool frontside,
                                               bool rotated,
                                               bool top)
   {
     AffineTransform3D::Pointer transform;
 
     transform = AffineTransform3D::New();
     AffineTransform3D::MatrixType matrix;
     AffineTransform3D::MatrixType::InternalMatrixType &vnlmatrix = matrix.GetVnlMatrix();
 
     vnlmatrix.set_identity();
     vnlmatrix(0, 0) = spacing[0];
     vnlmatrix(1, 1) = spacing[1];
     vnlmatrix(2, 2) = spacing[2];
     transform->SetIdentity();
     transform->SetMatrix(matrix);
 
     InitializeStandardPlane(width, height, transform.GetPointer(), planeorientation, zPosition, frontside, rotated, top);
   }
 
   void PlaneGeometry::InitializeStandardPlane(mitk::ScalarType width,
                                               mitk::ScalarType height,
                                               const AffineTransform3D *transform /* = nullptr */,
                                               AnatomicalPlane planeorientation /* = Axial */,
                                               mitk::ScalarType zPosition /* = 0 */,
                                               bool frontside /* = true */,
                                               bool rotated /* = false */,
                                               bool top /* = true */)
   {
     Superclass::Initialize();
 
     /// construct standard view.
 
     // We define at the moment "frontside" as: axial from above,
     // coronal from front (nose), sagittal from right.
     // TODO: Double check with medicals doctors or radiologists [ ].
 
     // We define the orientation in patient's view, e.g. LAI is in a axial cut
     // (parallel to the triangle ear-ear-nose):
     // first axis: To the left ear of the patient
     // seecond axis: To the nose of the patient
     // third axis: To the legs of the patient.
 
     // Options are: L/R left/right; A/P anterior/posterior; I/S inferior/superior
     // (AKA caudal/cranial).
     // We note on all cases in the following switch block r.h. for right handed
     // or l.h. for left handed to describe the different cases.
     // However, which system is chosen is defined at the end of the switch block.
 
     // CAVE / be careful: the vectors right and bottom are relative to the plane
     // and do NOT describe e.g. the right side of the patient.
 
     Point3D origin;
     /** Bottom means downwards, DV means Direction Vector. Both relative to the image! */
     VnlVector rightDV(3), bottomDV(3);
     /** Origin of this plane is by default a zero vector and implicitly in the top-left corner: */
     origin.Fill(0);
     /** This is different to all definitions in MITK, except the QT mouse clicks.
     *   But it is like this here and we don't want to change a running system.
     *   Just be aware, that IN THIS FUNCTION we define the origin at the top left (e.g. your screen). */
 
     /** NormalDirection defines which axis (i.e. column index in the transform matrix)
     * is perpendicular to the plane: */
     int normalDirection;
 
     switch (planeorientation) // Switch through our limited choice of standard planes:
     {
       case AnatomicalPlane::Original:
       /** Orientation 'Original' shall be done like the axial plane,
        *  for whatever reasons. */
       case AnatomicalPlane::Axial:
         if (frontside) // Radiologist's view from below. A cut along the triangle ear-ear-nose.
         {
           if (rotated == false)
           /** Origin in the top-left corner, x=[1; 0; 0], y=[0; 1; 0], z=[0; 0; 1],
           *   origin=[0,0,zpos]: LAI (r.h.)
           *
           *  0---rightDV---->                            |
           *  |                                           |
           *  |  Picture of a finite, rectangular plane   |
           *  |  ( insert LOLCAT-scan here ^_^ )          |
           *  |                                           |
           *  v  _________________________________________|
           *
           */
           {
             FillVector3D(origin, 0, 0, zPosition);
             FillVector3D(rightDV, 1, 0, 0);
             FillVector3D(bottomDV, 0, 1, 0);
           }
           else // Origin rotated to the bottom-right corner, x=[-1; 0; 0], y=[0; -1; 0], z=[0; 0; 1],
                // origin=[w,h,zpos]: RPI (r.h.)
           {    // Caveat emptor:  Still  using  top-left  as  origin  of  index  coordinate  system!
             FillVector3D(origin, width, height, zPosition);
             FillVector3D(rightDV, -1, 0, 0);
             FillVector3D(bottomDV, 0, -1, 0);
           }
         }
         else // 'Backside, not frontside.' Neuro-Surgeons's view from above patient.
         {
           if (rotated == false) // x=[-1; 0; 0], y=[0; 1; 0], z=[0; 0; 1], origin=[w,0,zpos]:  RAS (r.h.)
           {
             FillVector3D(origin, width, 0, zPosition);
             FillVector3D(rightDV, -1, 0, 0);
             FillVector3D(bottomDV, 0, 1, 0);
           }
           else // Origin in the bottom-left corner, x=[1; 0; 0], y=[0; -1; 0], z=[0; 0; 1],
                // origin=[0,h,zpos]:  LPS (r.h.)
           {
             FillVector3D(origin, 0, height, zPosition);
             FillVector3D(rightDV, 1, 0, 0);
             FillVector3D(bottomDV, 0, -1, 0);
           }
         }
         normalDirection = 2; // That is S=Superior=z=third_axis=middlefinger in righthanded LPS-system.
         break;
 
       case AnatomicalPlane::Coronal: // Coronal=Frontal plane; cuts through patient's ear-ear-heel-heel:
         if (frontside)
         {
           if (rotated == false) // x=[1; 0; 0], y=[0; 0; 1], z=[0; 1; 0], origin=[0,zpos,0]: LAI (r.h.)
           {
             FillVector3D(origin, 0, zPosition, 0);
             FillVector3D(rightDV, 1, 0, 0);
             FillVector3D(bottomDV, 0, 0, 1);
           }
           else // x=[-1;0;0], y=[0;0;-1], z=[0;1;0], origin=[w,zpos,h]:  RAS  (r.h.)
           {
             FillVector3D(origin, width, zPosition, height);
             FillVector3D(rightDV, -1, 0, 0);
             FillVector3D(bottomDV, 0, 0, -1);
           }
         }
         else
         {
           if (rotated == false) //  x=[-1;0;0], y=[0;0;1], z=[0;1;0], origin=[w,zpos,0]: RPI (r.h.)
           {
             FillVector3D(origin, width, zPosition, 0);
             FillVector3D(rightDV, -1, 0, 0);
             FillVector3D(bottomDV, 0, 0, 1);
           }
           else //  x=[1;0;0], y=[0;1;0], z=[0;0;-1], origin=[0,zpos,h]: LPS (r.h.)
           {
             FillVector3D(origin, 0, zPosition, height);
             FillVector3D(rightDV, 1, 0, 0);
             FillVector3D(bottomDV, 0, 0, -1);
           }
         }
         normalDirection = 1; // Normal vector = posterior direction.
         break;
 
       case AnatomicalPlane::Sagittal: // Sagittal=Medial plane, the symmetry-plane mirroring your face.
         if (frontside)
         {
           if (rotated == false) //  x=[0;1;0], y=[0;0;1], z=[1;0;0], origin=[zpos,0,0]:  LAI (r.h.)
           {
             FillVector3D(origin, zPosition, 0, 0);
             FillVector3D(rightDV, 0, 1, 0);
             FillVector3D(bottomDV, 0, 0, 1);
           }
           else //  x=[0;-1;0], y=[0;0;-1], z=[1;0;0], origin=[zpos,w,h]:  LPS (r.h.)
           {
             FillVector3D(origin, zPosition, width, height);
             FillVector3D(rightDV, 0, -1, 0);
             FillVector3D(bottomDV, 0, 0, -1);
           }
         }
         else
         {
           if (rotated == false) //  x=[0;-1;0], y=[0;0;1], z=[1;0;0], origin=[zpos,w,0]:  RPI (r.h.)
           {
             FillVector3D(origin, zPosition, width, 0);
             FillVector3D(rightDV, 0, -1, 0);
             FillVector3D(bottomDV, 0, 0, 1);
           }
           else //  x=[0;1;0], y=[0;0;-1], z=[1;0;0], origin=[zpos,0,h]:  RAS (r.h.)
           {
             FillVector3D(origin, zPosition, 0, height);
             FillVector3D(rightDV, 0, 1, 0);
             FillVector3D(bottomDV, 0, 0, -1);
           }
         }
         normalDirection = 0; // Normal vector = Lateral direction: Left in a LPS-system.
         break;
 
       default:
         itkExceptionMacro("unknown AnatomicalPlane");
     }
 
     VnlVector normal(3);
     FillVector3D(normal, 0, 0, 0);
     normal[normalDirection] = top ? 1 : -1;
 
     if ( transform != nullptr )
     {
       origin = transform->TransformPoint( origin );
       rightDV = transform->TransformVector( rightDV ).as_ref();
       bottomDV = transform->TransformVector( bottomDV ).as_ref();
       normal = transform->TransformVector( normal ).as_ref();
     }
 
     ScalarType bounds[6] = {0, width, 0, height, 0, 1};
     this->SetBounds(bounds);
 
     AffineTransform3D::Pointer planeTransform = AffineTransform3D::New();
     Matrix3D matrix;
     matrix.GetVnlMatrix().set_column(0, rightDV.as_ref());
     matrix.GetVnlMatrix().set_column(1, bottomDV.as_ref());
     matrix.GetVnlMatrix().set_column(2, normal.as_ref());
     planeTransform->SetMatrix(matrix);
     planeTransform->SetOffset(this->GetIndexToWorldTransform()->GetOffset());
     this->SetIndexToWorldTransform(planeTransform);
 
     this->SetOrigin(origin);
   }
-
-  std::vector< int > PlaneGeometry::CalculateDominantAxes(mitk::AffineTransform3D::MatrixType::InternalMatrixType& rotation_matrix)
-  {
-    std::vector< int > axes;
-
-    bool dominant_axis_error = false;
-    for (int i = 0; i < 3; ++i)
-    {
-      int dominantAxis = itk::Function::Max3(
-          rotation_matrix[0][i],
-          rotation_matrix[1][i],
-          rotation_matrix[2][i]
-      );
-
-      for (int j=0; j<i; ++j)
-        if (axes[j] == dominantAxis)
-        {
-          dominant_axis_error = true;
-          break;
-        }
-      if (dominant_axis_error)
-        break;
-
-      axes.push_back(dominantAxis);
-    }
-
-    if (dominant_axis_error)
-    {
-      MITK_DEBUG << "Error during dominant axis calculation. Using default.";
-      MITK_DEBUG << "This is either caused by an imperfect rotation matrix or if the rotation is axactly 45° around one or more axis.";
-      axes.clear();
-      for (int i = 0; i < 3; ++i)
-        axes.push_back(i);
-    }
-
-    return axes;
-  }
-
+  
   void PlaneGeometry::InitializeStandardPlane(const BaseGeometry *geometry3D,
                                               AnatomicalPlane planeorientation,
                                               ScalarType zPosition,
                                               bool frontside,
                                               bool rotated,
                                               bool top)
   {
     this->SetReferenceGeometry(geometry3D);
 
     ScalarType width, height;
 
-    // Inspired by:
-    // http://www.na-mic.org/Wiki/index.php/Coordinate_System_Conversion_Between_ITK_and_Slicer3
-
-    mitk::AffineTransform3D::MatrixType matrix = geometry3D->GetIndexToWorldTransform()->GetMatrix();
-
+    auto matrix = geometry3D->GetIndexToWorldTransform()->GetMatrix();
     matrix.GetVnlMatrix().normalize_columns();
-    mitk::AffineTransform3D::MatrixType::InternalMatrixType inverseMatrix = matrix.GetTranspose();
+    auto inverseMatrix = matrix.GetInverse();
+
+    // The index of the sagittal, coronal and axial axes in the reference geometry.
+    int axes[3];
+    geometry3D->MapAxesToOrientations(axes);
 
-    /// The index of the sagittal, coronal and axial axes in the reference geometry.
-    auto axes = CalculateDominantAxes(inverseMatrix);
-    /// The direction of the sagittal, coronal and axial axes in the reference geometry.
-    /// +1 means that the direction is straight, i.e. greater index translates to greater
-    /// world coordinate. -1 means that the direction is inverted.
+    // The direction of the sagittal, coronal and axial axes in the reference geometry.
+    // +1 means that the direction is straight, i.e. greater index translates to greater
+    // world coordinate. -1 means that the direction is inverted.
     int directions[3];
     ScalarType extents[3];
     ScalarType spacings[3];
     for (int i=0; i<3; ++i)
     {
-      int dominantAxis = axes.at(i);
-      directions[i] = itk::Function::Sign(inverseMatrix[dominantAxis][i]);
-      extents[i] = geometry3D->GetExtent(dominantAxis);
-      spacings[i] = geometry3D->GetSpacing()[dominantAxis];
+      int axis = axes[i];
+      directions[i] = itk::Function::Sign(inverseMatrix[axis][i]);
+      extents[i] = geometry3D->GetExtent(axis);
+      spacings[i] = geometry3D->GetSpacing()[axis];
     }
 
     // matrix(column) = inverseTransformMatrix(row) * flippedAxes * spacing
     matrix[0][0] = inverseMatrix[axes[0]][0] * directions[0] * spacings[0];
     matrix[1][0] = inverseMatrix[axes[0]][1] * directions[0] * spacings[0];
     matrix[2][0] = inverseMatrix[axes[0]][2] * directions[0] * spacings[0];
     matrix[0][1] = inverseMatrix[axes[1]][0] * directions[1] * spacings[1];
     matrix[1][1] = inverseMatrix[axes[1]][1] * directions[1] * spacings[1];
     matrix[2][1] = inverseMatrix[axes[1]][2] * directions[1] * spacings[1];
     matrix[0][2] = inverseMatrix[axes[2]][0] * directions[2] * spacings[2];
     matrix[1][2] = inverseMatrix[axes[2]][1] * directions[2] * spacings[2];
     matrix[2][2] = inverseMatrix[axes[2]][2] * directions[2] * spacings[2];
 
     /// The "world origin" is the corner with the lowest physical coordinates.
     /// We use it as a reference point so that we get the correct anatomical
     /// orientations.
     Point3D worldOrigin = geometry3D->GetOrigin();
     for (int i = 0; i < 3; ++i)
     {
       /// The distance of the plane origin from the world origin in voxels.
       double offset = directions[i] > 0 ? 0.0 : extents[i];
 
       if (geometry3D->GetImageGeometry())
       {
         offset += directions[i] * 0.5;
       }
 
       for (int j = 0; j < 3; ++j)
       {
         worldOrigin[j] -= offset * matrix[j][i];
       }
     }
 
     switch(planeorientation)
     {
     case AnatomicalPlane::Original:
     /** Orientation 'Original' shall be done like the axial plane orientation,
      *  for whatever reasons. */
     case AnatomicalPlane::Axial:
       width  = extents[0];
       height = extents[1];
       break;
     case AnatomicalPlane::Coronal:
       width  = extents[0];
       height = extents[2];
       break;
     case AnatomicalPlane::Sagittal:
       width  = extents[1];
       height = extents[2];
       break;
     default:
       itkExceptionMacro("unknown AnatomicalPlane");
     }
 
     ScalarType bounds[6]= { 0, width, 0, height, 0, 1 };
     this->SetBounds( bounds );
 
     AffineTransform3D::Pointer transform = AffineTransform3D::New();
     transform->SetMatrix(matrix);
     transform->SetOffset(worldOrigin.GetVectorFromOrigin());
 
     InitializeStandardPlane(
       width, height, transform, planeorientation, zPosition, frontside, rotated, top);
   }
 
   void PlaneGeometry::InitializeStandardPlane(const BaseGeometry *geometry3D,
                                               bool top,
                                               AnatomicalPlane planeorientation,
                                               bool frontside,
                                               bool rotated)
   {
     /// The index of the sagittal, coronal and axial axes in world coordinate system.
     int worldAxis;
     switch(planeorientation)
     {
     case AnatomicalPlane::Original:
     /** Orientation 'Original' shall be done like the axial plane orientation,
      *  for whatever reasons. */
     case AnatomicalPlane::Axial:
       worldAxis = 2;
       break;
     case AnatomicalPlane::Coronal:
       worldAxis = 1;
       break;
     case AnatomicalPlane::Sagittal:
       worldAxis = 0;
       break;
     default:
       itkExceptionMacro("unknown AnatomicalPlane");
     }
 
-    // Inspired by:
-    // http://www.na-mic.org/Wiki/index.php/Coordinate_System_Conversion_Between_ITK_and_Slicer3
-
-    mitk::AffineTransform3D::ConstPointer affineTransform = geometry3D->GetIndexToWorldTransform();
-    mitk::AffineTransform3D::MatrixType matrix = affineTransform->GetMatrix();
-    matrix.GetVnlMatrix().normalize_columns();
-    mitk::AffineTransform3D::MatrixType::InternalMatrixType inverseMatrix = matrix.GetInverse();
-
-    /// The index of the sagittal, coronal and axial axes in the reference geometry.
-    int dominantAxis = CalculateDominantAxes(inverseMatrix).at(worldAxis);
+    int axes[3];
+    geometry3D->MapAxesToOrientations(axes);
+    int axis = axes[worldAxis];
 
-    ScalarType zPosition = top ? 0.5 : geometry3D->GetExtent(dominantAxis) - 0.5;
+    ScalarType zPosition = top ? 0.5 : geometry3D->GetExtent(axis) - 0.5;
 
     InitializeStandardPlane(geometry3D, planeorientation, zPosition, frontside, rotated, top);
   }
 
   void PlaneGeometry::InitializeStandardPlane(const Vector3D &rightVector,
                                               const Vector3D &downVector,
                                               const Vector3D *spacing)
   {
     InitializeStandardPlane(rightVector.GetVnlVector(), downVector.GetVnlVector(), spacing);
   }
 
   void PlaneGeometry::InitializeStandardPlane(const VnlVector &rightVector,
                                               const VnlVector &downVector,
                                               const Vector3D *spacing)
   {
     ScalarType width = rightVector.two_norm();
     ScalarType height = downVector.two_norm();
 
     InitializeStandardPlane(width, height, rightVector, downVector, spacing);
   }
 
   void PlaneGeometry::InitializeStandardPlane(mitk::ScalarType width,
                                               ScalarType height,
                                               const Vector3D &rightVector,
                                               const Vector3D &downVector,
                                               const Vector3D *spacing)
   {
     InitializeStandardPlane(width, height, rightVector.GetVnlVector(), downVector.GetVnlVector(), spacing);
   }
 
   void PlaneGeometry::InitializeStandardPlane(mitk::ScalarType width,
                                               ScalarType height,
                                               const VnlVector &rightVector,
                                               const VnlVector &downVector,
                                               const Vector3D *spacing)
   {
     assert(width > 0);
     assert(height > 0);
 
     VnlVector rightDV = rightVector;
     rightDV.normalize();
     VnlVector downDV = downVector;
     downDV.normalize();
     VnlVector normal = vnl_cross_3d(rightVector, downVector);
     normal.normalize();
     // Crossproduct vnl_cross_3d is always righthanded, but that is okay here
     // because in this method we create a new IndexToWorldTransform and
     // spacing with 1 or 3 negative components could still make it lefthanded.
 
     if (spacing != nullptr)
     {
       rightDV *= (*spacing)[0];
       downDV *= (*spacing)[1];
       normal *= (*spacing)[2];
     }
 
     AffineTransform3D::Pointer transform = AffineTransform3D::New();
     Matrix3D matrix;
     matrix.GetVnlMatrix().set_column(0, rightDV);
     matrix.GetVnlMatrix().set_column(1, downDV);
     matrix.GetVnlMatrix().set_column(2, normal);
     transform->SetMatrix(matrix);
     transform->SetOffset(this->GetIndexToWorldTransform()->GetOffset());
 
     ScalarType bounds[6] = {0, width, 0, height, 0, 1};
     this->SetBounds(bounds);
 
     this->SetIndexToWorldTransform(transform);
   }
 
   void PlaneGeometry::InitializePlane(const Point3D &origin, const Vector3D &normal)
   {
     VnlVector rightVectorVnl(3), downVectorVnl;
 
     if (Equal(normal[1], 0.0f) == false)
     {
       FillVector3D(rightVectorVnl, 1.0f, -normal[0] / normal[1], 0.0f);
       rightVectorVnl.normalize();
     }
     else
     {
       FillVector3D(rightVectorVnl, 0.0f, 1.0f, 0.0f);
     }
     downVectorVnl = vnl_cross_3d(normal.GetVnlVector(), rightVectorVnl);
     downVectorVnl.normalize();
     // Crossproduct vnl_cross_3d is always righthanded.
 
     InitializeStandardPlane(rightVectorVnl, downVectorVnl);
 
     SetOrigin(origin);
   }
 
   void PlaneGeometry::SetMatrixByVectors(const VnlVector &rightVector,
                                          const VnlVector &downVector,
                                          ScalarType thickness /* = 1.0 */)
   {
     VnlVector normal = vnl_cross_3d(rightVector, downVector);
     normal.normalize();
     normal *= thickness;
     // Crossproduct vnl_cross_3d is always righthanded, but that is okay here
     // because in this method we create a new IndexToWorldTransform and
     // a negative thickness could still make it lefthanded.
 
     AffineTransform3D::Pointer transform = AffineTransform3D::New();
     Matrix3D matrix;
     matrix.GetVnlMatrix().set_column(0, rightVector);
     matrix.GetVnlMatrix().set_column(1, downVector);
     matrix.GetVnlMatrix().set_column(2, normal);
     transform->SetMatrix(matrix);
     transform->SetOffset(this->GetIndexToWorldTransform()->GetOffset());
     SetIndexToWorldTransform(transform);
   }
 
   Vector3D PlaneGeometry::GetNormal() const
   {
     Vector3D frontToBack;
     frontToBack.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(2).as_ref());
 
     return frontToBack;
   }
 
   VnlVector PlaneGeometry::GetNormalVnl() const
   {
     return this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(2).as_ref();
   }
 
   ScalarType PlaneGeometry::DistanceFromPlane(const Point3D &pt3d_mm) const { return fabs(SignedDistance(pt3d_mm)); }
   ScalarType PlaneGeometry::SignedDistance(const Point3D &pt3d_mm) const { return SignedDistanceFromPlane(pt3d_mm); }
   bool PlaneGeometry::IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox) const
   {
     if (considerBoundingBox)
     {
       Point3D pt3d_units;
       BaseGeometry::WorldToIndex(pt3d_mm, pt3d_units);
       return (pt3d_units[2] > this->GetBoundingBox()->GetBounds()[4]);
     }
     else
       return SignedDistanceFromPlane(pt3d_mm) > 0;
   }
 
   bool PlaneGeometry::IntersectionLine(const PlaneGeometry* plane, Line3D& crossline) const
   {
     Vector3D normal = this->GetNormal();
     normal.Normalize();
 
     Vector3D planeNormal = plane->GetNormal();
     planeNormal.Normalize();
 
     Vector3D direction = itk::CrossProduct(normal, planeNormal);
 
     if (direction.GetSquaredNorm() < eps)
       return false;
 
     crossline.SetDirection(direction);
 
     double N1dN2 = normal * planeNormal;
     double determinant = 1.0 - N1dN2 * N1dN2;
 
     Vector3D origin = this->GetOrigin().GetVectorFromOrigin();
     Vector3D planeOrigin = plane->GetOrigin().GetVectorFromOrigin();
 
     double d1 = normal * origin;
     double d2 = planeNormal * planeOrigin;
 
     double c1 = (d1 - d2 * N1dN2) / determinant;
     double c2 = (d2 - d1 * N1dN2) / determinant;
 
     Vector3D p = normal * c1 + planeNormal * c2;
     crossline.GetPoint()[0] = p.GetVnlVector()[0];
     crossline.GetPoint()[1] = p.GetVnlVector()[1];
     crossline.GetPoint()[2] = p.GetVnlVector()[2];
 
     return true;
   }
 
   unsigned int PlaneGeometry::IntersectWithPlane2D(const PlaneGeometry *plane, Point2D &lineFrom, Point2D &lineTo) const
   {
     Line3D crossline;
     if (this->IntersectionLine(plane, crossline) == false)
       return 0;
 
     Point2D point2;
     Vector2D direction2;
 
     this->Map(crossline.GetPoint(), point2);
     this->Map(crossline.GetPoint(), crossline.GetDirection(), direction2);
 
     return Line3D::RectangleLineIntersection(
       0, 0, GetExtentInMM(0), GetExtentInMM(1), point2, direction2, lineFrom, lineTo);
   }
 
   double PlaneGeometry::Angle(const PlaneGeometry *plane) const
   {
     return angle(plane->GetMatrixColumn(2), GetMatrixColumn(2));
   }
 
   double PlaneGeometry::Angle(const Line3D &line) const
   {
     return vnl_math::pi_over_2 - angle(line.GetDirection().GetVnlVector(), GetMatrixColumn(2));
   }
 
   bool PlaneGeometry::IntersectionPoint(const Line3D &line, Point3D &intersectionPoint) const
   {
     Vector3D planeNormal = this->GetNormal();
     planeNormal.Normalize();
 
     Vector3D lineDirection = line.GetDirection();
     lineDirection.Normalize();
 
     double t = planeNormal * lineDirection;
     if (fabs(t) < eps)
     {
       return false;
     }
 
     Vector3D diff;
     diff = this->GetOrigin() - line.GetPoint();
     t = (planeNormal * diff) / t;
 
     intersectionPoint = line.GetPoint() + lineDirection * t;
     return true;
   }
 
   bool PlaneGeometry::IntersectionPointParam(const Line3D &line, double &t) const
   {
     Vector3D planeNormal = this->GetNormal();
 
     Vector3D lineDirection = line.GetDirection();
 
     t = planeNormal * lineDirection;
 
     if (fabs(t) < eps)
     {
       return false;
     }
 
     Vector3D diff;
     diff = this->GetOrigin() - line.GetPoint();
     t = (planeNormal * diff) / t;
     return true;
   }
 
   bool PlaneGeometry::IsParallel(const PlaneGeometry *plane) const
   {
     return ((Angle(plane) < 10.0 * mitk::sqrteps) || (Angle(plane) > (vnl_math::pi - 10.0 * sqrteps)));
   }
 
   bool PlaneGeometry::IsOnPlane(const Point3D &point) const { return Distance(point) < eps; }
   bool PlaneGeometry::IsOnPlane(const Line3D &line) const
   {
     return ((Distance(line.GetPoint()) < eps) && (Distance(line.GetPoint2()) < eps));
   }
 
   bool PlaneGeometry::IsOnPlane(const PlaneGeometry *plane) const
   {
     return (IsParallel(plane) && (Distance(plane->GetOrigin()) < eps));
   }
 
   Point3D PlaneGeometry::ProjectPointOntoPlane(const Point3D &pt) const
   {
     ScalarType len = this->GetNormalVnl().two_norm();
     return pt - this->GetNormal() * this->SignedDistanceFromPlane(pt) / len;
   }
 
   itk::LightObject::Pointer PlaneGeometry::InternalClone() const
   {
     Self::Pointer newGeometry = new PlaneGeometry(*this);
     newGeometry->UnRegister();
     return newGeometry.GetPointer();
   }
 
   void PlaneGeometry::ExecuteOperation(Operation *operation)
   {
     vtkTransform *transform = vtkTransform::New();
     transform->SetMatrix(this->GetVtkMatrix());
 
     switch (operation->GetOperationType())
     {
       case OpORIENT:
       {
         auto *planeOp = dynamic_cast<mitk::PlaneOperation *>(operation);
         if (planeOp == nullptr)
         {
           return;
         }
 
         Point3D center = planeOp->GetPoint();
 
         Vector3D orientationVector = planeOp->GetNormal();
         Vector3D defaultVector;
         FillVector3D(defaultVector, 0.0, 0.0, 1.0);
 
         Vector3D rotationAxis = itk::CrossProduct(orientationVector, defaultVector);
         // double rotationAngle = acos( orientationVector[2] / orientationVector.GetNorm() );
 
         double rotationAngle = atan2((double)rotationAxis.GetNorm(), (double)(orientationVector * defaultVector));
         rotationAngle *= 180.0 / vnl_math::pi;
 
         transform->PostMultiply();
         transform->Identity();
         transform->Translate(center[0], center[1], center[2]);
         transform->RotateWXYZ(rotationAngle, rotationAxis[0], rotationAxis[1], rotationAxis[2]);
         transform->Translate(-center[0], -center[1], -center[2]);
         break;
       }
       case OpRESTOREPLANEPOSITION:
       {
         auto *op = dynamic_cast<mitk::RestorePlanePositionOperation *>(operation);
         if (op == nullptr)
         {
           return;
         }
 
         AffineTransform3D::Pointer transform2 = AffineTransform3D::New();
         Matrix3D matrix;
         matrix.GetVnlMatrix().set_column(0, op->GetTransform()->GetMatrix().GetVnlMatrix().get_column(0));
         matrix.GetVnlMatrix().set_column(1, op->GetTransform()->GetMatrix().GetVnlMatrix().get_column(1));
         matrix.GetVnlMatrix().set_column(2, op->GetTransform()->GetMatrix().GetVnlMatrix().get_column(2));
         transform2->SetMatrix(matrix);
         Vector3D offset = op->GetTransform()->GetOffset();
         transform2->SetOffset(offset);
 
         this->SetIndexToWorldTransform(transform2);
         ScalarType bounds[6] = {0, op->GetWidth(), 0, op->GetHeight(), 0, 1};
         this->SetBounds(bounds);
         this->Modified();
         transform->Delete();
         return;
       }
       default:
         Superclass::ExecuteOperation(operation);
         transform->Delete();
         return;
     }
 
     this->SetVtkMatrixDeepCopy(transform);
     this->Modified();
     transform->Delete();
   }
 
   void PlaneGeometry::PrintSelf(std::ostream &os, itk::Indent indent) const
   {
     Superclass::PrintSelf(os, indent);
     os << indent << " ScaleFactorMMPerUnitX: " << GetExtentInMM(0) / GetExtent(0) << std::endl;
     os << indent << " ScaleFactorMMPerUnitY: " << GetExtentInMM(1) / GetExtent(1) << std::endl;
     os << indent << " Normal: " << GetNormal() << std::endl;
   }
 
   bool PlaneGeometry::Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const
   {
     assert(this->IsBoundingBoxNull() == false);
 
     Point3D pt3d_units;
     Superclass::WorldToIndex(pt3d_mm, pt3d_units);
     pt2d_mm[0] = pt3d_units[0] * GetExtentInMM(0) / GetExtent(0);
     pt2d_mm[1] = pt3d_units[1] * GetExtentInMM(1) / GetExtent(1);
     pt3d_units[2] = 0;
     return this->GetBoundingBox()->IsInside(pt3d_units);
   }
 
   void PlaneGeometry::Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const
   {
     // pt2d_mm is measured from the origin of the world geometry (at least it called form BaseRendere::Mouse...Event)
     Point3D pt3d_units;
     pt3d_units[0] = pt2d_mm[0] / (GetExtentInMM(0) / GetExtent(0));
     pt3d_units[1] = pt2d_mm[1] / (GetExtentInMM(1) / GetExtent(1));
     pt3d_units[2] = 0;
     // pt3d_units is a continuous index. We divided it with the Scale Factor (= spacing in x and y) to convert it from mm
     // to index units.
     //
     pt3d_mm = GetIndexToWorldTransform()->TransformPoint(pt3d_units);
     // now we convert the 3d index to a 3D world point in mm. We could have used IndexToWorld as well as
     // GetITW->Transform...
   }
 
   void PlaneGeometry::SetSizeInUnits(mitk::ScalarType width, mitk::ScalarType height)
   {
     ScalarType bounds[6] = {0, width, 0, height, 0, 1};
     ScalarType extent, newextentInMM;
     if (GetExtent(0) > 0)
     {
       extent = GetExtent(0);
       if (width > extent)
         newextentInMM = GetExtentInMM(0) / width * extent;
       else
         newextentInMM = GetExtentInMM(0) * extent / width;
       SetExtentInMM(0, newextentInMM);
     }
     if (GetExtent(1) > 0)
     {
       extent = GetExtent(1);
       if (width > extent)
         newextentInMM = GetExtentInMM(1) / height * extent;
       else
         newextentInMM = GetExtentInMM(1) * extent / height;
       SetExtentInMM(1, newextentInMM);
     }
     SetBounds(bounds);
   }
 
   bool PlaneGeometry::Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const
   {
     assert(this->IsBoundingBoxNull() == false);
 
     Point3D pt3d_units;
     Superclass::WorldToIndex(pt3d_mm, pt3d_units);
     pt3d_units[2] = 0;
     projectedPt3d_mm = GetIndexToWorldTransform()->TransformPoint(pt3d_units);
     return this->GetBoundingBox()->IsInside(pt3d_units);
   }
 
   bool PlaneGeometry::Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const
   {
     assert(this->IsBoundingBoxNull() == false);
 
     Vector3D vec3d_units;
     Superclass::WorldToIndex(vec3d_mm, vec3d_units);
     vec3d_units[2] = 0;
     projectedVec3d_mm = GetIndexToWorldTransform()->TransformVector(vec3d_units);
     return true;
   }
 
   bool PlaneGeometry::Project(const mitk::Point3D &atPt3d_mm,
                               const mitk::Vector3D &vec3d_mm,
                               mitk::Vector3D &projectedVec3d_mm) const
   {
     MITK_WARN << "Deprecated function! Call Project(vec3D,vec3D) instead.";
     assert(this->IsBoundingBoxNull() == false);
 
     Vector3D vec3d_units;
     Superclass::WorldToIndex(atPt3d_mm, vec3d_mm, vec3d_units);
     vec3d_units[2] = 0;
     projectedVec3d_mm = GetIndexToWorldTransform()->TransformVector(vec3d_units);
 
     Point3D pt3d_units;
     Superclass::WorldToIndex(atPt3d_mm, pt3d_units);
     return this->GetBoundingBox()->IsInside(pt3d_units);
   }
 
   bool PlaneGeometry::Map(const mitk::Point3D &atPt3d_mm,
                           const mitk::Vector3D &vec3d_mm,
                           mitk::Vector2D &vec2d_mm) const
   {
     Point2D pt2d_mm_start, pt2d_mm_end;
     Point3D pt3d_mm_end;
     bool inside = Map(atPt3d_mm, pt2d_mm_start);
     pt3d_mm_end = atPt3d_mm + vec3d_mm;
     inside &= Map(pt3d_mm_end, pt2d_mm_end);
     vec2d_mm = pt2d_mm_end - pt2d_mm_start;
     return inside;
   }
 
   void PlaneGeometry::Map(const mitk::Point2D & /*atPt2d_mm*/,
                           const mitk::Vector2D & /*vec2d_mm*/,
                           mitk::Vector3D & /*vec3d_mm*/) const
   {
     //@todo implement parallel to the other Map method!
     assert(false);
   }
 
   void PlaneGeometry::SetReferenceGeometry(const mitk::BaseGeometry *geometry) { m_ReferenceGeometry = geometry; }
   const mitk::BaseGeometry *PlaneGeometry::GetReferenceGeometry() const { return m_ReferenceGeometry; }
   bool PlaneGeometry::HasReferenceGeometry() const { return (m_ReferenceGeometry != nullptr); }
 } // namespace
diff --git a/Modules/Core/src/DataManagement/mitkSlicedGeometry3D.cpp b/Modules/Core/src/DataManagement/mitkSlicedGeometry3D.cpp
index 6e23ef32d9..d03779a6a1 100644
--- a/Modules/Core/src/DataManagement/mitkSlicedGeometry3D.cpp
+++ b/Modules/Core/src/DataManagement/mitkSlicedGeometry3D.cpp
@@ -1,962 +1,960 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 <itkSpatialOrientationAdapter.h>
 
 #include "mitkSlicedGeometry3D.h"
 #include "mitkAbstractTransformGeometry.h"
 #include "mitkApplyTransformMatrixOperation.h"
 #include "mitkInteractionConst.h"
 #include "mitkPlaneGeometry.h"
 #include "mitkPlaneOperation.h"
 #include "mitkRestorePlanePositionOperation.h"
 #include "mitkRotationOperation.h"
 #include "mitkSliceNavigationController.h"
 
 const mitk::ScalarType PI = 3.14159265359;
 
 mitk::SlicedGeometry3D::SlicedGeometry3D()
   : m_EvenlySpaced(true), m_Slices(0), m_ReferenceGeometry(nullptr), m_SliceNavigationController(nullptr)
 {
   m_DirectionVector.Fill(0);
   this->InitializeSlicedGeometry(m_Slices);
 }
 
 mitk::SlicedGeometry3D::SlicedGeometry3D(const SlicedGeometry3D &other)
   : Superclass(other),
     m_EvenlySpaced(other.m_EvenlySpaced),
     m_Slices(other.m_Slices),
     m_ReferenceGeometry(other.m_ReferenceGeometry),
     m_SliceNavigationController(other.m_SliceNavigationController)
 {
   m_DirectionVector.Fill(0);
   SetSpacing(other.GetSpacing());
   SetDirectionVector(other.GetDirectionVector());
 
   if (m_EvenlySpaced)
   {
     assert(!other.m_PlaneGeometries.empty() && "This may happen when you use one of the old Initialize methods, which had a bool parameter that is implicitly casted to the number of slices now.");
     PlaneGeometry::Pointer geometry = other.m_PlaneGeometries[0]->Clone();
     assert(geometry.IsNotNull());
     SetPlaneGeometry(geometry, 0);
   }
   else
   {
     unsigned int s;
     for (s = 0; s < other.m_Slices; ++s)
     {
       if (other.m_PlaneGeometries[s].IsNull())
       {
         assert(other.m_EvenlySpaced);
         m_PlaneGeometries[s] = nullptr;
       }
       else
       {
         PlaneGeometry *geometry2D = other.m_PlaneGeometries[s]->Clone();
         assert(geometry2D != nullptr);
         SetPlaneGeometry(geometry2D, s);
       }
     }
   }
 }
 
 mitk::SlicedGeometry3D::~SlicedGeometry3D()
 {
 }
 
 mitk::PlaneGeometry *mitk::SlicedGeometry3D::GetPlaneGeometry(int s) const
 {
   mitk::PlaneGeometry::Pointer geometry2D = nullptr;
 
   if (this->IsValidSlice(s))
   {
     geometry2D = m_PlaneGeometries[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[2]*s
     // in the direction of m_DirectionVector.
     if ((m_EvenlySpaced) && (geometry2D.IsNull()))
     {
       PlaneGeometry *firstSlice = m_PlaneGeometries[0];
 
       if (firstSlice != nullptr &&
           dynamic_cast<AbstractTransformGeometry *>(m_PlaneGeometries[0].GetPointer()) == nullptr)
       {
         if ((m_DirectionVector[0] == 0.0) && (m_DirectionVector[1] == 0.0) && (m_DirectionVector[2] == 0.0))
         {
           m_DirectionVector = firstSlice->GetNormal();
           m_DirectionVector.Normalize();
         }
 
         Vector3D direction;
         direction = m_DirectionVector * this->GetSpacing()[2];
 
         mitk::PlaneGeometry::Pointer requestedslice;
         requestedslice = static_cast<mitk::PlaneGeometry *>(firstSlice->Clone().GetPointer());
 
         requestedslice->SetOrigin(requestedslice->GetOrigin() + direction * s);
 
         geometry2D = requestedslice;
         m_PlaneGeometries[s] = geometry2D;
       }
     }
     return geometry2D;
   }
   else
   {
     return nullptr;
   }
 }
 
 const mitk::BoundingBox *mitk::SlicedGeometry3D::GetBoundingBox() const
 {
   assert(this->IsBoundingBoxNull() == false);
   return Superclass::GetBoundingBox();
 }
 
 bool mitk::SlicedGeometry3D::SetPlaneGeometry(mitk::PlaneGeometry *geometry2D, int s)
 {
   if (this->IsValidSlice(s))
   {
     m_PlaneGeometries[s] = geometry2D;
     m_PlaneGeometries[s]->SetReferenceGeometry(m_ReferenceGeometry);
     return true;
   }
   return false;
 }
 
 void mitk::SlicedGeometry3D::InitializeSlicedGeometry(unsigned int slices)
 {
   Superclass::Initialize();
   m_Slices = slices;
 
   PlaneGeometry::Pointer gnull = nullptr;
   m_PlaneGeometries.assign(m_Slices, gnull);
 
   Vector3D spacing;
   spacing.Fill(1.0);
   this->SetSpacing(spacing);
 
   m_DirectionVector.Fill(0);
 }
 
 void mitk::SlicedGeometry3D::InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D, unsigned int slices)
 {
   assert(geometry2D != nullptr);
   this->InitializeEvenlySpaced(geometry2D, geometry2D->GetExtentInMM(2) / geometry2D->GetExtent(2), slices);
 }
 
 void mitk::SlicedGeometry3D::InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D,
                                                     mitk::ScalarType zSpacing,
                                                     unsigned int slices)
 {
   assert(geometry2D != nullptr);
   assert(geometry2D->GetExtent(0) > 0);
   assert(geometry2D->GetExtent(1) > 0);
 
   geometry2D->Register();
 
   Superclass::Initialize();
   m_Slices = slices;
 
   BoundingBox::BoundsArrayType bounds = geometry2D->GetBounds();
   bounds[4] = 0;
   bounds[5] = slices;
 
   // clear and reserve
   PlaneGeometry::Pointer gnull = nullptr;
   m_PlaneGeometries.assign(m_Slices, gnull);
 
   Vector3D directionVector = geometry2D->GetAxisVector(2);
   directionVector.Normalize();
   directionVector *= zSpacing;
 
   // Normally we should use the following four lines to create a copy of
   // the transform contained in geometry2D, because it may not be changed
   // by us. But we know that SetSpacing creates a new transform without
   // changing the old (coming from geometry2D), so we can use the fifth
   // line instead. We check this at (**).
   //
   // AffineTransform3D::Pointer transform = AffineTransform3D::New();
   // transform->SetMatrix(geometry2D->GetIndexToWorldTransform()->GetMatrix());
   // transform->SetOffset(geometry2D->GetIndexToWorldTransform()->GetOffset());
   // SetIndexToWorldTransform(transform);
 
   this->SetIndexToWorldTransform(geometry2D->GetIndexToWorldTransform());
 
   mitk::Vector3D spacing;
   FillVector3D(spacing, geometry2D->GetExtentInMM(0) / bounds[1], geometry2D->GetExtentInMM(1) / bounds[3], zSpacing);
 
   this->SetDirectionVector(directionVector);
   this->SetBounds(bounds);
   this->SetPlaneGeometry(geometry2D, 0);
   this->SetSpacing(spacing, true);
   this->SetEvenlySpaced();
 
   // this->SetTimeBounds( geometry2D->GetTimeBounds() );
 
   assert(this->GetIndexToWorldTransform() != geometry2D->GetIndexToWorldTransform()); // (**) see above.
 
   this->SetFrameOfReferenceID(geometry2D->GetFrameOfReferenceID());
   this->SetImageGeometry(geometry2D->GetImageGeometry());
 
   geometry2D->UnRegister();
 }
 
 void mitk::SlicedGeometry3D::InitializePlanes(const mitk::BaseGeometry *geometry3D,
                                               mitk::AnatomicalPlane orientation,
                                               bool top,
                                               bool frontside,
                                               bool rotated)
 {
   m_ReferenceGeometry = geometry3D;
 
   PlaneGeometry::Pointer planeGeometry = mitk::PlaneGeometry::New();
   planeGeometry->InitializeStandardPlane(geometry3D, top, orientation, frontside, rotated);
 
   int worldAxis = 
     orientation == AnatomicalPlane::Sagittal ? 0 :
     orientation == AnatomicalPlane::Coronal  ? 1 : 2;
 
-  // Inspired by:
-  // http://www.na-mic.org/Wiki/index.php/Coordinate_System_Conversion_Between_ITK_and_Slicer3
+  int axes[3];
+  geometry3D->MapAxesToOrientations(axes);
+  int axis = axes[worldAxis];
 
-  mitk::AffineTransform3D::MatrixType matrix = geometry3D->GetIndexToWorldTransform()->GetMatrix();
-  matrix.GetVnlMatrix().normalize_columns();
-  mitk::AffineTransform3D::MatrixType::InternalMatrixType inverseMatrix = matrix.GetTranspose();
-
-  int dominantAxis = planeGeometry->CalculateDominantAxes(inverseMatrix).at(worldAxis);
-  ScalarType viewSpacing = geometry3D->GetSpacing()[dominantAxis];
-
-  /// Although the double value returned by GetExtent() holds a round number,
-  /// you need to add 0.5 to safely convert it to unsigned it. I have seen a
-  /// case when the result was less by one without this.
-  auto slices = static_cast<unsigned int>(geometry3D->GetExtent(dominantAxis) + 0.5);
-  if ( slices == 0 && geometry3D->GetExtent(dominantAxis) > 0) {
-      // require at least one slice if there is _some_ extent
-      slices = 1;
+  ScalarType viewSpacing = geometry3D->GetSpacing()[axis];
+  unsigned int slices = static_cast<unsigned int>(geometry3D->GetExtent(axis) + 0.5);
+
+  if (slices == 0 && geometry3D->GetExtent(axis) > 0)
+  {
+    // require at least one slice if there is _some_ extent
+    slices = 1;
   }
 
 #ifndef NDEBUG
-  int upDirection = itk::Function::Sign(inverseMatrix[dominantAxis][worldAxis]);
+  auto matrix = geometry3D->GetIndexToWorldTransform()->GetMatrix();
+  matrix.GetVnlMatrix().normalize_columns();
+  auto inverseMatrix = matrix.GetInverse();
+
+  int upDirection = itk::Function::Sign(inverseMatrix[axis][worldAxis]);
 
   /// The normal vector of an imaginary plane that points from the world origin (bottom left back
   /// corner or the world, with the lowest physical coordinates) towards the inside of the volume,
   /// along the renderer axis. Length is the slice thickness.
-  Vector3D worldPlaneNormal = inverseMatrix.get_row(dominantAxis) * (upDirection * viewSpacing);
+  Vector3D worldPlaneNormal = inverseMatrix.get_row(axis) * (upDirection * viewSpacing);
 
   /// The normal of the standard plane geometry just created.
   Vector3D standardPlaneNormal = planeGeometry->GetNormal();
 
   /// The standard plane must be parallel to the 'world plane'. The normal of the standard plane
   /// must point against the world plane if and only if 'top' is 'false'. The length of the
   /// standard plane normal must be equal to the slice thickness.
   assert((standardPlaneNormal - (top ? 1.0 : -1.0) * worldPlaneNormal).GetSquaredNorm() < 0.000001);
 #endif
 
   this->InitializeEvenlySpaced(planeGeometry, viewSpacing, slices);
 
 #ifndef NDEBUG
   /// The standard plane normal and the z axis vector of the sliced geometry must point in
   /// the same direction.
   Vector3D zAxisVector = this->GetAxisVector(2);
   Vector3D upscaledStandardPlaneNormal = standardPlaneNormal;
   upscaledStandardPlaneNormal *= slices;
   assert((zAxisVector - upscaledStandardPlaneNormal).GetSquaredNorm() < 0.000001);
 
   /// You can use this test is to check the handedness of the coordinate system of the current
   /// geometry. In principle, you can use either left- or right-handed coordinate systems, but
   /// you normally want it to be consistent, that is the handedness should be the same across
   /// the renderers of the same viewer.
 //  ScalarType det = vnl_det(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix());
 //  MITK_DEBUG << "world axis: " << worldAxis << (det > 0 ? " ; right-handed" : " ; left-handed");
 #endif
 }
 
 void mitk::SlicedGeometry3D::ReinitializePlanes(const Point3D &center, const Point3D &referencePoint)
 {
   // Need a reference frame to align the rotated planes
   if (!m_ReferenceGeometry)
   {
     return;
   }
 
   // Get first plane of plane stack
   PlaneGeometry *firstPlane = m_PlaneGeometries[0];
 
   // If plane stack is empty, exit
   if (!firstPlane || dynamic_cast<AbstractTransformGeometry *>(firstPlane))
   {
     return;
   }
 
   // Calculate the "directed" spacing when taking the plane (defined by its axes
   // vectors and normal) as the reference coordinate frame.
   //
   // This is done by calculating the radius of the ellipsoid defined by the
   // original volume spacing axes, in the direction of the respective axis of the
   // reference frame.
   mitk::Vector3D axis0 = firstPlane->GetAxisVector(0);
   mitk::Vector3D axis1 = firstPlane->GetAxisVector(1);
   mitk::Vector3D normal = firstPlane->GetNormal();
   normal.Normalize();
 
   Vector3D spacing;
   spacing[0] = this->CalculateSpacing(axis0);
   spacing[1] = this->CalculateSpacing(axis1);
   spacing[2] = this->CalculateSpacing(normal);
 
   Superclass::SetSpacing(spacing);
 
   // Now we need to calculate the number of slices in the plane's normal
   // direction, so that the entire volume is covered. This is done by first
   // calculating the dot product between the volume diagonal (the maximum
   // distance inside the volume) and the normal, and dividing this value by
   // the directed spacing calculated above.
   ScalarType directedExtent = std::abs(m_ReferenceGeometry->GetExtentInMM(0) * normal[0]) +
                               std::abs(m_ReferenceGeometry->GetExtentInMM(1) * normal[1]) +
                               std::abs(m_ReferenceGeometry->GetExtentInMM(2) * normal[2]);
 
   if (directedExtent >= spacing[2])
   {
     m_Slices = static_cast<unsigned int>(directedExtent / spacing[2] + 0.5);
   }
   else
   {
     m_Slices = 1;
   }
 
   // The origin of our "first plane" needs to be adapted to this new extent.
   // To achieve this, we first calculate the current distance to the volume's
   // center, and then shift the origin in the direction of the normal by the
   // difference between this distance and half of the new extent.
   double centerOfRotationDistance = firstPlane->SignedDistanceFromPlane(center);
 
   if (centerOfRotationDistance > 0)
   {
     firstPlane->SetOrigin(firstPlane->GetOrigin() + normal * (centerOfRotationDistance - directedExtent / 2.0));
     m_DirectionVector = normal;
   }
   else
   {
     firstPlane->SetOrigin(firstPlane->GetOrigin() + normal * (directedExtent / 2.0 + centerOfRotationDistance));
     m_DirectionVector = -normal;
   }
 
   // Now we adjust this distance according with respect to the given reference
   // point: we need to make sure that the point is touched by one slice of the
   // new slice stack.
   double referencePointDistance = firstPlane->SignedDistanceFromPlane(referencePoint);
 
   auto referencePointSlice = static_cast<int>(referencePointDistance / spacing[2]);
 
   double alignmentValue = referencePointDistance / spacing[2] - referencePointSlice;
 
   firstPlane->SetOrigin(firstPlane->GetOrigin() + normal * alignmentValue * spacing[2]);
 
   // Finally, we can clear the previous geometry stack and initialize it with
   // our re-initialized "first plane".
   m_PlaneGeometries.assign(m_Slices, PlaneGeometry::Pointer(nullptr));
 
   if (m_Slices > 0)
   {
     m_PlaneGeometries[0] = firstPlane;
   }
 
   // Reinitialize SNC with new number of slices
   m_SliceNavigationController->GetStepper()->SetSteps(m_Slices);
 
   this->Modified();
 }
 
 double mitk::SlicedGeometry3D::CalculateSpacing(const mitk::Vector3D &d) const
 {
   // Need the spacing of the underlying dataset / geometry
   if (!m_ReferenceGeometry)
   {
     return 1.0;
   }
 
   const mitk::Vector3D &spacing = m_ReferenceGeometry->GetSpacing();
   return SlicedGeometry3D::CalculateSpacing(spacing, d);
 }
 
 double mitk::SlicedGeometry3D::CalculateSpacing(const mitk::Vector3D &spacing, const mitk::Vector3D &d)
 {
   // The following can be derived from the ellipsoid equation
   //
   //   1 = x^2/a^2 + y^2/b^2 + z^2/c^2
   //
   // where (a,b,c) = spacing of original volume (ellipsoid radii)
   // and   (x,y,z) = scaled coordinates of vector d (according to ellipsoid)
   //
   double scaling = d[0] * d[0] / (spacing[0] * spacing[0]) + d[1] * d[1] / (spacing[1] * spacing[1]) +
                    d[2] * d[2] / (spacing[2] * spacing[2]);
 
   scaling = sqrt(scaling);
 
   return (sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]) / scaling);
 }
 
 mitk::Vector3D mitk::SlicedGeometry3D::AdjustNormal(const mitk::Vector3D &normal) const
 {
   TransformType::Pointer inverse = TransformType::New();
   m_ReferenceGeometry->GetIndexToWorldTransform()->GetInverse(inverse);
 
   Vector3D transformedNormal = inverse->TransformVector(normal);
 
   transformedNormal.Normalize();
   return transformedNormal;
 }
 
 void mitk::SlicedGeometry3D::SetImageGeometry(const bool isAnImageGeometry)
 {
   Superclass::SetImageGeometry(isAnImageGeometry);
 
   unsigned int s;
   for (s = 0; s < m_Slices; ++s)
   {
     mitk::BaseGeometry *geometry = m_PlaneGeometries[s];
     if (geometry != nullptr)
     {
       geometry->SetImageGeometry(isAnImageGeometry);
     }
   }
 }
 
 void mitk::SlicedGeometry3D::ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry)
 {
   unsigned int s;
   for (s = 0; s < m_Slices; ++s)
   {
     mitk::BaseGeometry *geometry = m_PlaneGeometries[s];
     if (geometry != nullptr)
     {
       geometry->ChangeImageGeometryConsideringOriginOffset(isAnImageGeometry);
     }
   }
 
   Superclass::ChangeImageGeometryConsideringOriginOffset(isAnImageGeometry);
 }
 
 bool mitk::SlicedGeometry3D::IsValidSlice(int s) const
 {
   return ((s >= 0) && (s < (int)m_Slices));
 }
 
 const mitk::BaseGeometry *mitk::SlicedGeometry3D::GetReferenceGeometry() const
 {
   return m_ReferenceGeometry;
 }
 
 void mitk::SlicedGeometry3D::SetReferenceGeometry(const BaseGeometry *referenceGeometry)
 {
   m_ReferenceGeometry = referenceGeometry;
 
   std::vector<PlaneGeometry::Pointer>::iterator it;
 
   for (it = m_PlaneGeometries.begin(); it != m_PlaneGeometries.end(); ++it)
   {
     (*it)->SetReferenceGeometry(referenceGeometry);
   }
 }
 
 bool mitk::SlicedGeometry3D::HasReferenceGeometry() const
 {
   return ( m_ReferenceGeometry != nullptr );
 }
 
 void mitk::SlicedGeometry3D::PreSetSpacing(const mitk::Vector3D &aSpacing)
 {
   bool hasEvenlySpacedPlaneGeometry = false;
   mitk::Point3D origin;
   mitk::Vector3D rightDV, bottomDV;
   BoundingBox::BoundsArrayType bounds;
 
   // Check for valid spacing
   if (!(aSpacing[0] > 0 && aSpacing[1] > 0 && aSpacing[2] > 0))
   {
     mitkThrow() << "You try to set a spacing with at least one element equal or "
                    "smaller to \"0\". This might lead to a crash during rendering. Please double"
                    " check your data!";
   }
 
   // In case of evenly-spaced data: re-initialize instances of PlaneGeometry,
   // since the spacing influences them
   if ((m_EvenlySpaced) && (m_PlaneGeometries.size() > 0))
   {
     const PlaneGeometry *planeGeometry = m_PlaneGeometries[0];
 
     if (planeGeometry && !dynamic_cast<const AbstractTransformGeometry *>(planeGeometry))
     {
       this->WorldToIndex(planeGeometry->GetOrigin(), origin);
       this->WorldToIndex(planeGeometry->GetAxisVector(0), rightDV);
       this->WorldToIndex(planeGeometry->GetAxisVector(1), bottomDV);
 
       bounds = planeGeometry->GetBounds();
       hasEvenlySpacedPlaneGeometry = true;
     }
   }
 
   BaseGeometry::_SetSpacing(aSpacing);
 
   mitk::PlaneGeometry::Pointer firstGeometry;
 
   // In case of evenly-spaced data: re-initialize instances of PlaneGeometry,
   // since the spacing influences them
   if (hasEvenlySpacedPlaneGeometry)
   {
     // create planeGeometry according to new spacing
     this->IndexToWorld(origin, origin);
     this->IndexToWorld(rightDV, rightDV);
     this->IndexToWorld(bottomDV, bottomDV);
 
     mitk::PlaneGeometry::Pointer planeGeometry = mitk::PlaneGeometry::New();
     planeGeometry->SetImageGeometry(this->GetImageGeometry());
 
     planeGeometry->SetReferenceGeometry(m_ReferenceGeometry);
 
     // Store spacing, as Initialize... needs a pointer
     mitk::Vector3D lokalSpacing = this->GetSpacing();
     planeGeometry->InitializeStandardPlane(rightDV.GetVnlVector(), bottomDV.GetVnlVector(), &lokalSpacing);
     planeGeometry->SetOrigin(origin);
     planeGeometry->SetBounds(bounds);
 
     firstGeometry = planeGeometry;
   }
   else if ((m_EvenlySpaced) && (m_PlaneGeometries.size() > 0))
   {
     firstGeometry = m_PlaneGeometries[0].GetPointer();
   }
 
   // clear and reserve
   PlaneGeometry::Pointer gnull = nullptr;
   m_PlaneGeometries.assign(m_Slices, gnull);
 
   if (m_Slices > 0)
   {
     m_PlaneGeometries[0] = firstGeometry;
   }
 
   this->Modified();
 }
 
 void mitk::SlicedGeometry3D::SetSliceNavigationController(SliceNavigationController *snc)
 {
   m_SliceNavigationController = snc;
 }
 
 mitk::SliceNavigationController *mitk::SlicedGeometry3D::GetSliceNavigationController()
 {
   return m_SliceNavigationController;
 }
 
 void mitk::SlicedGeometry3D::SetEvenlySpaced(bool on)
 {
   if (m_EvenlySpaced != on)
   {
     m_EvenlySpaced = on;
     this->Modified();
   }
 }
 
 void mitk::SlicedGeometry3D::SetDirectionVector(const mitk::Vector3D &directionVector)
 {
   Vector3D newDir = directionVector;
   newDir.Normalize();
   if (newDir != m_DirectionVector)
   {
     m_DirectionVector = newDir;
     this->Modified();
   }
 }
 
 // void
 // mitk::SlicedGeometry3D::SetTimeBounds( const mitk::TimeBounds& timebounds )
 //{
 //  Superclass::SetTimeBounds( timebounds );
 //
 //  unsigned int s;
 //  for ( s = 0; s < m_Slices; ++s )
 //  {
 //    if(m_Geometry2Ds[s].IsNotNull())
 //    {
 //      m_Geometry2Ds[s]->SetTimeBounds( timebounds );
 //    }
 //  }
 //  m_TimeBounds = timebounds;
 //}
 
 itk::LightObject::Pointer mitk::SlicedGeometry3D::InternalClone() const
 {
   Self::Pointer newGeometry = new SlicedGeometry3D(*this);
   newGeometry->UnRegister();
   return newGeometry.GetPointer();
 }
 
 void mitk::SlicedGeometry3D::PrintSelf(std::ostream &os, itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
   os << indent << " EvenlySpaced: " << m_EvenlySpaced << std::endl;
   if (m_EvenlySpaced)
   {
     os << indent << " DirectionVector: " << m_DirectionVector << std::endl;
   }
   os << indent << " Slices: " << m_Slices << std::endl;
 
   os << std::endl;
   os << indent << " GetPlaneGeometry(0): ";
   if (this->GetPlaneGeometry(0) == nullptr)
   {
     os << "nullptr" << std::endl;
   }
   else
   {
     this->GetPlaneGeometry(0)->Print(os, indent);
   }
 }
 
 void mitk::SlicedGeometry3D::ExecuteOperation(Operation *operation)
 {
   PlaneGeometry::Pointer geometry2D;
   ApplyTransformMatrixOperation *applyMatrixOp;
   Point3D center;
 
   switch (operation->GetOperationType())
   {
     case OpNOTHING:
       break;
 
     case OpROTATE:
       if (m_EvenlySpaced)
       {
         // Need a reference frame to align the rotation
         if (m_ReferenceGeometry)
         {
           // Clear all generated geometries and then rotate only the first slice.
           // The other slices will be re-generated on demand
 
           // Save first slice
           PlaneGeometry::Pointer geometry2D = m_PlaneGeometries[0];
 
           auto *rotOp = dynamic_cast<RotationOperation *>(operation);
 
           // Generate a RotationOperation using the dataset center instead of
           // the supplied rotation center. This is necessary so that the rotated
           // zero-plane does not shift away. The supplied center is instead used
           // to adjust the slice stack afterwards.
           Point3D center = m_ReferenceGeometry->GetCenter();
 
           RotationOperation centeredRotation(
             rotOp->GetOperationType(), center, rotOp->GetVectorOfRotation(), rotOp->GetAngleOfRotation());
 
           // Rotate first slice
           geometry2D->ExecuteOperation(&centeredRotation);
 
           // Clear the slice stack and adjust it according to the center of
           // the dataset and the supplied rotation center (see documentation of
           // ReinitializePlanes)
           this->ReinitializePlanes(center, rotOp->GetCenterOfRotation());
 
           geometry2D->SetSpacing(this->GetSpacing());
 
           if (m_SliceNavigationController)
           {
             m_SliceNavigationController->SelectSliceByPoint(rotOp->GetCenterOfRotation());
             m_SliceNavigationController->AdjustSliceStepperRange();
           }
 
           BaseGeometry::ExecuteOperation(&centeredRotation);
         }
         else
         {
           // we also have to consider the case, that there is no reference geometry available.
           if (m_PlaneGeometries.size() > 0)
           {
             // Reach through to all slices in my container
             for (auto iter = m_PlaneGeometries.begin(); iter != m_PlaneGeometries.end(); ++iter)
             {
               // Test for empty slices, which can happen if evenly spaced geometry
               if ((*iter).IsNotNull())
               {
                 (*iter)->ExecuteOperation(operation);
               }
             }
 
             // rotate overall geometry
             auto *rotOp = dynamic_cast<RotationOperation *>(operation);
             BaseGeometry::ExecuteOperation(rotOp);
           }
         }
       }
       else
       {
         // Reach through to all slices
         for (auto iter = m_PlaneGeometries.begin(); iter != m_PlaneGeometries.end(); ++iter)
         {
           (*iter)->ExecuteOperation(operation);
         }
       }
       break;
 
     case OpORIENT:
       if (m_EvenlySpaced)
       {
         // get operation data
         auto *planeOp = dynamic_cast<PlaneOperation *>(operation);
 
         // Get first slice
         PlaneGeometry::Pointer planeGeometry = m_PlaneGeometries[0];
 
         // Need a PlaneGeometry, a PlaneOperation and a reference frame to
         // carry out the re-orientation. If not all available, stop here
         if (!m_ReferenceGeometry ||
             (!planeGeometry || dynamic_cast<AbstractTransformGeometry *>(planeGeometry.GetPointer())) || !planeOp)
         {
           break;
         }
 
         // General Behavior:
         // Clear all generated geometries and then rotate only the first slice.
         // The other slices will be re-generated on demand
 
         //
         // 1st Step: Reorient Normal Vector of first plane
         //
         Point3D center = planeOp->GetPoint(); // m_ReferenceGeometry->GetCenter();
         mitk::Vector3D currentNormal = planeGeometry->GetNormal();
         mitk::Vector3D newNormal;
         if (planeOp->AreAxisDefined())
         {
           // If planeOp was defined by one centerpoint and two axis vectors
           newNormal = CrossProduct(planeOp->GetAxisVec0(), planeOp->GetAxisVec1());
         }
         else
         {
           // If planeOp was defined by one centerpoint and one normal vector
           newNormal = planeOp->GetNormal();
         }
 
         // Get Rotation axis und angle
         currentNormal.Normalize();
         newNormal.Normalize();
         ScalarType rotationAngle = angle(currentNormal.GetVnlVector(), newNormal.GetVnlVector());
 
         rotationAngle *= 180.0 / vnl_math::pi; // from rad to deg
         Vector3D rotationAxis = itk::CrossProduct(currentNormal, newNormal);
         if (std::abs(rotationAngle - 180) < mitk::eps)
         {
           // current Normal and desired normal are not linear independent!!(e.g 1,0,0 and -1,0,0).
           // Rotation Axis should be ANY vector that is 90� to current Normal
           mitk::Vector3D helpNormal;
           helpNormal = currentNormal;
           helpNormal[0] += 1;
           helpNormal[1] -= 1;
           helpNormal[2] += 1;
           helpNormal.Normalize();
           rotationAxis = itk::CrossProduct(helpNormal, currentNormal);
         }
 
         RotationOperation centeredRotation(mitk::OpROTATE, center, rotationAxis, rotationAngle);
 
         // Rotate first slice
         planeGeometry->ExecuteOperation(&centeredRotation);
 
         // Reinitialize planes and select slice, if my rotations are all done.
         if (!planeOp->AreAxisDefined())
         {
           // Clear the slice stack and adjust it according to the center of
           // rotation and plane position (see documentation of ReinitializePlanes)
           this->ReinitializePlanes(center, planeOp->GetPoint());
           planeGeometry->SetSpacing(this->GetSpacing());
 
           if (m_SliceNavigationController)
           {
             m_SliceNavigationController->SelectSliceByPoint(planeOp->GetPoint());
             m_SliceNavigationController->AdjustSliceStepperRange();
           }
         }
 
         // Also apply rotation on the slicedGeometry - Geometry3D (Bounding geometry)
         BaseGeometry::ExecuteOperation(&centeredRotation);
 
         //
         // 2nd step. If axis vectors were defined, rotate the plane around its normal to fit these
         //
 
         if (planeOp->AreAxisDefined())
         {
           mitk::Vector3D vecAxixNew = planeOp->GetAxisVec0();
           vecAxixNew.Normalize();
           mitk::Vector3D VecAxisCurr = planeGeometry->GetAxisVector(0);
           VecAxisCurr.Normalize();
 
           ScalarType rotationAngle = angle(VecAxisCurr.GetVnlVector(), vecAxixNew.GetVnlVector());
           rotationAngle = rotationAngle * 180 / PI; // Rad to Deg
 
           // we rotate around the normal of the plane, but we do not know, if we need to rotate clockwise
           // or anti-clockwise. So we rotate around the crossproduct of old and new Axisvector.
           // Since both axis vectors lie in the plane, the crossproduct is the planes normal or the negative planes
           // normal
 
           rotationAxis = itk::CrossProduct(VecAxisCurr, vecAxixNew);
           if (std::abs(rotationAngle - 180) < mitk::eps)
           {
             // current axisVec and desired axisVec are not linear independent!!(e.g 1,0,0 and -1,0,0).
             // Rotation Axis can be just plane Normal. (have to rotate by 180�)
             rotationAxis = newNormal;
           }
 
           // Perform Rotation
           mitk::RotationOperation op(mitk::OpROTATE, center, rotationAxis, rotationAngle);
           planeGeometry->ExecuteOperation(&op);
 
           // Apply changes on first slice to whole slice stack
           this->ReinitializePlanes(center, planeOp->GetPoint());
           planeGeometry->SetSpacing(this->GetSpacing());
 
           if (m_SliceNavigationController)
           {
             m_SliceNavigationController->SelectSliceByPoint(planeOp->GetPoint());
             m_SliceNavigationController->AdjustSliceStepperRange();
           }
 
           // Also apply rotation on the slicedGeometry - Geometry3D (Bounding geometry)
           BaseGeometry::ExecuteOperation(&op);
         }
       }
       else
       {
         // Reach through to all slices
         for (auto iter = m_PlaneGeometries.begin(); iter != m_PlaneGeometries.end(); ++iter)
         {
           (*iter)->ExecuteOperation(operation);
         }
       }
       break;
 
     case OpRESTOREPLANEPOSITION:
       if (m_EvenlySpaced)
       {
         // Save first slice
         PlaneGeometry::Pointer planeGeometry = m_PlaneGeometries[0];
 
         auto *restorePlaneOp = dynamic_cast<RestorePlanePositionOperation *>(operation);
 
         // Need a PlaneGeometry, a PlaneOperation and a reference frame to
         // carry out the re-orientation
         if (m_ReferenceGeometry &&
             (planeGeometry && dynamic_cast<AbstractTransformGeometry *>(planeGeometry.GetPointer()) == nullptr) &&
             restorePlaneOp)
         {
           // Clear all generated geometries and then rotate only the first slice.
           // The other slices will be re-generated on demand
 
           // Rotate first slice
           planeGeometry->ExecuteOperation(restorePlaneOp);
 
           m_DirectionVector = restorePlaneOp->GetDirectionVector();
 
           double centerOfRotationDistance = planeGeometry->SignedDistanceFromPlane(m_ReferenceGeometry->GetCenter());
 
           if (centerOfRotationDistance <= 0)
           {
             m_DirectionVector = -m_DirectionVector;
           }
 
           Vector3D spacing = restorePlaneOp->GetSpacing();
 
           Superclass::SetSpacing(spacing);
 
           // /*Now we need to calculate the number of slices in the plane's normal
           // direction, so that the entire volume is covered. This is done by first
           // calculating the dot product between the volume diagonal (the maximum
           // distance inside the volume) and the normal, and dividing this value by
           // the directed spacing calculated above.*/
           ScalarType directedExtent = std::abs(m_ReferenceGeometry->GetExtentInMM(0) * m_DirectionVector[0]) +
                                       std::abs(m_ReferenceGeometry->GetExtentInMM(1) * m_DirectionVector[1]) +
                                       std::abs(m_ReferenceGeometry->GetExtentInMM(2) * m_DirectionVector[2]);
 
           if (directedExtent >= spacing[2])
           {
             m_Slices = static_cast<unsigned int>(directedExtent / spacing[2] + 0.5);
           }
           else
           {
             m_Slices = 1;
           }
 
           m_PlaneGeometries.assign(m_Slices, PlaneGeometry::Pointer(nullptr));
 
           if (m_Slices > 0)
           {
             m_PlaneGeometries[0] = planeGeometry;
           }
 
           m_SliceNavigationController->GetStepper()->SetSteps(m_Slices);
 
           this->Modified();
 
           // End Reinitialization
 
           if (m_SliceNavigationController)
           {
             m_SliceNavigationController->GetStepper()->SetPos(restorePlaneOp->GetPos());
             m_SliceNavigationController->AdjustSliceStepperRange();
           }
           BaseGeometry::ExecuteOperation(restorePlaneOp);
         }
       }
       else
       {
         // Reach through to all slices
         for (auto iter = m_PlaneGeometries.begin(); iter != m_PlaneGeometries.end(); ++iter)
         {
           (*iter)->ExecuteOperation(operation);
         }
       }
       break;
 
     case OpAPPLYTRANSFORMMATRIX:
 
       // Clear all generated geometries and then transform only the first slice.
       // The other slices will be re-generated on demand
 
       // Save first slice
       geometry2D = m_PlaneGeometries[0];
 
       applyMatrixOp = dynamic_cast<ApplyTransformMatrixOperation *>(operation);
 
       // Apply transformation to first plane
       geometry2D->ExecuteOperation(applyMatrixOp);
 
       // Generate a ApplyTransformMatrixOperation using the dataset center instead of
       // the supplied rotation center. The supplied center is instead used to adjust the
       // slice stack afterwards (see OpROTATE).
       center = m_ReferenceGeometry->GetCenter();
 
       // Clear the slice stack and adjust it according to the center of
       // the dataset and the supplied rotation center (see documentation of
       // ReinitializePlanes)
       this->ReinitializePlanes(center, applyMatrixOp->GetReferencePoint());
 
       BaseGeometry::ExecuteOperation(applyMatrixOp);
       break;
 
     default: // let handle by base class if we don't do anything
       BaseGeometry::ExecuteOperation(operation);
   }
 
   this->Modified();
 }
diff --git a/Modules/Core/test/mitkPlaneGeometryTest.cpp b/Modules/Core/test/mitkPlaneGeometryTest.cpp
index e64ebc6e26..737222fc05 100644
--- a/Modules/Core/test/mitkPlaneGeometryTest.cpp
+++ b/Modules/Core/test/mitkPlaneGeometryTest.cpp
@@ -1,1093 +1,1084 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkAffineTransform3D.h"
 #include "mitkBaseGeometry.h"
 #include "mitkGeometry3D.h"
 #include "mitkInteractionConst.h"
 #include "mitkLine.h"
 #include "mitkPlaneGeometry.h"
 #include "mitkRotationOperation.h"
 #include "mitkSlicedGeometry3D.h"
 #include "mitkThinPlateSplineCurvedGeometry.h"
 
 #include <mitkTestFixture.h>
 #include <mitkTestingMacros.h>
 
 #include <vnl/vnl_quaternion.h>
 #include <vnl/vnl_quaternion.hxx>
 
 #include <fstream>
 #include <iomanip>
 #include <mitkIOUtil.h>
 #include <mitkImage.h>
 
 static const mitk::ScalarType testEps = 1E-9; // the epsilon used in this test == at least float precision.
 
 class mitkPlaneGeometryTestSuite : public mitk::TestFixture
 {
   CPPUNIT_TEST_SUITE(mitkPlaneGeometryTestSuite);
   MITK_TEST(TestInitializeStandardPlane);
   MITK_TEST(TestProjectPointOntoPlane);
   MITK_TEST(TestPlaneGeometryCloning);
   MITK_TEST(TestInheritance);
   MITK_TEST(TestSetExtendInMM);
   MITK_TEST(TestRotate);
   MITK_TEST(TestClone);
   MITK_TEST(TestPlaneComparison);
   MITK_TEST(TestAxialInitialization);
   MITK_TEST(TestCoronalInitialization);
   MITK_TEST(TestSagittalInitialization);
   MITK_TEST(TestLefthandedCoordinateSystem);
-  MITK_TEST(TestDominantAxesError);
   MITK_TEST(TestCheckRotationMatrix);
 
   // Currently commented out, see See bug 15990
   // MITK_TEST(testPlaneGeometryInitializeOrder);
   MITK_TEST(TestIntersectionPoint);
   MITK_TEST(TestCase1210);
 
   CPPUNIT_TEST_SUITE_END();
 
 private:
   // private test members that are initialized by setUp()
   mitk::PlaneGeometry::Pointer planegeometry;
   mitk::Point3D origin;
   mitk::Vector3D right, bottom, normal, spacing;
   mitk::ScalarType width, height;
   mitk::ScalarType widthInMM, heightInMM, thicknessInMM;
 
 public:
   void setUp() override
   {
     planegeometry = mitk::PlaneGeometry::New();
     width = 100;
     widthInMM = width;
     height = 200;
     heightInMM = height;
     thicknessInMM = 1.0;
     mitk::FillVector3D(origin, 4.5, 7.3, 11.2);
     mitk::FillVector3D(right, widthInMM, 0, 0);
     mitk::FillVector3D(bottom, 0, heightInMM, 0);
     mitk::FillVector3D(normal, 0, 0, thicknessInMM);
     mitk::FillVector3D(spacing, 1.0, 1.0, thicknessInMM);
 
     planegeometry->InitializeStandardPlane(right, bottom);
     planegeometry->SetOrigin(origin);
     planegeometry->SetSpacing(spacing);
   }
 
   void tearDown() override {}
   // This test verifies inheritance behaviour, this test will fail if the behaviour changes in the future
   void TestInheritance()
   {
     mitk::PlaneGeometry::Pointer plane = mitk::PlaneGeometry::New();
     mitk::Geometry3D::Pointer g3d = dynamic_cast<mitk::Geometry3D *>(plane.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("Planegeometry should not be castable to Geometry 3D", g3d.IsNull());
 
     mitk::BaseGeometry::Pointer base = dynamic_cast<mitk::BaseGeometry *>(plane.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("Planegeometry should be castable to BaseGeometry", base.IsNotNull());
 
     g3d = mitk::Geometry3D::New();
     base = dynamic_cast<mitk::BaseGeometry *>(g3d.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("Geometry3D should be castable to BaseGeometry", base.IsNotNull());
 
     mitk::SlicedGeometry3D::Pointer sliced = mitk::SlicedGeometry3D::New();
     g3d = dynamic_cast<mitk::Geometry3D *>(sliced.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("SlicedGeometry3D should not be castable to Geometry3D", g3d.IsNull());
 
     mitk::ThinPlateSplineCurvedGeometry::Pointer thin = mitk::ThinPlateSplineCurvedGeometry::New();
     plane = dynamic_cast<mitk::PlaneGeometry *>(thin.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("AbstractTransformGeometry should be castable to PlaneGeometry", plane.IsNotNull());
 
     plane = mitk::PlaneGeometry::New();
     mitk::AbstractTransformGeometry::Pointer atg = dynamic_cast<mitk::AbstractTransformGeometry *>(plane.GetPointer());
     CPPUNIT_ASSERT_MESSAGE("PlaneGeometry should not be castable to AbstractTransofrmGeometry", atg.IsNull());
   }
 
-  void TestDominantAxesError()
-  {
-    auto image = mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath("NotQuiteARotationMatrix.nrrd"));
-    auto matrix = image->GetGeometry()->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().transpose();
-    std::vector< int > axes = mitk::PlaneGeometry::CalculateDominantAxes(matrix);
-    CPPUNIT_ASSERT_MESSAGE("Domiant axes cannot be determined in this dataset. Output should be default ordering.", axes.at(0)==0 && axes.at(1)==1 && axes.at(2)==2);
-  }
-
   void TestCheckRotationMatrix()
   {
     auto image = mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath("NotQuiteARotationMatrix.nrrd"));
     bool is_rotation = mitk::PlaneGeometry::CheckRotationMatrix(image->GetGeometry()->GetIndexToWorldTransform(), 1e-8);
     CPPUNIT_ASSERT_MESSAGE("Since the test data matrix is not quite a rotation matrix, this should be detected.", !is_rotation);
   }
 
   void TestLefthandedCoordinateSystem()
   {
     /**
      * @brief This method tests InitializeStandardPlane() and IndexToWorld()
      * with a left-handed coordinate orientation or indexToWorldMatrix.
      *
      * Of course this test does not use standard Parameters, which are right-handed.
      * See also discussion of bug #11477: https://phabricator.mitk.org/T11477
      */
     planegeometry = mitk::PlaneGeometry::New();
     width = 100;
     widthInMM = 5;
     height = 200;
     heightInMM = 3;
     thicknessInMM = 1.0;
     mitk::FillVector3D(right, widthInMM, 0, 0);
     mitk::FillVector3D(bottom, 0, heightInMM, 0);
     // This one negative sign results in lefthanded coordinate orientation and det(matrix) < 0.
     mitk::FillVector3D(normal, 0, 0, -thicknessInMM);
 
     mitk::AffineTransform3D::Pointer transform = mitk::AffineTransform3D::New();
 
     mitk::AffineTransform3D::MatrixType matrix;
     mitk::AffineTransform3D::MatrixType::InternalMatrixType &vnl_matrix = matrix.GetVnlMatrix();
 
     vnl_matrix.set_column(0, right);
     vnl_matrix.set_column(1, bottom);
     vnl_matrix.set_column(2, normal);
 
     // making sure that we didn't screw up this special test case or else fail deadly:
     assert(vnl_determinant(vnl_matrix) < 0.0);
 
     transform->SetIdentity();
     transform->SetMatrix(matrix);
 
     planegeometry->InitializeStandardPlane(width, height, transform); // Crux of the matter.
     CPPUNIT_ASSERT_MESSAGE(
       "Testing if IndexToWorldMatrix is correct after InitializeStandardPlane( width, height, transform ) ",
       mitk::MatrixEqualElementWise(planegeometry->GetIndexToWorldTransform()->GetMatrix(), matrix));
 
     mitk::Point3D p_index;
     p_index[0] = 10.;
     p_index[1] = 10.;
     p_index[2] = 0.;
     mitk::Point3D p_world;
     mitk::Point3D p_expectedResult;
     p_expectedResult[0] = 50.;
     p_expectedResult[1] = 30.;
     p_expectedResult[2] = 0.;
 
     ((mitk::BaseGeometry::Pointer)planegeometry)->IndexToWorld(p_index, p_world); // Crux of the matter.
     CPPUNIT_ASSERT_MESSAGE("Testing if IndexToWorld(a,b) function works correctly with lefthanded matrix ",
                            mitk::Equal(p_world, p_expectedResult, testEps));
   }
 
   // See bug 1210
   // Test does not use standard Parameters
   void TestCase1210()
   {
     mitk::PlaneGeometry::Pointer planegeometry = mitk::PlaneGeometry::New();
 
     mitk::Point3D origin;
     mitk::Vector3D right, down, spacing;
 
     mitk::FillVector3D(origin, 4.5, 7.3, 11.2);
     mitk::FillVector3D(right, 1.015625, 1.015625, 1.1999969482421875);
 
     mitk::FillVector3D(down, 1.4012984643248170709237295832899161312802619418765e-45, 0, 0);
     mitk::FillVector3D(spacing,
                        0,
                        1.4713633875410579244699160624544119378442750389703e-43,
                        9.2806360452222355258639080851310540729807238879469e-32);
 
     std::cout << "Testing InitializeStandardPlane(rightVector, downVector, spacing = nullptr): " << std::endl;
     CPPUNIT_ASSERT_NO_THROW(planegeometry->InitializeStandardPlane(right, down, &spacing));
     /*
     std::cout << "Testing width, height and thickness (in units): ";
     if((mitk::Equal(planegeometry->GetExtent(0),width)==false) ||
     (mitk::Equal(planegeometry->GetExtent(1),height)==false) ||
     (mitk::Equal(planegeometry->GetExtent(2),1)==false)
     )
     {
     std::cout<<"[FAILED]"<<std::endl;
     return EXIT_FAILURE;
     }
     std::cout<<"[PASSED]"<<std::endl;
 
     std::cout << "Testing width, height and thickness (in mm): ";
     if((mitk::Equal(planegeometry->GetExtentInMM(0),widthInMM)==false) ||
     (mitk::Equal(planegeometry->GetExtentInMM(1),heightInMM)==false) ||
     (mitk::Equal(planegeometry->GetExtentInMM(2),thicknessInMM)==false)
     )
     {
     std::cout<<"[FAILED]"<<std::endl;
     return EXIT_FAILURE;
     }
      */
   }
 
   /**
    * @brief This method tests method IntersectionPoint
    *
    * See also bug #7151. (ref 2 this test: iggy)
    * This test was written due to incorrect calculation of the intersection point
    * between a given line and plane. This only occurred when the pointdistance of
    * the line was less than 1.
    * Test Behaviour:
    * ===============
    * we have a given line and a given plane.
    * we let the line intersect the plane.
    * when testing several positions on the line the resulting intersection point must be the same
    * we test a position where the distance between the corresponding points is < 0 and another position where the
    * distance is > 0.
    *
    */
   // Test does not use standard Parameters
   void TestIntersectionPoint()
   {
     // init plane with its parameter
     mitk::PlaneGeometry::Pointer myPlaneGeometry = mitk::PlaneGeometry::New();
 
     mitk::Point3D origin;
     origin[0] = 0.0;
     origin[1] = 2.0;
     origin[2] = 0.0;
 
     mitk::Vector3D normal;
     normal[0] = 0.0;
     normal[1] = 1.0;
     normal[2] = 0.0;
 
     myPlaneGeometry->InitializePlane(origin, normal);
 
     // generate points and line for intersection testing
     // point distance of given line > 1
     mitk::Point3D pointP1;
     pointP1[0] = 2.0;
     pointP1[1] = 1.0;
     pointP1[2] = 0.0;
 
     mitk::Point3D pointP2;
     pointP2[0] = 2.0;
     pointP2[1] = 4.0;
     pointP2[2] = 0.0;
 
     mitk::Vector3D lineDirection;
     lineDirection[0] = pointP2[0] - pointP1[0];
     lineDirection[1] = pointP2[1] - pointP1[1];
     lineDirection[2] = pointP2[2] - pointP1[2];
 
     mitk::Line3D xingline(pointP1, lineDirection);
     mitk::Point3D calcXingPoint;
     myPlaneGeometry->IntersectionPoint(xingline, calcXingPoint);
 
     // point distance of given line < 1
     mitk::Point3D pointP3;
     pointP3[0] = 2.0;
     pointP3[1] = 2.2;
     pointP3[2] = 0.0;
 
     mitk::Point3D pointP4;
     pointP4[0] = 2.0;
     pointP4[1] = 1.7;
     pointP4[2] = 0.0;
 
     mitk::Vector3D lineDirection2;
     lineDirection2[0] = pointP4[0] - pointP3[0];
     lineDirection2[1] = pointP4[1] - pointP3[1];
     lineDirection2[2] = pointP4[2] - pointP3[2];
 
     mitk::Line3D xingline2(pointP3, lineDirection2);
     mitk::Point3D calcXingPoint2;
     myPlaneGeometry->IntersectionPoint(xingline2, calcXingPoint2);
 
     // intersection points must be the same
     CPPUNIT_ASSERT_MESSAGE("Failed to calculate Intersection Point", calcXingPoint == calcXingPoint2);
   }
 
   /**
    * @brief This method tests method ProjectPointOntoPlane.
    *
    * See also bug #3409.
    */
   // Test does not use standard Parameters
   void TestProjectPointOntoPlane()
   {
     mitk::PlaneGeometry::Pointer myPlaneGeometry = mitk::PlaneGeometry::New();
 
     // create normal
     mitk::Vector3D normal;
     normal[0] = 0.0;
     normal[1] = 0.0;
     normal[2] = 1.0;
 
     // create origin
     mitk::Point3D origin;
     origin[0] = -27.582859;
     origin[1] = 50;
     origin[2] = 200.27742;
 
     // initialize plane geometry
     myPlaneGeometry->InitializePlane(origin, normal);
 
     // output to describe the test
     std::cout << "Testing PlaneGeometry according to bug #3409" << std::endl;
     std::cout << "Our normal is: " << normal << std::endl;
     std::cout << "So ALL projected points should have exactly the same z-value!" << std::endl;
 
     // create a number of points
     mitk::Point3D myPoints[5];
     myPoints[0][0] = -27.582859;
     myPoints[0][1] = 50.00;
     myPoints[0][2] = 200.27742;
 
     myPoints[1][0] = -26.58662;
     myPoints[1][1] = 50.00;
     myPoints[1][2] = 200.19026;
 
     myPoints[2][0] = -26.58662;
     myPoints[2][1] = 50.00;
     myPoints[2][2] = 200.33124;
 
     myPoints[3][0] = 104.58662;
     myPoints[3][1] = 452.12313;
     myPoints[3][2] = 866.41236;
 
     myPoints[4][0] = -207.58662;
     myPoints[4][1] = 312.00;
     myPoints[4][2] = -300.12346;
 
     // project points onto plane
     mitk::Point3D myProjectedPoints[5];
     for (unsigned int i = 0; i < 5; ++i)
     {
       myProjectedPoints[i] = myPlaneGeometry->ProjectPointOntoPlane(myPoints[i]);
     }
 
     // compare z-values with z-value of plane (should be equal)
     bool allPointsOnPlane = true;
     for (auto &myProjectedPoint : myProjectedPoints)
     {
       if (fabs(myProjectedPoint[2] - origin[2]) > mitk::sqrteps)
       {
         allPointsOnPlane = false;
       }
     }
     CPPUNIT_ASSERT_MESSAGE("All points lie not on the same plane", allPointsOnPlane);
   }
 
   void TestPlaneGeometryCloning()
   {
     mitk::PlaneGeometry::Pointer geometry2D = createPlaneGeometry();
 
     try
     {
       mitk::PlaneGeometry::Pointer clone = geometry2D->Clone();
       itk::Matrix<mitk::ScalarType, 3, 3> matrix = clone->GetIndexToWorldTransform()->GetMatrix();
       CPPUNIT_ASSERT_MESSAGE("Test if matrix element exists...", matrix[0][0] == 31);
 
       double origin = geometry2D->GetOrigin()[0];
       CPPUNIT_ASSERT_MESSAGE("First Point of origin as expected...", mitk::Equal(origin, 8));
 
       double spacing = geometry2D->GetSpacing()[0];
       CPPUNIT_ASSERT_MESSAGE("First Point of spacing as expected...", mitk::Equal(spacing, 31));
     }
     catch (...)
     {
       CPPUNIT_FAIL("Error during access on a member of cloned geometry");
     }
     // direction [row] [column]
     MITK_TEST_OUTPUT(<< "Casting a rotated 2D ITK Image to a MITK Image and check if Geometry is still same");
   }
 
   void TestPlaneGeometryInitializeOrder()
   {
     mitk::Vector3D mySpacing;
     mySpacing[0] = 31;
     mySpacing[1] = 0.1;
     mySpacing[2] = 5.4;
     mitk::Point3D myOrigin;
     myOrigin[0] = 8;
     myOrigin[1] = 9;
     myOrigin[2] = 10;
     mitk::AffineTransform3D::Pointer myTransform = mitk::AffineTransform3D::New();
     itk::Matrix<mitk::ScalarType, 3, 3> transMatrix;
     transMatrix.Fill(0);
     transMatrix[0][0] = 1;
     transMatrix[1][1] = 2;
     transMatrix[2][2] = 4;
 
     myTransform->SetMatrix(transMatrix);
 
     mitk::PlaneGeometry::Pointer geometry2D1 = mitk::PlaneGeometry::New();
     geometry2D1->SetIndexToWorldTransform(myTransform);
     geometry2D1->SetSpacing(mySpacing);
     geometry2D1->SetOrigin(myOrigin);
 
     mitk::PlaneGeometry::Pointer geometry2D2 = mitk::PlaneGeometry::New();
     geometry2D2->SetSpacing(mySpacing);
     geometry2D2->SetOrigin(myOrigin);
     geometry2D2->SetIndexToWorldTransform(myTransform);
 
     mitk::PlaneGeometry::Pointer geometry2D3 = mitk::PlaneGeometry::New();
     geometry2D3->SetIndexToWorldTransform(myTransform);
     geometry2D3->SetSpacing(mySpacing);
     geometry2D3->SetOrigin(myOrigin);
     geometry2D3->SetIndexToWorldTransform(myTransform);
 
     CPPUNIT_ASSERT_MESSAGE("Origin of Geometry 1 matches that of Geometry 2.",
                            mitk::Equal(geometry2D1->GetOrigin(), geometry2D2->GetOrigin()));
     CPPUNIT_ASSERT_MESSAGE("Origin of Geometry 1 match those of Geometry 3.",
                            mitk::Equal(geometry2D1->GetOrigin(), geometry2D3->GetOrigin()));
     CPPUNIT_ASSERT_MESSAGE("Origin of Geometry 2 match those of Geometry 3.",
                            mitk::Equal(geometry2D2->GetOrigin(), geometry2D3->GetOrigin()));
 
     CPPUNIT_ASSERT_MESSAGE("Spacing of Geometry 1 match those of Geometry 2.",
                            mitk::Equal(geometry2D1->GetSpacing(), geometry2D2->GetSpacing()));
     CPPUNIT_ASSERT_MESSAGE("Spacing of Geometry 1 match those of Geometry 3.",
                            mitk::Equal(geometry2D1->GetSpacing(), geometry2D3->GetSpacing()));
     CPPUNIT_ASSERT_MESSAGE("Spacing of Geometry 2 match those of Geometry 3.",
                            mitk::Equal(geometry2D2->GetSpacing(), geometry2D3->GetSpacing()));
 
     CPPUNIT_ASSERT_MESSAGE("Transformation of Geometry 1 match those of Geometry 2.",
                            compareMatrix(geometry2D1->GetIndexToWorldTransform()->GetMatrix(),
                                          geometry2D2->GetIndexToWorldTransform()->GetMatrix()));
     CPPUNIT_ASSERT_MESSAGE("Transformation of Geometry 1 match those of Geometry 3.",
                            compareMatrix(geometry2D1->GetIndexToWorldTransform()->GetMatrix(),
                                          geometry2D3->GetIndexToWorldTransform()->GetMatrix()));
     CPPUNIT_ASSERT_MESSAGE("Transformation of Geometry 2 match those of Geometry 3.",
                            compareMatrix(geometry2D2->GetIndexToWorldTransform()->GetMatrix(),
                                          geometry2D3->GetIndexToWorldTransform()->GetMatrix()));
   }
 
   void TestInitializeStandardPlane()
   {
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: width",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: height",
                            mitk::Equal(planegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: depth",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: width in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: heght in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: depth in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: AxisVectorRight",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: AxisVectorBottom",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with default Spacing: AxisVectorNormal",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     mitk::Vector3D spacing;
     thicknessInMM = 1.5;
     normal.Normalize();
     normal *= thicknessInMM;
     mitk::FillVector3D(spacing, 1.0, 1.0, thicknessInMM);
     planegeometry->InitializeStandardPlane(right.GetVnlVector(), bottom.GetVnlVector(), &spacing);
 
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: width",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: height",
                            mitk::Equal(planegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: depth",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: width in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: height in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: depth in mm",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: AxisVectorRight",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: AxisVectorBottom",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing correct Standard Plane initialization with custom Spacing: AxisVectorNormal",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     ;
   }
 
   void TestSetExtendInMM()
   {
     normal.Normalize();
     normal *= thicknessInMM;
     planegeometry->SetExtentInMM(2, thicknessInMM);
     CPPUNIT_ASSERT_MESSAGE("Testing SetExtentInMM(2, ...), querying by GetExtentInMM(2): ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing SetExtentInMM(2, ...), querying by GetAxisVector(2) and comparing to normal: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     planegeometry->SetOrigin(origin);
     CPPUNIT_ASSERT_MESSAGE("Testing SetOrigin", mitk::Equal(planegeometry->GetOrigin(), origin, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() after SetOrigin: Right",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() after SetOrigin: Bottom",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() after SetOrigin: Normal",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     mappingTests2D(planegeometry, width, height, widthInMM, heightInMM, origin, right, bottom);
   }
 
   void TestRotate()
   {
     // Changing the IndexToWorldTransform to a rotated version by SetIndexToWorldTransform() (keep origin):
     mitk::AffineTransform3D::Pointer transform = mitk::AffineTransform3D::New();
     mitk::AffineTransform3D::MatrixType::InternalMatrixType vnlmatrix;
     vnlmatrix = planegeometry->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix();
     mitk::VnlVector axis(3);
     mitk::FillVector3D(axis, 1.0, 1.0, 1.0);
     axis.normalize();
     vnl_quaternion<mitk::ScalarType> rotation(axis, 0.223);
     vnlmatrix = rotation.rotation_matrix_transpose() * vnlmatrix;
     mitk::Matrix3D matrix;
     matrix = vnlmatrix;
     transform->SetMatrix(matrix);
     transform->SetOffset(planegeometry->GetIndexToWorldTransform()->GetOffset());
 
     right.SetVnlVector(rotation.rotation_matrix_transpose() * right.GetVnlVector());
     bottom.SetVnlVector(rotation.rotation_matrix_transpose() * bottom.GetVnlVector());
     normal.SetVnlVector(rotation.rotation_matrix_transpose() * normal.GetVnlVector());
     planegeometry->SetIndexToWorldTransform(transform);
 
     // The origin changed,because m_Origin=m_IndexToWorldTransform->GetOffset()+GetAxisVector(2)*0.5
     // and the AxisVector changes due to the rotation. In other words: the rotation was done around
     // the corner of the box, not around the planes origin. Now change it to a rotation around
     // the origin, simply by re-setting the origin to the original one:
     planegeometry->SetOrigin(origin);
 
     CPPUNIT_ASSERT_MESSAGE("Testing whether SetIndexToWorldTransform kept origin: ",
                            mitk::Equal(planegeometry->GetOrigin(), origin, testEps));
 
     mitk::Point2D point;
     point[0] = 4;
     point[1] = 3;
     mitk::Point2D dummy;
     planegeometry->WorldToIndex(point, dummy);
     planegeometry->IndexToWorld(dummy, dummy);
     CPPUNIT_ASSERT_MESSAGE("Testing consistency of index and world coordinates.", dummy == point);
 
     CPPUNIT_ASSERT_MESSAGE("Testing width of rotated version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height of rotated version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness of rotated version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of rotated version: right ",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of rotated version: bottom",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of rotated version: normal",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(0).GetNorm(), planegeometry->GetExtentInMM(0), testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(1).GetNorm(), planegeometry->GetExtentInMM(1), testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(2).GetNorm(), planegeometry->GetExtentInMM(2), testEps));
 
     mappingTests2D(planegeometry, width, height, widthInMM, heightInMM, origin, right, bottom);
 
     width *= 2;
     height *= 3;
     planegeometry->SetSizeInUnits(width, height);
     CPPUNIT_ASSERT_MESSAGE("Testing SetSizeInUnits() of rotated version: ",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing SetSizeInUnits() of rotated version: ",
                            mitk::Equal(planegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing SetSizeInUnits() of rotated version: ",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in mm) of version with changed size in units: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in mm) of version with changed size in units: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in mm) of version with changed size in units: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of version with changed size in units: right ",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of version with changed size in units: bottom",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of version with changed size in units: normal",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(0).GetNorm(), planegeometry->GetExtentInMM(0), testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(1).GetNorm(), planegeometry->GetExtentInMM(1), testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing GetAxisVector(direction).GetNorm() != planegeometry->GetExtentInMM(direction) of rotated version: ",
       mitk::Equal(planegeometry->GetAxisVector(2).GetNorm(), planegeometry->GetExtentInMM(2), testEps));
 
     mappingTests2D(planegeometry, width, height, widthInMM, heightInMM, origin, right, bottom);
   }
 
   void TestClone()
   {
     mitk::PlaneGeometry::Pointer clonedplanegeometry =
       dynamic_cast<mitk::PlaneGeometry *>(planegeometry->Clone().GetPointer());
     // Cave: Statement below is negated!
     CPPUNIT_ASSERT_MESSAGE("Testing Clone(): ",
                            !((clonedplanegeometry.IsNull()) || (clonedplanegeometry->GetReferenceCount() != 1)));
     CPPUNIT_ASSERT_MESSAGE("Testing origin of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetOrigin(), origin, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in units) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in units) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing extent (in units) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in mm) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in mm) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in mm) of cloned version: ",
                            mitk::Equal(clonedplanegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of cloned version: right",
                            mitk::Equal(clonedplanegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of cloned version: bottom",
                            mitk::Equal(clonedplanegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of cloned version: normal",
                            mitk::Equal(clonedplanegeometry->GetAxisVector(2), normal, testEps));
 
     mappingTests2D(clonedplanegeometry, width, height, widthInMM, heightInMM, origin, right, bottom);
   }
 
   void TestSagittalInitialization()
   {
     mitk::Point3D cornerpoint0 = planegeometry->GetCornerPoint(0);
     mitk::PlaneGeometry::Pointer clonedplanegeometry = planegeometry->Clone();
 
     // Testing InitializeStandardPlane(clonedplanegeometry, anatomicalplane = Sagittal, zPosition = 0, frontside=true):
     planegeometry->InitializeStandardPlane(clonedplanegeometry, mitk::AnatomicalPlane::Sagittal);
 
     mitk::Vector3D newright, newbottom, newnormal;
     mitk::ScalarType newthicknessInMM;
 
     newright = bottom;
     newthicknessInMM = widthInMM / width * 1.0; // extent in normal direction is 1;
     newnormal = right;
     newnormal.Normalize();
     newnormal *= newthicknessInMM;
     newbottom = normal;
     newbottom.Normalize();
     newbottom *= thicknessInMM;
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetCornerPoint(0) of sagittally initialized version:",
                            mitk::Equal(planegeometry->GetCornerPoint(0), cornerpoint0, testEps));
 
     // ok, corner was fine, so we can dare to believe the origin is ok.
     origin = planegeometry->GetOrigin();
 
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(0), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(1), 1, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), newthicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), newright, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), newbottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), newnormal, testEps));
 
     mappingTests2D(planegeometry, height, 1, heightInMM, thicknessInMM, origin, newright, newbottom);
 
     // set origin back to the one of the axial slice:
     origin = clonedplanegeometry->GetOrigin();
     // Testing backside initialization: InitializeStandardPlane(clonedplanegeometry, anatomicalplane = Axial, zPosition
     // = 0, frontside=false, rotated=true):
     planegeometry->InitializeStandardPlane(clonedplanegeometry, mitk::AnatomicalPlane::Axial, 0, false, true);
     mitk::Point3D backsideorigin;
     backsideorigin = origin + clonedplanegeometry->GetAxisVector(1); //+clonedplanegeometry->GetAxisVector(2);
 
     CPPUNIT_ASSERT_MESSAGE("Testing origin of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetOrigin(), backsideorigin, testEps));
 
     mitk::Point3D backsidecornerpoint0;
     backsidecornerpoint0 =
       cornerpoint0 + clonedplanegeometry->GetAxisVector(1); //+clonedplanegeometry->GetAxisVector(2);
     CPPUNIT_ASSERT_MESSAGE("Testing GetCornerPoint(0) of sagittally initialized version: ",
                            mitk::Equal(planegeometry->GetCornerPoint(0), backsidecornerpoint0, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of backsidedly, axially initialized version "
                            "(should be same as in mm due to unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of backsidedly, axially initialized version "
                            "(should be same as in mm due to unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in units) of backsidedly, axially initialized version "
                            "(should be same as in mm due to unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing width, height and thickness (in mm) of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), -bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of backsidedly, axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps)); // T22254: Flipped sign
 
     mappingTests2D(planegeometry, width, height, widthInMM, heightInMM, backsideorigin, right, -bottom);
   }
 
   void TestCoronalInitialization()
   {
     mitk::Point3D cornerpoint0 = planegeometry->GetCornerPoint(0);
 
     mitk::PlaneGeometry::Pointer clonedplanegeometry =
       dynamic_cast<mitk::PlaneGeometry *>(planegeometry->Clone().GetPointer());
     //--------
 
     mitk::Vector3D newright, newbottom, newnormal;
     mitk::ScalarType newthicknessInMM;
 
     // Testing InitializeStandardPlane(clonedplanegeometry, anatomicalplane = Coronal, zPosition = 0, frontside=true)
     planegeometry->InitializeStandardPlane(clonedplanegeometry, mitk::AnatomicalPlane::Coronal);
     newright = right;
     newbottom = normal;
     newbottom.Normalize();
     newbottom *= thicknessInMM;
     newthicknessInMM = heightInMM / height * 1.0 /*extent in normal direction is 1*/;
     newnormal = -bottom;
     newnormal.Normalize();
     newnormal *= newthicknessInMM;
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetCornerPoint(0) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetCornerPoint(0), cornerpoint0, testEps));
 
     // ok, corner was fine, so we can dare to believe the origin is ok.
     origin = planegeometry->GetOrigin();
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in units) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in units) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(1), 1, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in units) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in mm) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in mm) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in mm) of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), newthicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), newright, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), newbottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), -newnormal, testEps)); // T22254: Flipped sign
 
     mappingTests2D(planegeometry, width, 1, widthInMM, thicknessInMM, origin, newright, newbottom);
 
     // Changing plane to in-plane unit spacing using SetSizeInUnits:
     planegeometry->SetSizeInUnits(planegeometry->GetExtentInMM(0), planegeometry->GetExtentInMM(1));
 
     CPPUNIT_ASSERT_MESSAGE("Testing origin of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetOrigin(), origin, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(2), newthicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), newright, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), newbottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), -newnormal, testEps)); // T22254: Flipped sign
 
     mappingTests2D(planegeometry, widthInMM, thicknessInMM, widthInMM, thicknessInMM, origin, newright, newbottom);
 
     // Changing plane to unit spacing also in normal direction using SetExtentInMM(2, 1.0):
     planegeometry->SetExtentInMM(2, 1.0);
     newnormal.Normalize();
 
     CPPUNIT_ASSERT_MESSAGE("Testing origin of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetOrigin(), origin, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in units) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(1), thicknessInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE(
       "Testing width, height and thickness (in mm) of unit spaced, coronally initialized version: ",
       mitk::Equal(planegeometry->GetExtentInMM(2), 1.0, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), newright, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), newbottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of unit spaced, coronally initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), -newnormal, testEps)); // T22254: Flipped sign
     mappingTests2D(planegeometry, widthInMM, thicknessInMM, widthInMM, thicknessInMM, origin, newright, newbottom);
   }
 
   void TestAxialInitialization()
   {
     mitk::Point3D cornerpoint0 = planegeometry->GetCornerPoint(0);
 
     // Clone, move, rotate and test for 'IsParallel' and 'IsOnPlane'
     mitk::PlaneGeometry::Pointer clonedplanegeometry =
       dynamic_cast<mitk::PlaneGeometry *>(planegeometry->Clone().GetPointer());
 
     CPPUNIT_ASSERT_MESSAGE("Testing Clone(): ",
                            !((clonedplanegeometry.IsNull()) || (clonedplanegeometry->GetReferenceCount() != 1)));
 
     std::cout << "Testing InitializeStandardPlane(clonedplanegeometry, anatomicalplane = Axial, zPosition = 0, "
                  "frontside=true): "
               << std::endl;
     planegeometry->InitializeStandardPlane(clonedplanegeometry);
 
     CPPUNIT_ASSERT_MESSAGE("Testing origin of axially initialized version: ",
                            mitk::Equal(planegeometry->GetOrigin(), origin));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetCornerPoint(0) of axially initialized version: ",
                            mitk::Equal(planegeometry->GetCornerPoint(0), cornerpoint0));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in units) of axially initialized version (should be same as in mm due to "
                            "unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(0), width, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height (in units) of axially initialized version (should be same as in mm due to "
                            "unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(1), height, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in units) of axially initialized version (should be same as in mm due "
                            "to unit spacing, except for thickness, which is always 1): ",
                            mitk::Equal(planegeometry->GetExtent(2), 1, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing width (in mm) of axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(0), widthInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing height  (in mm) of axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(1), heightInMM, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing thickness (in mm) of axially initialized version: ",
                            mitk::Equal(planegeometry->GetExtentInMM(2), thicknessInMM, testEps));
 
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(0), right, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(1), bottom, testEps));
     CPPUNIT_ASSERT_MESSAGE("Testing GetAxisVector() of axially initialized version: ",
                            mitk::Equal(planegeometry->GetAxisVector(2), normal, testEps));
 
     mappingTests2D(planegeometry, width, height, widthInMM, heightInMM, origin, right, bottom);
   }
 
   void TestPlaneComparison()
   {
     // Clone, move, rotate and test for 'IsParallel' and 'IsOnPlane'
     mitk::PlaneGeometry::Pointer clonedplanegeometry2 =
       dynamic_cast<mitk::PlaneGeometry *>(planegeometry->Clone().GetPointer());
 
     CPPUNIT_ASSERT_MESSAGE("Testing Clone(): ",
                            !((clonedplanegeometry2.IsNull()) || (clonedplanegeometry2->GetReferenceCount() != 1)));
     CPPUNIT_ASSERT_MESSAGE("Testing whether original and clone are at the same position",
                            clonedplanegeometry2->IsOnPlane(planegeometry.GetPointer()));
     CPPUNIT_ASSERT_MESSAGE(" Asserting that origin is on the plane cloned plane:",
                            clonedplanegeometry2->IsOnPlane(origin));
 
     mitk::VnlVector newaxis(3);
     mitk::FillVector3D(newaxis, 1.0, 1.0, 1.0);
     newaxis.normalize();
     vnl_quaternion<mitk::ScalarType> rotation2(newaxis, 0.0);
 
     mitk::Vector3D clonednormal = clonedplanegeometry2->GetNormal();
     mitk::Point3D clonedorigin = clonedplanegeometry2->GetOrigin();
 
     auto planerot = new mitk::RotationOperation(mitk::OpROTATE, origin, clonedplanegeometry2->GetAxisVector(0), 180.0);
 
     clonedplanegeometry2->ExecuteOperation(planerot);
     CPPUNIT_ASSERT_MESSAGE(" Asserting that a flipped plane is still on the original plane: ",
                            clonedplanegeometry2->IsOnPlane(planegeometry.GetPointer()));
 
     clonedorigin += clonednormal;
     clonedplanegeometry2->SetOrigin(clonedorigin);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if the translated (cloned, flipped) plane is parallel to its origin plane: ",
                            clonedplanegeometry2->IsParallel(planegeometry));
     delete planerot;
 
     planerot = new mitk::RotationOperation(mitk::OpROTATE, origin, clonedplanegeometry2->GetAxisVector(0), 0.5);
     clonedplanegeometry2->ExecuteOperation(planerot);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if a non-parallel plane gets recognized as not parallel  [rotation +0.5 degree] : ",
                            !clonedplanegeometry2->IsParallel(planegeometry));
     delete planerot;
 
     planerot = new mitk::RotationOperation(mitk::OpROTATE, origin, clonedplanegeometry2->GetAxisVector(0), -1.0);
     clonedplanegeometry2->ExecuteOperation(planerot);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if a non-parallel plane gets recognized as not parallel  [rotation -0.5 degree] : ",
                            !clonedplanegeometry2->IsParallel(planegeometry));
     delete planerot;
 
     planerot = new mitk::RotationOperation(mitk::OpROTATE, origin, clonedplanegeometry2->GetAxisVector(0), 360.5);
     clonedplanegeometry2->ExecuteOperation(planerot);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if a non-parallel plane gets recognized as parallel  [rotation 360 degree] : ",
                            clonedplanegeometry2->IsParallel(planegeometry));
   }
 
 private:
   // helper Methods for the Tests
 
   mitk::PlaneGeometry::Pointer createPlaneGeometry()
   {
     mitk::Vector3D mySpacing;
     mySpacing[0] = 31;
     mySpacing[1] = 0.1;
     mySpacing[2] = 5.4;
     mitk::Point3D myOrigin;
     myOrigin[0] = 8;
     myOrigin[1] = 9;
     myOrigin[2] = 10;
     mitk::AffineTransform3D::Pointer myTransform = mitk::AffineTransform3D::New();
     itk::Matrix<mitk::ScalarType, 3, 3> transMatrix;
     transMatrix.Fill(0);
     transMatrix[0][0] = 1;
     transMatrix[1][1] = 2;
     transMatrix[2][2] = 4;
 
     myTransform->SetMatrix(transMatrix);
 
     mitk::PlaneGeometry::Pointer geometry2D = mitk::PlaneGeometry::New();
     geometry2D->SetIndexToWorldTransform(myTransform);
     geometry2D->SetSpacing(mySpacing);
     geometry2D->SetOrigin(myOrigin);
     return geometry2D;
   }
 
   bool compareMatrix(itk::Matrix<mitk::ScalarType, 3, 3> left, itk::Matrix<mitk::ScalarType, 3, 3> right)
   {
     bool equal = true;
     for (int i = 0; i < 3; ++i)
       for (int j = 0; j < 3; ++j)
         equal &= mitk::Equal(left[i][j], right[i][j]);
     return equal;
   }
 
   /**
    * This function tests for correct mapping and is called several times from other tests
    **/
   void mappingTests2D(const mitk::PlaneGeometry *planegeometry,
                       const mitk::ScalarType &width,
                       const mitk::ScalarType &height,
                       const mitk::ScalarType &widthInMM,
                       const mitk::ScalarType &heightInMM,
                       const mitk::Point3D &origin,
                       const mitk::Vector3D &right,
                       const mitk::Vector3D &bottom)
   {
     std::cout << "Testing mapping Map(pt2d_mm(x=widthInMM/2.3,y=heightInMM/2.5), pt3d_mm) and compare with expected: ";
     mitk::Point2D pt2d_mm;
     mitk::Point3D pt3d_mm, expected_pt3d_mm;
     pt2d_mm[0] = widthInMM / 2.3;
     pt2d_mm[1] = heightInMM / 2.5;
     expected_pt3d_mm = origin + right * (pt2d_mm[0] / right.GetNorm()) + bottom * (pt2d_mm[1] / bottom.GetNorm());
     planegeometry->Map(pt2d_mm, pt3d_mm);
     CPPUNIT_ASSERT_MESSAGE(
       "Testing mapping Map(pt2d_mm(x=widthInMM/2.3,y=heightInMM/2.5), pt3d_mm) and compare with expected",
       mitk::Equal(pt3d_mm, expected_pt3d_mm, testEps));
 
     std::cout << "Testing mapping Map(pt3d_mm, pt2d_mm) and compare with expected: ";
     mitk::Point2D testpt2d_mm;
     planegeometry->Map(pt3d_mm, testpt2d_mm);
     std::cout << std::setprecision(12) << "Expected pt2d_mm " << pt2d_mm << std::endl;
     std::cout << std::setprecision(12) << "Result testpt2d_mm " << testpt2d_mm << std::endl;
     std::cout << std::setprecision(12) << "10*mitk::eps " << 10 * mitk::eps << std::endl;
     // This eps is temporarily set to 10*mitk::eps. See bug #15037 for details.
     CPPUNIT_ASSERT_MESSAGE("Testing mapping Map(pt3d_mm, pt2d_mm) and compare with expected",
                            mitk::Equal(pt2d_mm, testpt2d_mm, 10 * mitk::eps));
 
     std::cout << "Testing IndexToWorld(pt2d_units, pt2d_mm) and compare with expected: ";
     mitk::Point2D pt2d_units;
     pt2d_units[0] = width / 2.0;
     pt2d_units[1] = height / 2.0;
     pt2d_mm[0] = widthInMM / 2.0;
     pt2d_mm[1] = heightInMM / 2.0;
     planegeometry->IndexToWorld(pt2d_units, testpt2d_mm);
     std::cout << std::setprecision(12) << "Expected pt2d_mm " << pt2d_mm << std::endl;
     std::cout << std::setprecision(12) << "Result testpt2d_mm " << testpt2d_mm << std::endl;
     std::cout << std::setprecision(12) << "10*mitk::eps " << 10 * mitk::eps << std::endl;
     // This eps is temporarily set to 10*mitk::eps. See bug #15037 for details.
     CPPUNIT_ASSERT_MESSAGE("Testing IndexToWorld(pt2d_units, pt2d_mm) and compare with expected: ",
                            mitk::Equal(pt2d_mm, testpt2d_mm, 10 * mitk::eps));
 
     std::cout << "Testing WorldToIndex(pt2d_mm, pt2d_units) and compare with expected: ";
     mitk::Point2D testpt2d_units;
     planegeometry->WorldToIndex(pt2d_mm, testpt2d_units);
 
     std::cout << std::setprecision(12) << "Expected pt2d_units " << pt2d_units << std::endl;
     std::cout << std::setprecision(12) << "Result testpt2d_units " << testpt2d_units << std::endl;
     std::cout << std::setprecision(12) << "10*mitk::eps " << 10 * mitk::eps << std::endl;
     // This eps is temporarily set to 10*mitk::eps. See bug #15037 for details.
     CPPUNIT_ASSERT_MESSAGE("Testing WorldToIndex(pt2d_mm, pt2d_units) and compare with expected:",
                            mitk::Equal(pt2d_units, testpt2d_units, 10 * mitk::eps));
   }
 };
 MITK_TEST_SUITE_REGISTRATION(mitkPlaneGeometry)
diff --git a/Modules/CppMicroServices/CMakeLists.txt b/Modules/CppMicroServices/CMakeLists.txt
index 4a7d9ca897..4a026cf4e3 100644
--- a/Modules/CppMicroServices/CMakeLists.txt
+++ b/Modules/CppMicroServices/CMakeLists.txt
@@ -1,440 +1,438 @@
 project(CppMicroServices)
 
 set(${PROJECT_NAME}_MAJOR_VERSION 2)
 set(${PROJECT_NAME}_MINOR_VERSION 99)
 set(${PROJECT_NAME}_PATCH_VERSION 0)
 set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
 
-cmake_minimum_required(VERSION 2.8.12)
-cmake_policy(VERSION 2.8.12)
-cmake_policy(SET CMP0017 NEW)
+cmake_minimum_required(VERSION ${MITK_CMAKE_MINIMUM_REQUIRED_VERSION})
 
 #-----------------------------------------------------------------------------
 # Update CMake module path
 #------------------------------------------------------------------------------
 
 set(US_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake)
 
 set(CMAKE_MODULE_PATH
   ${US_CMAKE_DIR}
   ${CMAKE_MODULE_PATH}
   )
 
 #-----------------------------------------------------------------------------
 # CMake function(s) and macro(s)
 #-----------------------------------------------------------------------------
 
 include(CMakeParseArguments)
 include(CMakePackageConfigHelpers)
 include(CheckCXXSourceCompiles)
 include(usFunctionAddResources)
 include(usFunctionEmbedResources)
 include(usFunctionGetResourceSource)
 include(usFunctionCheckResourceLinking)
 include(usFunctionCheckCompilerFlags)
 include(usFunctionGetGccVersion)
 include(usFunctionGenerateModuleInit)
 include(usMacroCreateModule)
 
 if(US_BUILD_TESTING)
   include(usFunctionCompileSnippets)
 endif()
 
 #-----------------------------------------------------------------------------
 # Init output directories
 #-----------------------------------------------------------------------------
 
 set(US_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
 set(US_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
 set(US_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
 
 foreach(_type ARCHIVE LIBRARY RUNTIME)
   if(NOT CMAKE_${_type}_OUTPUT_DIRECTORY)
     set(CMAKE_${_type}_OUTPUT_DIRECTORY ${US_${_type}_OUTPUT_DIRECTORY})
   endif()
 endforeach()
 
 #-----------------------------------------------------------------------------
 # 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()
 
 #-----------------------------------------------------------------------------
 # CMake options
 #-----------------------------------------------------------------------------
 
 function(us_cache_var _var_name _var_default _var_type _var_help)
   set(_advanced 0)
   set(_force)
   foreach(_argn ${ARGN})
     if(_argn STREQUAL ADVANCED)
       set(_advanced 1)
     elseif(_argn STREQUAL FORCE)
       set(_force FORCE)
     endif()
   endforeach()
 
   if(US_IS_EMBEDDED)
     if(NOT DEFINED ${_var_name} OR _force)
       set(${_var_name} ${_var_default} PARENT_SCOPE)
     endif()
   else()
     set(${_var_name} ${_var_default} CACHE ${_var_type} "${_var_help}" ${_force})
     if(_advanced)
       mark_as_advanced(${_var_name})
     endif()
   endif()
 endfunction()
 
 # Determine if we are being build inside a larger project
 if(NOT DEFINED US_IS_EMBEDDED)
   if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
     set(US_IS_EMBEDDED 0)
   else()
     set(US_IS_EMBEDDED 1)
   endif()
 endif()
 
 # Determine the name of the install component for "SDK" artifacts.
 # The default is "sdk"
 if(NOT DEFINED US_SDK_INSTALL_COMPONENT)
   set(US_SDK_INSTALL_COMPONENT COMPONENT sdk)
 elseif(US_SDK_INSTALL_COMPONENT)
   set(US_SDK_INSTALL_COMPONENT COMPONENT ${US_SDK_INSTALL_COMPONENT})
 endif()
 
 us_cache_var(US_ENABLE_AUTOLOADING_SUPPORT OFF BOOL "Enable module auto-loading support")
 us_cache_var(US_ENABLE_THREADING_SUPPORT OFF BOOL "Enable threading support")
 us_cache_var(US_ENABLE_DEBUG_OUTPUT OFF BOOL "Enable debug messages" ADVANCED)
 us_cache_var(US_BUILD_SHARED_LIBS ON BOOL "Build shared libraries")
 us_cache_var(US_BUILD_TESTING OFF BOOL "Build tests")
 us_cache_var(US_BUILD_EXAMPLES OFF BOOL "Build example projects")
 
 if(US_BUILD_TESTING)
   enable_testing()
 endif()
 
 if(WIN32 AND NOT CYGWIN)
   set(default_runtime_install_dir bin/)
   set(default_library_install_dir bin/)
   set(default_archive_install_dir lib/)
   set(default_header_install_dir include/)
   set(default_auxiliary_install_dir share/)
 else()
   set(default_runtime_install_dir bin/)
   set(default_library_install_dir lib/${PROJECT_NAME})
   set(default_archive_install_dir lib/${PROJECT_NAME})
   set(default_header_install_dir include/${PROJECT_NAME})
   set(default_auxiliary_install_dir share/${PROJECT_NAME})
 endif()
 
 us_cache_var(RUNTIME_INSTALL_DIR ${default_runtime_install_dir} STRING "Relative install location for binaries" ADVANCED)
 us_cache_var(LIBRARY_INSTALL_DIR ${default_library_install_dir} STRING "Relative install location for libraries" ADVANCED)
 us_cache_var(ARCHIVE_INSTALL_DIR ${default_archive_install_dir} STRING "Relative install location for archives" ADVANCED)
 us_cache_var(HEADER_INSTALL_DIR ${default_header_install_dir} STRING "Relative install location for headers" ADVANCED)
 us_cache_var(AUXILIARY_INSTALL_DIR ${default_auxiliary_install_dir} STRING "Relative install location for auxiliary files" ADVANCED)
 set(AUXILIARY_CMAKE_INSTALL_DIR ${AUXILIARY_INSTALL_DIR}/cmake)
 
 us_cache_var(US_NAMESPACE "us" STRING "The namespace for the C++ Micro Services symbols")
 
 set(BUILD_SHARED_LIBS ${US_BUILD_SHARED_LIBS})
 
 set(US_MODULE_INIT_TEMPLATE "${US_CMAKE_DIR}/usModuleInit.cpp" CACHE INTERNAL "The module initialization template code")
 set(US_RESOURCE_RC_TEMPLATE "${US_CMAKE_DIR}/us_resources.rc.in" CACHE INTERNAL "The Windows RC resource template")
 set(US_CMAKE_RESOURCE_DEPENDENCIES_CPP "${US_CMAKE_DIR}/usCMakeResourceDependencies.cpp" CACHE INTERNAL "The dummy resource dependencies code")
 
 #-----------------------------------------------------------------------------
 # US C/CXX Flags
 #-----------------------------------------------------------------------------
 
 if(US_IS_EMBEDDED)
   set(CMAKE_C_FLAGS)
   set(CMAKE_C_FLAGS_RELEASE)
   set(CMAKE_C_FLAGS_DEBUG)
   set(CMAKE_CXX_FLAGS)
   set(CMAKE_CXX_FLAGS_RELEASE)
   set(CMAKE_CXX_FLAGS_DEBUG)
   set(CMAKE_LINK_FLAGS)
   set(CMAKE_LINK_FLAGS_RELEASE)
   set(CMAKE_LINK_FLAGS_DEBUG)
 endif()
 
 # Set C++ compiler flags
 if(NOT MSVC)
   foreach(_cxxflag -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor
                    -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option -Wno-error=deprecated-copy
                    -Wno-error=implicit-int-float-conversion)
     usFunctionCheckCompilerFlags(${_cxxflag} US_CXX_FLAGS)
   endforeach()
 endif()
 
 set(US_HAVE_VISIBILITY_ATTRIBUTE 0)
 usFunctionCheckCompilerFlags("-fvisibility=hidden -fvisibility-inlines-hidden" _have_visibility)
 if(_have_visibility)
   set(US_HAVE_VISIBILITY_ATTRIBUTE 1)
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
 
   usFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
   if(${GCC_VERSION} VERSION_LESS "4.0.0")
     message(FATAL_ERROR "gcc version ${GCC_VERSION} not supported. Please use gcc >= 4.")
   endif()
 
   # With older versions of gcc the flag -fstack-protector-all requires an extra dependency to libssp.so.
   # If the gcc version is lower than 4.4.0 and the build type is Release let's not include the flag.
   if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
     usFunctionCheckCompilerFlags("-fstack-protector-all" US_CXX_FLAGS)
   endif()
 
   # Enable visibility support (only for gcc >= 4.5)
   # We only support hidden visibility with gcc for now.
   #
   # Clang has troubles with correctly marking template declarations and explicit template
   # instantiations as exported across shared library boundaries. Specifically, comparing
   # type_info objects from STL types does not work (used in us::Any::Type() == typeid(std::string))
   # which could be related to the default visibility of STL types declared in libstdc++ and/or libc++
   # but also to using RTLD_LOCAL or RTLD_GLOBAL when loading shared libraries via dlopen().
   #
   if(_have_visibility AND NOT ${GCC_VERSION} VERSION_LESS "4.5")
     set(US_CXX_FLAGS "${US_CXX_FLAGS} ${_have_visibility}")
   else()
     set(US_GCC_RTTI_WORKAROUND_NEEDED 1)
   endif()
 
   usFunctionCheckCompilerFlags("-O1 -D_FORTIFY_SOURCE=2" _fortify_source_flag)
   if(_fortify_source_flag)
     set(US_CXX_FLAGS_RELEASE "${US_CXX_FLAGS_RELEASE} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
   endif()
 endif()
 
 if(MSVC)
   set(US_CXX_FLAGS "/MP /WX /wd4180 /wd4996 /wd4251 /wd4503 ${US_CXX_FLAGS}")
 endif()
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${US_CXX_FLAGS}")
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${US_CXX_FLAGS_RELEASE}")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${US_C_FLAGS}")
 set(CMAKE_C_FLAGS_REALEASE "${CMAKE_C_FLAGS_RELEASE} ${US_C_FLAGS_RELEASE}")
 
 #-----------------------------------------------------------------------------
 # US Link Flags
 #-----------------------------------------------------------------------------
 
 set(US_LINK_FLAGS )
 if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
   foreach(_linkflag -Wl,--no-undefined)
     set(_add_flag)
     usFunctionCheckCompilerFlags("${_linkflag}" _add_flag)
     if(_add_flag)
       set(US_LINK_FLAGS "${US_LINK_FLAGS} ${_linkflag}")
     endif()
   endforeach()
 endif()
 
 usFunctionCheckResourceLinking()
 
 #-----------------------------------------------------------------------------
 # US Header Checks
 #-----------------------------------------------------------------------------
 
 include(CheckIncludeFileCXX)
 include(CheckCXXSourceCompiles)
 
 CHECK_INCLUDE_FILE_CXX(cxxabi.h US_HAVE_CXXABI_H)
 CHECK_INCLUDE_FILE_CXX(stdint.h US_HAVE_STDINT_H)
 CHECK_INCLUDE_FILE_CXX(tr1/unordered_map US_HAVE_TR1_UNORDERED_MAP_H)
 CHECK_INCLUDE_FILE_CXX(tr1/unordered_set US_HAVE_TR1_UNORDERED_SET_H)
 CHECK_INCLUDE_FILE_CXX(tr1/functional US_HAVE_TR1_FUNCTIONAL_H)
 CHECK_INCLUDE_FILE_CXX(unordered_map US_HAVE_UNORDERED_MAP_H)
 CHECK_INCLUDE_FILE_CXX(unordered_set US_HAVE_UNORDERED_SET_H)
 CHECK_INCLUDE_FILE_CXX(functional US_HAVE_FUNCTIONAL_H)
 
 if(US_HAVE_UNORDERED_MAP_H)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nint main() { std::tr1::unordered_map<int,int> m; return 0; }"
                             US_HAVE_TR1_UNORDERED_MAP)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nint main() { std::unordered_map<int,int> m; return 0; }"
                             US_HAVE_STD_UNORDERED_MAP)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nint main() { std::tr1::hash<int>(); return 0; }"
                             US_HAVE_TR1_HASH)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nint main() { std::hash<int>(); return 0; }"
                             US_HAVE_STD_HASH)
   if(US_HAVE_STD_HASH)
     CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nstruct A { friend struct std::hash<int>; }; int main() { return 0; }"
                               US_HAVE_STD_HASH_STRUCT)
     CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nstruct A { friend class std::hash<int>; }; int main() { return 0; }"
                               US_HAVE_STD_HASH_CLASS)
   elseif(US_HAVE_TR1_HASH)
     CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nstruct A { friend struct std::tr1::hash<int>; }; int main() { return 0; }"
                               US_HAVE_TR1_HASH_STRUCT)
     CHECK_CXX_SOURCE_COMPILES("#include <unordered_map>\nstruct A { friend class std::tr1::hash<int>; }; int main() { return 0; }"
                               US_HAVE_TR1_HASH_CLASS)
   endif()
 elseif(US_HAVE_TR1_UNORDERED_MAP_H)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nint main() { std::tr1::unordered_map<int,int> m; return 0; }"
                             US_HAVE_TR1_UNORDERED_MAP)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nint main() { std::unordered_map<int,int> m; return 0; }"
                             US_HAVE_STD_UNORDERED_MAP)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nint main() { std::tr1::hash<int>(); return 0; }"
                             US_HAVE_TR1_HASH)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nint main() { std::hash<int>(); return 0; }"
                             US_HAVE_STD_HASH)
   if(US_HAVE_STD_HASH)
     CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nstruct A { friend struct std::hash<int>; }; int main() { return 0; }"
                               US_HAVE_STD_HASH_STRUCT)
     CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nstruct A { friend class std::hash<int>; }; int main() { return 0; }"
                               US_HAVE_STD_HASH_CLASS)
   elseif(US_HAVE_TR1_HASH)
     CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nstruct A { friend struct std::tr1::hash<int>; }; int main() { return 0; }"
                               US_HAVE_TR1_HASH_STRUCT)
     CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_map>\nstruct A { friend class std::tr1::hash<int>; }; int main() { return 0; }"
                               US_HAVE_TR1_HASH_CLASS)
   endif()
 else()
   message(SEND_ERROR "The header file \"unordered_map\" is not available.")
 endif()
 if(NOT (US_HAVE_TR1_UNORDERED_MAP OR US_HAVE_STD_UNORDERED_MAP))
   message(SEND_ERROR "The \"unordered_map\" type is not available.")
 endif()
 
 if(US_HAVE_UNORDERED_SET_H)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_set>\nint main() { std::tr1::unordered_set<int> s; return 0; }"
                             US_HAVE_TR1_UNORDERED_SET)
   CHECK_CXX_SOURCE_COMPILES("#include <unordered_set>\nint main() { std::unordered_set<int> s; return 0; }"
                             US_HAVE_STD_UNORDERED_SET)
 elseif(US_HAVE_TR1_UNORDERED_SET_H)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_set>\nint main() { std::tr1::unordered_set<int> s; return 0; }"
                             US_HAVE_TR1_UNORDERED_SET)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/unordered_set>\nint main() { std::unordered_set<int> s; return 0; }"
                             US_HAVE_STD_UNORDERED_SET)
 else()
   message(SEND_ERROR "The header file \"unordered_set\" is not available.")
 endif()
 if(NOT (US_HAVE_TR1_UNORDERED_SET OR US_HAVE_STD_UNORDERED_SET))
   message(SEND_ERROR "The \"unordered_set\" type is not available.")
 endif()
 
 if(NOT (US_HAVE_FUNCTIONAL_H OR US_HAVE_TR1_FUNCTIONAL_H))
   message(SEND_ERROR "The header file \"functional\" is not available.")
 endif()
 
 if(US_HAVE_FUNCTIONAL_H)
   CHECK_CXX_SOURCE_COMPILES("#include <functional>\nint main() { std::tr1::function<int(void)> f(main); return 0; }"
                             US_HAVE_TR1_FUNCTION)
   CHECK_CXX_SOURCE_COMPILES("#include <functional>\nint main() { std::function<int(void)> f(main); return 0; }"
                             US_HAVE_STD_FUNCTION)
 endif()
 if((NOT (US_HAVE_STD_FUNCTION OR US_HAVE_TR1_FUNCTION)) AND US_HAVE_TR1_FUNCTIONAL_H)
   unset(US_HAVE_TR1_FUNCTION CACHE)
   unset(US_HAVE_STD_FUNCTION CACHE)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/functional>\nint main() { std::tr1::function<int(void)> f(main); return 0; }"
                             US_HAVE_TR1_FUNCTION)
   CHECK_CXX_SOURCE_COMPILES("#include <tr1/functional>\nint main() { std::function<int(void)> f(main); return 0; }"
                             US_HAVE_STD_FUNCTION)
 endif()
 
 if(NOT (US_HAVE_STD_FUNCTION OR US_HAVE_TR1_FUNCTION))
   message(SEND_ERROR "The \"function\" type is not available.")
 endif()
 
 #-----------------------------------------------------------------------------
 # Source directory
 #-----------------------------------------------------------------------------
 
 set(US_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third_party ${PROJECT_BINARY_DIR}/include)
 
 # Configure CppMicroServicesConfig.cmake for the build tree.
 # The file is used in sub-directories.
 
 set(PACKAGE_CONFIG_INCLUDE_DIR ${US_INCLUDE_DIRS})
 set(PACKAGE_CONFIG_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
 set(PACKAGE_CONFIG_CMAKE_DIR ${US_CMAKE_DIR})
 
 set(US_RCC_EXECUTABLE_NAME usResourceCompiler CACHE INTERNAL "The target name of the usResourceCompiler executable.")
 
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
   ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
   @ONLY
   )
 
 set(us_global_config_h_file "${PROJECT_BINARY_DIR}/include/usGlobalConfig.h")
 configure_file(${US_CMAKE_DIR}/usGlobalConfig.h.in ${us_global_config_h_file})
 
 include_directories(${US_INCLUDE_DIRS})
 
 add_subdirectory(tools)
 
 add_subdirectory(core)
 
 #-----------------------------------------------------------------------------
 # Documentation
 #-----------------------------------------------------------------------------
 
 add_subdirectory(doc)
 
 #-----------------------------------------------------------------------------
 # Last configuration and install steps
 #-----------------------------------------------------------------------------
 
 # Version information
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
   @ONLY
   )
 
 export(TARGETS ${US_RCC_EXECUTABLE_NAME}
        FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
 
 if(NOT US_NO_INSTALL)
 
   install(EXPORT ${PROJECT_NAME}Targets
           FILE ${PROJECT_NAME}Targets.cmake
           DESTINATION ${AUXILIARY_CMAKE_INSTALL_DIR})
 
   set(_install_cmake_scripts
     ${US_MODULE_INIT_TEMPLATE}
     ${US_CMAKE_RESOURCE_DEPENDENCIES_CPP}
     ${US_CMAKE_DIR}/usFunctionGenerateModuleInit.cmake
     ${US_CMAKE_DIR}/usFunctionAddResources.cmake
     ${US_CMAKE_DIR}/usFunctionEmbedResources.cmake
     ${US_CMAKE_DIR}/usFunctionGetResourceSource.cmake
     ${US_CMAKE_DIR}/usFunctionCheckResourceLinking.cmake
     ${US_CMAKE_DIR}/usFunctionCheckCompilerFlags.cmake
     )
 
   install(FILES ${_install_cmake_scripts}
           DESTINATION ${AUXILIARY_CMAKE_INSTALL_DIR})
 
   install(FILES ${us_global_config_h_file}
           DESTINATION ${HEADER_INSTALL_DIR})
 
   # Configure CppMicroServicesConfig.cmake for the install tree
   set(CONFIG_INCLUDE_DIR ${HEADER_INSTALL_DIR})
   set(CONFIG_RUNTIME_DIR ${RUNTIME_INSTALL_DIR})
   set(CONFIG_CMAKE_DIR ${AUXILIARY_CMAKE_INSTALL_DIR})
   configure_package_config_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
     ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake
     INSTALL_DESTINATION ${AUXILIARY_CMAKE_INSTALL_DIR}
     PATH_VARS CONFIG_INCLUDE_DIR CONFIG_RUNTIME_DIR CONFIG_CMAKE_DIR
     NO_SET_AND_CHECK_MACRO
     NO_CHECK_REQUIRED_COMPONENTS_MACRO
     )
 
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake
                 ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
           DESTINATION ${AUXILIARY_CMAKE_INSTALL_DIR}
           ${US_SDK_INSTALL_COMPONENT}
     )
 
 endif()
diff --git a/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp
index 6c62aaf983..c9688f320c 100644
--- a/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp
+++ b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp
@@ -1,64 +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.
 
 ============================================================================*/
 
 
 #include <usModuleActivator.h>
 #include <usModuleContext.h>
 
 #include <mitkModelFitProviderBase.h>
 
 //general models
 #include "mitkGenericParamModelFactory.h"
 #include "mitkLinearModelFactory.h"
-#include "mitkT2DecayModelFactory.h"
+#include "mitkExponentialDecayModelFactory.h"
 #include "mitkExpDecayOffsetModelFactory.h"
 #include "mitkExponentialSaturationModelFactory.h"
+#include "mitkTwoStepLinearModelFactory.h"
+#include "mitkThreeStepLinearModelFactory.h"
 
 namespace mitk
 {
 
 /*
  * This is the module activator for the IO aspects of the "ModelFit" module.
  */
 class ModelFitModelsActivator : public us::ModuleActivator
 {
 public:
 
   template <class TProvider> void RegisterProvider(us::ModuleContext* context)
   {
     auto provider = new TProvider();
     provider->RegisterService(context);
 
     m_RegisteredProviders.push_back(std::unique_ptr<IModelFitProvider>(provider));
   }
 
   void Load(us::ModuleContext* context) override
   {
     m_RegisteredProviders.clear();
     RegisterProvider<mitk::ModelFitProviderBase<mitk::GenericParamModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::LinearModelFactory> >(context);
-    RegisterProvider<mitk::ModelFitProviderBase<mitk::T2DecayModelFactory> >(context);
+    RegisterProvider<mitk::ModelFitProviderBase<mitk::ExponentialDecayModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::ExpDecayOffsetModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::ExponentialSaturationModelFactory> >(context);
+    RegisterProvider<mitk::ModelFitProviderBase<mitk::TwoStepLinearModelFactory> >(context);
+    RegisterProvider<mitk::ModelFitProviderBase<mitk::ThreeStepLinearModelFactory> >(context);
   }
 
   void Unload(us::ModuleContext* ) override
   {
   }
 
 private:
   std::vector<std::unique_ptr<IModelFitProvider> > m_RegisteredProviders;
 };
 
 }
 
 US_EXPORT_MODULE_ACTIVATOR(mitk::ModelFitModelsActivator)
diff --git a/Modules/ModelFit/files.cmake b/Modules/ModelFit/files.cmake
index 97c70eaeb0..2749ab3b99 100644
--- a/Modules/ModelFit/files.cmake
+++ b/Modules/ModelFit/files.cmake
@@ -1,82 +1,88 @@
 file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
 
 set(CPP_FILES
   Common/mitkExtractTimeGrid.cpp
   Common/mitkTimeGridHelper.cpp
   Common/mitkMaskedDynamicImageStatisticsGenerator.cpp
   Common/mitkModelFitConstants.cpp
   Common/mitkModelFitParameter.cpp
   Common/mitkModelFitCmdAppsHelper.cpp
   Common/mitkParameterFitImageGeneratorBase.cpp
   Common/mitkPixelBasedParameterFitImageGenerator.cpp
   Common/mitkROIBasedParameterFitImageGenerator.cpp
   Common/mitkModelFitInfo.cpp
   Common/mitkModelFitStaticParameterMap.cpp
   Common/mitkModelGenerator.cpp
   Common/mitkModelFitResultHelper.cpp
   Common/mitkScalarListLookupTable.cpp
   Common/mitkScalarListLookupTableProperty.cpp
   Common/mitkScalarListLookupTablePropertySerializer.cpp
   Common/mitkIModelFitProvider.cpp
   Common/mitkModelFitParameterValueExtraction.cpp
   Common/mitkBinaryImageToLabelSetImageFilter.cpp
   Common/mitkFormulaParser.cpp
   Common/mitkFresnel.cpp
   Common/mitkModelFitPlotDataHelper.cpp
   Common/mitkModelSignalImageGenerator.cpp
   Common/mitkModelFitResultRelationRule.cpp
   Functors/mitkSimpleFunctorBase.cpp
   Functors/mitkSimpleFunctorPolicy.cpp
   Functors/mitkChiSquareFitCostFunction.cpp
   Functors/mitkReducedChiSquareFitCostFunction.cpp
   Functors/mitkConstraintCheckerBase.cpp
   Functors/mitkSimpleBarrierConstraintChecker.cpp
   Functors/mitkSquaredDifferencesFitCostFunction.cpp
   Functors/mitkSumOfSquaredDifferencesFitCostFunction.cpp
   Functors/mitkMVConstrainedCostFunctionDecorator.cpp
   Functors/mitkMVModelFitCostFunction.cpp
   Functors/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.cpp
   Functors/mitkSVModelFitCostFunction.cpp
   Functors/mitkModelFitFunctorBase.cpp
   Functors/mitkLevenbergMarquardtModelFitFunctor.cpp
   Functors/mitkDummyModelFitFunctor.cpp
   Functors/mitkModelFitInfoSignalGenerationFunctor.cpp
   Functors/mitkIndexedValueFunctorPolicy.cpp
   Functors/mitkModelDataGenerationFunctor.cpp
   Models/mitkModelBase.cpp
   Models/mitkModelFactoryBase.cpp
   Models/mitkModelParameterizerBase.cpp
   Models/mitkLinearModel.cpp
   Models/mitkLinearModelFactory.cpp
   Models/mitkInitialParameterizationDelegateBase.cpp
   Models/mitkImageBasedParameterizationDelegate.cpp
   Models/mitkGenericParamModel.cpp
   Models/mitkGenericParamModelFactory.cpp
   Models/mitkGenericParamModelParameterizer.cpp
   Models/mitkValueBasedParameterizationDelegate.cpp
-  Models/mitkT2DecayModel.cpp
-  Models/mitkT2DecayModelFactory.cpp
-  Models/mitkT2DecayModelParameterizer.cpp
+  Models/mitkExponentialDecayModel.cpp
+  Models/mitkExponentialDecayModelFactory.cpp
+  Models/mitkExponentialDecayModelParameterizer.cpp
   Models/mitkExponentialSaturationModel.cpp
   Models/mitkExponentialSaturationModelFactory.cpp
   Models/mitkExponentialSaturationModelParameterizer.cpp
   Models/mitkExpDecayOffsetModel.cpp
   Models/mitkExpDecayOffsetModelFactory.cpp
   Models/mitkExpDecayOffsetModelParameterizer.cpp
+  Models/mitkTwoStepLinearModel.cpp
+  Models/mitkTwoStepLinearModelFactory.cpp
+  Models/mitkTwoStepLinearModelParameterizer.cpp
+  Models/mitkThreeStepLinearModel.cpp
+  Models/mitkThreeStepLinearModelFactory.cpp
+  Models/mitkThreeStepLinearModelParameterizer.cpp
   TestingHelper/mitkTestModel.cpp
   TestingHelper/mitkTestModelFactory.cpp
 )
 
 set(TPP_FILES
     include/itkMultiOutputNaryFunctorImageFilter.tpp
     include/itkMaskedStatisticsImageFilter.hxx
     include/itkMaskedNaryStatisticsImageFilter.hxx
 	include/mitkModelFitProviderBase.tpp
 )
 
 set(HXX_FILES
 )
 
 
 set(MOC_H_FILES
 )
diff --git a/Modules/ModelFit/include/mitkExpDecayOffsetModel.h b/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
index 33d286984b..e9b779f3bf 100644
--- a/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
+++ b/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
@@ -1,87 +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 mitkExpDecayOffsetModel_h
 #define mitkExpDecayOffsetModel_h
 
 #include "mitkModelBase.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
   /** @class ExpDecayOffsetModel
    * @brief Implementation of a general exponential decay model with offset,
-   * following the function: f(x) = a * exp(-1.0 * x * b) + c.
+   * following the function: y(x) = y-intercept * exp(-rate*x) + baseline.
    */
   class MITKMODELFIT_EXPORT ExpDecayOffsetModel : public mitk::ModelBase
   {
 
   public:
     typedef ExpDecayOffsetModel 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(ExpDecayOffsetModel, ModelBase);
 
-    std::string GetModelDisplayName() const override;
+    static const std::string NAME_PARAMETER_y0;
+    static const std::string NAME_PARAMETER_k;
+    static const std::string NAME_PARAMETER_y_bl;
 
-    std::string GetModelType() const override;
+    static const unsigned int NUMBER_OF_PARAMETERS;
 
-    FunctionStringType GetFunctionString() const override;
+    static const std::string UNIT_PARAMETER_y0;
+    static const std::string UNIT_PARAMETER_k;
+    static const std::string UNIT_PARAMETER_y_bl;
 
-    std::string GetXName() const override;
+    static const unsigned int POSITION_PARAMETER_y0;
+    static const unsigned int POSITION_PARAMETER_k;
+    static const unsigned int POSITION_PARAMETER_y_bl;
+
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
+    ParamterUnitMapType GetParameterUnits() const override;
+
     ParameterNamesType GetStaticParameterNames() const override;
 
     ParametersSizeType GetNumberOfStaticParameters() const override;
 
+    std::string GetModelDisplayName() const override;
+
+    std::string GetModelType() const override;
+
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
+
+    std::string GetYAxisUnit() const override;
+
   protected:
     ExpDecayOffsetModel() {};
     ~ExpDecayOffsetModel() 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;
 
   private:
 
     //No copy constructor allowed
     ExpDecayOffsetModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 }
 
 #endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModel.h b/Modules/ModelFit/include/mitkExponentialDecayModel.h
similarity index 54%
rename from Modules/ModelFit/include/mitkT2DecayModel.h
rename to Modules/ModelFit/include/mitkExponentialDecayModel.h
index 7bb5f48409..60797f420b 100644
--- a/Modules/ModelFit/include/mitkT2DecayModel.h
+++ b/Modules/ModelFit/include/mitkExponentialDecayModel.h
@@ -1,95 +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 mitkT2DecayModel_h
-#define mitkT2DecayModel_h
+#ifndef mitkExponentialDecayModel_h
+#define mitkExponentialDecayModel_h
 
 #include "mitkModelBase.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
-  /** @class T2DecayModel
-  * @brief Simple model of the MR T2 signal decay. This corresponds to an exponential decay in the form of:
-  * f(t) = M0 * exp(-t/T2) with T2 being the transverse / spin-spin relaxation time. The derived parameter R2
-  * is calculated from T2 by inversion.
+  /** @class ExponentialDecayModel
+  * @brief Simple model of exponential decay in the form of:
+  * y(x) = y-intercept * exp(-x/lambda) with lambda being the decay constant.
   */
-  class MITKMODELFIT_EXPORT T2DecayModel : public mitk::ModelBase
+  class MITKMODELFIT_EXPORT ExponentialDecayModel : public mitk::ModelBase
   {
 
   public:
-    typedef T2DecayModel Self;
+    typedef ExponentialDecayModel 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(T2DecayModel, ModelBase);
+    itkTypeMacro(ExponentialDecayModel, ModelBase);
 
-    std::string GetModelDisplayName() const override;
 
-    std::string GetModelType() const override;
+    static const std::string NAME_PARAMETER_y0;
+    static const std::string NAME_PARAMETER_lambda;
 
-    FunctionStringType GetFunctionString() const override;
+    static const unsigned int NUMBER_OF_PARAMETERS;
 
-    std::string GetXName() const override;
+    static const std::string UNIT_PARAMETER_y0;
+    static const std::string UNIT_PARAMETER_lambda;
+
+    static const unsigned int POSITION_PARAMETER_y0;
+    static const unsigned int POSITION_PARAMETER_lambda;
+
+    static const std::string NAME_DERIVED_PARAMETER_k;
+
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
+
+    static const std::string UNIT_DERIVED_PARAMETER_k;
+
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
+    ParamterUnitMapType GetParameterUnits() const override;
+
+    ParameterNamesType GetDerivedParameterNames() const override;
+
+    ParametersSizeType  GetNumberOfDerivedParameters() const override;
+
+    ParamterUnitMapType GetDerivedParameterUnits() const override;
+
     ParameterNamesType GetStaticParameterNames() const override;
 
     ParametersSizeType GetNumberOfStaticParameters() const override;
 
-    DerivedParametersSizeType GetNumberOfDerivedParameters() const override;
+    std::string GetModelDisplayName() const override;
+
+    std::string GetModelType() const override;
+
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
 
-    DerivedParameterNamesType GetDerivedParameterNames() const override;
+    std::string GetYAxisUnit() const override;
 
     mitk::ModelBase::DerivedParameterMapType ComputeDerivedParameters(
       const mitk::ModelBase::ParametersType &parameters) const;
 
   protected:
-    T2DecayModel() {};
-    ~T2DecayModel() override {};
+    ExponentialDecayModel() {};
+    ~ExponentialDecayModel() 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;
 
   private:
 
     //No copy constructor allowed
-    T2DecayModel(const Self& source);
+    ExponentialDecayModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 }
 
 #endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModelFactory.h b/Modules/ModelFit/include/mitkExponentialDecayModelFactory.h
similarity index 66%
rename from Modules/ModelFit/include/mitkT2DecayModelFactory.h
rename to Modules/ModelFit/include/mitkExponentialDecayModelFactory.h
index c3553fe9c1..2a7c1ded12 100644
--- a/Modules/ModelFit/include/mitkT2DecayModelFactory.h
+++ b/Modules/ModelFit/include/mitkExponentialDecayModelFactory.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 mitkT2DecayModelFactory_h
-#define mitkT2DecayModelFactory_h
+#ifndef mitkExponentialDecayModelFactory_h
+#define mitkExponentialDecayModelFactory_h
 
 #include <mitkCommon.h>
 
 #include "mitkConcreteModelFactoryBase.h"
-#include "mitkT2DecayModel.h"
+#include "mitkExponentialDecayModel.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
-  class MITKMODELFIT_EXPORT T2DecayModelFactory : public ConcreteModelFactoryBase<T2DecayModel>
+  class MITKMODELFIT_EXPORT ExponentialDecayModelFactory : public ConcreteModelFactoryBase<ExponentialDecayModel>
   {
   public:
-    mitkClassMacroItkParent(T2DecayModelFactory, ConcreteModelFactoryBase<T2DecayModel>);
+    mitkClassMacroItkParent(ExponentialDecayModelFactory, ConcreteModelFactoryBase<ExponentialDecayModel>);
     itkFactorylessNewMacro(Self);
 
     ParametersType GetDefaultInitialParameterization() const override;
 
     ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
 
   protected:
     ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
     const override;
 
-    T2DecayModelFactory();
+    ExponentialDecayModelFactory();
 
-    ~T2DecayModelFactory() override;
+    ~ExponentialDecayModelFactory() override;
 
   private:
 
     //No copy constructor allowed
-    T2DecayModelFactory(const Self& source);
+    ExponentialDecayModelFactory(const Self& source);
     void operator=(const Self&);  //purposely not implemented
   };
 }
 
 
 #endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h b/Modules/ModelFit/include/mitkExponentialDecayModelParameterizer.h
similarity index 66%
rename from Modules/ModelFit/include/mitkT2DecayModelParameterizer.h
rename to Modules/ModelFit/include/mitkExponentialDecayModelParameterizer.h
index 3f4fe5e092..2606384594 100644
--- a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkExponentialDecayModelParameterizer.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 mitkT2DecayModelParameterizer_h
-#define mitkT2DecayModelParameterizer_h
+#ifndef mitkExponentialDecayModelParameterizer_h
+#define mitkExponentialDecayModelParameterizer_h
 
 #include "mitkConcreteModelParameterizerBase.h"
-#include "mitkT2DecayModel.h"
+#include "mitkExponentialDecayModel.h"
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
-  class MITKMODELFIT_EXPORT T2DecayModelParameterizer : public
-    mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel>
+  class MITKMODELFIT_EXPORT ExponentialDecayModelParameterizer : public
+    mitk::ConcreteModelParameterizerBase<mitk::ExponentialDecayModel>
   {
   public:
-    typedef T2DecayModelParameterizer Self;
-    typedef mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel> Superclass;
+    typedef ExponentialDecayModelParameterizer Self;
+    typedef mitk::ConcreteModelParameterizerBase<mitk::ExponentialDecayModel> Superclass;
     typedef itk::SmartPointer< Self >                            Pointer;
     typedef itk::SmartPointer< const Self >                      ConstPointer;
 
-    itkTypeMacro(T2DecayModelParameterizer,
-      mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel>);
+    itkTypeMacro(ExponentialDecayModelParameterizer,
+      mitk::ConcreteModelParameterizerBase<mitk::ExponentialDecayModel>);
     itkFactorylessNewMacro(Self);
 
     typedef Superclass::ModelBaseType ModelBaseType;
     typedef Superclass::ModelBasePointer ModelBasePointer;
 
     typedef Superclass::ModelType ModelType;
     typedef ModelType::Pointer ModelPointer;
 
     typedef Superclass::StaticParameterValueType StaticParameterValueType;
     typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
     typedef  Superclass::StaticParameterMapType StaticParameterMapType;
 
     typedef Superclass::IndexType IndexType;
 
     ParametersType GetDefaultInitialParameterization() const override;
 
   protected:
-    T2DecayModelParameterizer();
+    ExponentialDecayModelParameterizer();
 
-    ~T2DecayModelParameterizer() override;
+    ~ExponentialDecayModelParameterizer() override;
 
   private:
 
     //No copy constructor allowed
-    T2DecayModelParameterizer(const Self& source);
+    ExponentialDecayModelParameterizer(const Self& source);
     void operator=(const Self&);  //purposely not implemented
   };
 }
 
 #endif
diff --git a/Modules/ModelFit/include/mitkExponentialSaturationModel.h b/Modules/ModelFit/include/mitkExponentialSaturationModel.h
index 7072660796..daba982745 100644
--- a/Modules/ModelFit/include/mitkExponentialSaturationModel.h
+++ b/Modules/ModelFit/include/mitkExponentialSaturationModel.h
@@ -1,86 +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 __MITK_EXPONENTIAL_SATURATION_MODEL_H_
 #define __MITK_EXPONENTIAL_SATURATION_MODEL_H_
 
 #include "mitkModelBase.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
   /** @class ExponentialSaturationModel
-  * @brief This genric model has the form: if x<BAT f(x) = S0 , else f(x) = A * (1-exp(-*B(x-BAT)))
+  * @brief This genric model has the form: if x<onset: y(x) = baseline , else: y(x) = baseline + (y_final-baseline) * (1 - exp(-rate*(x-onset)))
   */
   class MITKMODELFIT_EXPORT ExponentialSaturationModel : public mitk::ModelBase
   {
 
   public:
     typedef ExponentialSaturationModel 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(ExponentialSaturationModel, ModelBase);
 
-    std::string GetModelDisplayName() const override;
+    static const std::string NAME_PARAMETER_BAT;
+    static const std::string NAME_PARAMETER_y_bl;
+    static const std::string NAME_PARAMETER_y_fin;
+    static const std::string NAME_PARAMETER_k;
 
-    std::string GetModelType() const override;
+    static const unsigned int NUMBER_OF_PARAMETERS;
 
-    FunctionStringType GetFunctionString() const override;
+    static const std::string UNIT_PARAMETER_BAT;
+    static const std::string UNIT_PARAMETER_y_bl;
+    static const std::string UNIT_PARAMETER_y_fin;
+    static const std::string UNIT_PARAMETER_k;
 
-    std::string GetXName() const override;
+    static const unsigned int POSITION_PARAMETER_BAT;
+    static const unsigned int POSITION_PARAMETER_y_bl;
+    static const unsigned int POSITION_PARAMETER_y_fin;
+    static const unsigned int POSITION_PARAMETER_k;
+
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
+    ParamterUnitMapType GetParameterUnits() const override;
+
     ParameterNamesType GetStaticParameterNames() const override;
 
     ParametersSizeType GetNumberOfStaticParameters() const override;
 
+    std::string GetModelDisplayName() const override;
+
+    std::string GetModelType() const override;
+
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
+
+    std::string GetYAxisUnit() const override;
+
+
   protected:
     ExponentialSaturationModel() {};
     ~ExponentialSaturationModel() 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;
 
   private:
 
     //No copy constructor allowed
     ExponentialSaturationModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 }
 
 #endif
diff --git a/Modules/ModelFit/include/mitkLinearModel.h b/Modules/ModelFit/include/mitkLinearModel.h
index fe12b0d16b..e10578f78d 100644
--- a/Modules/ModelFit/include/mitkLinearModel.h
+++ b/Modules/ModelFit/include/mitkLinearModel.h
@@ -1,89 +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 mitkLinearModel_h
 #define mitkLinearModel_h
 
 #include "mitkModelBase.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
   class MITKMODELFIT_EXPORT LinearModel : public mitk::ModelBase
   {
 
   public:
     typedef LinearModel 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(LinearModel, ModelBase);
 
-    std::string GetModelDisplayName() const override;
+    static const std::string NAME_PARAMETER_y0;
+    static const std::string NAME_PARAMETER_b;
 
-    std::string GetModelType() const override;
+    static const unsigned int NUMBER_OF_PARAMETERS;
 
-    FunctionStringType GetFunctionString() const override;
+    static const std::string UNIT_PARAMETER_y0;
+    static const std::string UNIT_PARAMETER_b;
+
+    static const unsigned int POSITION_PARAMETER_y0;
+    static const unsigned int POSITION_PARAMETER_b;
+
+    static const std::string NAME_DERIVED_PARAMETER_x_intercept;
+
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
+
+    static const std::string UNIT_DERIVED_PARAMETER_x_intercept;
+
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
 
-    std::string GetXName() const override;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
+    ParamterUnitMapType GetParameterUnits() const override;
+
+    ParameterNamesType GetDerivedParameterNames() const override;
+
+    ParametersSizeType  GetNumberOfDerivedParameters() const override;
+
+    ParamterUnitMapType GetDerivedParameterUnits() const override;
+
     ParameterNamesType GetStaticParameterNames() const override;
 
     ParametersSizeType GetNumberOfStaticParameters() const override;
 
-    ParameterNamesType GetDerivedParameterNames() const override;
+    std::string GetModelDisplayName() const override;
+
+    std::string GetModelType() const override;
+
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
+
+    std::string GetYAxisUnit() const override;
 
-    ParametersSizeType  GetNumberOfDerivedParameters() const override;
 
   protected:
     LinearModel() {};
     ~LinearModel() 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
     LinearModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h b/Modules/ModelFit/include/mitkThreeStepLinearModel.h
similarity index 61%
rename from Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
rename to Modules/ModelFit/include/mitkThreeStepLinearModel.h
index bdfc6a7cff..144c14f081 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
+++ b/Modules/ModelFit/include/mitkThreeStepLinearModel.h
@@ -1,125 +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 mitkThreeStepLinearModel_h
 #define mitkThreeStepLinearModel_h
 
 #include "mitkModelBase.h"
 
-#include "MitkPharmacokineticsExports.h"
+#include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
-  class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModel : public mitk::ModelBase
+  class MITKMODELFIT_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);
 
-    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_y_bl;
+    static const std::string NAME_PARAMETER_x0;
+    static const std::string NAME_PARAMETER_x1;
+    static const std::string NAME_PARAMETER_b0;
     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 unsigned int NUMBER_OF_PARAMETERS;
+
+    static const std::string UNIT_PARAMETER_y_bl;
+    static const std::string UNIT_PARAMETER_x0;
+    static const std::string UNIT_PARAMETER_x1;
+    static const std::string UNIT_PARAMETER_b0;
     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_y_bl;
+    static const unsigned int POSITION_PARAMETER_x0;
+    static const unsigned int POSITION_PARAMETER_x1;
+    static const unsigned int POSITION_PARAMETER_b0;
     static const unsigned int POSITION_PARAMETER_b1;
-    static const unsigned int POSITION_PARAMETER_b2;
 
-    static const unsigned int NUMBER_OF_PARAMETERS;
+    static const std::string NAME_DERIVED_PARAMETER_auc;
+    static const std::string NAME_DERIVED_PARAMETER_x_fin;
+    static const std::string NAME_DERIVED_PARAMETER_y_fin;
+    static const std::string NAME_DERIVED_PARAMETER_y_max;
+    static const std::string NAME_DERIVED_PARAMETER_y1;
+    static const std::string NAME_DERIVED_PARAMETER_y2;
 
-    std::string GetModelDisplayName() const override;
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
 
-    std::string GetModelType() const override;
+    static const std::string UNIT_DERIVED_PARAMETER_auc;
+    static const std::string UNIT_DERIVED_PARAMETER_x_fin;
+    static const std::string UNIT_DERIVED_PARAMETER_y_fin;
+    static const std::string UNIT_DERIVED_PARAMETER_y_max;
+    static const std::string UNIT_DERIVED_PARAMETER_y1;
+    static const std::string UNIT_DERIVED_PARAMETER_y2;
 
-    FunctionStringType GetFunctionString() const override;
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
 
-    std::string GetXName() const override;
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
+    ParameterNamesType GetDerivedParameterNames() const override;
+
+    ParametersSizeType  GetNumberOfDerivedParameters() const override;
+
+    ParamterUnitMapType GetDerivedParameterUnits() const override;
+
     ParameterNamesType GetStaticParameterNames() const override;
 
     ParametersSizeType GetNumberOfStaticParameters() const override;
 
-    ParameterNamesType GetDerivedParameterNames() const override;
+    std::string GetModelDisplayName() const override;
 
-    ParametersSizeType  GetNumberOfDerivedParameters() const override;
+    std::string GetModelType() const override;
 
-    ParamterUnitMapType GetDerivedParameterUnits() const override;
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
+
+    std::string GetYAxisUnit() 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;
 
     static double ComputeSignalFromParameters(double x, double s0, double t1, double t2, double a1, double a2, double b1, double b2);
 
   private:
 
     //No copy constructor allowed
     ThreeStepLinearModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 }
 
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h b/Modules/ModelFit/include/mitkThreeStepLinearModelFactory.h
similarity index 89%
rename from Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h
rename to Modules/ModelFit/include/mitkThreeStepLinearModelFactory.h
index 9ea1d756a4..8d844f5abe 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h
+++ b/Modules/ModelFit/include/mitkThreeStepLinearModelFactory.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 mitkThreeStepLinearModelFactory_h
 #define mitkThreeStepLinearModelFactory_h
 
 #include <mitkCommon.h>
 
 #include "mitkConcreteModelFactoryBase.h"
 #include "mitkThreeStepLinearModel.h"
 #include "mitkThreeStepLinearModelParameterizer.h"
 
-#include "MitkPharmacokineticsExports.h"
+#include "MitkModelFitExports.h"
 namespace mitk
 {
 
 
-  class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelFactory : public ConcreteModelFactoryBase<ThreeStepLinearModel>
+  class MITKMODELFIT_EXPORT ThreeStepLinearModelFactory : public ConcreteModelFactoryBase<ThreeStepLinearModel>
   {
   public:
     mitkClassMacroItkParent(ThreeStepLinearModelFactory, ConcreteModelFactoryBase<ThreeStepLinearModel>);
     itkFactorylessNewMacro(Self);
 
     /** This function returns the default parameterization (e.g. initial parametrization for fitting)
      defined by the model developer for  for the given model.*/
     ParametersType GetDefaultInitialParameterization() const override;
 
   protected:
     ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
     const override;
 
     ThreeStepLinearModelFactory();
 
     ~ThreeStepLinearModelFactory() override;
 
   private:
 
     //No copy constructor allowed
     ThreeStepLinearModelFactory(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h b/Modules/ModelFit/include/mitkThreeStepLinearModelParameterizer.h
similarity index 96%
rename from Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h
rename to Modules/ModelFit/include/mitkThreeStepLinearModelParameterizer.h
index d5dfcd1571..e03e3d8751 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkThreeStepLinearModelParameterizer.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 mitkThreeStepLinearModelParameterizer_h
 #define mitkThreeStepLinearModelParameterizer_h
 
 #include "mitkConcreteModelParameterizerBase.h"
 #include "mitkThreeStepLinearModel.h"
 
 namespace mitk
 {
 
-class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelParameterizer : public
+class MITKMODELFIT_EXPORT ThreeStepLinearModelParameterizer : public
   mitk::ConcreteModelParameterizerBase<mitk::ThreeStepLinearModel>
 {
 public:
   typedef ThreeStepLinearModelParameterizer Self;
   typedef mitk::ConcreteModelParameterizerBase<mitk::ThreeStepLinearModel> Superclass;
   typedef itk::SmartPointer< Self >                            Pointer;
   typedef itk::SmartPointer< const Self >                      ConstPointer;
 
   itkTypeMacro(ThreeStepLinearModelParameterizer, ConcreteModelParameterizerBase);
   itkFactorylessNewMacro(Self);
 
   typedef Superclass::ModelBaseType ModelBaseType;
   typedef Superclass::ModelBasePointer ModelBasePointer;
 
   typedef Superclass::ModelType ModelType;
   typedef Superclass::ModelPointer ModelPointer;
 
   typedef Superclass::StaticParameterValueType StaticParameterValueType;
   typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
   typedef Superclass::StaticParameterMapType StaticParameterMapType;
 
   typedef Superclass::IndexType IndexType;
 
   /** This function returns the default parameterization (e.g. initial parametrization for fitting)
    defined by the model developer for  for the given model.*/
   ParametersType GetDefaultInitialParameterization() const override;
 
 protected:
   ThreeStepLinearModelParameterizer(){};
 
   ~ThreeStepLinearModelParameterizer() override{};
 
 private:
 
   //No copy constructor allowed
   ThreeStepLinearModelParameterizer(const Self& source);
   void operator=(const Self&);  //purposely not implemented
 };}
 
 #endif
diff --git a/Modules/ModelFit/include/mitkTwoStepLinearModel.h b/Modules/ModelFit/include/mitkTwoStepLinearModel.h
new file mode 100644
index 0000000000..8e93819089
--- /dev/null
+++ b/Modules/ModelFit/include/mitkTwoStepLinearModel.h
@@ -0,0 +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 mitkTwoStepLinearModel_h
+#define mitkTwoStepLinearModel_h
+
+#include "mitkModelBase.h"
+
+#include "MitkModelFitExports.h"
+
+namespace mitk
+{
+
+  class MITKMODELFIT_EXPORT TwoStepLinearModel : public mitk::ModelBase
+  {
+
+  public:
+    typedef TwoStepLinearModel 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(TwoStepLinearModel, ModelBase)
+
+    static const std::string NAME_PARAMETER_y0;
+    static const std::string NAME_PARAMETER_x0;
+    static const std::string NAME_PARAMETER_b0;
+    static const std::string NAME_PARAMETER_b1;
+
+    static const unsigned int NUMBER_OF_PARAMETERS;
+
+    static const std::string UNIT_PARAMETER_y0;
+    static const std::string UNIT_PARAMETER_x0;
+    static const std::string UNIT_PARAMETER_b0;
+    static const std::string UNIT_PARAMETER_b1;
+
+    static const unsigned int POSITION_PARAMETER_y0;
+    static const unsigned int POSITION_PARAMETER_x0;
+    static const unsigned int POSITION_PARAMETER_b0;
+    static const unsigned int POSITION_PARAMETER_b1;
+
+    static const std::string NAME_DERIVED_PARAMETER_auc;
+    static const std::string NAME_DERIVED_PARAMETER_y_fin;
+    static const std::string NAME_DERIVED_PARAMETER_y_max;
+    static const std::string NAME_DERIVED_PARAMETER_y1;
+
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
+
+    static const std::string UNIT_DERIVED_PARAMETER_auc;
+    static const std::string UNIT_DERIVED_PARAMETER_y_fin;
+    static const std::string UNIT_DERIVED_PARAMETER_y_max;
+    static const std::string UNIT_DERIVED_PARAMETER_y1;
+
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string FUNCTION_STRING;
+
+    static const std::string X_NAME;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
+
+
+    ParameterNamesType GetParameterNames() const override;
+
+    ParametersSizeType  GetNumberOfParameters() const override;
+
+    ParamterUnitMapType GetParameterUnits() const override;
+
+    ParameterNamesType GetDerivedParameterNames() const override;
+
+    ParametersSizeType  GetNumberOfDerivedParameters() const override;
+
+    ParamterUnitMapType GetDerivedParameterUnits() const override;
+
+    ParameterNamesType GetStaticParameterNames() const override;
+
+    ParametersSizeType GetNumberOfStaticParameters() const override;
+
+    std::string GetModelDisplayName() const override;
+
+    std::string GetModelType() const override;
+
+    FunctionStringType GetFunctionString() const override;
+
+    std::string GetXName() const override;
+
+    std::string GetXAxisName() const override;
+
+    std::string GetXAxisUnit() const override;
+
+    std::string GetYAxisName() const override;
+
+    std::string GetYAxisUnit() const override;
+
+
+  protected:
+    TwoStepLinearModel() {};
+    virtual ~TwoStepLinearModel(){};
+
+
+    /**
+     * Actual implementation of the clone method. This method should be reimplemeted
+     * in subclasses to clone the extra required parameters.
+     */
+    virtual itk::LightObject::Pointer InternalClone() const;
+
+    virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const;
+    virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
+        parameters) const;
+
+    virtual void SetStaticParameter(const ParameterNameType& name,
+                                    const StaticParameterValuesType& values);
+    virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const;
+
+    static double ComputeSignalFromParameters(double x, double t, double a1, double a2, double b1, double b2);
+
+  private:
+
+    //No copy constructor allowed
+    TwoStepLinearModel(const Self& source);
+    void operator=(const Self&);  //purposely not implemented
+  };
+}
+
+
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h b/Modules/ModelFit/include/mitkTwoStepLinearModelFactory.h
similarity index 89%
rename from Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h
rename to Modules/ModelFit/include/mitkTwoStepLinearModelFactory.h
index fd13df6575..a4166b4278 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h
+++ b/Modules/ModelFit/include/mitkTwoStepLinearModelFactory.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 mitkTwoStepLinearModelFactory_h
 #define mitkTwoStepLinearModelFactory_h
 
 #include <mitkCommon.h>
 
 #include "mitkConcreteModelFactoryBase.h"
 #include "mitkTwoStepLinearModel.h"
 #include "mitkTwoStepLinearModelParameterizer.h"
 
-#include "MitkPharmacokineticsExports.h"
+#include "MitkModelFitExports.h"
 
 namespace mitk
 {
 
-  class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModelFactory : public ConcreteModelFactoryBase<TwoStepLinearModel>
+  class MITKMODELFIT_EXPORT TwoStepLinearModelFactory : public ConcreteModelFactoryBase<TwoStepLinearModel>
   {
   public:
     mitkClassMacroItkParent(TwoStepLinearModelFactory, ConcreteModelFactoryBase<TwoStepLinearModel>);
     itkFactorylessNewMacro(Self);
 
     /** This function returns the default parameterization (e.g. initial parametrization for fitting)
      defined by the model developer for  for the given model.*/
     virtual ParametersType GetDefaultInitialParameterization() const;
 
   protected:
     virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
     const;
 
     TwoStepLinearModelFactory();
 
     virtual ~TwoStepLinearModelFactory();
 
   private:
 
     //No copy constructor allowed
     TwoStepLinearModelFactory(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
   };
 
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h b/Modules/ModelFit/include/mitkTwoStepLinearModelParameterizer.h
similarity index 96%
rename from Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h
rename to Modules/ModelFit/include/mitkTwoStepLinearModelParameterizer.h
index 588fe4b08b..9beda06309 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkTwoStepLinearModelParameterizer.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 mitkTwoStepLinearModelParameterizer_h
 #define mitkTwoStepLinearModelParameterizer_h
 
 #include "mitkConcreteModelParameterizerBase.h"
 #include "mitkTwoStepLinearModel.h"
 
 namespace mitk
 {
 
-class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModelParameterizer : public
+class MITKMODELFIT_EXPORT TwoStepLinearModelParameterizer : public
   mitk::ConcreteModelParameterizerBase<mitk::TwoStepLinearModel>
 {
 public:
   typedef TwoStepLinearModelParameterizer Self;
   typedef mitk::ConcreteModelParameterizerBase<mitk::TwoStepLinearModel> Superclass;
   typedef itk::SmartPointer< Self >                            Pointer;
   typedef itk::SmartPointer< const Self >                      ConstPointer;
 
   itkTypeMacro(TwoStepLinearModelParameterizer, ConcreteModelParameterizerBase);
   itkFactorylessNewMacro(Self);
 
   typedef typename Superclass::ModelBaseType ModelBaseType;
   typedef typename Superclass::ModelBasePointer ModelBasePointer;
 
   typedef typename Superclass::ModelType ModelType;
   typedef typename Superclass::ModelPointer ModelPointer;
 
   typedef typename Superclass::StaticParameterValueType StaticParameterValueType;
   typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType;
   typedef typename Superclass::StaticParameterMapType StaticParameterMapType;
 
   typedef typename Superclass::IndexType IndexType;
 
   /** This function returns the default parameterization (e.g. initial parametrization for fitting)
    defined by the model developer for  for the given model.*/
   virtual ParametersType GetDefaultInitialParameterization() const;
 
 protected:
   TwoStepLinearModelParameterizer(){};
 
   virtual ~TwoStepLinearModelParameterizer(){};
 
 private:
 
   //No copy constructor allowed
   TwoStepLinearModelParameterizer(const Self& source);
   void operator=(const Self&);  //purposely not implemented
 };}
 
 
 #endif
diff --git a/Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp b/Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp
index 306bc796ad..ee293b11e4 100644
--- a/Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp
+++ b/Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp
@@ -1,275 +1,275 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "itkCommand.h"
 #include "itkMultiOutputNaryFunctorImageFilter.h"
 
 #include "mitkPixelBasedParameterFitImageGenerator.h"
 #include "mitkImageTimeSelector.h"
 #include "mitkImageAccessByItk.h"
 #include "mitkImageCast.h"
 #include "mitkModelFitFunctorPolicy.h"
 
 #include "mitkExtractTimeGrid.h"
 
 void
   mitk::PixelBasedParameterFitImageGenerator::
   onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& /*eventObject*/)
 {
-  this->InvokeEvent(::itk::ProgressEvent());
 
   auto* process = dynamic_cast<itk::ProcessObject*>(caller);
   if (process)
   {
     this->m_Progress = process->GetProgress();
   }
+  this->InvokeEvent(::itk::ProgressEvent());
 };
 
 template <typename TPixel, unsigned int VDim>
 void
   mitk::PixelBasedParameterFitImageGenerator::DoPrepareMask(itk::Image<TPixel, VDim>* image)
 {
   m_InternalMask = dynamic_cast<InternalMaskType*>(image);
 
   if (m_InternalMask.IsNull())
   {
     MITK_INFO << "Parameter Fit Generator. Need to cast mask for parameter fit.";
     using InputImageType = itk::Image<TPixel, VDim>;
     using CastFilterType = itk::CastImageFilter< InputImageType, InternalMaskType >;
     typename CastFilterType::Pointer  spImageCaster =  CastFilterType::New();
 
     spImageCaster->SetInput(image);
 
     m_InternalMask = spImageCaster->GetOutput();
     spImageCaster->Update();
   }
 }
 
 template<typename TImage>
 mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType StoreResultImages( mitk::ModelFitFunctorBase::ParameterNamesType &paramNames, itk::ImageSource<TImage>* source, mitk::ModelFitFunctorBase::ParameterNamesType::size_type startPos, mitk::ModelFitFunctorBase::ParameterNamesType::size_type& endPos )
 {
   mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType result;
   for (mitk::ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < paramNames.size(); ++j)
   {
     if (source->GetNumberOfOutputs() < startPos+j)
     {
       mitkThrow() << "Error while generating fitted parameter images. Number of sources is too low and does not match expected parameter number. Output size: "<< source->GetNumberOfOutputs()<<"; number of param names: "<<paramNames.size()<<";source start pos: " << startPos;
     }
 
     mitk::Image::Pointer paramImage = mitk::Image::New();
     typename TImage::ConstPointer outputImg = source->GetOutput(startPos+j);
     mitk::CastToMitkImage(outputImg, paramImage);
 
     result.insert(std::make_pair(paramNames[j],paramImage));
   }
 
   endPos = startPos + paramNames.size();
 
   return result;
 }
 
 template <typename TPixel, unsigned int VDim>
 void
   mitk::PixelBasedParameterFitImageGenerator::DoParameterFit(itk::Image<TPixel, VDim>* /*image*/)
 {
   using InputFrameImageType = itk::Image<TPixel, VDim-1>;
   using ParameterImageType = itk::Image<ScalarType, VDim-1>;
 
   using FitFilterType = itk::MultiOutputNaryFunctorImageFilter<InputFrameImageType, ParameterImageType, ModelFitFunctorPolicy, InternalMaskType>;
 
   typename FitFilterType::Pointer fitFilter = FitFilterType::New();
 
   typename ::itk::MemberCommand<Self>::Pointer spProgressCommand = ::itk::MemberCommand<Self>::New();
   spProgressCommand->SetCallbackFunction(this, &Self::onFitProgressEvent);
   fitFilter->AddObserver(::itk::ProgressEvent(), spProgressCommand);
 
   //add the time frames to the fit filter
   mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
   imageTimeSelector->SetInput(this->m_DynamicImage);
   std::vector<Image::Pointer> frameCache;
   for (unsigned int i = 0; i < this->m_DynamicImage->GetTimeSteps(); ++i)
   {
     typename InputFrameImageType::Pointer frameImage;
     imageTimeSelector->SetTimeNr(i);
     imageTimeSelector->UpdateLargestPossibleRegion();
 
     Image::Pointer frameMITKImage = imageTimeSelector->GetOutput();
     frameCache.push_back(frameMITKImage);
     mitk::CastToItkImage(frameMITKImage, frameImage);
     fitFilter->SetInput(i,frameImage);
   }
 
   ModelBaseType::TimeGridType timeGrid = ExtractTimeGrid(m_DynamicImage);
   if (m_TimeGridByParameterizer)
   {
     if (timeGrid.GetSize() != m_ModelParameterizer->GetDefaultTimeGrid().GetSize())
     {
       mitkThrow() << "Cannot do fitting. Filter is set to use default time grid of the parameterizer, but grid size does not match the number of input image frames. Grid size: " << m_ModelParameterizer->GetDefaultTimeGrid().GetSize() << "; frame count: " << timeGrid.GetSize();
     }
 
   }
   else
   {
     this->m_ModelParameterizer->SetDefaultTimeGrid(timeGrid);
   }
 
   ModelFitFunctorPolicy functor;
 
   functor.SetModelFitFunctor(this->m_FitFunctor);
   functor.SetModelParameterizer(this->m_ModelParameterizer);
   fitFilter->SetFunctor(functor);
   if (this->m_InternalMask.IsNotNull())
   {
     fitFilter->SetMask(this->m_InternalMask);
   }
 
   //generate the fits
   fitFilter->Update();
 
   //convert the outputs into mitk images and fill the parameter image map
   ModelBaseType::Pointer refModel = this->m_ModelParameterizer->GenerateParameterizedModel();
   ModelFitFunctorBase::ParameterNamesType paramNames = refModel->GetParameterNames();
   ModelFitFunctorBase::ParameterNamesType derivedParamNames = refModel->GetDerivedParameterNames();
   ModelFitFunctorBase::ParameterNamesType criterionNames = this->m_FitFunctor->GetCriterionNames();
   ModelFitFunctorBase::ParameterNamesType evaluationParamNames = this->m_FitFunctor->GetEvaluationParameterNames();
   ModelFitFunctorBase::ParameterNamesType debugParamNames = this->m_FitFunctor->GetDebugParameterNames();
 
   if (fitFilter->GetNumberOfOutputs() != (paramNames.size() + derivedParamNames.size() + criterionNames.size() + evaluationParamNames.size() + debugParamNames.size()))
   {
     mitkThrow() << "Error while generating fitted parameter images. Fit filter output size does not match expected parameter number. Output size: "<< fitFilter->GetNumberOfOutputs();
   }
 
   ModelFitFunctorBase::ParameterNamesType::size_type resultPos = 0;
   this->m_TempResultMap = StoreResultImages<ParameterImageType>(paramNames,fitFilter,resultPos, resultPos);
   this->m_TempDerivedResultMap = StoreResultImages<ParameterImageType>(derivedParamNames,fitFilter,resultPos, resultPos);
   this->m_TempCriterionResultMap = StoreResultImages<ParameterImageType>(criterionNames,fitFilter,resultPos, resultPos);
   this->m_TempEvaluationResultMap = StoreResultImages<ParameterImageType>(evaluationParamNames,fitFilter,resultPos, resultPos);
   //also add debug params (if generated) to the evaluation result map
   mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType debugMap = StoreResultImages<ParameterImageType>(debugParamNames, fitFilter, resultPos, resultPos);
   this->m_TempEvaluationResultMap.insert(debugMap.begin(), debugMap.end());
 }
 
 bool
   mitk::PixelBasedParameterFitImageGenerator::HasOutdatedResult() const
 {
   bool result = Superclass::HasOutdatedResult();
 
   if (m_ModelParameterizer.IsNotNull())
   {
     if (m_ModelParameterizer->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_FitFunctor.IsNotNull())
   {
     if (m_FitFunctor->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_DynamicImage.IsNotNull())
   {
     if (m_DynamicImage->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_Mask.IsNotNull())
   {
     if (m_Mask->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   return result;
 
 };
 
 void
   mitk::PixelBasedParameterFitImageGenerator::CheckValidInputs() const
 {
   Superclass::CheckValidInputs();
 
   if (m_DynamicImage.IsNull())
   {
     mitkThrow() << "Cannot generate fitted parameter images. Input dynamic image is not set.";
   }
 
 };
 
 void mitk::PixelBasedParameterFitImageGenerator::DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages)
 {
   this->m_Progress = 0;
 
   if(this->m_Mask.IsNotNull())
   {
     AccessFixedDimensionByItk(m_Mask, mitk::PixelBasedParameterFitImageGenerator::DoPrepareMask, 3);
   }
   else
   {
     this->m_InternalMask = nullptr;
   }
 
   AccessFixedDimensionByItk(m_DynamicImage, mitk::PixelBasedParameterFitImageGenerator::DoParameterFit, 4);
 
   parameterImages = this->m_TempResultMap;
   derivedParameterImages = this->m_TempDerivedResultMap;
   criterionImages = this->m_TempCriterionResultMap;
   evaluationParameterImages = this->m_TempEvaluationResultMap;
 
 };
 
 double
   mitk::PixelBasedParameterFitImageGenerator::GetProgress() const
 {
   return m_Progress;
 };
 
 mitk::PixelBasedParameterFitImageGenerator::ParameterNamesType
 mitk::PixelBasedParameterFitImageGenerator::GetParameterNames() const
 {
   ParameterizerType::ModelBasePointer parameterizedModel =
     m_ModelParameterizer->GenerateParameterizedModel();
 
   return parameterizedModel->GetParameterNames();
 }
 
 mitk::PixelBasedParameterFitImageGenerator::ParameterNamesType
 mitk::PixelBasedParameterFitImageGenerator::GetDerivedParameterNames() const
 {
   ParameterizerType::ModelBasePointer parameterizedModel =
     m_ModelParameterizer->GenerateParameterizedModel();
 
   return parameterizedModel->GetDerivedParameterNames();
 }
 
 mitk::PixelBasedParameterFitImageGenerator::ParameterNamesType
 mitk::PixelBasedParameterFitImageGenerator::GetCriterionNames() const
 {
   return this->m_FitFunctor->GetCriterionNames();
 }
 
 mitk::PixelBasedParameterFitImageGenerator::ParameterNamesType
 mitk::PixelBasedParameterFitImageGenerator::GetEvaluationParameterNames() const
 {
   auto evals = this->m_FitFunctor->GetEvaluationParameterNames();
   auto debugs = this->m_FitFunctor->GetDebugParameterNames();
 
   evals.insert(evals.end(), debugs.begin(), debugs.end());
 
   return evals;
 }
diff --git a/Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp b/Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp
index 78fcf960fe..9cb6ff5928 100644
--- a/Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp
+++ b/Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "itkChangeInformationImageFilter.h"
 
 #include "mitkROIBasedParameterFitImageGenerator.h"
 #include "mitkImageAccessByItk.h"
 #include "mitkImageCast.h"
 
 void
 mitk::ROIBasedParameterFitImageGenerator::
 onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& /*eventObject*/)
 {
-  this->InvokeEvent(::itk::ProgressEvent());
 
   itk::ProcessObject* process = dynamic_cast<itk::ProcessObject*>(caller);
 
   if (process)
   {
     this->m_Progress = process->GetProgress();
   }
+  this->InvokeEvent(::itk::ProgressEvent());
 };
 
 template <typename TPixel, unsigned int VDim>
 void
 mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration(itk::Image<TPixel, VDim>* image,
     double value)
 {
   typedef itk::Image<TPixel, VDim> MaskType;
   typedef itk::Image<ScalarType, VDim> ParameterImageType;
 
   typedef itk::ChangeInformationImageFilter< ParameterImageType > OutputImageInformationFilterType;
   typename OutputImageInformationFilterType::Pointer copyGeoInfoFilter =
     OutputImageInformationFilterType::New();
 
   typename ParameterImageType::Pointer paramImg = ParameterImageType::New();
 
   copyGeoInfoFilter->ChangeDirectionOn();
   copyGeoInfoFilter->SetOutputDirection(image->GetDirection());
   copyGeoInfoFilter->ChangeOriginOn();
   copyGeoInfoFilter->SetOutputOrigin(image->GetOrigin());
   copyGeoInfoFilter->ChangeSpacingOn();
   copyGeoInfoFilter->SetOutputSpacing(image->GetSpacing());
   copyGeoInfoFilter->SetInput(paramImg);
   copyGeoInfoFilter->Update();
 
   paramImg = copyGeoInfoFilter->GetOutput();
   paramImg->SetRegions(image->GetLargestPossibleRegion());
   paramImg->Allocate();
   paramImg->FillBuffer(0.0);
 
   typedef itk::ImageRegionConstIterator<MaskType> MaskIteratorType;
   typedef itk::ImageRegionIterator<ParameterImageType> ImageIteratorType;
 
   MaskIteratorType maskItr(image, image->GetLargestPossibleRegion());
   ImageIteratorType imgItr(paramImg, image->GetLargestPossibleRegion());
   maskItr.GoToBegin();
   imgItr.GoToBegin();
   while (!maskItr.IsAtEnd())
   {
     if (maskItr.Get() > 0.0)
     {
       imgItr.Set(value);
     }
 
     ++maskItr;
     ++imgItr;
   }
 
   m_TempResultImage = Image::New();
   mitk::CastToMitkImage(paramImg, m_TempResultImage);
 }
 
 bool
 mitk::ROIBasedParameterFitImageGenerator::HasOutdatedResult() const
 {
   bool result = Superclass::HasOutdatedResult();
 
   if (m_ModelParameterizer.IsNotNull())
   {
     if (m_ModelParameterizer->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_Mask.IsNotNull())
   {
     if (m_Mask->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_FitFunctor.IsNotNull())
   {
     if (m_FitFunctor->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   return result;
 };
 
 void
 mitk::ROIBasedParameterFitImageGenerator::CheckValidInputs() const
 {
   Superclass::CheckValidInputs();
 
   if (m_Mask.IsNull())
   {
     mitkThrow() << "Cannot generate fitted parameter images. Input mask is not set.";
   }
 
   if (m_Signal.Size() != m_TimeGrid.Size())
   {
     mitkThrow() << "Cannot generate fitted parameter images. Signal and TimeGrid do not match.";
   }
 
 };
 
 void mitk::ROIBasedParameterFitImageGenerator::DoFitAndGetResults(ParameterImageMapType&
     parameterImages, ParameterImageMapType& derivedParameterImages,
     ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages)
 {
   this->m_Progress = 0;
 
   //fit the signal
   ModelParameterizerBase::IndexType index;
   index.Fill(0);
   this->m_ModelParameterizer->SetDefaultTimeGrid(m_TimeGrid);
   ParameterizerType::ModelBasePointer parameterizedModel =
     m_ModelParameterizer->GenerateParameterizedModel(index);
   ParameterizerType::ParametersType initialParameters =
     m_ModelParameterizer->GetInitialParameterization(index);
 
   ModelFitFunctorBase::InputPixelArrayType inputValues;
 
   for (SignalType::const_iterator pos = m_Signal.begin(); pos != m_Signal.end(); ++pos)
   {
     inputValues.push_back(*pos);
   }
 
   ModelFitFunctorBase::OutputPixelArrayType fitResult = m_FitFunctor->Compute(inputValues,
       parameterizedModel, initialParameters);
 
   //generate the results maps
   ParameterImageMapType tempResultMap;
   ParameterImageMapType tempDerivedResultMap;
   ParameterImageMapType tempEvaluationResultMap;
   ParameterImageMapType tempCriterionResultMap;
 
   ModelFitFunctorBase::ParameterNamesType paramNames = parameterizedModel->GetParameterNames();
   ModelFitFunctorBase::ParameterNamesType derivedParamNames =
     parameterizedModel->GetDerivedParameterNames();
   ModelFitFunctorBase::ParameterNamesType criterionNames = this->m_FitFunctor->GetCriterionNames();
   ModelFitFunctorBase::ParameterNamesType evaluationParamNames =
     this->m_FitFunctor->GetEvaluationParameterNames();
   ModelFitFunctorBase::ParameterNamesType debugParamNames = this->m_FitFunctor->GetDebugParameterNames();
 
   if (fitResult.size() != (paramNames.size() + derivedParamNames.size() + criterionNames.size() +
                            evaluationParamNames.size() + debugParamNames.size()))
   {
     mitkThrow() <<
                 "Error while generating fitted parameter images. Fit functor output size does not match expected parameter number. Output size: "
                 << fitResult.size();
   }
 
   for (ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < paramNames.size(); ++j)
   {
     ModelFitFunctorBase::OutputPixelArrayType::value_type value = fitResult[j];
     AccessByItk_n(m_Mask, mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration, (value));
     tempResultMap.insert(std::make_pair(paramNames[j], m_TempResultImage));
   }
 
   ModelFitFunctorBase::ParameterNamesType::size_type offset = paramNames.size();
   for (ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < derivedParamNames.size(); ++j)
   {
     ModelFitFunctorBase::OutputPixelArrayType::value_type value = fitResult[j + offset];
     AccessByItk_n(m_Mask, mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration, (value));
     tempDerivedResultMap.insert(std::make_pair(derivedParamNames[j], m_TempResultImage));
   }
 
   offset += derivedParamNames.size();
   for (ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < criterionNames.size(); ++j)
   {
     ModelFitFunctorBase::OutputPixelArrayType::value_type value = fitResult[j + offset];
     AccessByItk_n(m_Mask, mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration, (value));
     tempCriterionResultMap.insert(std::make_pair(criterionNames[j], m_TempResultImage));
   }
 
   offset += criterionNames.size();
   for (ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < evaluationParamNames.size(); ++j)
   {
     ModelFitFunctorBase::OutputPixelArrayType::value_type value = fitResult[j + offset];
     AccessByItk_n(m_Mask, mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration, (value));
     tempEvaluationResultMap.insert(std::make_pair(evaluationParamNames[j], m_TempResultImage));
   }
 
   offset += evaluationParamNames.size();
   for (ModelFitFunctorBase::ParameterNamesType::size_type j = 0; j < debugParamNames.size(); ++j)
   { //add debug params (if they are generated to the evaluation result map
     ModelFitFunctorBase::OutputPixelArrayType::value_type value = fitResult[j + offset];
     AccessByItk_n(m_Mask, mitk::ROIBasedParameterFitImageGenerator::DoImageGeneration, (value));
     tempEvaluationResultMap.insert(std::make_pair(debugParamNames[j], m_TempResultImage));
   }
 
   parameterImages = tempResultMap;
   derivedParameterImages = tempDerivedResultMap;
   criterionImages = tempCriterionResultMap;
   evaluationParameterImages = tempEvaluationResultMap;
 
 };
 
 double
 mitk::ROIBasedParameterFitImageGenerator::GetProgress() const
 {
   return m_Progress;
 };
 
 mitk::ROIBasedParameterFitImageGenerator::ParameterNamesType
 mitk::ROIBasedParameterFitImageGenerator::GetParameterNames() const
 {
   ParameterizerType::ModelBasePointer parameterizedModel =
     m_ModelParameterizer->GenerateParameterizedModel();
 
   return parameterizedModel->GetParameterNames();
 }
 
 mitk::ROIBasedParameterFitImageGenerator::ParameterNamesType
 mitk::ROIBasedParameterFitImageGenerator::GetDerivedParameterNames() const
 {
   ParameterizerType::ModelBasePointer parameterizedModel =
     m_ModelParameterizer->GenerateParameterizedModel();
 
   return parameterizedModel->GetDerivedParameterNames();
 }
 
 mitk::ROIBasedParameterFitImageGenerator::ParameterNamesType
 mitk::ROIBasedParameterFitImageGenerator::GetCriterionNames() const
 {
   return this->m_FitFunctor->GetCriterionNames();
 }
 
 mitk::ROIBasedParameterFitImageGenerator::ParameterNamesType
 mitk::ROIBasedParameterFitImageGenerator::GetEvaluationParameterNames() const
 {
   auto evals = this->m_FitFunctor->GetEvaluationParameterNames();
   auto debugs = this->m_FitFunctor->GetDebugParameterNames();
 
   evals.insert(evals.end(), debugs.begin(), debugs.end());
 
   return evals;
 }
diff --git a/Modules/ModelFit/src/Models/mitkExpDecayOffsetModel.cpp b/Modules/ModelFit/src/Models/mitkExpDecayOffsetModel.cpp
index 4b9a687d65..19e19a1597 100644
--- a/Modules/ModelFit/src/Models/mitkExpDecayOffsetModel.cpp
+++ b/Modules/ModelFit/src/Models/mitkExpDecayOffsetModel.cpp
@@ -1,101 +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.
 
 ============================================================================*/
 
 #include "mitkExpDecayOffsetModel.h"
 
+
+const std::string mitk::ExpDecayOffsetModel::NAME_PARAMETER_y0 = "y-intercept";
+const std::string mitk::ExpDecayOffsetModel::NAME_PARAMETER_k = "rate";
+const std::string mitk::ExpDecayOffsetModel::NAME_PARAMETER_y_bl = "baseline";
+
+const unsigned int mitk::ExpDecayOffsetModel::NUMBER_OF_PARAMETERS = 3;
+
+const std::string mitk::ExpDecayOffsetModel::UNIT_PARAMETER_y0 = "[unit of y]";
+const std::string mitk::ExpDecayOffsetModel::UNIT_PARAMETER_k = "1/[unit of x]";
+const std::string mitk::ExpDecayOffsetModel::UNIT_PARAMETER_y_bl = "[unit of y]";
+
+const unsigned int mitk::ExpDecayOffsetModel::POSITION_PARAMETER_y0 = 0;
+const unsigned int mitk::ExpDecayOffsetModel::POSITION_PARAMETER_k = 1;
+const unsigned int mitk::ExpDecayOffsetModel::POSITION_PARAMETER_y_bl = 2;
+
+const unsigned int mitk::ExpDecayOffsetModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::ExpDecayOffsetModel::MODEL_DISPLAY_NAME = "Exponential Decay Offset Model";
+
+const std::string mitk::ExpDecayOffsetModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::ExpDecayOffsetModel::FUNCTION_STRING = "y(x) = y-intercept * exp(-rate*x) + baseline";
+
+const std::string mitk::ExpDecayOffsetModel::X_NAME = "x";
+
+const std::string mitk::ExpDecayOffsetModel::X_AXIS_NAME = "X";
+
+const std::string mitk::ExpDecayOffsetModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::ExpDecayOffsetModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::ExpDecayOffsetModel::Y_AXIS_UNIT = "unit of y";
+
+///////////
+
 std::string mitk::ExpDecayOffsetModel::GetModelDisplayName() const
 {
-  return "Exponential Decay Offset Model";
+  return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::ExpDecayOffsetModel::GetModelType() const
 {
-  return "Generic";
+  return MODEL_TYPE;
 };
 
 mitk::ExpDecayOffsetModel::FunctionStringType mitk::ExpDecayOffsetModel::GetFunctionString() const
 {
-  return "a*exp(-1.0*x*b)+c";
+  return FUNCTION_STRING;
 };
 
 std::string mitk::ExpDecayOffsetModel::GetXName() const
 {
-  return "x";
+  return X_NAME;
 };
 
+std::string mitk::ExpDecayOffsetModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
+};
+
+std::string mitk::ExpDecayOffsetModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::ExpDecayOffsetModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
+};
+
+std::string mitk::ExpDecayOffsetModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
 mitk::ExpDecayOffsetModel::ParameterNamesType
 mitk::ExpDecayOffsetModel::GetParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("a");
-  result.push_back("b");
-  result.push_back("c");
+  result.push_back(NAME_PARAMETER_y0);
+  result.push_back(NAME_PARAMETER_k);
+  result.push_back(NAME_PARAMETER_y_bl);
   return result;
 };
 
+mitk::ExpDecayOffsetModel::ParamterUnitMapType mitk::ExpDecayOffsetModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_y0, UNIT_PARAMETER_y0));
+  result.insert(std::make_pair(NAME_PARAMETER_k, UNIT_PARAMETER_k));
+  result.insert(std::make_pair(NAME_PARAMETER_y_bl, UNIT_PARAMETER_y_bl));
+
+  return result;
+}
+
 mitk::ExpDecayOffsetModel::ParametersSizeType
 mitk::ExpDecayOffsetModel::GetNumberOfParameters() const
 {
-  return 3;
+  return NUMBER_OF_PARAMETERS;
 };
 
 mitk::ExpDecayOffsetModel::ModelResultType
 mitk::ExpDecayOffsetModel::ComputeModelfunction(const ParametersType& parameters) const
 {
   ModelResultType signal(m_TimeGrid.GetSize());
 
   const auto timeGridEnd = m_TimeGrid.end();
   ModelResultType::iterator signalPos = signal.begin();
 
   for (auto gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd;
        ++gridPos, ++signalPos)
   {
     *signalPos = parameters[0] * exp(-1.0 * (*gridPos) * parameters[1]) + parameters[2];
   }
 
   return signal;
 };
 
 mitk::ExpDecayOffsetModel::ParameterNamesType mitk::ExpDecayOffsetModel::GetStaticParameterNames() const
 {
   return {};
 }
 
 mitk::ExpDecayOffsetModel::ParametersSizeType  mitk::ExpDecayOffsetModel::GetNumberOfStaticParameters() const
 {
-  return 0;
+  return NUMBER_OF_STATIC_PARAMETERS;
 }
 
 void mitk::ExpDecayOffsetModel::SetStaticParameter(const ParameterNameType& /*name*/,
     const StaticParameterValuesType& /*values*/)
 {
   //do nothing
 };
 
 mitk::ExpDecayOffsetModel::StaticParameterValuesType mitk::ExpDecayOffsetModel::GetStaticParameterValue(
   const ParameterNameType& /*name*/) const
 {
   StaticParameterValuesType result;
 
   //do nothing
 
   return result;
 };
 
 itk::LightObject::Pointer mitk::ExpDecayOffsetModel::InternalClone() const
 {
   ExpDecayOffsetModel::Pointer newClone = ExpDecayOffsetModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
diff --git a/Modules/ModelFit/src/Models/mitkExponentialDecayModel.cpp b/Modules/ModelFit/src/Models/mitkExponentialDecayModel.cpp
new file mode 100644
index 0000000000..ca96684b30
--- /dev/null
+++ b/Modules/ModelFit/src/Models/mitkExponentialDecayModel.cpp
@@ -0,0 +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.
+
+============================================================================*/
+
+#include "mitkExponentialDecayModel.h"
+#include "mitkNumericConstants.h"
+
+const std::string mitk::ExponentialDecayModel::NAME_PARAMETER_y0 = "y-intercept";
+const std::string mitk::ExponentialDecayModel::NAME_PARAMETER_lambda = "lambda";
+
+const unsigned int mitk::ExponentialDecayModel::NUMBER_OF_PARAMETERS = 2;
+
+const std::string mitk::ExponentialDecayModel::UNIT_PARAMETER_y0 = "[unit of y]";
+const std::string mitk::ExponentialDecayModel::UNIT_PARAMETER_lambda = "[unit of x]";
+
+const unsigned int mitk::ExponentialDecayModel::POSITION_PARAMETER_y0 = 0;
+const unsigned int mitk::ExponentialDecayModel::POSITION_PARAMETER_lambda = 1;
+
+const std::string mitk::ExponentialDecayModel::NAME_DERIVED_PARAMETER_k = "rate";
+
+const unsigned int mitk::ExponentialDecayModel::NUMBER_OF_DERIVED_PARAMETERS = 1;
+
+const std::string mitk::ExponentialDecayModel::UNIT_DERIVED_PARAMETER_k = "1/[unit of x]";
+
+const unsigned int mitk::ExponentialDecayModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::ExponentialDecayModel::MODEL_DISPLAY_NAME = "Exponential Decay Model";
+
+const std::string mitk::ExponentialDecayModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::ExponentialDecayModel::FUNCTION_STRING = "y(x) = y-intercept * exp(-x/lambda)";
+
+const std::string mitk::ExponentialDecayModel::X_NAME = "x";
+
+const std::string mitk::ExponentialDecayModel::X_AXIS_NAME = "X";
+
+const std::string mitk::ExponentialDecayModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::ExponentialDecayModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::ExponentialDecayModel::Y_AXIS_UNIT = "unit of y";
+
+
+std::string mitk::ExponentialDecayModel::GetModelDisplayName() const
+{
+  return MODEL_DISPLAY_NAME;
+};
+
+std::string mitk::ExponentialDecayModel::GetModelType() const
+{
+  return MODEL_TYPE;
+};
+
+mitk::ExponentialDecayModel::FunctionStringType mitk::ExponentialDecayModel::GetFunctionString() const
+{
+  return FUNCTION_STRING;
+};
+
+std::string mitk::ExponentialDecayModel::GetXName() const
+{
+  return X_NAME;
+};
+
+std::string mitk::ExponentialDecayModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
+};
+
+std::string mitk::ExponentialDecayModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::ExponentialDecayModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
+};
+
+std::string mitk::ExponentialDecayModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
+mitk::ExponentialDecayModel::ParameterNamesType
+mitk::ExponentialDecayModel::GetParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_PARAMETER_y0);
+  result.push_back(NAME_PARAMETER_lambda);
+  return result;
+};
+
+mitk::ExponentialDecayModel::ParamterUnitMapType mitk::ExponentialDecayModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_y0, UNIT_PARAMETER_y0));
+  result.insert(std::make_pair(NAME_PARAMETER_lambda, UNIT_PARAMETER_lambda));
+
+  return result;
+}
+
+mitk::ExponentialDecayModel::ParametersSizeType
+mitk::ExponentialDecayModel::GetNumberOfParameters() const
+{
+  return NUMBER_OF_PARAMETERS;
+};
+
+mitk::ExponentialDecayModel::ParameterNamesType
+mitk::ExponentialDecayModel::GetDerivedParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_DERIVED_PARAMETER_k);
+  return result;
+};
+
+mitk::ExponentialDecayModel::ParametersSizeType
+mitk::ExponentialDecayModel::GetNumberOfDerivedParameters() const
+{
+  return NUMBER_OF_DERIVED_PARAMETERS;
+};
+
+mitk::ExponentialDecayModel::ParamterUnitMapType mitk::ExponentialDecayModel::GetDerivedParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_k, UNIT_DERIVED_PARAMETER_k));
+
+  return result;
+};
+
+mitk::ExponentialDecayModel::ModelResultType
+mitk::ExponentialDecayModel::ComputeModelfunction(const ParametersType& parameters) const
+{
+  double     y0 = parameters[POSITION_PARAMETER_y0];
+  double     lambda = parameters[POSITION_PARAMETER_lambda];
+
+  ModelResultType signal(m_TimeGrid.GetSize());
+
+  ModelResultType::iterator signalPos = signal.begin();
+
+  for (const auto& gridPos : m_TimeGrid)
+  {
+    *signalPos = y0 * exp(-1.0 * gridPos/ lambda);
+    ++signalPos;
+  }
+
+  return signal;
+};
+
+mitk::ExponentialDecayModel::ParameterNamesType mitk::ExponentialDecayModel::GetStaticParameterNames() const
+{
+  ParameterNamesType result;
+
+  return result;
+}
+
+mitk::ExponentialDecayModel::ParametersSizeType  mitk::ExponentialDecayModel::GetNumberOfStaticParameters() const
+{
+  return NUMBER_OF_STATIC_PARAMETERS;
+}
+
+void mitk::ExponentialDecayModel::SetStaticParameter(const ParameterNameType& /*name*/,
+    const StaticParameterValuesType& /*values*/)
+{
+  //do nothing
+};
+
+mitk::ExponentialDecayModel::StaticParameterValuesType mitk::ExponentialDecayModel::GetStaticParameterValue(
+  const ParameterNameType& /*name*/) const
+{
+  StaticParameterValuesType result;
+
+  //do nothing
+
+  return result;
+};
+
+
+mitk::ModelBase::DerivedParameterMapType mitk::ExponentialDecayModel::ComputeDerivedParameters(
+  const mitk::ModelBase::ParametersType &parameters) const
+{
+  DerivedParameterMapType result;
+
+  //Model Parameters
+  double     lambda = parameters[POSITION_PARAMETER_lambda];
+
+  double k = 1.0 / (lambda + mitk::eps);
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_k, k));
+  return result;
+};
+
+itk::LightObject::Pointer mitk::ExponentialDecayModel::InternalClone() const
+{
+  ExponentialDecayModel::Pointer newClone = ExponentialDecayModel::New();
+
+  newClone->SetTimeGrid(this->m_TimeGrid);
+
+  return newClone.GetPointer();
+};
diff --git a/Modules/ModelFit/src/Models/mitkT2DecayModelFactory.cpp b/Modules/ModelFit/src/Models/mitkExponentialDecayModelFactory.cpp
similarity index 53%
rename from Modules/ModelFit/src/Models/mitkT2DecayModelFactory.cpp
rename to Modules/ModelFit/src/Models/mitkExponentialDecayModelFactory.cpp
index 8e843c4dea..a2ab3a559a 100644
--- a/Modules/ModelFit/src/Models/mitkT2DecayModelFactory.cpp
+++ b/Modules/ModelFit/src/Models/mitkExponentialDecayModelFactory.cpp
@@ -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.
 
 ============================================================================*/
 
-#include "mitkT2DecayModelFactory.h"
-#include "mitkT2DecayModelParameterizer.h"
+#include "mitkExponentialDecayModelFactory.h"
+#include "mitkExponentialDecayModelParameterizer.h"
 #include "mitkSimpleBarrierConstraintChecker.h"
 
-mitk::T2DecayModelFactory::T2DecayModelFactory()
+mitk::ExponentialDecayModelFactory::ExponentialDecayModelFactory()
 {
 };
 
-mitk::T2DecayModelFactory::~T2DecayModelFactory()
+mitk::ExponentialDecayModelFactory::~ExponentialDecayModelFactory()
 {
 };
 
 mitk::ModelParameterizerBase::ParametersType
-mitk::T2DecayModelFactory::GetDefaultInitialParameterization() const
+mitk::ExponentialDecayModelFactory::GetDefaultInitialParameterization() const
 {
-  return T2DecayModelParameterizer::New()->GetDefaultInitialParameterization();
+  return ExponentialDecayModelParameterizer::New()->GetDefaultInitialParameterization();
 };
 
-mitk::ConstraintCheckerBase::Pointer mitk::T2DecayModelFactory::CreateDefaultConstraints() const
+mitk::ConstraintCheckerBase::Pointer mitk::ExponentialDecayModelFactory::CreateDefaultConstraints() const
 {
   mitk::SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
 
   constraints->SetLowerBarrier(0, 0, 0);
   constraints->SetLowerBarrier(1, 0, 0);
 
   return constraints.GetPointer();
 };
 
-mitk::ModelParameterizerBase::Pointer mitk::T2DecayModelFactory::DoCreateParameterizer(
+mitk::ModelParameterizerBase::Pointer mitk::ExponentialDecayModelFactory::DoCreateParameterizer(
   const modelFit::ModelFitInfo* /*fit*/) const
 {
-  return T2DecayModelParameterizer::New().GetPointer();
+  return ExponentialDecayModelParameterizer::New().GetPointer();
 };
diff --git a/Modules/ModelFit/src/Models/mitkT2DecayModelParameterizer.cpp b/Modules/ModelFit/src/Models/mitkExponentialDecayModelParameterizer.cpp
similarity index 53%
rename from Modules/ModelFit/src/Models/mitkT2DecayModelParameterizer.cpp
rename to Modules/ModelFit/src/Models/mitkExponentialDecayModelParameterizer.cpp
index 890c5e25b1..f5d2e364d0 100644
--- a/Modules/ModelFit/src/Models/mitkT2DecayModelParameterizer.cpp
+++ b/Modules/ModelFit/src/Models/mitkExponentialDecayModelParameterizer.cpp
@@ -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.
 
 ============================================================================*/
 
-#include "mitkT2DecayModelParameterizer.h"
+#include "mitkExponentialDecayModelParameterizer.h"
 
-mitk::T2DecayModelParameterizer::ParametersType
-mitk::T2DecayModelParameterizer::GetDefaultInitialParameterization() const
+mitk::ExponentialDecayModelParameterizer::ParametersType
+mitk::ExponentialDecayModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(2);
-  initialParameters[0] = 10; //M0
-  initialParameters[1] = 1000; //T2
+  initialParameters[0] = 10; //y0
+  initialParameters[1] = 1000; //lambda
 
   return initialParameters;
 };
 
-mitk::T2DecayModelParameterizer::T2DecayModelParameterizer()
+mitk::ExponentialDecayModelParameterizer::ExponentialDecayModelParameterizer()
 {
 };
 
-mitk::T2DecayModelParameterizer::~T2DecayModelParameterizer()
+mitk::ExponentialDecayModelParameterizer::~ExponentialDecayModelParameterizer()
 {
 };
diff --git a/Modules/ModelFit/src/Models/mitkExponentialSaturationModel.cpp b/Modules/ModelFit/src/Models/mitkExponentialSaturationModel.cpp
index 51bcecc086..eb6608c68a 100644
--- a/Modules/ModelFit/src/Models/mitkExponentialSaturationModel.cpp
+++ b/Modules/ModelFit/src/Models/mitkExponentialSaturationModel.cpp
@@ -1,112 +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 "mitkExponentialSaturationModel.h"
 #include "mitkNumericConstants.h"
 
+const std::string mitk::ExponentialSaturationModel::NAME_PARAMETER_BAT = "onset";
+const std::string mitk::ExponentialSaturationModel::NAME_PARAMETER_y_bl = "baseline";
+const std::string mitk::ExponentialSaturationModel::NAME_PARAMETER_y_fin = "y_final";
+const std::string mitk::ExponentialSaturationModel::NAME_PARAMETER_k = "rate";
+
+const unsigned int mitk::ExponentialSaturationModel::NUMBER_OF_PARAMETERS = 4;
+
+const std::string mitk::ExponentialSaturationModel::UNIT_PARAMETER_BAT = "[unit of x]";
+const std::string mitk::ExponentialSaturationModel::UNIT_PARAMETER_y_bl = "[unit of y]";
+const std::string mitk::ExponentialSaturationModel::UNIT_PARAMETER_y_fin = "[unit of y]";
+const std::string mitk::ExponentialSaturationModel::UNIT_PARAMETER_k = "1/[unit of x]";
+
+const unsigned int mitk::ExponentialSaturationModel::POSITION_PARAMETER_BAT = 0;
+const unsigned int mitk::ExponentialSaturationModel::POSITION_PARAMETER_y_bl = 1;
+const unsigned int mitk::ExponentialSaturationModel::POSITION_PARAMETER_y_fin = 2;
+const unsigned int mitk::ExponentialSaturationModel::POSITION_PARAMETER_k = 3;
+
+const unsigned int mitk::ExponentialSaturationModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::ExponentialSaturationModel::MODEL_DISPLAY_NAME = "Exponential Saturation Model";
+
+const std::string mitk::ExponentialSaturationModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::ExponentialSaturationModel::FUNCTION_STRING = "if x<onset: y(x) = baseline , else: y(x) = baseline + (y_final-baseline) * (1 - exp(-rate*(x-onset)))";
+
+const std::string mitk::ExponentialSaturationModel::X_NAME = "x";
+
+const std::string mitk::ExponentialSaturationModel::X_AXIS_NAME = "X";
+
+const std::string mitk::ExponentialSaturationModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::ExponentialSaturationModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::ExponentialSaturationModel::Y_AXIS_UNIT = "unit of y";
+
 std::string mitk::ExponentialSaturationModel::GetModelDisplayName() const
 {
-  return "Exponential Saturation Model";
+  return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::ExponentialSaturationModel::GetModelType() const
 {
-  return "Generic";
+  return MODEL_TYPE;
 };
 
 mitk::ExponentialSaturationModel::FunctionStringType mitk::ExponentialSaturationModel::GetFunctionString() const
 {
-  return "if x<BAT f(x) = S0 , else f(x) = A * (1-exp(-*B(x-BAT)))";
+  return FUNCTION_STRING;
 };
 
 std::string mitk::ExponentialSaturationModel::GetXName() const
 {
-  return "t";
+  return X_NAME;
+};
+
+std::string mitk::ExponentialSaturationModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
 };
 
+std::string mitk::ExponentialSaturationModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::ExponentialSaturationModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
+};
+
+std::string mitk::ExponentialSaturationModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
 mitk::ExponentialSaturationModel::ParameterNamesType
 mitk::ExponentialSaturationModel::GetParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("bat");
-  result.push_back("s0");
-  result.push_back("sfin");
-  result.push_back("rate");
+  result.push_back(NAME_PARAMETER_BAT);
+  result.push_back(NAME_PARAMETER_y_bl);
+  result.push_back(NAME_PARAMETER_y_fin);
+  result.push_back(NAME_PARAMETER_k);
   return result;
 };
 
+mitk::ExponentialSaturationModel::ParamterUnitMapType mitk::ExponentialSaturationModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_BAT, UNIT_PARAMETER_BAT));
+  result.insert(std::make_pair(NAME_PARAMETER_y_bl, UNIT_PARAMETER_y_bl));
+  result.insert(std::make_pair(NAME_PARAMETER_y_fin, UNIT_PARAMETER_y_fin));
+  result.insert(std::make_pair(NAME_PARAMETER_k, UNIT_PARAMETER_k));
+
+  return result;
+}
+
 mitk::ExponentialSaturationModel::ParametersSizeType
 mitk::ExponentialSaturationModel::GetNumberOfParameters() const
 {
-  return 4;
+  return NUMBER_OF_PARAMETERS;
 };
 
 mitk::ExponentialSaturationModel::ModelResultType
 mitk::ExponentialSaturationModel::ComputeModelfunction(const ParametersType& parameters) const
 {
   ModelResultType signal(m_TimeGrid.GetSize());
 
   ModelResultType::iterator signalPos = signal.begin();
 
   for (const auto& gridPos : m_TimeGrid)
   {
     if ((gridPos) < parameters[0])
     {
       *signalPos = parameters[1];
     }
     else
     {
       *signalPos = parameters[1] + (parameters[2]- parameters[1]) * (1.0 - exp((-1.0) * parameters[3] * (gridPos - parameters[0])));
     }
 
     ++signalPos;
   }
 
   return signal;
 };
 
 mitk::ExponentialSaturationModel::ParameterNamesType mitk::ExponentialSaturationModel::GetStaticParameterNames() const
 {
   ParameterNamesType result;
 
   return result;
 }
 
 mitk::ExponentialSaturationModel::ParametersSizeType  mitk::ExponentialSaturationModel::GetNumberOfStaticParameters() const
 {
-  return 0;
+  return NUMBER_OF_STATIC_PARAMETERS;
 }
 
 void mitk::ExponentialSaturationModel::SetStaticParameter(const ParameterNameType& /*name*/,
     const StaticParameterValuesType& /*values*/)
 {
   //do nothing
 };
 
 mitk::ExponentialSaturationModel::StaticParameterValuesType mitk::ExponentialSaturationModel::GetStaticParameterValue(
   const ParameterNameType& /*name*/) const
 {
   StaticParameterValuesType result;
 
   //do nothing
 
   return result;
 };
 
 itk::LightObject::Pointer mitk::ExponentialSaturationModel::InternalClone() const
 {
   ExponentialSaturationModel::Pointer newClone = ExponentialSaturationModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
diff --git a/Modules/ModelFit/src/Models/mitkLinearModel.cpp b/Modules/ModelFit/src/Models/mitkLinearModel.cpp
index 25e6ed786a..beaaf10d40 100644
--- a/Modules/ModelFit/src/Models/mitkLinearModel.cpp
+++ b/Modules/ModelFit/src/Models/mitkLinearModel.cpp
@@ -1,125 +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.
 
 ============================================================================*/
 
 #include "mitkLinearModel.h"
 
+const std::string mitk::LinearModel::NAME_PARAMETER_b = "slope";
+const std::string mitk::LinearModel::NAME_PARAMETER_y0 = "y-intercept";
+
+const unsigned int mitk::LinearModel::NUMBER_OF_PARAMETERS = 2;
+
+const std::string mitk::LinearModel::UNIT_PARAMETER_b = "[unit of y]/[unit of x]";
+const std::string mitk::LinearModel::UNIT_PARAMETER_y0 = "[unit of y]";
+
+const unsigned int mitk::LinearModel::POSITION_PARAMETER_b = 0;
+const unsigned int mitk::LinearModel::POSITION_PARAMETER_y0 = 1;
+
+const std::string mitk::LinearModel::NAME_DERIVED_PARAMETER_x_intercept = "x-intercept";
+
+const unsigned int mitk::LinearModel::NUMBER_OF_DERIVED_PARAMETERS = 1;
+
+const std::string mitk::LinearModel::UNIT_DERIVED_PARAMETER_x_intercept = "[unit of x]";
+
+const unsigned int mitk::LinearModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::LinearModel::MODEL_DISPLAY_NAME = "Linear Model";
+
+const std::string mitk::LinearModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::LinearModel::FUNCTION_STRING = "y(x) = y-intercept + slope*x";
+
+const std::string mitk::LinearModel::X_NAME = "x";
+
+const std::string mitk::LinearModel::X_AXIS_NAME = "X";
+
+const std::string mitk::LinearModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::LinearModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::LinearModel::Y_AXIS_UNIT = "unit of y";
+
+
 std::string mitk::LinearModel::GetModelDisplayName() const
 {
-  return "Linear Model";
+  return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::LinearModel::GetModelType() const
 {
-  return "Generic";
+  return MODEL_TYPE;
 };
 
 mitk::LinearModel::FunctionStringType mitk::LinearModel::GetFunctionString() const
 {
-  return "slope*x+offset";
+  return FUNCTION_STRING;
 };
 
 std::string mitk::LinearModel::GetXName() const
 {
-  return "x";
+  return X_NAME;
+};
+
+std::string mitk::LinearModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
+};
+
+std::string mitk::LinearModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::LinearModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
 };
 
+std::string mitk::LinearModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
 mitk::LinearModel::ParameterNamesType
 mitk::LinearModel::GetParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("slope");
-  result.push_back("offset");
+  result.push_back(NAME_PARAMETER_b);
+  result.push_back(NAME_PARAMETER_y0);
   return result;
 };
 
+mitk::LinearModel::ParamterUnitMapType mitk::LinearModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_b, UNIT_PARAMETER_b));
+  result.insert(std::make_pair(NAME_PARAMETER_y0, UNIT_PARAMETER_y0));
+
+  return result;
+}
+
 mitk::LinearModel::ParametersSizeType
 mitk::LinearModel::GetNumberOfParameters() const
 {
-  return 2;
+  return NUMBER_OF_PARAMETERS;
 };
 
 mitk::LinearModel::ParameterNamesType
 mitk::LinearModel::GetDerivedParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("x-intercept");
+  result.push_back(NAME_DERIVED_PARAMETER_x_intercept);
   return result;
 };
 
 mitk::LinearModel::ParametersSizeType
 mitk::LinearModel::GetNumberOfDerivedParameters() const
 {
-  return 1;
+  return NUMBER_OF_DERIVED_PARAMETERS;
+};
+
+mitk::LinearModel::ParamterUnitMapType mitk::LinearModel::GetDerivedParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_x_intercept, UNIT_DERIVED_PARAMETER_x_intercept));
+
+  return result;
 };
 
 mitk::LinearModel::ModelResultType
 mitk::LinearModel::ComputeModelfunction(const ParametersType& parameters) const
 {
+  //Model Parameters
+  double     b = parameters[POSITION_PARAMETER_b];
+  double     y0 = parameters[POSITION_PARAMETER_y0];
+
   ModelResultType signal(m_TimeGrid.GetSize());
 
   TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
   ModelResultType::iterator signalPos = signal.begin();
 
   for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd;
        ++gridPos, ++signalPos)
   {
-    *signalPos = parameters[0] * (*gridPos) + parameters[1];
+    *signalPos = b * (*gridPos) + y0;
   }
 
   return signal;
 };
 
 mitk::LinearModel::ParameterNamesType mitk::LinearModel::GetStaticParameterNames() const
 {
   ParameterNamesType result;
 
   return result;
 }
 
 mitk::LinearModel::ParametersSizeType  mitk::LinearModel::GetNumberOfStaticParameters() const
 {
-  return 0;
+  return NUMBER_OF_STATIC_PARAMETERS;
 }
 
 void mitk::LinearModel::SetStaticParameter(const ParameterNameType& /*name*/,
     const StaticParameterValuesType& /*values*/)
 {
   //do nothing
 };
 
 mitk::LinearModel::StaticParameterValuesType mitk::LinearModel::GetStaticParameterValue(
   const ParameterNameType& /*name*/) const
 {
   StaticParameterValuesType result;
 
   //do nothing
 
   return result;
 };
 
 mitk::ModelBase::DerivedParameterMapType mitk::LinearModel::ComputeDerivedParameters(
   const mitk::ModelBase::ParametersType& parameters) const
 {
   DerivedParameterMapType result;
-  double intercept = -1 * parameters[1] / parameters[0];
-  result.insert(std::make_pair("x-intercept", intercept));
+
+  //Model Parameters
+  double     b = parameters[POSITION_PARAMETER_b];
+  double     y0 = parameters[POSITION_PARAMETER_y0];
+
+  double intercept = -1 * y0 / b;
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_x_intercept, intercept));
   return result;
 };
 
 itk::LightObject::Pointer mitk::LinearModel::InternalClone() const
 {
   LinearModel::Pointer newClone = LinearModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
diff --git a/Modules/ModelFit/src/Models/mitkT2DecayModel.cpp b/Modules/ModelFit/src/Models/mitkT2DecayModel.cpp
deleted file mode 100644
index 900a5a1bc7..0000000000
--- a/Modules/ModelFit/src/Models/mitkT2DecayModel.cpp
+++ /dev/null
@@ -1,123 +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 "mitkT2DecayModel.h"
-#include "mitkNumericConstants.h"
-
-std::string mitk::T2DecayModel::GetModelDisplayName() const
-{
-  return "T2 Decay Model";
-};
-
-std::string mitk::T2DecayModel::GetModelType() const
-{
-  return "MRSignal";
-};
-
-mitk::T2DecayModel::FunctionStringType mitk::T2DecayModel::GetFunctionString() const
-{
-  return "M0 * exp(-t/T2)";
-};
-
-std::string mitk::T2DecayModel::GetXName() const
-{
-  return "t";
-};
-
-mitk::T2DecayModel::ParameterNamesType
-mitk::T2DecayModel::GetParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back("M0");
-  result.push_back("T2");
-  return result;
-};
-
-mitk::T2DecayModel::ParametersSizeType
-mitk::T2DecayModel::GetNumberOfParameters() const
-{
-  return 2;
-};
-
-mitk::T2DecayModel::ModelResultType
-mitk::T2DecayModel::ComputeModelfunction(const ParametersType& parameters) const
-{
-  ModelResultType signal(m_TimeGrid.GetSize());
-
-  ModelResultType::iterator signalPos = signal.begin();
-
-  for (const auto& gridPos : m_TimeGrid)
-  {
-    *signalPos = parameters[0] * exp(-1.0 * gridPos/ parameters[1]);
-    ++signalPos;
-  }
-
-  return signal;
-};
-
-mitk::T2DecayModel::ParameterNamesType mitk::T2DecayModel::GetStaticParameterNames() const
-{
-  ParameterNamesType result;
-
-  return result;
-}
-
-mitk::T2DecayModel::ParametersSizeType  mitk::T2DecayModel::GetNumberOfStaticParameters() const
-{
-  return 0;
-}
-
-void mitk::T2DecayModel::SetStaticParameter(const ParameterNameType& /*name*/,
-    const StaticParameterValuesType& /*values*/)
-{
-  //do nothing
-};
-
-mitk::T2DecayModel::StaticParameterValuesType mitk::T2DecayModel::GetStaticParameterValue(
-  const ParameterNameType& /*name*/) const
-{
-  StaticParameterValuesType result;
-
-  //do nothing
-
-  return result;
-};
-
-mitk::T2DecayModel::DerivedParametersSizeType mitk::T2DecayModel::GetNumberOfDerivedParameters() const
-{
-  return 1;
-}
-
-mitk::T2DecayModel::DerivedParameterNamesType mitk::T2DecayModel::GetDerivedParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back("R2");
-  return result;
-};
-
-mitk::ModelBase::DerivedParameterMapType mitk::T2DecayModel::ComputeDerivedParameters(
-  const mitk::ModelBase::ParametersType &parameters) const
-{
-  DerivedParameterMapType result;
-  double inverse = 1.0 / (parameters[1] + mitk::eps);
-  result.insert(std::make_pair("R2", inverse));
-  return result;
-};
-
-itk::LightObject::Pointer mitk::T2DecayModel::InternalClone() const
-{
-  T2DecayModel::Pointer newClone = T2DecayModel::New();
-
-  newClone->SetTimeGrid(this->m_TimeGrid);
-
-  return newClone.GetPointer();
-};
diff --git a/Modules/ModelFit/src/Models/mitkThreeStepLinearModel.cpp b/Modules/ModelFit/src/Models/mitkThreeStepLinearModel.cpp
new file mode 100644
index 0000000000..6ec5cd98dc
--- /dev/null
+++ b/Modules/ModelFit/src/Models/mitkThreeStepLinearModel.cpp
@@ -0,0 +1,321 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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 "mitkThreeStepLinearModel.h"
+#include <mitkIOUtil.h>
+
+const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_y_bl = "baseline";
+const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_x0 = "x_changepoint1";
+const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_x1 = "x_changepoint2";
+const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_b0 = "slope1";
+const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_b1 = "slope2";
+
+const unsigned int mitk::ThreeStepLinearModel::NUMBER_OF_PARAMETERS = 5;
+
+const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_y_bl = "[unit of y]";
+const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_x0 = "[unit of x]";
+const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_x1 = "[unit of x]";
+const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_b0 = "[unit of y]/[unit of x]";
+const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_b1 = "[unit of y]/[unit of x]";
+
+const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_y_bl = 0;
+const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_x0 = 1;
+const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_x1 = 2;
+const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_b0 = 3;
+const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_b1 = 4;
+
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_auc = "auc";
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_x_fin = "x_final";
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_y_fin = "y_final";
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_y_max = "y_max";
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_y1 = "y-intercept1";
+const std::string mitk::ThreeStepLinearModel::NAME_DERIVED_PARAMETER_y2 = "y-intercept2";
+
+const unsigned int mitk::ThreeStepLinearModel::NUMBER_OF_DERIVED_PARAMETERS = 6;
+
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_auc = "[unit of x]*[unit of y]";
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_x_fin = "[unit of x]";
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_y_fin = "[unit of y]";
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_y_max = "[unit of y]";
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_y1 = "[unit of y]";
+const std::string mitk::ThreeStepLinearModel::UNIT_DERIVED_PARAMETER_y2 = "[unit of y]";
+
+const unsigned int mitk::ThreeStepLinearModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::ThreeStepLinearModel::MODEL_DISPLAY_NAME = "Three Step Linear Model";
+
+const std::string mitk::ThreeStepLinearModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::ThreeStepLinearModel::FUNCTION_STRING = "if x < x_changepoint1: y(x) = baseline, else if x_changepoint1 <= x <= x_changepoint2: y(x) = y-intercept1 + slope1*x, else if x>x_changepoint2: y(x) = y-intercept2 + slope2*x";
+
+const std::string mitk::ThreeStepLinearModel::X_NAME = "x";
+
+const std::string mitk::ThreeStepLinearModel::X_AXIS_NAME = "X";
+
+const std::string mitk::ThreeStepLinearModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::ThreeStepLinearModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::ThreeStepLinearModel::Y_AXIS_UNIT = "unit of y";
+
+
+std::string mitk::ThreeStepLinearModel::GetModelDisplayName() const
+{
+  return MODEL_DISPLAY_NAME;
+};
+
+std::string mitk::ThreeStepLinearModel::GetModelType() const
+{
+  return MODEL_TYPE;
+};
+
+mitk::ThreeStepLinearModel::FunctionStringType mitk::ThreeStepLinearModel::GetFunctionString() const
+{
+  return FUNCTION_STRING;
+};
+
+std::string mitk::ThreeStepLinearModel::GetXName() const
+{
+  return X_NAME;
+};
+
+std::string mitk::ThreeStepLinearModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
+};
+
+std::string mitk::ThreeStepLinearModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::ThreeStepLinearModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
+};
+
+std::string mitk::ThreeStepLinearModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
+mitk::ThreeStepLinearModel::ParameterNamesType
+mitk::ThreeStepLinearModel::GetParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_PARAMETER_y_bl);
+  result.push_back(NAME_PARAMETER_x0);
+  result.push_back(NAME_PARAMETER_x1);
+  result.push_back(NAME_PARAMETER_b0);
+  result.push_back(NAME_PARAMETER_b1);
+  return result;
+};
+
+mitk::ThreeStepLinearModel::ParamterUnitMapType mitk::ThreeStepLinearModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_y_bl, UNIT_PARAMETER_y_bl));
+  result.insert(std::make_pair(NAME_PARAMETER_x0, UNIT_PARAMETER_x0));
+  result.insert(std::make_pair(NAME_PARAMETER_x1, UNIT_PARAMETER_x1));
+  result.insert(std::make_pair(NAME_PARAMETER_b0, UNIT_PARAMETER_b0));
+  result.insert(std::make_pair(NAME_PARAMETER_b1, UNIT_PARAMETER_b1));
+
+  return result;
+}
+
+mitk::ThreeStepLinearModel::ParametersSizeType
+mitk::ThreeStepLinearModel::GetNumberOfParameters() const
+{
+  return NUMBER_OF_PARAMETERS;
+};
+
+mitk::ThreeStepLinearModel::ParameterNamesType
+mitk::ThreeStepLinearModel::GetDerivedParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_DERIVED_PARAMETER_auc);
+  result.push_back(NAME_DERIVED_PARAMETER_x_fin);
+  result.push_back(NAME_DERIVED_PARAMETER_y_fin);
+  result.push_back(NAME_DERIVED_PARAMETER_y_max);
+  result.push_back(NAME_DERIVED_PARAMETER_y1);
+  result.push_back(NAME_DERIVED_PARAMETER_y2);
+  return result;
+};
+
+mitk::ThreeStepLinearModel::ParametersSizeType
+mitk::ThreeStepLinearModel::GetNumberOfDerivedParameters() const
+{
+  return NUMBER_OF_DERIVED_PARAMETERS;
+};
+
+mitk::ThreeStepLinearModel::ParamterUnitMapType mitk::ThreeStepLinearModel::GetDerivedParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_auc, UNIT_DERIVED_PARAMETER_auc));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_x_fin, UNIT_DERIVED_PARAMETER_x_fin));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_fin, UNIT_DERIVED_PARAMETER_y_fin));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_max, UNIT_DERIVED_PARAMETER_y_max));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y1, UNIT_DERIVED_PARAMETER_y1));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y2, UNIT_DERIVED_PARAMETER_y2));
+
+  return result;
+};
+
+
+double mitk::ThreeStepLinearModel::ComputeSignalFromParameters(double x, double y_bl, double x0, double x1, double b0, double b1, double y1, double y2)
+{
+  double signal = 0.0;
+
+  if (x < x0)
+  {
+    signal = y_bl;
+  }
+  else if (x >= x0 && x <= x1)
+  {
+    signal = b0 * x + y1;
+  }
+  else
+  {
+    signal = b1 * x + y2;
+  }
+
+
+  return signal;
+};
+
+
+mitk::ThreeStepLinearModel::ModelResultType
+mitk::ThreeStepLinearModel::ComputeModelfunction(const ParametersType& parameters) const
+{
+  //Model Parameters
+  const double     y_bl = (double) parameters[POSITION_PARAMETER_y_bl];
+  const double     x0 = (double) parameters[POSITION_PARAMETER_x0] ;
+  const double     x1 = (double) parameters[POSITION_PARAMETER_x1] ;
+  const double     b0 = (double) parameters[POSITION_PARAMETER_b0] ;
+  const double     b1 = (double) parameters[POSITION_PARAMETER_b1] ;
+
+  double     y1 = y_bl - b0 * x0;
+  double     y2 = (b0 * x1 + y1) - (b1 * x1);
+
+  ModelResultType signal(m_TimeGrid.GetSize());
+
+  TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
+
+  ModelResultType::iterator signalPos = signal.begin();
+
+  for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd; ++gridPos, ++signalPos)
+  {
+    *signalPos = ComputeSignalFromParameters(*gridPos, y_bl, x0, x1, b0, b1, y1, y2);
+  }
+
+  return signal;
+};
+
+mitk::ThreeStepLinearModel::ParameterNamesType mitk::ThreeStepLinearModel::GetStaticParameterNames() const
+{
+  ParameterNamesType result;
+
+  return result;
+}
+
+mitk::ThreeStepLinearModel::ParametersSizeType  mitk::ThreeStepLinearModel::GetNumberOfStaticParameters() const
+{
+  return 0;
+}
+
+void mitk::ThreeStepLinearModel::SetStaticParameter(const ParameterNameType&,
+    const StaticParameterValuesType&)
+{
+  //do nothing
+};
+
+mitk::ThreeStepLinearModel::StaticParameterValuesType mitk::ThreeStepLinearModel::GetStaticParameterValue(
+  const ParameterNameType&) const
+{
+  StaticParameterValuesType result;
+
+  //do nothing
+
+  return result;
+};
+
+mitk::ModelBase::DerivedParameterMapType mitk::ThreeStepLinearModel::ComputeDerivedParameters(
+  const mitk::ModelBase::ParametersType& parameters) const
+{
+    const double     y_bl = (double) parameters[POSITION_PARAMETER_y_bl];
+    const double     x0 = (double) parameters[POSITION_PARAMETER_x0] ;
+    const double     x1 = (double) parameters[POSITION_PARAMETER_x1] ;
+    const double     b0 = (double) parameters[POSITION_PARAMETER_b0] ;
+    const double     b1 = (double) parameters[POSITION_PARAMETER_b1] ;
+
+    const double     y1 = y_bl - b0 * x0;
+    const double     y2 = (b0 * x1 + y1) - (b1 * x1);
+
+    unsigned int timeSteps = m_TimeGrid.GetSize();
+
+    const double x_fin = (m_TimeGrid.empty() == false) ? (m_TimeGrid.GetElement(timeSteps - 1)) : ( mitkThrow() << "An exception occured because time grid is empty, method can't continue.");
+
+    const double y_fin = b1 * x_fin + y2;
+
+    double y_max = y_fin;
+    if ((b0 >= 0) && (b1 >= 0))
+      y_max = y_fin;
+    else if ((b0 < 0) && (b1 < 0))
+      y_max = y_bl;
+    else if ((b0 > 0) && (b1 < 0))
+      y_max = (b0 * x1 + y1);
+    else
+    {
+      if (abs(b0 * (x1 - x0)) >= abs(b1 * (x_fin - x1)))
+        y_max = y_bl;
+      else y_max = y_fin;
+    }
+
+    double auc = 0.0;
+    TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
+
+    for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd - 1; ++gridPos)
+    {
+      double currentGridPos = *gridPos;
+      double nextGridPos = *(++gridPos);
+      double deltaX = nextGridPos - currentGridPos;
+      double deltaY = ComputeSignalFromParameters(nextGridPos, y_bl, x0, x1, b0, b1, y1, y2) - ComputeSignalFromParameters(currentGridPos, y_bl, x0, x1, b0, b1, y1, y2);
+      double Yi = ComputeSignalFromParameters(currentGridPos, y_bl, x0, x1, b0, b1, y1, y2 );
+      double intI = 0.5 * deltaX * deltaY + Yi * deltaX;
+      auc += std::abs(intI);
+      --gridPos;
+    }
+
+
+    DerivedParameterMapType result;
+
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_auc, auc));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_x_fin, x_fin));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_fin, y_fin));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_max, y_max));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y1, y1));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y2, y2));
+
+
+    return result;
+};
+
+itk::LightObject::Pointer mitk::ThreeStepLinearModel::InternalClone() const
+{
+  ThreeStepLinearModel::Pointer newClone = ThreeStepLinearModel::New();
+
+  newClone->SetTimeGrid(this->m_TimeGrid);
+
+  return newClone.GetPointer();
+};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModelFactory.cpp b/Modules/ModelFit/src/Models/mitkThreeStepLinearModelFactory.cpp
similarity index 100%
rename from Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModelFactory.cpp
rename to Modules/ModelFit/src/Models/mitkThreeStepLinearModelFactory.cpp
diff --git a/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModelParameterizer.cpp b/Modules/ModelFit/src/Models/mitkThreeStepLinearModelParameterizer.cpp
similarity index 92%
rename from Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModelParameterizer.cpp
rename to Modules/ModelFit/src/Models/mitkThreeStepLinearModelParameterizer.cpp
index 6eb6bcf471..3c4dfda211 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModelParameterizer.cpp
+++ b/Modules/ModelFit/src/Models/mitkThreeStepLinearModelParameterizer.cpp
@@ -1,29 +1,29 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkThreeStepLinearModelParameterizer.h"
 
 mitk::ThreeStepLinearModelParameterizer::ParametersType
 mitk::ThreeStepLinearModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(5);
-  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_s0] = 0.0;
-  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_t1] = 50.0;
-  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_t2] = 100.0;
-  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_a1] = 1.0;
-  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_a2] = -1.0;
+  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_y_bl] = 0.0;
+  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_x0] = 50.0;
+  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_x1] = 100.0;
+  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_b0] = 1.0;
+  initialParameters[mitk:: ThreeStepLinearModel::POSITION_PARAMETER_b1] = -1.0;
 
   return initialParameters;
 };
 
 
diff --git a/Modules/ModelFit/src/Models/mitkTwoStepLinearModel.cpp b/Modules/ModelFit/src/Models/mitkTwoStepLinearModel.cpp
new file mode 100644
index 0000000000..ab17e6770f
--- /dev/null
+++ b/Modules/ModelFit/src/Models/mitkTwoStepLinearModel.cpp
@@ -0,0 +1,285 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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 "mitkTwoStepLinearModel.h"
+#include <mitkIOUtil.h>
+
+
+const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_y0 = "y-intercept";
+const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_x0 = "x_changepoint";
+const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_b0 = "slope1";
+const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_b1 = "slope2";
+
+const unsigned int mitk::TwoStepLinearModel::NUMBER_OF_PARAMETERS = 4;
+
+const std::string mitk::TwoStepLinearModel::UNIT_PARAMETER_y0 = "[unit of y]";
+const std::string mitk::TwoStepLinearModel::UNIT_PARAMETER_x0 = "[unit of x]";
+const std::string mitk::TwoStepLinearModel::UNIT_PARAMETER_b0 = "[unit of y]/[unit of x]";
+const std::string mitk::TwoStepLinearModel::UNIT_PARAMETER_b1 = "[unit of y]/[unit of x]";
+
+const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_y0 = 0;
+const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_x0 = 1;
+const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_b0 = 2;
+const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_b1 = 3;
+
+const std::string mitk::TwoStepLinearModel::NAME_DERIVED_PARAMETER_auc = "auc";
+const std::string mitk::TwoStepLinearModel::NAME_DERIVED_PARAMETER_y_fin = "y_final";
+const std::string mitk::TwoStepLinearModel::NAME_DERIVED_PARAMETER_y_max = "y_max";
+const std::string mitk::TwoStepLinearModel::NAME_DERIVED_PARAMETER_y1 = "y-intercept1";
+
+const unsigned int mitk::TwoStepLinearModel::NUMBER_OF_DERIVED_PARAMETERS = 4;
+
+const std::string mitk::TwoStepLinearModel::UNIT_DERIVED_PARAMETER_auc = "[unit of x]*[unit of y]";
+const std::string mitk::TwoStepLinearModel::UNIT_DERIVED_PARAMETER_y_fin = "[unit of y]";
+const std::string mitk::TwoStepLinearModel::UNIT_DERIVED_PARAMETER_y_max = "[unit of y]";
+const std::string mitk::TwoStepLinearModel::UNIT_DERIVED_PARAMETER_y1 = "[unit of y]";
+
+const unsigned int mitk::TwoStepLinearModel::NUMBER_OF_STATIC_PARAMETERS = 0;
+
+const std::string mitk::TwoStepLinearModel::MODEL_DISPLAY_NAME = "Two Step Linear Model";
+
+const std::string mitk::TwoStepLinearModel::MODEL_TYPE = "Generic";
+
+const std::string mitk::TwoStepLinearModel::FUNCTION_STRING = "if x < x_changepoint: y(x) = y-intercept + slope1*x, else: y(x) = y-intercept1 + slope2*x";
+
+const std::string mitk::TwoStepLinearModel::X_NAME = "x";
+
+const std::string mitk::TwoStepLinearModel::X_AXIS_NAME = "X";
+
+const std::string mitk::TwoStepLinearModel::X_AXIS_UNIT = "unit of x";
+
+const std::string mitk::TwoStepLinearModel::Y_AXIS_NAME = "Y";
+
+const std::string mitk::TwoStepLinearModel::Y_AXIS_UNIT = "unit of y";
+
+
+std::string mitk::TwoStepLinearModel::GetModelDisplayName() const
+{
+  return MODEL_DISPLAY_NAME;
+};
+
+std::string mitk::TwoStepLinearModel::GetModelType() const
+{
+  return MODEL_TYPE;
+};
+
+mitk::TwoStepLinearModel::FunctionStringType mitk::TwoStepLinearModel::GetFunctionString() const
+{
+  return FUNCTION_STRING;
+};
+
+std::string mitk::TwoStepLinearModel::GetXName() const
+{
+  return X_NAME;
+};
+
+std::string mitk::TwoStepLinearModel::GetXAxisName() const
+{
+  return X_AXIS_NAME;
+};
+
+std::string mitk::TwoStepLinearModel::GetXAxisUnit() const
+{
+  return X_AXIS_UNIT;
+}
+
+std::string mitk::TwoStepLinearModel::GetYAxisName() const
+{
+  return Y_AXIS_NAME;
+};
+
+std::string mitk::TwoStepLinearModel::GetYAxisUnit() const
+{
+  return Y_AXIS_UNIT;
+}
+
+mitk::TwoStepLinearModel::ParameterNamesType
+mitk::TwoStepLinearModel::GetParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_PARAMETER_y0);
+  result.push_back(NAME_PARAMETER_x0);
+  result.push_back(NAME_PARAMETER_b0);
+  result.push_back(NAME_PARAMETER_b1);
+  return result;
+};
+
+mitk::TwoStepLinearModel::ParamterUnitMapType mitk::TwoStepLinearModel::GetParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_PARAMETER_y0, UNIT_PARAMETER_y0));
+  result.insert(std::make_pair(NAME_PARAMETER_x0, UNIT_PARAMETER_x0));
+  result.insert(std::make_pair(NAME_PARAMETER_b0, UNIT_PARAMETER_b0));
+  result.insert(std::make_pair(NAME_PARAMETER_b1, UNIT_PARAMETER_b1));
+
+  return result;
+}
+
+mitk::TwoStepLinearModel::ParametersSizeType
+mitk::TwoStepLinearModel::GetNumberOfParameters() const
+{
+  return NUMBER_OF_PARAMETERS;
+};
+
+mitk::TwoStepLinearModel::ParameterNamesType
+mitk::TwoStepLinearModel::GetDerivedParameterNames() const
+{
+  ParameterNamesType result;
+  result.push_back(NAME_DERIVED_PARAMETER_auc);
+  result.push_back(NAME_DERIVED_PARAMETER_y_fin);
+  result.push_back(NAME_DERIVED_PARAMETER_y_max);
+  result.push_back(NAME_DERIVED_PARAMETER_y1);
+  return result;
+};
+
+mitk::TwoStepLinearModel::ParametersSizeType
+mitk::TwoStepLinearModel::GetNumberOfDerivedParameters() const
+{
+  return NUMBER_OF_DERIVED_PARAMETERS;
+};
+
+mitk::TwoStepLinearModel::ParamterUnitMapType mitk::TwoStepLinearModel::GetDerivedParameterUnits() const
+{
+  ParamterUnitMapType result;
+
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_auc, UNIT_DERIVED_PARAMETER_auc));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_fin, UNIT_DERIVED_PARAMETER_y_fin));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_max, UNIT_DERIVED_PARAMETER_y_max));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y1, UNIT_DERIVED_PARAMETER_y1));
+
+  return result;
+};
+
+double mitk::TwoStepLinearModel::ComputeSignalFromParameters(double x, double x0, double b0, double b1, double y0, double y1)
+{
+  return (x < x0) ? (b0 * x + y0) : (b1 * x + y1);
+};
+
+
+
+
+mitk::TwoStepLinearModel::ModelResultType
+mitk::TwoStepLinearModel::ComputeModelfunction(const ParametersType& parameters) const
+{
+
+  //Model Parameters
+  const auto y0 = parameters[POSITION_PARAMETER_y0];
+  const auto x0 = parameters[POSITION_PARAMETER_x0] ;
+  const auto b0 = parameters[POSITION_PARAMETER_b0] ;
+  const auto b1 = parameters[POSITION_PARAMETER_b1] ;
+
+  double y1 = (b0 - b1) * x0 + y0;
+
+  ModelResultType signal(m_TimeGrid.GetSize());
+
+  TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
+
+  ModelResultType::iterator signalPos = signal.begin();
+
+  for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd; ++gridPos, ++signalPos)
+  {
+    *signalPos = ComputeSignalFromParameters(*gridPos, x0, b0, b1, y0, y1);
+  }
+
+  return signal;
+};
+
+mitk::TwoStepLinearModel::ParameterNamesType mitk::TwoStepLinearModel::GetStaticParameterNames() const
+{
+  ParameterNamesType result;
+
+  return result;
+}
+
+mitk::TwoStepLinearModel::ParametersSizeType  mitk::TwoStepLinearModel::GetNumberOfStaticParameters() const
+{
+  return 0;
+}
+
+void mitk::TwoStepLinearModel::SetStaticParameter(const ParameterNameType& /*name*/,
+    const StaticParameterValuesType& /*values*/)
+{
+  //do nothing
+};
+
+mitk::TwoStepLinearModel::StaticParameterValuesType mitk::TwoStepLinearModel::GetStaticParameterValue(
+  const ParameterNameType& /*name*/) const
+{
+  StaticParameterValuesType result;
+
+  //do nothing
+
+  return result;
+};
+
+mitk::ModelBase::DerivedParameterMapType mitk::TwoStepLinearModel::ComputeDerivedParameters(
+  const mitk::ModelBase::ParametersType& parameters) const
+{
+    const auto y0 = parameters[POSITION_PARAMETER_y0];
+    const auto x0 = parameters[POSITION_PARAMETER_x0] ;
+    const auto b0 = parameters[POSITION_PARAMETER_b0] ;
+    const auto b1 = parameters[POSITION_PARAMETER_b1] ;
+    const auto y1 = (b0 - b1) * x0 + y0;
+
+    unsigned int timeSteps = m_TimeGrid.GetSize();
+
+    const double taq = (m_TimeGrid.empty() == false) ? (m_TimeGrid.GetElement(timeSteps - 1)) : (mitkThrow() << "An exception occured because time grid is empty, method can't continue.");
+
+    const double y_fin = b1 * taq + y1;
+
+    double y_max = y_fin;
+    if ((b0 >= 0) && (b1 >= 0))
+      y_max = y_fin;
+    else if ((b0 < 0) && (b1 < 0))
+      y_max = y0;
+    else if ((b0 > 0) && (b1 < 0))
+      y_max = (b0 * x0 + y0);
+    else
+    {
+      if (abs(b0 * x0) >= abs(b1 * (taq - x0)))
+        y_max = y0;
+      else y_max = y_fin;
+    }
+
+    double auc = 0.0;
+    TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
+    for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd -1; ++gridPos)
+    {
+      double currentGridPos = *gridPos;
+      double nextGridPos = *(++gridPos);
+      double deltaX = nextGridPos - currentGridPos;
+      double deltaY = ComputeSignalFromParameters(nextGridPos, x0, b0, b1, y0, y1) - ComputeSignalFromParameters(currentGridPos, x0, b0, b1, y0, y1);
+      double Yi = ComputeSignalFromParameters(currentGridPos, x0, b0, b1, y0, y1);
+      double intI = 0.5 * deltaX * deltaY + Yi * deltaX;
+      auc += std::abs(intI);
+      --gridPos;
+    }
+
+    DerivedParameterMapType result;
+
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_auc, auc));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_fin, y_fin));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y_max, y_max));
+    result.insert(std::make_pair(NAME_DERIVED_PARAMETER_y1, y1));
+
+    return result;
+};
+
+itk::LightObject::Pointer mitk::TwoStepLinearModel::InternalClone() const
+{
+  TwoStepLinearModel::Pointer newClone = TwoStepLinearModel::New();
+
+  newClone->SetTimeGrid(this->m_TimeGrid);
+
+  return newClone.GetPointer();
+};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelFactory.cpp b/Modules/ModelFit/src/Models/mitkTwoStepLinearModelFactory.cpp
similarity index 100%
rename from Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelFactory.cpp
rename to Modules/ModelFit/src/Models/mitkTwoStepLinearModelFactory.cpp
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelParameterizer.cpp b/Modules/ModelFit/src/Models/mitkTwoStepLinearModelParameterizer.cpp
similarity index 94%
rename from Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelParameterizer.cpp
rename to Modules/ModelFit/src/Models/mitkTwoStepLinearModelParameterizer.cpp
index 29f6b5287c..b41341ed65 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelParameterizer.cpp
+++ b/Modules/ModelFit/src/Models/mitkTwoStepLinearModelParameterizer.cpp
@@ -1,28 +1,28 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkTwoStepLinearModelParameterizer.h"
 
 mitk::TwoStepLinearModelParameterizer::ParametersType
 mitk::TwoStepLinearModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(4);
-  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_y1] = 0.0;
-  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_t] = 50;
-  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_a1] = 1.0;
-  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_a2] = -1.0;
+  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_y0] = 0.0;
+  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_x0] = 50;
+  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_b0] = 1.0;
+  initialParameters[mitk:: TwoStepLinearModel::POSITION_PARAMETER_b1] = -1.0;
 
   return initialParameters;
 };
 
 
diff --git a/Modules/ModelFit/test/files.cmake b/Modules/ModelFit/test/files.cmake
index e0b2725304..c201b63062 100644
--- a/Modules/ModelFit/test/files.cmake
+++ b/Modules/ModelFit/test/files.cmake
@@ -1,19 +1,22 @@
 SET(MODULE_TESTS
   itkMultiOutputNaryFunctorImageFilterTest.cpp
   itkMaskedStatisticsImageFilterTest.cpp
   itkMaskedNaryStatisticsImageFilterTest.cpp
   mitkLevenbergMarquardtModelFitFunctorTest.cpp
   mitkPixelBasedParameterFitImageGeneratorTest.cpp
   mitkROIBasedParameterFitImageGeneratorTest.cpp
   mitkMaskedDynamicImageStatisticsGeneratorTest.cpp
   mitkModelFitInfoTest.cpp
   mitkModelFitStaticParameterMapTest.cpp
   mitkSimpleBarrierConstraintCheckerTest.cpp
   mitkMVConstrainedCostFunctionDecoratorTest.cpp
   mitkConcreteModelFactoryBaseTest.cpp
   mitkFormulaParserTest.cpp
   mitkModelFitResultRelationRuleTest.cpp
-  mitkT2DecayModelTest.cpp
+  mitkExponentialDecayModelTest.cpp
   mitkLinearModelTest.cpp
   mitkExpDecayOffsetModelTest.cpp
+  mitkTwoStepLinearModelTest.cpp
+  mitkThreeStepLinearModelTest.cpp
+  mitkExponentialSaturationModelTest.cpp
 )
diff --git a/Modules/ModelFit/test/mitkT2DecayModelTest.cpp b/Modules/ModelFit/test/mitkExponentialDecayModelTest.cpp
similarity index 72%
copy from Modules/ModelFit/test/mitkT2DecayModelTest.cpp
copy to Modules/ModelFit/test/mitkExponentialDecayModelTest.cpp
index b66b4f5398..4a2cfc9150 100644
--- a/Modules/ModelFit/test/mitkT2DecayModelTest.cpp
+++ b/Modules/ModelFit/test/mitkExponentialDecayModelTest.cpp
@@ -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.
 
 ============================================================================*/
 
 // Testing
 #include "mitkModelTestFixture.h"
 
 //MITK includes
-#include "mitkT2DecayModel.h"
+#include "mitkExponentialDecayModel.h"
 
 
-  class mitkT2DecayModelTestSuite : public mitk::mitkModelTestFixture
+  class mitkExponentialDecayModelTestSuite : public mitk::mitkModelTestFixture
   {
-    CPPUNIT_TEST_SUITE(mitkT2DecayModelTestSuite);
+    CPPUNIT_TEST_SUITE(mitkExponentialDecayModelTestSuite);
     MITK_TEST(GetModelInfoTest);
     MITK_TEST(ComputeModelfunctionTest);
     MITK_TEST(ComputeDerivedParametersTest);
     CPPUNIT_TEST_SUITE_END();
 
   private:
     json m_profile_json_obj;
     json m_modelValues_json_obj;
     mitk::ModelBase::Pointer m_testmodel;
 
   public:
     void setUp() override
     {
       // Parse JSON files
-      m_profile_json_obj = ParseJSONFile("ModelFit/mitkT2DecayModelTest_profile.json");
-      m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkT2DecayModelTest_modelValues.json");
+      m_profile_json_obj = ParseJSONFile("ModelFit/mitkExponentialDecayModelTest_profile.json");
+      m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkExponentialDecayModelTest_modelValues.json");
 
       // Generate test model
-      m_testmodel = mitk::T2DecayModel::New();
+      m_testmodel = mitk::ExponentialDecayModel::New();
     }
 
     void tearDown() override
     {
 
     }
 
     void GetModelInfoTest()
     {
       // comparison of reference and testmodel profile
       CompareModelAndReferenceProfile(m_testmodel, m_profile_json_obj);
     }
 
     void ComputeModelfunctionTest()
     {
         CompareModelAndReferenceSignal(m_testmodel, m_modelValues_json_obj, m_profile_json_obj);
     }
 
     void ComputeDerivedParametersTest()
     {
         CompareModelAndReferenceDerivedParameters(m_testmodel, m_modelValues_json_obj);
     }
   };
 
-MITK_TEST_SUITE_REGISTRATION(mitkT2DecayModel)
+MITK_TEST_SUITE_REGISTRATION(mitkExponentialDecayModel)
diff --git a/Modules/ModelFit/test/mitkT2DecayModelTest.cpp b/Modules/ModelFit/test/mitkExponentialSaturationModelTest.cpp
similarity index 71%
rename from Modules/ModelFit/test/mitkT2DecayModelTest.cpp
rename to Modules/ModelFit/test/mitkExponentialSaturationModelTest.cpp
index b66b4f5398..88e36f007a 100644
--- a/Modules/ModelFit/test/mitkT2DecayModelTest.cpp
+++ b/Modules/ModelFit/test/mitkExponentialSaturationModelTest.cpp
@@ -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.
 
 ============================================================================*/
 
 // Testing
 #include "mitkModelTestFixture.h"
 
 //MITK includes
-#include "mitkT2DecayModel.h"
+#include "mitkExponentialSaturationModel.h"
 
 
-  class mitkT2DecayModelTestSuite : public mitk::mitkModelTestFixture
+  class mitkExponentialSaturationModelTestSuite : public mitk::mitkModelTestFixture
   {
-    CPPUNIT_TEST_SUITE(mitkT2DecayModelTestSuite);
+    CPPUNIT_TEST_SUITE(mitkExponentialSaturationModelTestSuite);
     MITK_TEST(GetModelInfoTest);
     MITK_TEST(ComputeModelfunctionTest);
     MITK_TEST(ComputeDerivedParametersTest);
     CPPUNIT_TEST_SUITE_END();
 
   private:
     json m_profile_json_obj;
     json m_modelValues_json_obj;
     mitk::ModelBase::Pointer m_testmodel;
 
   public:
     void setUp() override
     {
       // Parse JSON files
-      m_profile_json_obj = ParseJSONFile("ModelFit/mitkT2DecayModelTest_profile.json");
-      m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkT2DecayModelTest_modelValues.json");
+      m_profile_json_obj = ParseJSONFile("ModelFit/mitkExponentialSaturationModelTest_profile.json");
+      m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkExponentialSaturationModelTest_modelValues.json");
 
       // Generate test model
-      m_testmodel = mitk::T2DecayModel::New();
+      m_testmodel = mitk::ExponentialSaturationModel::New();
     }
 
     void tearDown() override
     {
 
     }
 
     void GetModelInfoTest()
     {
       // comparison of reference and testmodel profile
       CompareModelAndReferenceProfile(m_testmodel, m_profile_json_obj);
     }
 
     void ComputeModelfunctionTest()
     {
         CompareModelAndReferenceSignal(m_testmodel, m_modelValues_json_obj, m_profile_json_obj);
     }
 
     void ComputeDerivedParametersTest()
     {
         CompareModelAndReferenceDerivedParameters(m_testmodel, m_modelValues_json_obj);
     }
   };
 
-MITK_TEST_SUITE_REGISTRATION(mitkT2DecayModel)
+MITK_TEST_SUITE_REGISTRATION(mitkExponentialSaturationModel)
diff --git a/Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp b/Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp
index 021df68dee..2fa166c061 100644
--- a/Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp
+++ b/Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <iostream>
 
 #include "itkImageRegionIterator.h"
 
 #include "mitkTestingMacros.h"
 #include "mitkImage.h"
 #include "mitkImagePixelReadAccessor.h"
 
 #include "mitkPixelBasedParameterFitImageGenerator.h"
 #include "mitkLinearModelParameterizer.h"
 
 #include "mitkLevenbergMarquardtModelFitFunctor.h"
 
 #include "mitkTestDynamicImageGenerator.h"
 
 int mitkPixelBasedParameterFitImageGeneratorTest(int  /*argc*/, char*[] /*argv[]*/)
 {
   // always start with this!
   MITK_TEST_BEGIN("mitkPixelBasedParameterFitImageGenerator")
 
     //Prepare test artifacts and helper
 
   itk::Index<3> testIndex1;
   testIndex1[0] =   0;
   testIndex1[1] =   0;
   testIndex1[2] =   0;
 
   itk::Index<3> testIndex2;
   testIndex2[0] =   2;
   testIndex2[1] =   0;
   testIndex2[2] =   1;
 
   itk::Index<3> testIndex3;
   testIndex3[0] =   1;
   testIndex3[1] =   1;
   testIndex3[2] =   2;
 
   itk::Index<3> testIndex4;
   testIndex4[0] =   2;
   testIndex4[1] =   2;
   testIndex4[2] =   0;
 
   itk::Index<3> testIndex5;
   testIndex5[0] =   1;
   testIndex5[1] =   1;
   testIndex5[2] =   1;
 
   itk::Index<3> testIndex6;
   testIndex6[0] =   2;
   testIndex6[1] =   1;
   testIndex6[2] =   1;
 
 
     mitk::Image::Pointer dynamicImage = mitk::GenerateDynamicTestImageMITK();
 
     mitk::LinearModel::Pointer model = mitk::LinearModel::New();
     mitk::LevenbergMarquardtModelFitFunctor::Pointer testFunctor = mitk::LevenbergMarquardtModelFitFunctor::New();
 
     //Test default usage of filter
     mitk::PixelBasedParameterFitImageGenerator::Pointer generator = mitk::PixelBasedParameterFitImageGenerator::New();
     mitk::LinearModelParameterizer::Pointer parameterizer = mitk::LinearModelParameterizer::New();
     generator->SetDynamicImage(dynamicImage);
     generator->SetModelParameterizer(parameterizer);
     generator->SetFitFunctor(testFunctor);
 
     generator->Generate();
 
     mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType resultImages = generator->GetParameterImages();
     mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType derivedResultImages = generator->GetDerivedParameterImages();
 
     CPPUNIT_ASSERT_MESSAGE("Check number of parameter images", 2 == resultImages.size());
     MITK_TEST_CONDITION(resultImages.find("slope") != resultImages.end(),"Check if \"slope\" parameter image exists.");
-    MITK_TEST_CONDITION(resultImages.find("offset") != resultImages.end(),"Check if \"offset\" parameter image exists.");
+    MITK_TEST_CONDITION(resultImages.find("y-intercept") != resultImages.end(),"Check if \"y-intercept\" parameter image exists.");
     CPPUNIT_ASSERT_MESSAGE("Check number of derived parameter images", 1 == derivedResultImages.size());
     MITK_TEST_CONDITION(derivedResultImages.find("x-intercept") != derivedResultImages.end(),"Check if \"x-intercept\" derived parameter image exists.");
 
     mitk::ImagePixelReadAccessor<mitk::ScalarType,3> slopeAccessor(resultImages["slope"]);
-    mitk::ImagePixelReadAccessor<mitk::ScalarType,3> offsetAccessor(resultImages["offset"]);
+    mitk::ImagePixelReadAccessor<mitk::ScalarType,3> yinterceptAccessor(resultImages["y-intercept"]);
 
     double testValue = slopeAccessor.GetPixelByIndex(testIndex1);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #1");
     testValue = slopeAccessor.GetPixelByIndex(testIndex2);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #2");
     testValue = slopeAccessor.GetPixelByIndex(testIndex3);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(4000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #3");
     testValue = slopeAccessor.GetPixelByIndex(testIndex4);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(8000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #4");
 
-    testValue = offsetAccessor.GetPixelByIndex(testIndex1);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #1");
-    testValue = offsetAccessor.GetPixelByIndex(testIndex2);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #2");
-    testValue = offsetAccessor.GetPixelByIndex(testIndex3);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(20,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #3");
-    testValue = offsetAccessor.GetPixelByIndex(testIndex4);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #4");
+    testValue = yinterceptAccessor.GetPixelByIndex(testIndex1);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #1");
+    testValue = yinterceptAccessor.GetPixelByIndex(testIndex2);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #2");
+    testValue = yinterceptAccessor.GetPixelByIndex(testIndex3);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(20,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #3");
+    testValue = yinterceptAccessor.GetPixelByIndex(testIndex4);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #4");
 
     //Test with mask set
     mitk::Image::Pointer maskImage = mitk::GenerateTestMaskMITK();
     generator->SetMask(maskImage);
 
     generator->Generate();
 
     resultImages = generator->GetParameterImages();
     derivedResultImages = generator->GetDerivedParameterImages();
 
     CPPUNIT_ASSERT_MESSAGE("Check number of parameter images", 2 == resultImages.size());
     MITK_TEST_CONDITION(resultImages.find("slope") != resultImages.end(),"Check if \"slope\" parameter image exists.");
-    MITK_TEST_CONDITION(resultImages.find("offset") != resultImages.end(),"Check if \"offset\" parameter image exists.");
+    MITK_TEST_CONDITION(resultImages.find("y-intercept") != resultImages.end(),"Check if \"y-intercept\" parameter image exists.");
     CPPUNIT_ASSERT_MESSAGE("Check number of derived parameter images", 1 == derivedResultImages.size());
     MITK_TEST_CONDITION(derivedResultImages.find("x-intercept") != derivedResultImages.end(),"Check if \"x-intercept\" derived parameter image exists.");
 
     mitk::ImagePixelReadAccessor<mitk::ScalarType,3> slopeAccessor2(resultImages["slope"]);
-    mitk::ImagePixelReadAccessor<mitk::ScalarType,3> offsetAccessor2(resultImages["offset"]);
+    mitk::ImagePixelReadAccessor<mitk::ScalarType,3> yinterceptAccessor2(resultImages["y-intercept"]);
 
     testValue = slopeAccessor2.GetPixelByIndex(testIndex1);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #1");
     testValue = slopeAccessor2.GetPixelByIndex(testIndex2);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #2");
     testValue = slopeAccessor2.GetPixelByIndex(testIndex3);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #3");
     testValue = slopeAccessor2.GetPixelByIndex(testIndex4);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(8000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #4");
     testValue = slopeAccessor2.GetPixelByIndex(testIndex5);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(4000,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #5");
     testValue = slopeAccessor2.GetPixelByIndex(testIndex6);
     MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #6");
 
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex1);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #1");
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex2);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #2");
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex3);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #3");
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex4);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #4");
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex5);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #5");
-    testValue = offsetAccessor2.GetPixelByIndex(testIndex6);
-    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #6");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex1);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #1");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex2);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #2");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex3);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #3");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex4);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #4");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex5);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(10,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #5");
+    testValue = yinterceptAccessor2.GetPixelByIndex(testIndex6);
+    MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #6");
 
   MITK_TEST_END()
 }
diff --git a/Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp b/Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp
index 8a7c122a57..43f24ca5dd 100644
--- a/Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp
+++ b/Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <iostream>
 
 #include "itkImageRegionIterator.h"
 
 #include "mitkTestingMacros.h"
 #include "mitkImage.h"
 #include "mitkImagePixelReadAccessor.h"
 
 #include "mitkROIBasedParameterFitImageGenerator.h"
 #include "mitkLinearModelParameterizer.h"
 
 #include "mitkLevenbergMarquardtModelFitFunctor.h"
 
 #include "mitkTestDynamicImageGenerator.h"
 
 int mitkROIBasedParameterFitImageGeneratorTest(int  /*argc*/, char*[] /*argv[]*/)
 {
   // always start with this!
   MITK_TEST_BEGIN("mitkROIBasedParameterFitImageGenerator")
 
     //Prepare test artifacts and helper
 
     itk::Index<3> testIndex1;
   testIndex1[0] =   0;
   testIndex1[1] =   0;
   testIndex1[2] =   0;
 
   itk::Index<3> testIndex2;
   testIndex2[0] =   2;
   testIndex2[1] =   0;
   testIndex2[2] =   1;
 
   itk::Index<3> testIndex3;
   testIndex3[0] =   1;
   testIndex3[1] =   1;
   testIndex3[2] =   2;
 
   itk::Index<3> testIndex4;
   testIndex4[0] =   2;
   testIndex4[1] =   2;
   testIndex4[2] =   0;
 
   itk::Index<3> testIndex5;
   testIndex5[0] =   1;
   testIndex5[1] =   1;
   testIndex5[2] =   1;
 
   itk::Index<3> testIndex6;
   testIndex6[0] =   2;
   testIndex6[1] =   1;
   testIndex6[2] =   1;
 
 
   mitk::Image::Pointer maskImage = mitk::GenerateTestMaskMITK();
 
   mitk::ROIBasedParameterFitImageGenerator::TimeGridType timeGrid;
   timeGrid.SetSize(5);
   timeGrid[0] = 0;
   timeGrid[1] = 1;
   timeGrid[2] = 2;
   timeGrid[3] = 3;
   timeGrid[4] = 4;
 
   mitk::ROIBasedParameterFitImageGenerator::SignalType signal;
   signal.SetSize(5);
   signal[0] = 3;
   signal[1] = 5;
   signal[2] = 7;
   signal[3] = 9;
   signal[4] = 11;
 
   mitk::LinearModel::Pointer model = mitk::LinearModel::New();
   mitk::LevenbergMarquardtModelFitFunctor::Pointer testFunctor = mitk::LevenbergMarquardtModelFitFunctor::New();
 
   //Test default usage of filter
   mitk::ROIBasedParameterFitImageGenerator::Pointer generator = mitk::ROIBasedParameterFitImageGenerator::New();
   mitk::LinearModelParameterizer::Pointer parameterizer = mitk::LinearModelParameterizer::New();
 
   generator->SetModelParameterizer(parameterizer);
   generator->SetFitFunctor(testFunctor);
   generator->SetMask(maskImage);
   generator->SetSignal(signal);
   generator->SetTimeGrid(timeGrid);
 
   generator->Generate();
 
   mitk::ROIBasedParameterFitImageGenerator::ParameterImageMapType resultImages = generator->GetParameterImages();
   mitk::ROIBasedParameterFitImageGenerator::ParameterImageMapType derivedResultImages = generator->GetDerivedParameterImages();
 
   CPPUNIT_ASSERT_MESSAGE("Check number of parameter images", 2 == resultImages.size());
   MITK_TEST_CONDITION(resultImages.find("slope") != resultImages.end(),"Check if \"slope\" parameter image exists.");
-  MITK_TEST_CONDITION(resultImages.find("offset") != resultImages.end(),"Check if \"offset\" parameter image exists.");
+  MITK_TEST_CONDITION(resultImages.find("y-intercept") != resultImages.end(),"Check if \"y-intercept\" parameter image exists.");
   CPPUNIT_ASSERT_MESSAGE("Check number of derived parameter images", 1 == derivedResultImages.size());
   MITK_TEST_CONDITION(derivedResultImages.find("x-intercept") != derivedResultImages.end(),"Check if \"x-intercept\" derived parameter image exists.");
 
   mitk::ImagePixelReadAccessor<mitk::ScalarType,3> slopeAccessor2(resultImages["slope"]);
-  mitk::ImagePixelReadAccessor<mitk::ScalarType,3> offsetAccessor2(resultImages["offset"]);
+  mitk::ImagePixelReadAccessor<mitk::ScalarType,3> yinterceptAccessor2(resultImages["y-intercept"]);
 
   double testValue = slopeAccessor2.GetPixelByIndex(testIndex1);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #1");
   testValue = slopeAccessor2.GetPixelByIndex(testIndex2);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #2");
   testValue = slopeAccessor2.GetPixelByIndex(testIndex3);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #3");
   testValue = slopeAccessor2.GetPixelByIndex(testIndex4);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #4");
   testValue = slopeAccessor2.GetPixelByIndex(testIndex5);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(2,testValue, 1e-4, true)==true, "Check param #1 (slope) at index #5");
   testValue = slopeAccessor2.GetPixelByIndex(testIndex6);
   MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #1 (slope) at index #6");
 
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex1);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #1");
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex2);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #2");
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex3);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #3");
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex4);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #4");
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex5);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #5");
-  testValue = offsetAccessor2.GetPixelByIndex(testIndex6);
-  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (offset) at index #6");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex1);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #1");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex2);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #2");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex3);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #3");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex4);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #4");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex5);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(3,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #5");
+  testValue = yinterceptAccessor2.GetPixelByIndex(testIndex6);
+  MITK_TEST_CONDITION_REQUIRED(mitk::Equal(0,testValue, 1e-5, true)==true, "Check param #2 (y-intercept) at index #6");
 
   MITK_TEST_END()
 }
diff --git a/Modules/Pharmacokinetics/test/mitkThreeStepLinearModelTest.cpp b/Modules/ModelFit/test/mitkThreeStepLinearModelTest.cpp
similarity index 87%
rename from Modules/Pharmacokinetics/test/mitkThreeStepLinearModelTest.cpp
rename to Modules/ModelFit/test/mitkThreeStepLinearModelTest.cpp
index 074f783c6b..ac5116f7fe 100644
--- a/Modules/Pharmacokinetics/test/mitkThreeStepLinearModelTest.cpp
+++ b/Modules/ModelFit/test/mitkThreeStepLinearModelTest.cpp
@@ -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.
 
 ============================================================================*/
 
  //Testing
 #include "mitkModelTestFixture.h"
 
 //MITK includes
 #include "mitkThreeStepLinearModel.h"
 
 
   class mitkThreeStepLinearModelTestSuite : public mitk::mitkModelTestFixture
 {
   CPPUNIT_TEST_SUITE(mitkThreeStepLinearModelTestSuite);
   MITK_TEST(GetModelInfoTest);
   MITK_TEST(ComputeModelfunctionTest);
   MITK_TEST(ComputeDerivedParametersTest);
   CPPUNIT_TEST_SUITE_END();
 
 private:
   mitk::ThreeStepLinearModel::Pointer m_testmodel;
 
   json m_profile_json_obj;
   json m_modelValues_json_obj;
 
 public:
   void setUp() override
   {
     // Parse JSON files
-    m_profile_json_obj = ParseJSONFile("Pharmacokinetics/mitkThreeStepLinearModelTest_profile.json");
-    m_modelValues_json_obj = ParseJSONFile("Pharmacokinetics/mitkThreeStepLinearModelTest_modelValues.json");
+    m_profile_json_obj = ParseJSONFile("ModelFit/mitkThreeStepLinearModelTest_profile.json");
+    m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkThreeStepLinearModelTest_modelValues.json");
 
     // Generate test model
     m_testmodel = mitk::ThreeStepLinearModel::New();
  }
 
   void tearDown() override
   {
   }
 
   void GetModelInfoTest()
   {
     // comparison of reference and testmodel profile
     CompareModelAndReferenceProfile(m_testmodel, m_profile_json_obj);
   }
 
   void ComputeModelfunctionTest()
   {
       CompareModelAndReferenceSignal(m_testmodel, m_modelValues_json_obj, m_profile_json_obj);
   }
 
   void ComputeDerivedParametersTest()
   {
       CompareModelAndReferenceDerivedParameters(m_testmodel, m_modelValues_json_obj);
   }
 };
 
 MITK_TEST_SUITE_REGISTRATION(mitkThreeStepLinearModel)
diff --git a/Modules/Pharmacokinetics/test/mitkTwoStepLinearModelTest.cpp b/Modules/ModelFit/test/mitkTwoStepLinearModelTest.cpp
similarity index 88%
rename from Modules/Pharmacokinetics/test/mitkTwoStepLinearModelTest.cpp
rename to Modules/ModelFit/test/mitkTwoStepLinearModelTest.cpp
index de8b2e160f..5fcb2448a8 100644
--- a/Modules/Pharmacokinetics/test/mitkTwoStepLinearModelTest.cpp
+++ b/Modules/ModelFit/test/mitkTwoStepLinearModelTest.cpp
@@ -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.
 
 ============================================================================*/
 
  //Testing
 #include "mitkModelTestFixture.h"
 
 //MITK includes
 #include "mitkTwoStepLinearModel.h"
 
 
   class mitkTwoStepLinearModelTestSuite : public mitk::mitkModelTestFixture
 {
   CPPUNIT_TEST_SUITE(mitkTwoStepLinearModelTestSuite);
   MITK_TEST(GetModelInfoTest);
   MITK_TEST(ComputeModelfunctionTest);
   MITK_TEST(ComputeDerivedParametersTest);
   CPPUNIT_TEST_SUITE_END();
 
 private:
   mitk::TwoStepLinearModel::Pointer m_testmodel;
 
   json m_profile_json_obj;
   json m_modelValues_json_obj;
 
 public:
   void setUp() override
   {
     // Parse JSON files
-    m_profile_json_obj = ParseJSONFile("Pharmacokinetics/mitkTwoStepLinearModelTest_profile.json");
-    m_modelValues_json_obj = ParseJSONFile("Pharmacokinetics/mitkTwoStepLinearModelTest_modelValues.json");
+    m_profile_json_obj = ParseJSONFile("ModelFit/mitkTwoStepLinearModelTest_profile.json");
+    m_modelValues_json_obj = ParseJSONFile("ModelFit/mitkTwoStepLinearModelTest_modelValues.json");
 
     // Generate test model
     m_testmodel = mitk::TwoStepLinearModel::New();
  }
 
   void tearDown() override
   {
   }
 
   void GetModelInfoTest()
   {
     // comparison of reference and testmodel profile
     CompareModelAndReferenceProfile(m_testmodel, m_profile_json_obj);
   }
 
   void ComputeModelfunctionTest()
   {
       CompareModelAndReferenceSignal(m_testmodel, m_modelValues_json_obj, m_profile_json_obj);
   }
 
   void ComputeDerivedParametersTest()
   {
       CompareModelAndReferenceDerivedParameters(m_testmodel, m_modelValues_json_obj);
   }
 };
 
 MITK_TEST_SUITE_REGISTRATION(mitkTwoStepLinearModel)
diff --git a/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp b/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp
index d67c683c15..f406aa87b1 100644
--- a/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp
+++ b/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp
@@ -1,82 +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.
 
 ============================================================================*/
 
 
 #include <usModuleActivator.h>
 #include <usModuleContext.h>
 
 #include <mitkModelFitProviderBase.h>
 
 //MR perfusion models
 #include "mitkDescriptivePharmacokineticBrixModelFactory.h"
 #include "mitkExtendedToftsModelFactory.h"
 #include "mitkStandardToftsModelFactory.h"
 #include "mitkTwoCompartmentExchangeModelFactory.h"
-#include "mitkNumericTwoCompartmentExchangeModelFactory.h"
 
 //PET perfusion models
 #include "mitkOneTissueCompartmentModelFactory.h"
 #include "mitkExtendedOneTissueCompartmentModelFactory.h"
 #include "mitkTwoTissueCompartmentModelFactory.h"
 #include "mitkTwoTissueCompartmentFDGModelFactory.h"
-#include "mitkNumericTwoTissueCompartmentModelFactory.h"
 
-//general models
-#include "mitkTwoStepLinearModelFactory.h"
-#include "mitkThreeStepLinearModelFactory.h"
 
 namespace mitk
 {
 
 /*
  * This is the module activator for the IO aspects of the "pharmacokinetics" module.
  */
 class PharmacokineticModelsActivator : public us::ModuleActivator
 {
 public:
 
   template <class TProvider> void RegisterProvider(us::ModuleContext* context)
   {
     auto provider = new TProvider();
     provider->RegisterService(context);
 
     m_RegisteredProviders.push_back(std::unique_ptr<IModelFitProvider>(provider));
   }
 
   void Load(us::ModuleContext* context) override
   {
     m_RegisteredProviders.clear();
     RegisterProvider<mitk::ModelFitProviderBase<mitk::DescriptivePharmacokineticBrixModelFactory> >(context);
-    RegisterProvider<mitk::ModelFitProviderBase<mitk::ThreeStepLinearModelFactory> >(context);
-    RegisterProvider<mitk::ModelFitProviderBase<mitk::TwoStepLinearModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::ExtendedToftsModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::StandardToftsModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::TwoCompartmentExchangeModelFactory> >(context);
-    RegisterProvider<mitk::ModelFitProviderBase<mitk::NumericTwoCompartmentExchangeModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::OneTissueCompartmentModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::ExtendedOneTissueCompartmentModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::TwoTissueCompartmentFDGModelFactory> >(context);
     RegisterProvider<mitk::ModelFitProviderBase<mitk::TwoTissueCompartmentModelFactory> >(context);
-    RegisterProvider<mitk::ModelFitProviderBase<mitk::NumericTwoTissueCompartmentModelFactory> >(context);
   }
 
   void Unload(us::ModuleContext* ) override
   {
   }
 
 private:
   std::vector<std::unique_ptr<IModelFitProvider> > m_RegisteredProviders;
 };
 
 }
 
 US_EXPORT_MODULE_ACTIVATOR(mitk::PharmacokineticModelsActivator)
diff --git a/Modules/Pharmacokinetics/files.cmake b/Modules/Pharmacokinetics/files.cmake
index 03780a2490..48ead4c7e1 100644
--- a/Modules/Pharmacokinetics/files.cmake
+++ b/Modules/Pharmacokinetics/files.cmake
@@ -1,67 +1,55 @@
 file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
 
 set(CPP_FILES
   Common/mitkAterialInputFunctionGenerator.cpp
   Common/mitkAIFParametrizerHelper.cpp
   Common/mitkConcentrationCurveGenerator.cpp
   Common/mitkDescriptionParameterImageGeneratorBase.cpp
   Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp
   DescriptionParameters/mitkCurveDescriptionParameterBase.cpp
   DescriptionParameters/mitkAreaUnderTheCurveDescriptionParameter.cpp
   DescriptionParameters/mitkAreaUnderFirstMomentDescriptionParameter.cpp
   DescriptionParameters/mitkMeanResidenceTimeDescriptionParameter.cpp
   DescriptionParameters/mitkTimeToPeakCurveDescriptionParameter.cpp
   DescriptionParameters/mitkMaximumCurveDescriptionParameter.cpp
   Functors/mitkCurveParameterFunctor.cpp
   Models/mitkAIFBasedModelBase.cpp
   Models/mitkDescriptivePharmacokineticBrixModel.cpp
   Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp
   Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp
   Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp
-  Models/mitkThreeStepLinearModel.cpp
-  Models/mitkThreeStepLinearModelFactory.cpp
-  Models/mitkThreeStepLinearModelParameterizer.cpp
   Models/mitkTwoCompartmentExchangeModel.cpp
   Models/mitkTwoCompartmentExchangeModelFactory.cpp
   Models/mitkTwoCompartmentExchangeModelParameterizer.cpp
-  Models/mitkNumericTwoCompartmentExchangeModel.cpp
-  Models/mitkNumericTwoCompartmentExchangeModelFactory.cpp
-  Models/mitkNumericTwoCompartmentExchangeModelParameterizer.cpp
   Models/mitkExtendedToftsModel.cpp
   Models/mitkExtendedToftsModelFactory.cpp
   Models/mitkExtendedToftsModelParameterizer.cpp
   Models/mitkStandardToftsModel.cpp
   Models/mitkStandardToftsModelFactory.cpp
   Models/mitkStandardToftsModelParameterizer.cpp
   Models/mitkOneTissueCompartmentModel.cpp
   Models/mitkOneTissueCompartmentModelFactory.cpp
   Models/mitkOneTissueCompartmentModelParameterizer.cpp
   Models/mitkExtendedOneTissueCompartmentModel.cpp
   Models/mitkExtendedOneTissueCompartmentModelFactory.cpp
   Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp
-  Models/mitkTwoStepLinearModel.cpp
-  Models/mitkTwoStepLinearModelFactory.cpp
-  Models/mitkTwoStepLinearModelParameterizer.cpp
   Models/mitkTwoTissueCompartmentModel.cpp
   Models/mitkTwoTissueCompartmentModelFactory.cpp
   Models/mitkTwoTissueCompartmentModelParameterizer.cpp
   Models/mitkTwoTissueCompartmentFDGModel.cpp
   Models/mitkTwoTissueCompartmentFDGModelFactory.cpp
   Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp
-  Models/mitkNumericTwoTissueCompartmentModel.cpp
-  Models/mitkNumericTwoTissueCompartmentModelFactory.cpp
-  Models/mitkNumericTwoTissueCompartmentModelParameterizer.cpp  
   SimulationFramework/mitkImageGenerationHelper.cpp
 )
 
 set(HXX_FILES
 mitkDICOMSegmentationConstants.h
 
 )
 
 
 set(MOC_H_FILES
 )
 
 
 
diff --git a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
index 057a7817c6..0a9a18b411 100644
--- a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
+++ b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
@@ -1,114 +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 mitkAIFBasedModelBase_h
 #define mitkAIFBasedModelBase_h
 
 
 #include "MitkPharmacokineticsExports.h"
 #include "mitkModelBase.h"
 #include "itkArray2D.h"
 
 namespace mitk
 {
 
   /** \class AIFBasedModelBase
    * \brief Base Class for all physiological perfusion models using an Aterial Input Function
    * All AIF based models come with an array of AIF values and the corresponding TimeGrid ( AIF(t))
    * This class provides functions for setting the AIF Values and optionally a specific AIF TimeGrid.
    * It also provides a method for interpolation of the AIF source array to a specified Timegrid that differs from
    * AIFTimeGrid. The AIF must be set with an itk::Array. If no AIFTimeGrid is specified with the Setter, it is assumed
    * that the AIFTimeGrid is the same as the ModelTimegrid (e.g. AIF is derived from data set to be fitted). In this
    * case, AIFvalues must have the same length as ModelTimeGrid, otherwise an exception is generated*/
   class MITKPHARMACOKINETICS_EXPORT AIFBasedModelBase : public mitk::ModelBase
   {
   public:
 
     typedef AIFBasedModelBase Self;
     typedef ModelBase Superclass;
     typedef itk::SmartPointer< Self >                            Pointer;
     typedef itk::SmartPointer< const Self >                      ConstPointer;
 
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(PhysiologciModelBase, AIFBasedModelBase);
 
 
     static const std::string NAME_STATIC_PARAMETER_AIF;
     static const std::string NAME_STATIC_PARAMETER_AIFTimeGrid;
 
     static const std::string UNIT_STATIC_PARAMETER_AIF;
     static const std::string UNIT_STATIC_PARAMETER_AIFTimeGrid;
 
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
+
     /** Typedef for Aterial InputFunction AIF(t)*/
     typedef itk::Array<double> AterialInputFunctionType;
 
     itkGetConstReferenceMacro(AterialInputFunctionValues, AterialInputFunctionType);
     itkGetConstReferenceMacro(AterialInputFunctionTimeGrid, TimeGridType);
 
     itkSetMacro(AterialInputFunctionValues, AterialInputFunctionType);
     itkSetMacro(AterialInputFunctionTimeGrid, TimeGridType);
 
     std::string GetXAxisName() const override;
 
     std::string GetXAxisUnit() const override;
 
     std::string GetYAxisName() const override;
 
     std::string GetYAxisUnit() const override;
 
     /** Returns the TimeGrid used for the AIF. Either the externally set AIF time grid
      * or the time grid of the model if nothing is set.*/
     const TimeGridType& GetCurrentAterialInputFunctionTimeGrid() const;
 
     /** Returns the Aterial Input function matching currentTimeGrid
      *  The original values are interpolated to the passed TimeGrid
      * if currentTimeGrid.Size() = 0 , the Original AIF will be returned*/
     const AterialInputFunctionType GetAterialInputFunction(TimeGridType currentTimeGrid) const;
 
     ParameterNamesType GetStaticParameterNames() const override;
     ParametersSizeType GetNumberOfStaticParameters() const override;
     ParamterUnitMapType GetStaticParameterUnits() const override;
 
 
   protected:
     AIFBasedModelBase();
     ~AIFBasedModelBase() override;
 
     /** Reimplementation that checks if AIF and timegrid settings are valid.
      * @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the
      * exception comment.
      * @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/
     bool ValidateModel(std::string& error) const override;
 
     void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
 
     void SetStaticParameter(const ParameterNameType& name,
                                     const StaticParameterValuesType& values) override;
 
     StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const
     override;
 
     TimeGridType m_AterialInputFunctionTimeGrid;
     AterialInputFunctionType m_AterialInputFunctionValues;
 
 
   private:
 
 
     //No copy constructor allowed
     AIFBasedModelBase(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
   };
 }
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
index 818cc01427..44c4f3fd8e 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
@@ -1,131 +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 mitkDescriptivePharmacokineticBrixModel_h
 #define mitkDescriptivePharmacokineticBrixModel_h
 
 #include <iostream>
 
 #include "mitkModelBase.h"
 #include "MitkPharmacokineticsExports.h"
 
 namespace mitk
 {
 
   class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModel : public ModelBase
   {
 
   public:
     typedef DescriptivePharmacokineticBrixModel Self;
     typedef ModelBase Superclass;
     typedef itk::SmartPointer< Self >                            Pointer;
     typedef itk::SmartPointer< const Self >                      ConstPointer;
 
     /** Method for creation through the object factory. */
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(DescriptivePharmacokineticBrixModel, ModelBase);
 
     static const std::string MODEL_DISPLAY_NAME;
 
     static const std::string NAME_PARAMETER_A;
     static const std::string NAME_PARAMETER_kep;
     static const std::string NAME_PARAMETER_kel;
-    static const std::string NAME_PARAMETER_tlag;
-    static const std::string NAME_STATIC_PARAMETER_Tau;
-    static const std::string NAME_STATIC_PARAMETER_S0;
+    static const std::string NAME_PARAMETER_BAT;
+
+    static const std::string NAME_STATIC_PARAMETER_tau;
+    static const std::string NAME_STATIC_PARAMETER_s0;
 
     static const std::string UNIT_PARAMETER_A;
     static const std::string UNIT_PARAMETER_kep;
     static const std::string UNIT_PARAMETER_kel;
-    static const std::string UNIT_PARAMETER_tlag;
-    static const std::string UNIT_STATIC_PARAMETER_Tau;
-    static const std::string UNIT_STATIC_PARAMETER_S0;
+    static const std::string UNIT_PARAMETER_BAT;
+
+    static const std::string UNIT_STATIC_PARAMETER_tau;
+    static const std::string UNIT_STATIC_PARAMETER_s0;
 
     static const unsigned int POSITION_PARAMETER_A;
     static const unsigned int POSITION_PARAMETER_kep;
     static const unsigned int POSITION_PARAMETER_kel;
-
-    //tlag in minutes
-    static const unsigned int POSITION_PARAMETER_tlag;
+    static const unsigned int POSITION_PARAMETER_BAT;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
+
+    static const std::string MODEL_TYPE;
+
+    static const std::string X_AXIS_NAME;
+
+    static const std::string X_AXIS_UNIT;
+
+    static const std::string Y_AXIS_NAME;
+
+    static const std::string Y_AXIS_UNIT;
+
     itkSetMacro(Tau, double);
     itkGetConstReferenceMacro(Tau, double);
 
     itkSetMacro(S0, double);
     itkGetConstReferenceMacro(S0, double);
 
     std::string GetModelDisplayName() const override;
 
     std::string GetModelType() const override;
 
     std::string GetXAxisName() const override;
 
     std::string GetXAxisUnit() const override;
 
     std::string GetYAxisName() const override;
 
     std::string GetYAxisUnit() const override;
 
     ParameterNamesType GetParameterNames() const override;
 
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
 
     ParameterNamesType GetStaticParameterNames() const override;
     ParametersSizeType GetNumberOfStaticParameters() const override;
     ParamterUnitMapType GetStaticParameterUnits() const override;
 
   protected:
     DescriptivePharmacokineticBrixModel();
     ~DescriptivePharmacokineticBrixModel() 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:
     /**injection time Tau in minutes [min]*/
     double m_Tau;
 
     /**Value of the first time step, thus base value to scale the signal.
      * Default is 1.*/
     double m_S0;
 
     //No copy constructor allowed
     DescriptivePharmacokineticBrixModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
   };
 }
 
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
index 05c5b21d2c..00420e355f 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
@@ -1,96 +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 mitkExtendedOneTissueCompartmentModel_h
 #define mitkExtendedOneTissueCompartmentModel_h
 
 #include "mitkAIFBasedModelBase.h"
 #include "MitkPharmacokineticsExports.h"
 
 namespace mitk
 {
-  /** @class OneTissueCompartmentModel
-   * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
-   * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
-   * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
-   *       C(t) = vp * Cp(t) + conv(Cp(t),R(t))
-   * The parameters ktrans, ve and ve are subject to the fitting routine*/
+
 
   class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModel : public AIFBasedModelBase
   {
 
   public:
     typedef ExtendedOneTissueCompartmentModel 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);
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(ExtendedOneTissueCompartmentModel, ModelBase);
 
     static const std::string MODEL_DISPLAY_NAME;
 
-    static const std::string NAME_PARAMETER_k1;
+    static const std::string NAME_PARAMETER_K1;
     static const std::string NAME_PARAMETER_k2;
-    static const std::string NAME_PARAMETER_VB;
+    static const std::string NAME_PARAMETER_vb;
 
-    static const std::string UNIT_PARAMETER_k1;
+    static const std::string UNIT_PARAMETER_K1;
     static const std::string UNIT_PARAMETER_k2;
-    static const std::string UNIT_PARAMETER_VB;
+    static const std::string UNIT_PARAMETER_vb;
 
-    static const unsigned int POSITION_PARAMETER_k1;
+    static const unsigned int POSITION_PARAMETER_K1;
     static const unsigned int POSITION_PARAMETER_k2;
-    static const unsigned int POSITION_PARAMETER_VB;
+    static const unsigned int POSITION_PARAMETER_vb;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string MODEL_TYPE;
+
     std::string GetModelDisplayName() const override;
 
     std::string GetModelType() const override;
 
     ParameterNamesType GetParameterNames() const override;
+
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
   protected:
     ExtendedOneTissueCompartmentModel();
     ~ExtendedOneTissueCompartmentModel() 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
     ExtendedOneTissueCompartmentModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
 
 
   };
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
index 64f03b7aff..9a85e67f69 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
@@ -1,106 +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 mitkExtendedToftsModel_h
 #define mitkExtendedToftsModel_h
 
 #include "mitkAIFBasedModelBase.h"
 #include "MitkPharmacokineticsExports.h"
 
 namespace mitk
 {
   /** @class ExtendedToftsModel
    * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
    * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
    * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
    *       C(t) = vp * Cp(t) + conv(Cp(t),R(t))
    * The parameters ktrans, ve and ve are subject to the fitting routine*/
 
   class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModel : public AIFBasedModelBase
   {
 
   public:
     typedef ExtendedToftsModel 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);
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(ExtendedToftsModel, ModelBase);
 
-    static const std::string MODEL_DISPLAY_NAME;
-
     static const std::string NAME_PARAMETER_Ktrans;
     static const std::string NAME_PARAMETER_ve;
     static const std::string NAME_PARAMETER_vp;
 
     static const std::string UNIT_PARAMETER_Ktrans;
     static const std::string UNIT_PARAMETER_ve;
     static const std::string UNIT_PARAMETER_vp;
 
     static const unsigned int POSITION_PARAMETER_Ktrans;
     static const unsigned int POSITION_PARAMETER_ve;
     static const unsigned int POSITION_PARAMETER_vp;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string NAME_DERIVED_PARAMETER_kep;
+
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
+
+    static const std::string UNIT_DERIVED_PARAMETER_kep;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+
     std::string GetModelDisplayName() const override;
 
     std::string GetModelType() const override;
 
     ParameterNamesType GetParameterNames() const override;
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
     ParameterNamesType GetDerivedParameterNames() const override;
 
     ParametersSizeType  GetNumberOfDerivedParameters() const override;
     ParamterUnitMapType GetDerivedParameterUnits() const override;
 
 
   protected:
     ExtendedToftsModel();
     ~ExtendedToftsModel() 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 PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
 
   private:
 
 
     //No copy constructor allowed
     ExtendedToftsModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
 
 
   };
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
deleted file mode 100644
index b8bcc20432..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
+++ /dev/null
@@ -1,128 +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.
-
-============================================================================*/
-
-#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);
-
-    /** Run-time type information (and related methods). */
-    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
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h
deleted file mode 100644
index f94e55ef59..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h
+++ /dev/null
@@ -1,46 +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.
-
-============================================================================*/
-#ifndef mitkNumericTwoCompartmentExchangeModelFactory_h
-#define mitkNumericTwoCompartmentExchangeModelFactory_h
-
-#include "mitkTwoCompartmentExchangeModelFactoryBase.h"
-#include "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
-
-namespace mitk
-{
-
-  class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelFactory : public
-    mitk::TwoCompartmentExchangeModelFactoryBase<NumericTwoCompartmentExchangeModelParameterizer>
-  {
-  public:
-    mitkClassMacro(NumericTwoCompartmentExchangeModelFactory,
-                   TwoCompartmentExchangeModelFactoryBase<NumericTwoCompartmentExchangeModelParameterizer>);
-    itkFactorylessNewMacro(Self);
-
-  protected:
-
-    ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override;
-
-    NumericTwoCompartmentExchangeModelFactory();
-
-    ~NumericTwoCompartmentExchangeModelFactory() override;
-
-  private:
-
-    //No copy constructor allowed
-    NumericTwoCompartmentExchangeModelFactory(const Self& source);
-    void operator=(const Self&);  //purposely not implemented
-
-  };
-
-}
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h
deleted file mode 100644
index 076952c6c3..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h
+++ /dev/null
@@ -1,77 +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.
-
-============================================================================*/
-
-#ifndef mitkNumericTwoCompartmentExchangeModelParameterizer_h
-#define mitkNumericTwoCompartmentExchangeModelParameterizer_h
-
-#include "mitkAIFBasedModelParameterizerBase.h"
-#include "mitkNumericTwoCompartmentExchangeModel.h"
-
-#include "MitkPharmacokineticsExports.h"
-
-namespace mitk
-{
-
-  class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelParameterizer : public
-    mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel>
-  {
-  public:
-    typedef NumericTwoCompartmentExchangeModelParameterizer Self;
-    typedef mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel> Superclass;
-    typedef itk::SmartPointer< Self >                            Pointer;
-    typedef itk::SmartPointer< const Self >                      ConstPointer;
-
-    itkTypeMacro(NumericTwoCompartmentExchangeModelParameterizer,
-                 mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel>);
-    itkFactorylessNewMacro(Self);
-
-    typedef Superclass::ModelBaseType ModelBaseType;
-    typedef Superclass::ModelBasePointer ModelBasePointer;
-
-    typedef Superclass::ModelType ModelType;
-    typedef ModelType::Pointer ModelPointer;
-
-    typedef Superclass::StaticParameterValueType StaticParameterValueType;
-    typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
-    typedef  Superclass::StaticParameterMapType StaticParameterMapType;
-
-    typedef Superclass::IndexType IndexType;
-
-    itkSetMacro(ODEINTStepSize, double);
-    itkGetConstReferenceMacro(ODEINTStepSize, double);
-
-    /** Returns the global static parameters for the model.
-    * @remark this default implementation assumes only AIF and its timegrid as static parameters.
-    * Reimplement in derived classes to change this behavior.*/
-    StaticParameterMapType GetGlobalStaticParameters() const override;
-
-
-    /** This function returns the default parameterization (e.g. initial parametrization for fitting)
-     defined by the model developer for  for the given model.*/
-    ParametersType GetDefaultInitialParameterization() const override;
-
-  protected:
-
-    double m_ODEINTStepSize;
-
-    NumericTwoCompartmentExchangeModelParameterizer();
-
-    ~NumericTwoCompartmentExchangeModelParameterizer() override;
-
-  private:
-
-    //No copy constructor allowed
-    NumericTwoCompartmentExchangeModelParameterizer(const Self& source);
-    void operator=(const Self&);  //purposely not implemented
-  };
-}
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
deleted file mode 100644
index 0364852861..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
+++ /dev/null
@@ -1,97 +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.
-
-============================================================================*/
-
-#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);
-
-    /** Run-time type information (and related methods). */
-    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
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h
deleted file mode 100644
index 6157d8b36a..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h
+++ /dev/null
@@ -1,48 +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.
-
-============================================================================*/
-
-#ifndef mitkNumericTwoTissueCompartmentModelFactory_h
-#define mitkNumericTwoTissueCompartmentModelFactory_h
-
-#include "mitkTwoTissueCompartmentModelFactoryBase.h"
-#include "mitkNumericTwoTissueCompartmentModelParameterizer.h"
-
-namespace mitk
-{
-
-
-  class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelFactory : public
-    mitk::TwoTissueCompartmentModelFactoryBase<NumericTwoTissueCompartmentModelParameterizer>
-  {
-  public:
-    mitkClassMacro(NumericTwoTissueCompartmentModelFactory,
-                   TwoTissueCompartmentModelFactoryBase<NumericTwoTissueCompartmentModelParameterizer>);
-    itkFactorylessNewMacro(Self);
-
-  protected:
-
-    NumericTwoTissueCompartmentModelFactory();
-
-    ~NumericTwoTissueCompartmentModelFactory() override;
-
-  private:
-
-    //No copy constructor allowed
-    NumericTwoTissueCompartmentModelFactory(const Self& source);
-    void operator=(const Self&);  //purposely not implemented
-
-  };
-
-}
-
-
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h
deleted file mode 100644
index 07f71e2720..0000000000
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h
+++ /dev/null
@@ -1,65 +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.
-
-============================================================================*/
-
-#ifndef mitkNumericTwoTissueCompartmentModelParameterizer_h
-#define mitkNumericTwoTissueCompartmentModelParameterizer_h
-
-#include "mitkAIFBasedModelParameterizerBase.h"
-#include "mitkNumericTwoTissueCompartmentModel.h"
-
-#include "MitkPharmacokineticsExports.h"
-
-namespace mitk
-{
-
-  class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelParameterizer : public
-    mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel>
-  {
-  public:
-    typedef NumericTwoTissueCompartmentModelParameterizer Self;
-    typedef mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel> Superclass;
-    typedef itk::SmartPointer< Self >                            Pointer;
-    typedef itk::SmartPointer< const Self >                      ConstPointer;
-
-    itkTypeMacro(NumericTwoTissueCompartmentModelParameterizer,
-                 mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel>);
-    itkFactorylessNewMacro(Self);
-
-    typedef Superclass::ModelBaseType ModelBaseType;
-    typedef Superclass::ModelBasePointer ModelBasePointer;
-
-    typedef Superclass::ModelType ModelType;
-    typedef ModelType::Pointer ModelPointer;
-
-    typedef Superclass::StaticParameterValueType StaticParameterValueType;
-    typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
-    typedef  Superclass::StaticParameterMapType StaticParameterMapType;
-
-    typedef Superclass::IndexType IndexType;
-
-    /** This function returns the default parameterization (e.g. initial parametrization for fitting)
-     defined by the model developer for  for the given model.*/
-    ParametersType GetDefaultInitialParameterization() const override;
-
-  protected:
-    NumericTwoTissueCompartmentModelParameterizer();
-
-    ~NumericTwoTissueCompartmentModelParameterizer() override;
-
-  private:
-
-    //No copy constructor allowed
-    NumericTwoTissueCompartmentModelParameterizer(const Self& source);
-    void operator=(const Self&);  //purposely not implemented
-  };
-}
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
index 6da9c3a278..1211729ddb 100644
--- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
@@ -1,94 +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 mitkOneTissueCompartmentModel_h
 #define mitkOneTissueCompartmentModel_h
 
 #include "mitkAIFBasedModelBase.h"
 #include "MitkPharmacokineticsExports.h"
 
 namespace mitk
 {
-  /** @class OneTissueCompartmentModel
-   * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
-   * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
-   * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
-   *       C(t) = vp * Cp(t) + conv(Cp(t),R(t))
-   * The parameters ktrans, ve and ve are subject to the fitting routine*/
-
   class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModel : public AIFBasedModelBase
   {
 
   public:
     typedef OneTissueCompartmentModel 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);
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(OneTissueCompartmentModel, ModelBase);
 
-    static const std::string MODEL_DISPLAY_NAME;
-
-    static const std::string NAME_PARAMETER_k1;
+    static const std::string NAME_PARAMETER_K1;
     static const std::string NAME_PARAMETER_k2;
 
-    static const std::string UNIT_PARAMETER_k1;
+    static const std::string UNIT_PARAMETER_K1;
     static const std::string UNIT_PARAMETER_k2;
 
-    static const unsigned int POSITION_PARAMETER_k1;
+    static const unsigned int POSITION_PARAMETER_K1;
     static const unsigned int POSITION_PARAMETER_k2;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
     std::string GetModelDisplayName() const override;
 
     std::string GetModelType() const override;
 
     ParameterNamesType GetParameterNames() const override;
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
-
   protected:
     OneTissueCompartmentModel();
     ~OneTissueCompartmentModel() 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
     OneTissueCompartmentModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
 
 
   };
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
index 209bc84646..bea02f08d2 100644
--- a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
+++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
@@ -1,106 +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 mitkStandardToftsModel_h
 #define mitkStandardToftsModel_h
 
 #include "mitkAIFBasedModelBase.h"
 #include "MitkPharmacokineticsExports.h"
 
 namespace mitk
 {
   /** @class StandardToftsModel
    * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
    * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
    * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
    *       C(t) = vp * Cp(t) + conv(Cp(t),R(t))
    * The parameters ktrans, ve and ve are subject to the fitting routine*/
 
   class MITKPHARMACOKINETICS_EXPORT StandardToftsModel : public AIFBasedModelBase
   {
 
   public:
     typedef StandardToftsModel 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);
 
     /** Run-time type information (and related methods). */
     itkTypeMacro(StandardToftsModel, ModelBase);
 
-    static const std::string MODEL_DISPLAY_NAME;
-
     static const std::string NAME_PARAMETER_Ktrans;
     static const std::string NAME_PARAMETER_ve;
-    static const std::string NAME_PARAMETER_vp;
 
     static const std::string UNIT_PARAMETER_Ktrans;
     static const std::string UNIT_PARAMETER_ve;
-    static const std::string UNIT_PARAMETER_vp;
 
     static const unsigned int POSITION_PARAMETER_Ktrans;
     static const unsigned int POSITION_PARAMETER_ve;
-    static const unsigned int POSITION_PARAMETER_vp;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string NAME_DERIVED_PARAMETER_kep;
+
+    static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
+
+    static const std::string UNIT_DERIVED_PARAMETER_kep;
+
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
+
+
     std::string GetModelDisplayName() const override;
 
     std::string GetModelType() const override;
 
     ParameterNamesType GetParameterNames() const override;
     ParametersSizeType  GetNumberOfParameters() const override;
 
     ParamterUnitMapType GetParameterUnits() const override;
 
     ParameterNamesType GetDerivedParameterNames() const override;
 
     ParametersSizeType  GetNumberOfDerivedParameters() const override;
 
     ParamterUnitMapType GetDerivedParameterUnits() const override;
 
   protected:
     StandardToftsModel();
     ~StandardToftsModel() 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 PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
 
   private:
 
 
     //No copy constructor allowed
     StandardToftsModel(const Self& source);
     void operator=(const Self&);  //purposely not implemented
 
 
 
 
   };
 }
 
 #endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
index d01d5b51c4..bb4071d24d 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
@@ -1,113 +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 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);
 
     /** Run-time type information (and related methods). */
     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;
 
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
     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
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h
deleted file mode 100644
index f9e4b461fa..0000000000
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h
+++ /dev/null
@@ -1,114 +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.
-
-============================================================================*/
-
-#ifndef mitkTwoCompartmentExchangeModelDifferentialEquations_h
-#define mitkTwoCompartmentExchangeModelDifferentialEquations_h
-
-#include "mitkNumericTwoCompartmentExchangeModel.h"
-
-namespace mitk{
-/** @class TwoCompartmentExchangeModelDifferentialEquations
- * @brief Helper Class for NumericTwoCompartmentExchangeModel: Defines the differential equations (Mass Balance Equations) in the 2 Compartment Exchange model.
- * The 2 Compartment Exchange model is defined via the mass balance equations
- * vp * dCp(t)/dt =  F * (CA(t) - Cp(t)) - PS * (Cp(t) - Ce(t))
- * ve * dCe(t)/dt = PS * (Cp(t) - Ce(t))
- * Boost ODEINT performs a stepwise numeric integration (e.g. via Runge-Kutta method) of the initial value problem
- * x' = dx/dt = f(x,t)
- * It needs an operator () (a functor) that calculates dx/dt = dxdt for a given x and t.
- * Parameters are F, PS, ve and vp and the time dependent Ca(t) =AIF, that is interpolated to the current step t
-*/
-
-class TwoCompartmentExchangeModelDifferentialEquations
-{
-public:
-
-    typedef std::vector< double > AIFType;
-
-    /** @brief Functor for differential equation of Physiological Pharmacokinetic Brix Model
-     * Takes current state x = x(t) and time t and calculates the corresponding dxdt = dx/dt
-    */
-    void operator() (const mitk::NumericTwoCompartmentExchangeModel::state_type &x, mitk::NumericTwoCompartmentExchangeModel::state_type &dxdt, const double t)
-    {
-        double Ca_t = InterpolateAIFToCurrentTimeStep(t);
-
-//        dxdt[0] = -(this->FVP + this->PSVP)*x[0] - this->PSVP*x[1]+this->FVP*Ca_t;
-        dxdt[0] = (1/this->vp) * ( this->F*(Ca_t - x[0]) - this->PS*(x[0] - x[1]) );
-        dxdt[1] = (1/this->ve) * this->PS * (x[0] - x[1]);
-
-    }
-
-    TwoCompartmentExchangeModelDifferentialEquations() : F(0), PS(0), ve(0), vp(0), m_AIF(0), m_AIFTimeGrid(0)
-    {
-    }
-
-    /** @brief Initialize class with parameters F/Vp, PS/Vp, fi and fp that are free fit parameters*/
-    void initialize(double Fp, double ps, double fi, double fp)
-    {
-        this->F = Fp;
-        this->PS = ps;
-        this->ve = fi;
-        this->vp = fp;
-    }
-
-
-    void setAIF(AIFType &aif)
-    {
-        this->m_AIF = aif;
-    }
-
-
-    void setAIFTimeGrid(AIFType &grid)
-    {
-        this->m_AIFTimeGrid = grid;
-    }
-
-private:
-
-    double F;
-    double PS;
-    double ve;
-    double vp;
-
-    AIFType m_AIF;
-    AIFType m_AIFTimeGrid;
-
-
-    /** @brief Internal routine to interpolate the AIF to the current time point t used for integration
-     * The numerical integration of ODEINT is performed on an adaptive timegrid (adaptive step size dt) different from the time grid of the AIF and model function.
-     * Thus, the AIF value Ca(t) has to be interpolated from the set AIF
-     */
-    double InterpolateAIFToCurrentTimeStep(double t)
-    {
-        double lastValue = m_AIF[0];
-        double lastTime = std::numeric_limits<double>::min();
-
-        AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
-        AIFType::const_iterator posValue = m_AIF.begin();
-
-        while(t > *posITime)
-        {
-            lastValue = *posValue;
-            lastTime = *posITime;
-            ++posValue;
-            ++posITime;
-        }
-        double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
-        double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
-        double result = weightLast * lastValue + weightNext * (*posValue);
-
-        return result;
-    }
-
-};
-}
-
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h
deleted file mode 100644
index 92b03e5903..0000000000
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h
+++ /dev/null
@@ -1,106 +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.
-
-============================================================================*/
-
-#ifndef mitkTwoStepLinearModel_h
-#define mitkTwoStepLinearModel_h
-
-#include "mitkModelBase.h"
-
-#include "MitkPharmacokineticsExports.h"
-
-namespace mitk
-{
-
-  class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModel : public mitk::ModelBase
-  {
-
-  public:
-    typedef TwoStepLinearModel 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(TwoStepLinearModel, ModelBase)
-
-    static const std::string MODELL_NAME;
-    static const std::string NAME_PARAMETER_y1;
-    static const std::string NAME_PARAMETER_t;
-    static const std::string NAME_PARAMETER_a1;
-    static const std::string NAME_PARAMETER_a2;
-
-    static const unsigned int POSITION_PARAMETER_y1;
-    static const unsigned int POSITION_PARAMETER_t;
-    static const unsigned int POSITION_PARAMETER_a1;
-    static const unsigned int POSITION_PARAMETER_a2;
-
-    static const unsigned int NUMBER_OF_PARAMETERS;
-
-    virtual std::string GetModelDisplayName() const override;
-
-    virtual std::string GetModelType() const override;
-
-    virtual FunctionStringType GetFunctionString() const override;
-
-    virtual std::string GetXName() const override;
-
-    virtual ParameterNamesType GetParameterNames() const override;
-
-    virtual ParametersSizeType  GetNumberOfParameters() const override;
-
-    virtual ParameterNamesType GetStaticParameterNames() const override;
-
-    virtual ParametersSizeType GetNumberOfStaticParameters() const override;
-
-    virtual ParameterNamesType GetDerivedParameterNames() const override;
-
-    virtual ParametersSizeType  GetNumberOfDerivedParameters() const override;
-
-
-  protected:
-    TwoStepLinearModel() {};
-    virtual ~TwoStepLinearModel(){};
-
-
-    /**
-     * Actual implementation of the clone method. This method should be reimplemeted
-     * in subclasses to clone the extra required parameters.
-     */
-    virtual itk::LightObject::Pointer InternalClone() const;
-
-    virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const;
-    virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
-        parameters) const;
-
-    virtual void SetStaticParameter(const ParameterNameType& name,
-                                    const StaticParameterValuesType& values);
-    virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const;
-
-    static double ComputeSignalFromParameters(double x, double t, double a1, double a2, double b1, double b2);
-
-  private:
-
-    //No copy constructor allowed
-    TwoStepLinearModel(const Self& source);
-    void operator=(const Self&);  //purposely not implemented
-  };
-}
-
-
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
index d6e2240302..981d44cd0e 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
@@ -1,92 +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 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);
 
     /** Run-time type information (and related methods). */
     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 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 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 POSITION_PARAMETER_vb;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string MODEL_TYPE;
+
     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
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
index a20c922009..5f1ebe6506 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
@@ -1,94 +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 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);
 
     /** Run-time type information (and related methods). */
     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 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 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 POSITION_PARAMETER_vb;
 
     static const unsigned int NUMBER_OF_PARAMETERS;
 
+    static const std::string MODEL_DISPLAY_NAME;
+
+    static const std::string MODEL_TYPE;
+
     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
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h
deleted file mode 100644
index b892bef899..0000000000
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h
+++ /dev/null
@@ -1,114 +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.
-
-============================================================================*/
-
-#ifndef mitkTwoTissueCompartmentModelDifferentialEquations_h
-#define mitkTwoTissueCompartmentModelDifferentialEquations_h
-#include "mitkNumericTwoTissueCompartmentModel.h"
-
-namespace mitk{
-/** @class TwoTissueCompartmentModelDifferentialEquations
- * @brief Helper Class for NumericTwoTissueCompartment Model: Defines the differential equations (Mass Balance Equations) in the
- * 2-tissue-compartment model for dynamic PET data modeling.
- * The 2-Tissue Compartment model is defined via the mass balance equations
- * dC1(t)/dt =  K1*Ca(t) - (k2 + k3)*C1(t) + k4*C2(t)
- * dC2(t)/dt = k3*C1(t) - k4*C2(t)
- * CT(t) = C_a(t)*VB + (1-VB)*(C1(t)+C2(t)
- * where Ca(t) is the plasma concentration(aterial input function)
- * Boost ODEINT performs a stepwise numeric integration (e.g. via Runge-Kutta method) of the initial value problem
- * x' = dx/dt = f(x,t)
- * It needs an operator () (a functor) that calculates dx/dt = dxdt for a given x and t.
- * Parameters are K1,k2,k3,k4, VB and the time dependent Ca(t) =AIF, that is interpolated to the current step t
-*/
-
-class TwoTissueCompartmentModelDifferentialEquations
-{
-public:
-
-    typedef std::vector< double > AIFType;
-
-    /** @brief Functor for differential equation of Two Tissue Compartment Model
-     * Takes current state x = x(t) and time t and calculates the corresponding dxdt = dx/dt
-    */
-    void operator() (const mitk::NumericTwoTissueCompartmentModel::state_type &x, mitk::NumericTwoTissueCompartmentModel::state_type &dxdt, const double t)
-    {
-        double Ca_t = InterpolateAIFToCurrentTimeStep(t);
-
-        dxdt[0] = this->K1*Ca_t-(this->k2+this->k3)*x[0] + this->k4*x[1];
-        dxdt[1] = this->k3*x[0] - this->k4*x[1];
-    }
-
-    TwoTissueCompartmentModelDifferentialEquations() : K1(0), k2(0), k3(0), k4(0), m_AIF(0), m_AIFTimeGrid(0)
-    {
-    }
-
-    /** @brief Initialize class with parameters K1, k2, k3 and k4 that are free fit parameters*/
-    void initialize(double k_1, double k_2, double k_3, double k_4)
-    {
-        this->K1 = k_1;
-        this->k2 = k_2;
-        this->k3 = k_3;
-        this->k4 = k_4;
-    }
-
-
-    void setAIF(AIFType &aif)
-    {
-        this->m_AIF = aif;
-    }
-
-
-    void setAIFTimeGrid(AIFType &grid)
-    {
-        this->m_AIFTimeGrid = grid;
-    }
-
-private:
-
-    double K1;
-    double k2;
-    double k3;
-    double k4;
-
-    AIFType m_AIF;
-    AIFType m_AIFTimeGrid;
-
-
-    /** @brief Internal routine to interpolate the AIF to the current time point t used for integration
-     * The numerical integration of ODEINT is performed on an adaptive timegrid (adaptive step size dt) different from the time grid of the AIF and model function.
-     * Thus, the AIF value Ca(t) has to be interpolated from the set AIF
-     */
-    double InterpolateAIFToCurrentTimeStep(double t)
-    {
-        double lastValue = m_AIF[0];
-        double lastTime = std::numeric_limits<double>::min();
-
-        AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
-        AIFType::const_iterator posValue = m_AIF.begin();
-
-        while(t > *posITime)
-        {
-            lastValue = *posValue;
-            lastTime = *posITime;
-            ++posValue;
-            ++posITime;
-        }
-        double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
-        double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
-        double result = weightLast * lastValue + weightNext * (*posValue);
-
-        return result;
-    }
-
-};
-}
-
-#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h
index 2430ab8a15..ad8047cf3b 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.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 mitkTwoTissueCompartmentModelFactoryBase_h
 #define mitkTwoTissueCompartmentModelFactoryBase_h
 
 #include "mitkConcreteAIFBasedModelFactory.h"
 #include "mitkAIFBasedModelParameterizerBase.h"
 #include "mitkSimpleBarrierConstraintChecker.h"
 
 namespace mitk
 {
   template <class TModelParameterizer>
   class TwoTissueCompartmentModelFactoryBase : public
     mitk::ConcreteAIFBasedModelFactory< TModelParameterizer >
   {
   public:
     mitkClassMacro(TwoTissueCompartmentModelFactoryBase,
                    ConcreteAIFBasedModelFactory< TModelParameterizer >);
     itkFactorylessNewMacro(Self);
 
     typedef typename Superclass::ModelType ModelType;
     typedef typename Superclass::ModelParameterizerType ModelParameterizerType;
     typedef typename Superclass::ParametersType ParametersType;
 
     ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override
     {
       SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
 
       /**@todo Mit Charlie klaren ob es eine sinnvolle default Einstellung gibt.*/
       constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0, 0);
       constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0, 0);
       constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k3, 0, 0);
       constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k4, 0, 0);
-      constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_VB, 0, 0);
-      constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_VB, 1, 0);
+      constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_vb, 0, 0);
+      constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_vb, 1, 0);
 
       constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_K1, 1.0, 0);
       constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0, 0);
       constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k3, 1.0, 0);
       constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k4, 1.0, 0);
 
 
       return constraints.GetPointer();
     };
 
     ParametersType GetDefaultInitialParameterization() const override
     {
         typename ModelParameterizerType::Pointer modelParameterizer =
           ModelParameterizerType::New();
 
       return modelParameterizer->GetDefaultInitialParameterization();
     };
 
   protected:
 
     TwoTissueCompartmentModelFactoryBase()
     {
     };
 
     ~TwoTissueCompartmentModelFactoryBase() override
     {
     };
 
   private:
 
     //No copy constructor allowed
     TwoTissueCompartmentModelFactoryBase(const Self& source);
     void operator=(const Self&);  //purposely not implemented
   };
 
 }
 #endif
diff --git a/Modules/Pharmacokinetics/src/Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp b/Modules/Pharmacokinetics/src/Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp
index 287ca01c4a..301fd846cb 100644
--- a/Modules/Pharmacokinetics/src/Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp
+++ b/Modules/Pharmacokinetics/src/Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp
@@ -1,191 +1,191 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "itkCommand.h"
 #include "itkMultiOutputNaryFunctorImageFilter.h"
 
 #include "mitkPixelBasedDescriptionParameterImageGenerator.h"
 #include "mitkImageTimeSelector.h"
 #include "mitkImageAccessByItk.h"
 #include "mitkImageCast.h"
 #include "mitkSimpleFunctorPolicy.h"
 #include "mitkModelBase.h"
 
 void
   mitk::PixelBasedDescriptionParameterImageGenerator::
   onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& /*eventObject*/)
 {
-  this->InvokeEvent(::itk::ProgressEvent());
 
   itk::ProcessObject* process = dynamic_cast<itk::ProcessObject*>(caller);
   if (process)
   {
     this->m_Progress = process->GetProgress();
   }
+  this->InvokeEvent(::itk::ProgressEvent());
 };
 
 template <typename TPixel, unsigned int VDim>
 void
   mitk::PixelBasedDescriptionParameterImageGenerator::DoPrepareMask(itk::Image<TPixel, VDim>* image)
 {
   m_InternalMask = dynamic_cast<InternalMaskType*>(image);
 
   if (m_InternalMask.IsNull())
   {
     MITK_INFO << "Parameter Fit Generator. Need to cast mask for parameter fit.";
     typedef itk::Image<TPixel, VDim> InputImageType;
     typedef itk::CastImageFilter< InputImageType, InternalMaskType > CastFilterType;
     typename CastFilterType::Pointer  spImageCaster =  CastFilterType::New();
 
     spImageCaster->SetInput(image);
 
     m_InternalMask = spImageCaster->GetOutput();
     spImageCaster->Update();
   }
 }
 
 template<typename TImage>
 mitk::PixelBasedDescriptionParameterImageGenerator::ParameterImageMapType StoreResultImages(const mitk::CurveParameterFunctor::ParameterNamesType &paramNames, itk::ImageSource<TImage>* source)
 {
   if (source->GetNumberOfOutputs() != paramNames.size())
   {
     mitkThrow() << "Error while generating fitted parameter images. Number of sources does not match expected parameter number. Output size: " << source->GetNumberOfOutputs() << "; number of param names: " << paramNames.size();
   }
 
   mitk::PixelBasedDescriptionParameterImageGenerator::ParameterImageMapType result;
   for (mitk::CurveParameterFunctor::ParameterNamesType::size_type j = 0; j < paramNames.size(); ++j)
   {
     mitk::Image::Pointer paramImage = mitk::Image::New();
     typename TImage::ConstPointer outputImg = source->GetOutput(j);
     mitk::CastToMitkImage(outputImg, paramImage);
 
     result.insert(std::make_pair(paramNames[j],paramImage));
   }
 
   return result;
 }
 
 template <typename TPixel, unsigned int VDim>
 void
   mitk::PixelBasedDescriptionParameterImageGenerator::DoParameterCalculation(itk::Image<TPixel, VDim>* /*image*/)
 {
   typedef itk::Image<TPixel, VDim-1> InputFrameImageType;
   typedef itk::Image<ScalarType, VDim-1> ParameterImageType;
 
   typedef itk::MultiOutputNaryFunctorImageFilter<InputFrameImageType, ParameterImageType, SimpleFunctorPolicy, InternalMaskType> DescriptorFilterType;
 
   typename DescriptorFilterType::Pointer descFilter = DescriptorFilterType::New();
 
   typename ::itk::MemberCommand<Self>::Pointer spProgressCommand = ::itk::MemberCommand<Self>::New();
   spProgressCommand->SetCallbackFunction(this, &Self::onFitProgressEvent);
   descFilter->AddObserver(::itk::ProgressEvent(), spProgressCommand);
 
   //add the time frames to the descriptor filter
   std::vector<Image::Pointer> frameCache;
   for (unsigned int i = 0; i < this->m_DynamicImage->GetTimeSteps(); ++i)
   {
     typename InputFrameImageType::Pointer frameImage;
     mitk::ImageTimeSelector::Pointer imageTimeSelector =	mitk::ImageTimeSelector::New();
     imageTimeSelector->SetInput(this->m_DynamicImage);
     imageTimeSelector->SetTimeNr(i);
     imageTimeSelector->UpdateLargestPossibleRegion();
 
     Image::Pointer frameMITKImage = imageTimeSelector->GetOutput();
     frameCache.push_back(frameMITKImage);
     mitk::CastToItkImage(frameMITKImage, frameImage);
     descFilter->SetInput(i,frameImage);
   }
 
 
   SimpleFunctorPolicy functor;
 
   functor.SetFunctor(this->m_Functor);
   descFilter->SetFunctor(functor);
   if (this->m_InternalMask.IsNotNull())
   {
     descFilter->SetMask(this->m_InternalMask);
   }
 
   //generate the fits
   descFilter->Update();
 
   //convert the outputs into mitk images and fill the parameter image map
   CurveParameterFunctor::ParameterNamesType paramNames = this->m_Functor->GetDescriptionParameterNames();
 
   if (descFilter->GetNumberOfOutputs() != (paramNames.size()))
   {
     mitkThrow() << "Error while generating fitted parameter images. Fit filter output size does not match expected parameter number. Output size: "<< descFilter->GetNumberOfOutputs();
   }
 
   this->m_TempResultMap = StoreResultImages<ParameterImageType>(paramNames,descFilter);
 }
 
 bool
   mitk::PixelBasedDescriptionParameterImageGenerator::HasOutdatedResult() const
 {
   bool result = Superclass::HasOutdatedResult();
 
   if (m_DynamicImage.IsNotNull())
   {
     if (m_DynamicImage->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   if (m_Mask.IsNotNull())
   {
     if (m_Mask->GetMTime() > this->m_GenerationTimeStamp)
     {
       result = true;
     }
   }
 
   return result;
 
 };
 
 void
   mitk::PixelBasedDescriptionParameterImageGenerator::CheckValidInputs() const
 {
   Superclass::CheckValidInputs();
 
   if (m_DynamicImage.IsNull())
   {
     mitkThrow() << "Cannot generate fitted parameter images. Input dynamic image is not set.";
   }
 
 };
 
 void mitk::PixelBasedDescriptionParameterImageGenerator::DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages)
 {
   this->m_Progress = 0;
 
   if(this->m_Mask.IsNotNull())
   {
     AccessFixedDimensionByItk(m_Mask, mitk::PixelBasedDescriptionParameterImageGenerator::DoPrepareMask, 3);
   }
   else
   {
     this->m_InternalMask = nullptr;
   }
 
   AccessFixedDimensionByItk(m_DynamicImage, mitk::PixelBasedDescriptionParameterImageGenerator::DoParameterCalculation, 4);
 
   parameterImages = this->m_TempResultMap;
  };
 
 double
   mitk::PixelBasedDescriptionParameterImageGenerator::GetProgress() const
 {
   return m_Progress;
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkAIFBasedModelBase.cpp b/Modules/Pharmacokinetics/src/Models/mitkAIFBasedModelBase.cpp
index b746b38fec..78fe64e9b3 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkAIFBasedModelBase.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkAIFBasedModelBase.cpp
@@ -1,183 +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.
 
 ============================================================================*/
 
 #include "mitkAIFBasedModelBase.h"
 #include "mitkTimeGridHelper.h"
 #include "mitkAIFParametrizerHelper.h"
 
 #include "itkArray2D.h"
 
+const unsigned int mitk::AIFBasedModelBase::NUMBER_OF_STATIC_PARAMETERS = 2;
 
-const std::string mitk::AIFBasedModelBase::NAME_STATIC_PARAMETER_AIF = "Aterial Input Function";
+const std::string mitk::AIFBasedModelBase::NAME_STATIC_PARAMETER_AIF = "Arterial Input Function";
 const std::string mitk::AIFBasedModelBase::NAME_STATIC_PARAMETER_AIFTimeGrid =
-  "Aterial Input Function Timegrid";
+  "Arterial Input Function Timegrid";
 
 //Assumed AIF is always extracted from concentration image
-const std::string mitk::AIFBasedModelBase::UNIT_STATIC_PARAMETER_AIF = "C";
+const std::string mitk::AIFBasedModelBase::UNIT_STATIC_PARAMETER_AIF = "mM";
 const std::string mitk::AIFBasedModelBase::UNIT_STATIC_PARAMETER_AIFTimeGrid =
   "s";
 
+const std::string mitk::AIFBasedModelBase::X_AXIS_NAME = "Time";
+
+const std::string mitk::AIFBasedModelBase::X_AXIS_UNIT = "s";
+
+const std::string mitk::AIFBasedModelBase::Y_AXIS_NAME = "Concentration";
+
+const std::string mitk::AIFBasedModelBase::Y_AXIS_UNIT = "mM";
+
 std::string mitk::AIFBasedModelBase::GetXAxisName() const
 {
-  return "Time";
+  return X_AXIS_NAME;
 };
 
 std::string mitk::AIFBasedModelBase::GetXAxisUnit() const
 {
-  return "s";
+  return X_AXIS_UNIT;
 }
 
 std::string mitk::AIFBasedModelBase::GetYAxisName() const
 {
-  return "";
+  return Y_AXIS_NAME;
 };
 
 std::string mitk::AIFBasedModelBase::GetYAxisUnit() const
 {
-  return "";
+  return Y_AXIS_UNIT;
 }
 
 mitk::AIFBasedModelBase::AIFBasedModelBase()
 {
 }
 
 mitk::AIFBasedModelBase::~AIFBasedModelBase()
 {
 }
 
 const mitk::AIFBasedModelBase::TimeGridType&
 mitk::AIFBasedModelBase::GetCurrentAterialInputFunctionTimeGrid() const
 {
   if (!m_AterialInputFunctionTimeGrid.empty())
   {
     return m_AterialInputFunctionTimeGrid;
   }
   else
   {
     return m_TimeGrid;
   }
 };
 
 const mitk::AIFBasedModelBase::AterialInputFunctionType
 mitk::AIFBasedModelBase::GetAterialInputFunction(TimeGridType CurrentTimeGrid) const
 {
   if (CurrentTimeGrid.GetSize() == 0)
   {
     return this->m_AterialInputFunctionValues;
   }
   else
   {
     return mitk::InterpolateSignalToNewTimeGrid(m_AterialInputFunctionValues,
            GetCurrentAterialInputFunctionTimeGrid(), CurrentTimeGrid);
   }
 }
 
 mitk::AIFBasedModelBase::ParameterNamesType mitk::AIFBasedModelBase::GetStaticParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_STATIC_PARAMETER_AIF);
   result.push_back(NAME_STATIC_PARAMETER_AIFTimeGrid);
 
   return result;
 }
 
 mitk::AIFBasedModelBase::ParametersSizeType  mitk::AIFBasedModelBase::GetNumberOfStaticParameters()
 const
 {
-  return 2;
+  return NUMBER_OF_STATIC_PARAMETERS;
 }
 
 mitk::AIFBasedModelBase::ParamterUnitMapType
 mitk::AIFBasedModelBase::GetStaticParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_STATIC_PARAMETER_AIF, UNIT_STATIC_PARAMETER_AIF));
   result.insert(std::make_pair(NAME_STATIC_PARAMETER_AIFTimeGrid, UNIT_STATIC_PARAMETER_AIFTimeGrid));
 
   return result;
 };
 
 
 void mitk::AIFBasedModelBase::SetStaticParameter(const ParameterNameType& name,
     const StaticParameterValuesType& values)
 {
   if (name == NAME_STATIC_PARAMETER_AIF)
   {
     AterialInputFunctionType aif = mitk::convertParameterToArray(values);
 
     SetAterialInputFunctionValues(aif);
   }
 
   if (name == NAME_STATIC_PARAMETER_AIFTimeGrid)
   {
     TimeGridType timegrid = mitk::convertParameterToArray(values);
 
     SetAterialInputFunctionTimeGrid(timegrid);
   }
 };
 
 mitk::AIFBasedModelBase::StaticParameterValuesType mitk::AIFBasedModelBase::GetStaticParameterValue(
   const ParameterNameType& name) const
 {
   StaticParameterValuesType result;
 
   if (name == NAME_STATIC_PARAMETER_AIF)
   {
     result = mitk::convertArrayToParameter(this->m_AterialInputFunctionValues);
   }
 
   if (name == NAME_STATIC_PARAMETER_AIFTimeGrid)
   {
     result = mitk::convertArrayToParameter(this->m_AterialInputFunctionTimeGrid);
   }
 
   return result;
 };
 
 bool mitk::AIFBasedModelBase::ValidateModel(std::string& error) const
 {
   bool result = Superclass::ValidateModel(error);
 
   if (result)
   {
     if (m_AterialInputFunctionTimeGrid.empty())
     {
       if (this->m_TimeGrid.GetSize() != m_AterialInputFunctionValues.GetSize())
       {
         result = false;
         error = "Number of elements of Model Time Grid does not match number of elements in Aterial Input Function! Set valid aif or aif time grid.";
       }
     }
     else
     {
       if (m_AterialInputFunctionTimeGrid.GetSize() != m_AterialInputFunctionValues.GetSize())
       {
         result = false;
         error = "Number of elements of Aterial Input Function Time Grid does not match number of elements of Aterial Input Function Values! Set valid curve";
       }
     }
   }
 
   return result;
 };
 
 void mitk::AIFBasedModelBase::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
-  os << indent << "Aterial Input Function: " << m_AterialInputFunctionValues;
-  os << indent << "Aterial Input Function Time Grid: " << m_AterialInputFunctionTimeGrid;
+  os << indent << "Arterial Input Function: " << m_AterialInputFunctionValues;
+  os << indent << "Arterial Input Function Time Grid: " << m_AterialInputFunctionTimeGrid;
 };
 
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModel.cpp
index 438f0353c3..81aef2e2ba 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModel.cpp
@@ -1,263 +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.
 
 ============================================================================*/
 
 #include "mitkDescriptivePharmacokineticBrixModel.h"
 
 const std::string mitk::DescriptivePharmacokineticBrixModel::MODEL_DISPLAY_NAME =
   "Descriptive Pharmacokinetic Brix Model";
 
+const std::string mitk::DescriptivePharmacokineticBrixModel::MODEL_TYPE =
+"Perfusion.MR";
+
 const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_A = "A";
-const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_kep = "kep";
-const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_kel = "kel";
-//tlag in minutes
-const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_tlag = "tlag";
+const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_kep = "k_{e->p}";
+const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_kel = "k_{el}";
+const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_PARAMETER_BAT = "BAT";
 
 const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_PARAMETER_A = "a.u.";
 const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_PARAMETER_kep = "1/min";
 const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_PARAMETER_kel = "1/min";
-//tlag in minutes
-const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_PARAMETER_tlag = "min";
+const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_PARAMETER_BAT = "min";
 
-const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_Tau = "Tau";
-const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_S0 = "S0";
+const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_tau = "Injection_time";
+const std::string mitk::DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_s0 = "Pre_contrast_signal";
 
-const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_STATIC_PARAMETER_Tau = "min";
-const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_STATIC_PARAMETER_S0 = "I";
+const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_STATIC_PARAMETER_tau = "min";
+const std::string mitk::DescriptivePharmacokineticBrixModel::UNIT_STATIC_PARAMETER_s0 = "a.u.";
 
 const unsigned int mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_A = 0;
 const unsigned int mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kep = 1;
 const unsigned int mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kel = 2;
-const unsigned int mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_tlag = 3;
+const unsigned int mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_BAT = 3;
 
 const unsigned int mitk::DescriptivePharmacokineticBrixModel::NUMBER_OF_PARAMETERS = 4;
+const unsigned int mitk::DescriptivePharmacokineticBrixModel::NUMBER_OF_STATIC_PARAMETERS = 2;
+
+const std::string mitk::DescriptivePharmacokineticBrixModel::X_AXIS_NAME = "Time";
+const std::string mitk::DescriptivePharmacokineticBrixModel::X_AXIS_UNIT = "s";
+const std::string mitk::DescriptivePharmacokineticBrixModel::Y_AXIS_NAME = "Signal";
+const std::string mitk::DescriptivePharmacokineticBrixModel::Y_AXIS_UNIT = "a.u.";
+
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetModelType() const
 {
-  return "Perfusion.MR";
+  return MODEL_TYPE;
 };
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetXAxisName() const
 {
-  return "Time";
+  return X_AXIS_NAME;
 };
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetXAxisUnit() const
 {
-  return "s";
+  return X_AXIS_UNIT;
 }
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetYAxisName() const
 {
-  return "";
+  return Y_AXIS_NAME;
 };
 
 std::string mitk::DescriptivePharmacokineticBrixModel::GetYAxisUnit() const
 {
-  return "";
+  return Y_AXIS_UNIT;
 }
 
 mitk::DescriptivePharmacokineticBrixModel::DescriptivePharmacokineticBrixModel(): m_Tau(0), m_S0(1)
 {
 
 }
 
 mitk::DescriptivePharmacokineticBrixModel::~DescriptivePharmacokineticBrixModel()
 {
 
 }
 
 mitk::DescriptivePharmacokineticBrixModel::ParameterNamesType
 mitk::DescriptivePharmacokineticBrixModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_A);
   result.push_back(NAME_PARAMETER_kep);
   result.push_back(NAME_PARAMETER_kel);
-  result.push_back(NAME_PARAMETER_tlag);
+  result.push_back(NAME_PARAMETER_BAT);
 
   return result;
 }
 
 mitk::DescriptivePharmacokineticBrixModel::ParametersSizeType
 mitk::DescriptivePharmacokineticBrixModel::GetNumberOfParameters() const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 mitk::DescriptivePharmacokineticBrixModel::ParamterUnitMapType
 mitk::DescriptivePharmacokineticBrixModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_A, UNIT_PARAMETER_A));
   result.insert(std::make_pair(NAME_PARAMETER_kep, UNIT_PARAMETER_kep));
   result.insert(std::make_pair(NAME_PARAMETER_kel, UNIT_PARAMETER_kel));
-  result.insert(std::make_pair(NAME_PARAMETER_tlag, UNIT_PARAMETER_tlag));
+  result.insert(std::make_pair(NAME_PARAMETER_BAT, UNIT_PARAMETER_BAT));
 
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModel::ParameterNamesType
 mitk::DescriptivePharmacokineticBrixModel::GetStaticParameterNames() const
 {
   ParameterNamesType result;
 
-  result.push_back(NAME_STATIC_PARAMETER_Tau);
-  result.push_back(NAME_STATIC_PARAMETER_S0);
+  result.push_back(NAME_STATIC_PARAMETER_tau);
+  result.push_back(NAME_STATIC_PARAMETER_s0);
 
   return result;
 }
 
 mitk::DescriptivePharmacokineticBrixModel::ParamterUnitMapType
 mitk::DescriptivePharmacokineticBrixModel::GetStaticParameterUnits() const
 {
   ParamterUnitMapType result;
 
-  result.insert(std::make_pair(NAME_STATIC_PARAMETER_Tau, UNIT_STATIC_PARAMETER_Tau));
-  result.insert(std::make_pair(NAME_STATIC_PARAMETER_S0, UNIT_STATIC_PARAMETER_S0));
+  result.insert(std::make_pair(NAME_STATIC_PARAMETER_tau, UNIT_STATIC_PARAMETER_tau));
+  result.insert(std::make_pair(NAME_STATIC_PARAMETER_s0, UNIT_STATIC_PARAMETER_s0));
 
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModel::ParametersSizeType
 mitk::DescriptivePharmacokineticBrixModel::GetNumberOfStaticParameters() const
 {
-  return 2;
+  return NUMBER_OF_STATIC_PARAMETERS;
 }
 
 
 mitk::DescriptivePharmacokineticBrixModel::ModelResultType
 mitk::DescriptivePharmacokineticBrixModel::ComputeModelfunction(const ParametersType& parameters)
 const
 {
   if (m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   if (m_Tau == 0)
   {
     itkExceptionMacro("Injection time is 0! Cannot Calculate Signal");
   }
 
 
   ModelResultType signal(m_TimeGrid.GetSize());
 
   double tx        = 0;
   double amplitude = parameters[POSITION_PARAMETER_A];
   double       kel = parameters[POSITION_PARAMETER_kel];
   double       kep = parameters[POSITION_PARAMETER_kep];
-  double      tlag = parameters[POSITION_PARAMETER_tlag];
+  double       bat = parameters[POSITION_PARAMETER_BAT];
 
   if (kep == kel)
   {
     itkExceptionMacro("(kep-kel) is 0! Cannot Calculate Signal");
   }
 
   TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
   ModelResultType::iterator signalPos = signal.begin();
 
   for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd;
        ++gridPos, ++signalPos)
   {
     double t = (*gridPos) / 60.0; //convert from [sec] to [min]
 
 
-    if (t <= tlag)
+    if (t <= bat)
     {
       tx = 0;
     }
-    else if ((t > tlag) && (t < (m_Tau + tlag)))
+    else if ((t > bat) && (t < (m_Tau + bat)))
     {
-      tx = t - tlag;
+      tx = t - bat;
     }
-    else if (t >= (m_Tau + tlag))
+    else if (t >= (m_Tau + bat))
     {
       tx = m_Tau;
     }
 
     double kDiff  = kep - kel;
-    double tDiff  = t - tlag;
+    double tDiff  = t - bat;
 
     double expkel   = (kep * exp(-kel * tDiff));
     double expkeltx =        exp(kel * tx);
     double expkep   =        exp(-kep * tDiff);
     double expkeptx =        exp(kep * tx);
 
     double value =  1 + (amplitude / m_Tau) * (((expkel / (kel * kDiff)) * (expkeltx - 1)) - ((
                       expkep / kDiff)  * (expkeptx - 1)));
 
     *signalPos = value * m_S0;
   }
 
   return signal;
 
 }
 
 void mitk::DescriptivePharmacokineticBrixModel::SetStaticParameter(const ParameterNameType& name,
     const StaticParameterValuesType& values)
 {
-  if (name == NAME_STATIC_PARAMETER_Tau)
+  if (name == NAME_STATIC_PARAMETER_tau)
   {
     SetTau(values[0]);
   }
 
-  if (name == NAME_STATIC_PARAMETER_S0)
+  if (name == NAME_STATIC_PARAMETER_s0)
   {
     SetS0(values[0]);
   }
 };
 
 mitk::DescriptivePharmacokineticBrixModel::StaticParameterValuesType
 mitk::DescriptivePharmacokineticBrixModel::GetStaticParameterValue(const ParameterNameType& name)
 const
 {
   StaticParameterValuesType result;
 
-  if (name == NAME_STATIC_PARAMETER_Tau)
+  if (name == NAME_STATIC_PARAMETER_tau)
   {
     result.push_back(GetTau());
   }
 
-  if (name == NAME_STATIC_PARAMETER_S0)
+  if (name == NAME_STATIC_PARAMETER_s0)
   {
     result.push_back(GetS0());
   }
 
   return result;
 };
 
 itk::LightObject::Pointer mitk::DescriptivePharmacokineticBrixModel::InternalClone() const
 {
   DescriptivePharmacokineticBrixModel::Pointer newClone = DescriptivePharmacokineticBrixModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
   newClone->SetTau(this->m_Tau);
   newClone->SetS0(this->m_S0);
 
   return newClone.GetPointer();
 };
 
 void mitk::DescriptivePharmacokineticBrixModel::PrintSelf(std::ostream& os,
     ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
   os << indent << "Tau (injection time): " << m_Tau;
-  os << indent << "S0 (base value): " << m_S0;
+  os << indent << "S0 (baseline value): " << m_S0;
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp
index 906a9bc909..14be13fc5b 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <mitkImageTimeSelector.h>
 #include <mitkImageCast.h>
 
 #include "mitkDescriptivePharmacokineticBrixModelFactory.h"
 #include "mitkDescriptivePharmacokineticBrixModelParameterizer.h"
 #include "mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h"
 
 mitk::DescriptivePharmacokineticBrixModelFactory::DescriptivePharmacokineticBrixModelFactory()
 {
 };
 
 mitk::DescriptivePharmacokineticBrixModelFactory::~DescriptivePharmacokineticBrixModelFactory()
 {
 };
 
 mitk::ModelParameterizerBase::ParametersType
 mitk::DescriptivePharmacokineticBrixModelFactory::GetDefaultInitialParameterization() const
 {
   return DescriptivePharmacokineticBrixModelParameterizer::New()->GetDefaultInitialParameterization();
 };
 
 mitk::ModelParameterizerBase::Pointer
 mitk::DescriptivePharmacokineticBrixModelFactory::DoCreateParameterizer(
   const mitk::modelFit::ModelFitInfo* fit) const
 {
   mitk::ModelParameterizerBase::Pointer result;
 
   if (fit->fitType == ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED())
   {
     DescriptivePharmacokineticBrixModelParameterizer::Pointer modelParameterizer =
       DescriptivePharmacokineticBrixModelParameterizer::New();
 
     modelFit::StaticParameterMap::ValueType tau = fit->staticParamMap.Get(
-          DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_Tau);
+          DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_tau);
     modelParameterizer->SetTau(tau[0]);
 
     mitk::ImageTimeSelector::Pointer imageTimeSelector =	mitk::ImageTimeSelector::New();
     imageTimeSelector->SetInput(fit->inputImage);
     imageTimeSelector->SetTimeNr(0);
     imageTimeSelector->UpdateLargestPossibleRegion();
 
     mitk::DescriptivePharmacokineticBrixModelParameterizer::BaseImageType::Pointer baseImage;
     mitk::CastToItkImage(imageTimeSelector->GetOutput(), baseImage);
 
     modelParameterizer->SetBaseImage(baseImage);
 
     result = modelParameterizer.GetPointer();
   }
   else if (fit->fitType == ModelFitConstants::FIT_TYPE_VALUE_ROIBASED())
   {
     DescriptivePharmacokineticBrixModelValueBasedParameterizer::Pointer modelParameterizer =
       DescriptivePharmacokineticBrixModelValueBasedParameterizer::New();
 
     modelFit::StaticParameterMap::ValueType tau = fit->staticParamMap.Get(
-          DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_Tau);
+          DescriptivePharmacokineticBrixModel::NAME_STATIC_PARAMETER_tau);
     modelParameterizer->SetTau(tau[0]);
 
     if (!fit->inputData.ValueExists("ROI"))
     {
       mitkThrow() <<
                   "Cannot generate parameterizer for fit of type ROIbased. Input data with the lable \"ROI\" is missing in fit.";
     }
 
     ScalarListLookupTable::ValueType signal = fit->inputData.GetTableValue("ROI");
 
     if (signal.empty())
     {
       mitkThrow() <<
                   "Cannot generate parameterizer for fit of type ROIbased. Input data with the lable \"ROI\" is invalid: No values available.";
     }
 
     modelParameterizer->SetBaseValue(signal[0]);
 
     result = modelParameterizer.GetPointer();
   }
 
   return result;
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp
index 9ca922d049..0b75907320 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <mitkImageAccessByItk.h>
 
 #include "mitkDescriptivePharmacokineticBrixModel.h"
 #include "mitkDescriptivePharmacokineticBrixModelParameterizer.h"
 
 mitk::DescriptivePharmacokineticBrixModelParameterizer::StaticParameterMapType
 mitk::DescriptivePharmacokineticBrixModelParameterizer::GetGlobalStaticParameters() const
 {
   StaticParameterMapType result;
   StaticParameterValuesType values;
   values.push_back(m_Tau);
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_Tau, values));
+  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_tau, values));
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModelParameterizer::StaticParameterMapType
 mitk::DescriptivePharmacokineticBrixModelParameterizer::GetLocalStaticParameters(
   const IndexType& currentPosition) const
 {
   StaticParameterMapType result;
 
   double s0 = m_BaseImage->GetPixel(currentPosition);
 
   StaticParameterValuesType values;
   values.push_back(s0);
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_S0, values));
+  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_s0, values));
 
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModelParameterizer::ParametersType
 mitk::DescriptivePharmacokineticBrixModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(4);
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_A] = 1.0;
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kep] = 4.0;
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kel] = 0.2;
-  initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_tlag] = 1.0;
+  initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_BAT] = 1.0;
 
   return initialParameters;
 }
 
 mitk::DescriptivePharmacokineticBrixModelParameterizer::DescriptivePharmacokineticBrixModelParameterizer()
 {
 };
 
 mitk::DescriptivePharmacokineticBrixModelParameterizer::~DescriptivePharmacokineticBrixModelParameterizer()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp
index da6f2a4acd..767c1f42a0 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <mitkImageAccessByItk.h>
 
 #include "mitkDescriptivePharmacokineticBrixModel.h"
 #include "mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h"
 
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::StaticParameterMapType
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::GetGlobalStaticParameters() const
 {
   StaticParameterMapType result;
   StaticParameterValuesType values;
   values.push_back(m_Tau);
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_Tau, values));
+  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_tau, values));
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::StaticParameterMapType
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::GetLocalStaticParameters(
   const IndexType&) const
 {
   StaticParameterMapType result;
 
   StaticParameterValuesType values;
   values.push_back(m_BaseValue);
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_S0, values));
+  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_s0, values));
 
   return result;
 };
 
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::ParametersType
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::GetDefaultInitialParameterization()
 const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(4);
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_A] = 1.0;
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kep] = 4.0;
   initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_kel] = 0.2;
-  initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_tlag] = 1.0;
+  initialParameters[mitk::DescriptivePharmacokineticBrixModel::POSITION_PARAMETER_BAT] = 1.0;
 
   return initialParameters;
 }
 
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::DescriptivePharmacokineticBrixModelValueBasedParameterizer()
 {
 };
 
 mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::~DescriptivePharmacokineticBrixModelValueBasedParameterizer()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModel.cpp
index 7cfa46a0c3..355683f1cb 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModel.cpp
@@ -1,144 +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.
 
 ============================================================================*/
 
 #include "mitkExtendedOneTissueCompartmentModel.h"
 #include "mitkConvolutionHelper.h"
 #include <vnl/algo/vnl_fft_1d.h>
 #include <fstream>
 
 const std::string mitk::ExtendedOneTissueCompartmentModel::MODEL_DISPLAY_NAME = "Extended One Tissue Compartment Model (with blood volume)";
 
-const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_k1 = "K1";
-const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_k2 = "k2";
-const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_VB = "VB";
+const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_K1 = "K_1";
+const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_k2 = "k_2";
+const std::string mitk::ExtendedOneTissueCompartmentModel::NAME_PARAMETER_vb = "v_b";
 
-const std::string mitk::ExtendedOneTissueCompartmentModel::UNIT_PARAMETER_k1 = "1/min";
+const std::string mitk::ExtendedOneTissueCompartmentModel::UNIT_PARAMETER_K1 = "1/min";
 const std::string mitk::ExtendedOneTissueCompartmentModel::UNIT_PARAMETER_k2 = "1/min";
-const std::string mitk::ExtendedOneTissueCompartmentModel::UNIT_PARAMETER_VB = "ml/ml";
+const std::string mitk::ExtendedOneTissueCompartmentModel::UNIT_PARAMETER_vb = "ml/ml";
 
-const unsigned int mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_k1 = 0;
+const unsigned int mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_K1 = 0;
 const unsigned int mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_k2 = 1;
-const unsigned int mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_VB = 2;
+const unsigned int mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_vb = 2;
 
 const unsigned int mitk::ExtendedOneTissueCompartmentModel::NUMBER_OF_PARAMETERS = 3;
 
+const std::string mitk::ExtendedOneTissueCompartmentModel::MODEL_TYPE = "Dynamic.PET";
+
 std::string mitk::ExtendedOneTissueCompartmentModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::ExtendedOneTissueCompartmentModel::GetModelType() const
 {
-  return "Dynamic.PET";
+  return MODEL_TYPE;
 };
 
 mitk::ExtendedOneTissueCompartmentModel::ExtendedOneTissueCompartmentModel()
 {
 
 }
 
 mitk::ExtendedOneTissueCompartmentModel::~ExtendedOneTissueCompartmentModel()
 {
 
 }
 
 mitk::ExtendedOneTissueCompartmentModel::ParameterNamesType mitk::ExtendedOneTissueCompartmentModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
-  result.push_back(NAME_PARAMETER_k1);
+  result.push_back(NAME_PARAMETER_K1);
   result.push_back(NAME_PARAMETER_k2);
-  result.push_back(NAME_PARAMETER_VB);
+  result.push_back(NAME_PARAMETER_vb);
 
   return result;
 }
 
 mitk::ExtendedOneTissueCompartmentModel::ParametersSizeType  mitk::ExtendedOneTissueCompartmentModel::GetNumberOfParameters()
 const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 mitk::ExtendedOneTissueCompartmentModel::ParamterUnitMapType
 mitk::ExtendedOneTissueCompartmentModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
-  result.insert(std::make_pair(NAME_PARAMETER_k1, UNIT_PARAMETER_k1));
+  result.insert(std::make_pair(NAME_PARAMETER_K1, UNIT_PARAMETER_K1));
   result.insert(std::make_pair(NAME_PARAMETER_k2, UNIT_PARAMETER_k2));
-  result.insert(std::make_pair(NAME_PARAMETER_VB, UNIT_PARAMETER_VB));
+  result.insert(std::make_pair(NAME_PARAMETER_vb, UNIT_PARAMETER_vb));
 
   return result;
 };
 
 mitk::ExtendedOneTissueCompartmentModel::ModelResultType mitk::ExtendedOneTissueCompartmentModel::ComputeModelfunction(
   const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
-  double     K1 = (double) parameters[POSITION_PARAMETER_k1] / 60.0;
+  double     K1 = (double) parameters[POSITION_PARAMETER_K1] / 60.0;
   double     k2 = (double) parameters[POSITION_PARAMETER_k2] / 60.0;
-  double     VB = parameters[POSITION_PARAMETER_VB];
+  double     vb = parameters[POSITION_PARAMETER_vb];
 
 
 
   mitk::ModelBase::ModelResultType convolution = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
       aterialInputFunction, k2);
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
 
   AterialInputFunctionType::const_iterator aifPos = aterialInputFunction.begin();
 
 
   for (mitk::ModelBase::ModelResultType::const_iterator res = convolution.begin(); res != convolution.end(); ++res, ++signalPos, ++aifPos)
   {
-    *signalPos = VB * (*aifPos) + (1 - VB) * K1 * (*res);
+    *signalPos = vb * (*aifPos) + (1 - vb) * K1 * (*res);
   }
 
   return signal;
 
 }
 
 
 
 
 itk::LightObject::Pointer mitk::ExtendedOneTissueCompartmentModel::InternalClone() const
 {
   ExtendedOneTissueCompartmentModel::Pointer newClone = ExtendedOneTissueCompartmentModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
 
 void mitk::ExtendedOneTissueCompartmentModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelFactory.cpp
index d3ec6b0bdb..1fa785b5b1 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelFactory.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelFactory.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkExtendedOneTissueCompartmentModelFactory.h"
 
 #include <mitkImageTimeSelector.h>
 #include <mitkImageCast.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 
 mitk::ConstraintCheckerBase::Pointer
 mitk::ExtendedOneTissueCompartmentModelFactory::CreateDefaultConstraints() const
 {
   SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
 
-  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k1, 0.0);
+  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0.0);
   constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0.0);
-  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_VB, 0.0);
+  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_vb, 0.0);
 
-  constraints->SetUpperBarrier (ModelType::POSITION_PARAMETER_k1, 1.0);
+  constraints->SetUpperBarrier (ModelType::POSITION_PARAMETER_K1, 1.0);
   constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0);
-  constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_VB, 1.0);
+  constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_vb, 1.0);
 
   SimpleBarrierConstraintChecker::ParameterIndexVectorType indices;
-  indices.push_back(ModelType::POSITION_PARAMETER_k1);
+  indices.push_back(ModelType::POSITION_PARAMETER_K1);
   indices.push_back(ModelType::POSITION_PARAMETER_k2);
-  indices.push_back(ModelType::POSITION_PARAMETER_VB);
+  indices.push_back(ModelType::POSITION_PARAMETER_vb);
 
   return constraints.GetPointer();
 };
 
 mitk::ModelParameterizerBase::ParametersType
 mitk::ExtendedOneTissueCompartmentModelFactory::GetDefaultInitialParameterization() const
 {
   return ExtendedOneTissueCompartmentModelParameterizer::New()->GetDefaultInitialParameterization();
 };
 
 mitk::ExtendedOneTissueCompartmentModelFactory::ExtendedOneTissueCompartmentModelFactory()
 {
 };
 
 mitk::ExtendedOneTissueCompartmentModelFactory::~ExtendedOneTissueCompartmentModelFactory()
 {
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp
index 575ebf12d0..9a5cc1948f 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp
@@ -1,34 +1,34 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkExtendedOneTissueCompartmentModelParameterizer.h"
 
 mitk::ExtendedOneTissueCompartmentModelParameterizer::ParametersType
 mitk::ExtendedOneTissueCompartmentModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(3);
-  initialParameters[mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_k1] = 0.5;
+  initialParameters[mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_K1] = 0.5;
   initialParameters[mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_k2] = 0.5;
-  initialParameters[mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_VB] = 0.5;
+  initialParameters[mitk::ExtendedOneTissueCompartmentModel::POSITION_PARAMETER_vb] = 0.5;
 
   return initialParameters;
 };
 
 mitk::ExtendedOneTissueCompartmentModelParameterizer::ExtendedOneTissueCompartmentModelParameterizer()
 {
 };
 
 mitk::ExtendedOneTissueCompartmentModelParameterizer::~ExtendedOneTissueCompartmentModelParameterizer()
 {
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkExtendedToftsModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkExtendedToftsModel.cpp
index dedc6d3917..d178fa721c 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkExtendedToftsModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkExtendedToftsModel.cpp
@@ -1,182 +1,191 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkExtendedToftsModel.h"
 #include "mitkConvolutionHelper.h"
 #include <vnl/algo/vnl_fft_1d.h>
 #include <fstream>
 
 const std::string mitk::ExtendedToftsModel::MODEL_DISPLAY_NAME = "Extended Tofts Model";
 
-const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_Ktrans = "KTrans";
-const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_ve = "ve";
-const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_vp = "vp";
+const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_Ktrans = "K^trans";
+const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_ve = "v_e";
+const std::string mitk::ExtendedToftsModel::NAME_PARAMETER_vp = "v_p";
 
 const std::string mitk::ExtendedToftsModel::UNIT_PARAMETER_Ktrans = "ml/min/100ml";
 const std::string mitk::ExtendedToftsModel::UNIT_PARAMETER_ve = "ml/ml";
 const std::string mitk::ExtendedToftsModel::UNIT_PARAMETER_vp = "ml/ml";
 
 const unsigned int mitk::ExtendedToftsModel::POSITION_PARAMETER_Ktrans = 0;
 const unsigned int mitk::ExtendedToftsModel::POSITION_PARAMETER_ve = 1;
 const unsigned int mitk::ExtendedToftsModel::POSITION_PARAMETER_vp = 2;
 
 const unsigned int mitk::ExtendedToftsModel::NUMBER_OF_PARAMETERS = 3;
 
+const std::string mitk::ExtendedToftsModel::NAME_DERIVED_PARAMETER_kep = "k_{e->p}";
+
+const unsigned int mitk::ExtendedToftsModel::NUMBER_OF_DERIVED_PARAMETERS = 1;
+
+const std::string mitk::ExtendedToftsModel::UNIT_DERIVED_PARAMETER_kep = "1/min";
+
+const std::string mitk::ExtendedToftsModel::MODEL_TYPE = "Perfusion.MR";
+
+
 std::string mitk::ExtendedToftsModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::ExtendedToftsModel::GetModelType() const
 {
-  return "Perfusion.MR";
+  return MODEL_TYPE;
 };
 
 mitk::ExtendedToftsModel::ExtendedToftsModel()
 {
 
 }
 
 mitk::ExtendedToftsModel::~ExtendedToftsModel()
 {
 
 }
 
 mitk::ExtendedToftsModel::ParameterNamesType mitk::ExtendedToftsModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_Ktrans);
   result.push_back(NAME_PARAMETER_ve);
   result.push_back(NAME_PARAMETER_vp);
 
   return result;
 }
 
 mitk::ExtendedToftsModel::ParametersSizeType  mitk::ExtendedToftsModel::GetNumberOfParameters()
 const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 mitk::ExtendedToftsModel::ParamterUnitMapType
 mitk::ExtendedToftsModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_Ktrans, UNIT_PARAMETER_Ktrans));
   result.insert(std::make_pair(NAME_PARAMETER_vp, UNIT_PARAMETER_vp));
   result.insert(std::make_pair(NAME_PARAMETER_ve, UNIT_PARAMETER_ve));
 
   return result;
 };
 
 
 
 mitk::ExtendedToftsModel::ParameterNamesType
 mitk::ExtendedToftsModel::GetDerivedParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("kep");
+  result.push_back(NAME_DERIVED_PARAMETER_kep);
   return result;
 };
 
 mitk::ExtendedToftsModel::ParametersSizeType
 mitk::ExtendedToftsModel::GetNumberOfDerivedParameters() const
 {
-  return 1;
+  return NUMBER_OF_DERIVED_PARAMETERS;
 };
 
 mitk::ExtendedToftsModel::ParamterUnitMapType mitk::ExtendedToftsModel::GetDerivedParameterUnits() const
 {
   ParamterUnitMapType result;
 
-  result.insert(std::make_pair("kep", "1/min"));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_kep, UNIT_DERIVED_PARAMETER_kep));
 
   return result;
 };
 
 mitk::ExtendedToftsModel::ModelResultType mitk::ExtendedToftsModel::ComputeModelfunction(
   const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
   double ktrans = parameters[POSITION_PARAMETER_Ktrans] / 6000.0;
   double     ve = parameters[POSITION_PARAMETER_ve];
   double     vp = parameters[POSITION_PARAMETER_vp];
 
 
   if (ve == 0.0)
   {
     itkExceptionMacro("ve is 0! Cannot calculate signal");
   }
 
   double lambda =  ktrans / ve;
 
   mitk::ModelBase::ModelResultType convolution = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
       aterialInputFunction, lambda);
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
   mitk::ModelBase::ModelResultType::const_iterator res = convolution.begin();
 
 
   for (AterialInputFunctionType::iterator Cp = aterialInputFunction.begin();
        Cp != aterialInputFunction.end(); ++res, ++signalPos, ++Cp)
   {
     *signalPos = (*Cp) * vp + ktrans * (*res);
   }
 
   return signal;
 
 }
 
 
 mitk::ModelBase::DerivedParameterMapType mitk::ExtendedToftsModel::ComputeDerivedParameters(
   const mitk::ModelBase::ParametersType& parameters) const
 {
   DerivedParameterMapType result;
   double kep = parameters[POSITION_PARAMETER_Ktrans] / parameters[POSITION_PARAMETER_ve];
-  result.insert(std::make_pair("kep", kep));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_kep, kep));
   return result;
 };
 
 itk::LightObject::Pointer mitk::ExtendedToftsModel::InternalClone() const
 {
   ExtendedToftsModel::Pointer newClone = ExtendedToftsModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
 
 void mitk::ExtendedToftsModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModel.cpp
deleted file mode 100644
index 2d95cd5e57..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModel.cpp
+++ /dev/null
@@ -1,286 +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 "mitkNumericTwoCompartmentExchangeModel.h"
-#include "mitkAIFParametrizerHelper.h"
-#include "mitkTimeGridHelper.h"
-#include "mitkTwoCompartmentExchangeModelDifferentialEquations.h"
-#include <vnl/algo/vnl_fft_1d.h>
-#include <boost/numeric/odeint.hpp>
-#include <fstream>
-
-const std::string mitk::NumericTwoCompartmentExchangeModel::MODEL_DISPLAY_NAME =
-  "Numeric Two Compartment Exchange Model";
-
-const std::string mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_F = "F";
-const std::string mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_PS = "PS";
-const std::string mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_ve = "ve";
-const std::string mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_vp = "vp";
-
-const std::string mitk::NumericTwoCompartmentExchangeModel::UNIT_PARAMETER_F = "ml/min/100ml";
-const std::string mitk::NumericTwoCompartmentExchangeModel::UNIT_PARAMETER_PS = "ml/min/100ml";
-const std::string mitk::NumericTwoCompartmentExchangeModel::UNIT_PARAMETER_ve = "ml/ml";
-const std::string mitk::NumericTwoCompartmentExchangeModel::UNIT_PARAMETER_vp = "ml/ml";
-
-const unsigned int mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_F = 0;
-const unsigned int mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_PS = 1;
-const unsigned int mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_ve = 2;
-const unsigned int mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_vp = 3;
-
-const unsigned int mitk::NumericTwoCompartmentExchangeModel::NUMBER_OF_PARAMETERS = 4;
-
-const std::string mitk::NumericTwoCompartmentExchangeModel::NAME_STATIC_PARAMETER_ODEINTStepSize = "ODEIntStepSize";
-
-
-std::string mitk::NumericTwoCompartmentExchangeModel::GetModelDisplayName() const
-{
-  return MODEL_DISPLAY_NAME;
-};
-
-std::string mitk::NumericTwoCompartmentExchangeModel::GetModelType() const
-{
-  return "Perfusion.MR";
-};
-
-
-mitk::NumericTwoCompartmentExchangeModel::NumericTwoCompartmentExchangeModel()
-{
-
-}
-
-mitk::NumericTwoCompartmentExchangeModel::~NumericTwoCompartmentExchangeModel()
-{
-
-}
-
-mitk::NumericTwoCompartmentExchangeModel::ParameterNamesType mitk::NumericTwoCompartmentExchangeModel::GetStaticParameterNames() const
-{
-  ParameterNamesType result;
-
-  result.push_back(NAME_STATIC_PARAMETER_AIF);
-  result.push_back(NAME_STATIC_PARAMETER_AIFTimeGrid);
-  result.push_back(NAME_STATIC_PARAMETER_ODEINTStepSize);
-
-  return result;
-}
-
-mitk::NumericTwoCompartmentExchangeModel::ParametersSizeType  mitk::NumericTwoCompartmentExchangeModel::GetNumberOfStaticParameters()
-const
-{
-  return 3;
-}
-
-
-void mitk::NumericTwoCompartmentExchangeModel::SetStaticParameter(const ParameterNameType& name,
-    const StaticParameterValuesType& values)
-{
-  if (name == NAME_STATIC_PARAMETER_AIF)
-  {
-    AterialInputFunctionType aif = mitk::convertParameterToArray(values);
-
-    SetAterialInputFunctionValues(aif);
-  }
-
-  if (name == NAME_STATIC_PARAMETER_AIFTimeGrid)
-  {
-    TimeGridType timegrid = mitk::convertParameterToArray(values);
-
-    SetAterialInputFunctionTimeGrid(timegrid);
-  }
-
-  if (name == NAME_STATIC_PARAMETER_ODEINTStepSize)
-  {
-      SetODEINTStepSize(values[0]);
-  }
-};
-
-mitk::NumericTwoCompartmentExchangeModel::StaticParameterValuesType mitk::NumericTwoCompartmentExchangeModel::GetStaticParameterValue(
-  const ParameterNameType& name) const
-{
-  StaticParameterValuesType result;
-
-  if (name == NAME_STATIC_PARAMETER_AIF)
-  {
-    result = mitk::convertArrayToParameter(this->m_AterialInputFunctionValues);
-  }
-
-  if (name == NAME_STATIC_PARAMETER_AIFTimeGrid)
-  {
-    result = mitk::convertArrayToParameter(this->m_AterialInputFunctionTimeGrid);
-  }
-  if (name == NAME_STATIC_PARAMETER_ODEINTStepSize)
-  {
-    result.push_back(GetODEINTStepSize());
-  }
-
-  return result;
-};
-
-
-mitk::NumericTwoCompartmentExchangeModel::ParameterNamesType
-mitk::NumericTwoCompartmentExchangeModel::GetParameterNames() const
-{
-  ParameterNamesType result;
-
-  result.push_back(NAME_PARAMETER_F);
-  result.push_back(NAME_PARAMETER_PS);
-  result.push_back(NAME_PARAMETER_ve);
-  result.push_back(NAME_PARAMETER_vp);
-
-  return result;
-}
-
-mitk::NumericTwoCompartmentExchangeModel::ParametersSizeType
-mitk::NumericTwoCompartmentExchangeModel::GetNumberOfParameters() const
-{
-  return NUMBER_OF_PARAMETERS;
-}
-
-
-mitk::NumericTwoCompartmentExchangeModel::ParamterUnitMapType
-mitk::NumericTwoCompartmentExchangeModel::GetParameterUnits() const
-{
-  ParamterUnitMapType result;
-
-  result.insert(std::make_pair(NAME_PARAMETER_F, UNIT_PARAMETER_F));
-  result.insert(std::make_pair(NAME_PARAMETER_PS, UNIT_PARAMETER_PS));
-  result.insert(std::make_pair(NAME_PARAMETER_vp, UNIT_PARAMETER_vp));
-  result.insert(std::make_pair(NAME_PARAMETER_ve, UNIT_PARAMETER_ve));
-
-  return result;
-};
-
-mitk::NumericTwoCompartmentExchangeModel::ModelResultType
-mitk::NumericTwoCompartmentExchangeModel::ComputeModelfunction(const ParametersType& parameters)
-const
-{
-  typedef itk::Array<double> ConcentrationCurveType;
-  typedef std::vector<double> ConcentrationVectorType;
-
-  if (this->m_TimeGrid.GetSize() == 0)
-  {
-    itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
-  }
-
-  AterialInputFunctionType aterialInputFunction;
-  aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
-
-  unsigned int timeSteps = this->m_TimeGrid.GetSize();
-
-  /** @brief Boost::numeric::odeint works with type std::vector<double> thus, aif and grid are converted to ModelParameters( of type std::vector)
-   */
-  mitk::TwoCompartmentExchangeModelDifferentialEquations::AIFType aif = mitk::convertArrayToParameter(
-        aterialInputFunction);
-  mitk::TwoCompartmentExchangeModelDifferentialEquations::AIFType grid =
-    mitk::convertArrayToParameter(m_TimeGrid);
-
-  mitk::TwoCompartmentExchangeModelDifferentialEquations::AIFType aifODE = aif;
-  aifODE.push_back(aif[timeSteps - 1]);
-  mitk::TwoCompartmentExchangeModelDifferentialEquations::AIFType gridODE = grid;
-  gridODE.push_back(grid[timeSteps - 1] + (grid[timeSteps - 1] - grid[timeSteps - 2]));
-
-
-
-  //Model Parameters
-  double F = (double) parameters[POSITION_PARAMETER_F] / 6000.0;
-  double PS  = (double) parameters[POSITION_PARAMETER_PS] / 6000.0;
-  double ve = (double) parameters[POSITION_PARAMETER_ve];
-  double vp = (double) parameters[POSITION_PARAMETER_vp];
-
-
-  /** @brief Initialize class TwoCompartmentExchangeModelDifferentialEquations defining the differential equations. AIF and Grid must be set so that at step t the aterial Concentration Ca(t) can be interpolated from AIF*/
-  mitk::TwoCompartmentExchangeModelDifferentialEquations ode;
-  ode.initialize(F, PS, ve, vp);
-  ode.setAIF(aifODE);
-  ode.setAIFTimeGrid(gridODE);
-
-  state_type x(2);
-  x[0] = 0.0;
-  x[1] = 0.0;
-  typedef boost::numeric::odeint::runge_kutta_cash_karp54<state_type> error_stepper_type;
-  //typedef boost::numeric::odeint::runge_kutta4< state_type > stepper_type;
-
-  /** @brief Results of odeeint x[0] and x[1]*/
-  ConcentrationVectorType Cp;
-  ConcentrationVectorType Ce;
-  ConcentrationVectorType odeTimeGrid;
-
-  error_stepper_type stepper;
-
-
-  /** @brief Stepsize. Should be adapted by stepper (runge_kutta_cash_karp54) */
-//  const double dt = 0.05;
-   const double dt = this->m_ODEINTStepSize;
-
-
-  /** @brief perform Step t -> t+dt to calculate approximate value x(t+dt)*/
-  for (double t = 0.0; t < this->m_TimeGrid(this->m_TimeGrid.GetSize() - 1) - 2*dt; t += dt)
-  {
-    stepper.do_step(ode, x, t, dt);
-    Cp.push_back(x[0]);
-    Ce.push_back(x[1]);
-    odeTimeGrid.push_back(t);
-  }
-
-  /** @brief transfom result of Differential equations back to itk::Array and interpolate to m_TimeGrid (they are calculated on a different grid defined by stepsize of odeint)*/
-  ConcentrationCurveType plasmaConcentration = mitk::convertParameterToArray(Cp);
-  ConcentrationCurveType EESConcentration = mitk::convertParameterToArray(Ce);
-  ConcentrationCurveType rungeKuttaTimeGrid = mitk::convertParameterToArray(odeTimeGrid);
-
-  mitk::ModelBase::ModelResultType C_Plasma = mitk::InterpolateSignalToNewTimeGrid(plasmaConcentration, rungeKuttaTimeGrid, m_TimeGrid);
-  mitk::ModelBase::ModelResultType C_EES = mitk::InterpolateSignalToNewTimeGrid(EESConcentration, rungeKuttaTimeGrid, m_TimeGrid);
-
-
-  //Signal that will be returned by ComputeModelFunction
-  mitk::ModelBase::ModelResultType signal(timeSteps);
-  signal.fill(0.0);
-
-  mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
-  mitk::ModelBase::ModelResultType::const_iterator CePos = C_EES.begin();
-
-  mitk::ModelBase::ModelResultType::const_iterator t = this->m_TimeGrid.begin();
-  mitk::ModelBase::ModelResultType::const_iterator Cin = aterialInputFunction.begin();
-
-
-
-  for (mitk::ModelBase::ModelResultType::const_iterator CpPos = C_Plasma.begin();
-       CpPos != C_Plasma.end(); ++CpPos, ++CePos, ++signalPos, ++t, ++Cin)
-  {
-    *signalPos = vp * (*CpPos) + ve * (*CePos);
-
-  }
-
-  return signal;
-
-}
-
-
-
-
-itk::LightObject::Pointer mitk::NumericTwoCompartmentExchangeModel::InternalClone() const
-{
-  NumericTwoCompartmentExchangeModel::Pointer newClone = NumericTwoCompartmentExchangeModel::New();
-
-  newClone->SetTimeGrid(this->m_TimeGrid);
-
-  return newClone.GetPointer();
-}
-
-void mitk::NumericTwoCompartmentExchangeModel::PrintSelf(std::ostream& os,
-    ::itk::Indent indent) const
-{
-  Superclass::PrintSelf(os, indent);
-
-
-}
-
-
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelFactory.cpp
deleted file mode 100644
index ef04fa136a..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelFactory.cpp
+++ /dev/null
@@ -1,54 +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 "mitkNumericTwoCompartmentExchangeModelFactory.h"
-
-
-#include "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
-#include "mitkAIFParametrizerHelper.h"
-
-mitk::NumericTwoCompartmentExchangeModelFactory::NumericTwoCompartmentExchangeModelFactory()
-{
-};
-
-mitk::NumericTwoCompartmentExchangeModelFactory::~NumericTwoCompartmentExchangeModelFactory()
-{
-};
-
-mitk::ModelParameterizerBase::Pointer
-mitk::NumericTwoCompartmentExchangeModelFactory::DoCreateParameterizer(
-  const modelFit::ModelFitInfo* fit)
-const
-{
-  mitk::ModelParameterizerBase::Pointer result;
-
-  ModelParameterizerType::Pointer modelParameterizer =
-    ModelParameterizerType::New();
-
-  modelFit::StaticParameterMap::ValueType aif = fit->staticParamMap.Get(
-        ModelType::NAME_STATIC_PARAMETER_AIF);
-
-  modelParameterizer->SetAIF(mitk::convertParameterToArray(aif));
-
-  modelFit::StaticParameterMap::ValueType aifGrid = fit->staticParamMap.Get(
-        ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid);
-  modelParameterizer->SetAIFTimeGrid(mitk::convertParameterToArray(aifGrid));
-
-  modelFit::StaticParameterMap::ValueType odeStepSize = fit->staticParamMap.Get(
-        ModelType::NAME_STATIC_PARAMETER_ODEINTStepSize);
-  modelParameterizer->SetODEINTStepSize(odeStepSize[0]);
-
-
-  result = modelParameterizer.GetPointer();
-
-  return result;
-};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelParameterizer.cpp
deleted file mode 100644
index 25910af578..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoCompartmentExchangeModelParameterizer.cpp
+++ /dev/null
@@ -1,49 +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 "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
-
-mitk::NumericTwoCompartmentExchangeModelParameterizer::ParametersType
-mitk::NumericTwoCompartmentExchangeModelParameterizer::GetDefaultInitialParameterization() const
-{
-  ParametersType initialParameters;
-  initialParameters.SetSize(4);
-  initialParameters[mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_PS] = 5.0;
-  initialParameters[mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_F] = 20.0;
-  initialParameters[mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_ve] = 0.1;
-  initialParameters[mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_vp] = 0.04;
-
-  return initialParameters;
-};
-
-mitk::NumericTwoCompartmentExchangeModelParameterizer::NumericTwoCompartmentExchangeModelParameterizer()
-{
-};
-
-mitk::NumericTwoCompartmentExchangeModelParameterizer::~NumericTwoCompartmentExchangeModelParameterizer()
-{
-};
-
-mitk::NumericTwoCompartmentExchangeModelParameterizer::StaticParameterMapType mitk::NumericTwoCompartmentExchangeModelParameterizer::GetGlobalStaticParameters() const
-{
-  StaticParameterMapType result;
-  StaticParameterValuesType valuesAIF = mitk::convertArrayToParameter(this->m_AIF);
-  StaticParameterValuesType valuesAIFGrid = mitk::convertArrayToParameter(this->m_AIFTimeGrid);
-  StaticParameterValuesType values;
-  values.push_back(m_ODEINTStepSize);
-
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIF, valuesAIF));
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid, valuesAIFGrid));
-  result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_ODEINTStepSize, values));
-
-  return result;
-};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModel.cpp
deleted file mode 100644
index bb7226a2d9..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModel.cpp
+++ /dev/null
@@ -1,216 +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 "mitkNumericTwoTissueCompartmentModel.h"
-#include "mitkAIFParametrizerHelper.h"
-#include "mitkTimeGridHelper.h"
-#include "mitkTwoTissueCompartmentModelDifferentialEquations.h"
-#include <vnl/algo/vnl_fft_1d.h>
-#include <boost/numeric/odeint.hpp>
-#include <fstream>
-
-const std::string mitk::NumericTwoTissueCompartmentModel::MODEL_DISPLAY_NAME =
-  "Numeric Two Tissue Compartment Model";
-
-const std::string mitk::NumericTwoTissueCompartmentModel::NAME_PARAMETER_K1 = "K1";
-const std::string mitk::NumericTwoTissueCompartmentModel::NAME_PARAMETER_k2 = "k2";
-const std::string mitk::NumericTwoTissueCompartmentModel::NAME_PARAMETER_k3 = "k3";
-const std::string mitk::NumericTwoTissueCompartmentModel::NAME_PARAMETER_k4 = "k4";
-const std::string mitk::NumericTwoTissueCompartmentModel::NAME_PARAMETER_VB = "V_B";
-
-const std::string mitk::NumericTwoTissueCompartmentModel::UNIT_PARAMETER_K1 = "1/min";
-const std::string mitk::NumericTwoTissueCompartmentModel::UNIT_PARAMETER_k2 = "1/min";
-const std::string mitk::NumericTwoTissueCompartmentModel::UNIT_PARAMETER_k3 = "1/min";
-const std::string mitk::NumericTwoTissueCompartmentModel::UNIT_PARAMETER_k4 = "1/min";
-const std::string mitk::NumericTwoTissueCompartmentModel::UNIT_PARAMETER_VB = "ml/ml";
-
-const unsigned int mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_K1 = 0;
-const unsigned int mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k2 = 1;
-const unsigned int mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k3 = 2;
-const unsigned int mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k4 = 3;
-const unsigned int mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_VB = 4;
-
-const unsigned int mitk::NumericTwoTissueCompartmentModel::NUMBER_OF_PARAMETERS = 5;
-
-
-std::string mitk::NumericTwoTissueCompartmentModel::GetModelDisplayName() const
-{
-  return MODEL_DISPLAY_NAME;
-};
-
-std::string mitk::NumericTwoTissueCompartmentModel::GetModelType() const
-{
-  return "Dynamic.PET";
-};
-
-mitk::NumericTwoTissueCompartmentModel::NumericTwoTissueCompartmentModel()
-{
-
-}
-
-mitk::NumericTwoTissueCompartmentModel::~NumericTwoTissueCompartmentModel()
-{
-
-}
-
-mitk::NumericTwoTissueCompartmentModel::ParameterNamesType
-mitk::NumericTwoTissueCompartmentModel::GetParameterNames() const
-{
-  ParameterNamesType result;
-
-  result.push_back(NAME_PARAMETER_K1);
-  result.push_back(NAME_PARAMETER_k2);
-  result.push_back(NAME_PARAMETER_k3);
-  result.push_back(NAME_PARAMETER_k4);
-  result.push_back(NAME_PARAMETER_VB);
-
-  return result;
-}
-
-mitk::NumericTwoTissueCompartmentModel::ParametersSizeType
-mitk::NumericTwoTissueCompartmentModel::GetNumberOfParameters() const
-{
-  return NUMBER_OF_PARAMETERS;
-}
-
-mitk::NumericTwoTissueCompartmentModel::ParamterUnitMapType
-mitk::NumericTwoTissueCompartmentModel::GetParameterUnits() const
-{
-  ParamterUnitMapType result;
-
-  result.insert(std::make_pair(NAME_PARAMETER_K1, UNIT_PARAMETER_K1));
-  result.insert(std::make_pair(NAME_PARAMETER_k2, UNIT_PARAMETER_k2));
-  result.insert(std::make_pair(NAME_PARAMETER_k3, UNIT_PARAMETER_k3));
-  result.insert(std::make_pair(NAME_PARAMETER_k4, UNIT_PARAMETER_k4));
-  result.insert(std::make_pair(NAME_PARAMETER_VB, UNIT_PARAMETER_VB));
-
-  return result;
-};
-
-
-mitk::NumericTwoTissueCompartmentModel::ModelResultType
-mitk::NumericTwoTissueCompartmentModel::ComputeModelfunction(const ParametersType& parameters) const
-{
-  typedef itk::Array<double> ConcentrationCurveType;
-  typedef std::vector<double> ConcentrationVectorType;
-
-  if (this->m_TimeGrid.GetSize() == 0)
-  {
-    itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
-  }
-
-  AterialInputFunctionType aterialInputFunction;
-  aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
-
-  unsigned int timeSteps = this->m_TimeGrid.GetSize();
-
-  /** @brief Boost::numeric::odeint works with type std::vector<double> thus, aif and grid are converted to ModelParameters( of type std::vector)
-   */
-  mitk::TwoTissueCompartmentModelDifferentialEquations::AIFType aif = mitk::convertArrayToParameter(
-        aterialInputFunction);
-  mitk::TwoTissueCompartmentModelDifferentialEquations::AIFType grid = mitk::convertArrayToParameter(
-        m_TimeGrid);
-
-  mitk::TwoTissueCompartmentModelDifferentialEquations::AIFType aifODE = aif;
-  aifODE.push_back(aif[timeSteps - 1]);
-  mitk::TwoTissueCompartmentModelDifferentialEquations::AIFType gridODE = grid;
-  gridODE.push_back(grid[timeSteps - 1] + (grid[timeSteps - 1] - grid[timeSteps - 2]));
-
-  //Model Parameters
-  double K1 = (double)parameters[POSITION_PARAMETER_K1] / 60.0;
-  double k2 = (double)parameters[POSITION_PARAMETER_k2] / 60.0;
-  double k3 = (double)parameters[POSITION_PARAMETER_k3] / 60.0;
-  double k4 = (double)parameters[POSITION_PARAMETER_k4] / 60.0;
-  double VB = parameters[POSITION_PARAMETER_VB];
-
-
-  /** @brief Initialize class TwpTissueCompartmentModelDifferentialEquations defining the differential equations. AIF and Grid must be set so that at step t the aterial Concentration Ca(t) can be interpolated from AIF*/
-  mitk::TwoTissueCompartmentModelDifferentialEquations ode;
-  ode.initialize(K1, k2, k3, k4);
-  ode.setAIF(aifODE);
-  ode.setAIFTimeGrid(gridODE);
-
-  state_type x(2);
-  x[0] = 0.0;
-  x[1] = 0.0;
-  typedef boost::numeric::odeint::runge_kutta_cash_karp54<state_type> error_stepper_type;
-  //typedef boost::numeric::odeint::runge_kutta4< state_type > stepper_type;
-
-  /** @brief Results of odeeint x[0] and x[1]*/
-  ConcentrationVectorType C1;
-  ConcentrationVectorType C2;
-  ConcentrationVectorType odeTimeGrid;
-
-  error_stepper_type stepper;
-  /** @brief Stepsize. Should be adapted by stepper (runge_kutta_cash_karp54) */
-  const double dt = 0.1;
-  /** @brief perform Step t -> t+dt to calculate approximate value x(t+dt)*/
-
-  double T = this->m_TimeGrid(timeSteps - 1) + (grid[timeSteps - 1] - grid[timeSteps - 2]);
-
-  for (double t = 0.0; t < T; t += dt)
-  {
-    stepper.do_step(ode, x, t, dt);
-    C1.push_back(x[0]);
-    C2.push_back(x[1]);
-    odeTimeGrid.push_back(t);
-
-  }
-
-  /** @brief transfom result of Differential equations back to itk::Array and interpolate to m_TimeGrid (they are calculated on a different grid defined by stepsize of odeint)*/
-  ConcentrationCurveType ConcentrationCompartment1 = mitk::convertParameterToArray(C1);
-  ConcentrationCurveType ConcentrationCompartment2 = mitk::convertParameterToArray(C2);
-  ConcentrationCurveType rungeKuttaTimeGrid = mitk::convertParameterToArray(odeTimeGrid);
-
-  mitk::ModelBase::ModelResultType C_1 = mitk::InterpolateSignalToNewTimeGrid(
-      ConcentrationCompartment1, rungeKuttaTimeGrid, m_TimeGrid);
-  mitk::ModelBase::ModelResultType C_2 = mitk::InterpolateSignalToNewTimeGrid(
-      ConcentrationCompartment2, rungeKuttaTimeGrid, m_TimeGrid);
-
-
-  //Signal that will be returned by ComputeModelFunction
-  mitk::ModelBase::ModelResultType signal(timeSteps);
-  signal.fill(0.0);
-  mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
-  mitk::ModelBase::ModelResultType::const_iterator C1Pos = C_1.begin();
-  mitk::ModelBase::ModelResultType::const_iterator C2Pos = C_2.begin();
-
-
-  for (AterialInputFunctionType::const_iterator aifpos = aterialInputFunction.begin();
-       aifpos != aterialInputFunction.end(); ++aifpos, ++C1Pos, ++C2Pos, ++signalPos)
-  {
-    *signalPos = VB * (*aifpos) + (1 - VB) * (*C1Pos + *C2Pos);
-  }
-
-  return signal;
-
-}
-
-itk::LightObject::Pointer mitk::NumericTwoTissueCompartmentModel::InternalClone() const
-{
-  NumericTwoTissueCompartmentModel::Pointer newClone = NumericTwoTissueCompartmentModel::New();
-
-  newClone->SetTimeGrid(this->m_TimeGrid);
-
-  return newClone.GetPointer();
-}
-
-void mitk::NumericTwoTissueCompartmentModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
-{
-  Superclass::PrintSelf(os, indent);
-
-
-}
-
-
-
-
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelFactory.cpp
deleted file mode 100644
index d00b9d3370..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelFactory.cpp
+++ /dev/null
@@ -1,25 +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 "mitkNumericTwoTissueCompartmentModelFactory.h"
-
-#include "mitkNumericTwoTissueCompartmentModelParameterizer.h"
-#include "mitkAIFParametrizerHelper.h"
-
-mitk::NumericTwoTissueCompartmentModelFactory::NumericTwoTissueCompartmentModelFactory()
-{
-};
-
-mitk::NumericTwoTissueCompartmentModelFactory::~NumericTwoTissueCompartmentModelFactory()
-{
-};
-
diff --git a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelParameterizer.cpp
deleted file mode 100644
index 32bc61366e..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkNumericTwoTissueCompartmentModelParameterizer.cpp
+++ /dev/null
@@ -1,35 +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 "mitkNumericTwoTissueCompartmentModelParameterizer.h"
-
-mitk::NumericTwoTissueCompartmentModelParameterizer::ParametersType
-mitk::NumericTwoTissueCompartmentModelParameterizer::GetDefaultInitialParameterization() const
-{
-  ParametersType initialParameters;
-  initialParameters.SetSize(5);
-  initialParameters[mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_K1] = 0.23;
-  initialParameters[mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k2] = 0.4;
-  initialParameters[mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k3] = 0.13;
-  initialParameters[mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_k4] = 0.15;
-  initialParameters[mitk::NumericTwoTissueCompartmentModel::POSITION_PARAMETER_VB] = 0.03;
-
-  return initialParameters;
-};
-
-mitk::NumericTwoTissueCompartmentModelParameterizer::NumericTwoTissueCompartmentModelParameterizer()
-{
-};
-
-mitk::NumericTwoTissueCompartmentModelParameterizer::~NumericTwoTissueCompartmentModelParameterizer()
-{
-};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModel.cpp
index a4d455583e..49deb33fac 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModel.cpp
@@ -1,138 +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.
 
 ============================================================================*/
 
 #include "mitkOneTissueCompartmentModel.h"
 #include "mitkConvolutionHelper.h"
 #include <vnl/algo/vnl_fft_1d.h>
 #include <fstream>
 
 const std::string mitk::OneTissueCompartmentModel::MODEL_DISPLAY_NAME = "One Tissue Compartment Model";
 
-const std::string mitk::OneTissueCompartmentModel::NAME_PARAMETER_k1 = "K1";
-const std::string mitk::OneTissueCompartmentModel::NAME_PARAMETER_k2 = "k2";
+const std::string mitk::OneTissueCompartmentModel::NAME_PARAMETER_K1 = "K_1";
+const std::string mitk::OneTissueCompartmentModel::NAME_PARAMETER_k2 = "k_2";
 
-const std::string mitk::OneTissueCompartmentModel::UNIT_PARAMETER_k1 = "1/min";
+const std::string mitk::OneTissueCompartmentModel::UNIT_PARAMETER_K1 = "1/min";
 const std::string mitk::OneTissueCompartmentModel::UNIT_PARAMETER_k2 = "1/min";
 
-const unsigned int mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k1 = 0;
+const unsigned int mitk::OneTissueCompartmentModel::POSITION_PARAMETER_K1 = 0;
 const unsigned int mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k2 = 1;
 
 const unsigned int mitk::OneTissueCompartmentModel::NUMBER_OF_PARAMETERS = 2;
 
+const std::string mitk::OneTissueCompartmentModel::MODEL_TYPE = "Dynamic.PET";
+
 std::string mitk::OneTissueCompartmentModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::OneTissueCompartmentModel::GetModelType() const
 {
-  return "Dynamic.PET";
+  return MODEL_TYPE;
 };
 
 mitk::OneTissueCompartmentModel::OneTissueCompartmentModel()
 {
 
 }
 
 mitk::OneTissueCompartmentModel::~OneTissueCompartmentModel()
 {
 
 }
 
 mitk::OneTissueCompartmentModel::ParameterNamesType mitk::OneTissueCompartmentModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
-  result.push_back(NAME_PARAMETER_k1);
+  result.push_back(NAME_PARAMETER_K1);
   result.push_back(NAME_PARAMETER_k2);
 
   return result;
 }
 
 mitk::OneTissueCompartmentModel::ParametersSizeType  mitk::OneTissueCompartmentModel::GetNumberOfParameters()
 const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 
 mitk::OneTissueCompartmentModel::ParamterUnitMapType
 mitk::OneTissueCompartmentModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
-  result.insert(std::make_pair(NAME_PARAMETER_k1, UNIT_PARAMETER_k1));
+  result.insert(std::make_pair(NAME_PARAMETER_K1, UNIT_PARAMETER_K1));
   result.insert(std::make_pair(NAME_PARAMETER_k2, UNIT_PARAMETER_k2));
 
   return result;
 };
 
+
 mitk::OneTissueCompartmentModel::ModelResultType mitk::OneTissueCompartmentModel::ComputeModelfunction(
   const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
-  double     K1 = (double) parameters[POSITION_PARAMETER_k1] / 60.0;
+  double     K1 = (double) parameters[POSITION_PARAMETER_K1] / 60.0;
   double     k2 = (double) parameters[POSITION_PARAMETER_k2] / 60.0;
 
 
 
   mitk::ModelBase::ModelResultType convolution = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
       aterialInputFunction, k2);
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
 
 
 
   for (mitk::ModelBase::ModelResultType::const_iterator res = convolution.begin(); res != convolution.end(); ++res, ++signalPos)
   {
     *signalPos = K1 * (*res);
   }
 
   return signal;
 
 }
 
 
 
 
 itk::LightObject::Pointer mitk::OneTissueCompartmentModel::InternalClone() const
 {
   OneTissueCompartmentModel::Pointer newClone = OneTissueCompartmentModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
 
 void mitk::OneTissueCompartmentModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelFactory.cpp
index b9c28d3295..5a2b2c9d1e 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelFactory.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelFactory.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkOneTissueCompartmentModelFactory.h"
 
 #include <mitkImageTimeSelector.h>
 #include <mitkImageCast.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 
 mitk::ConstraintCheckerBase::Pointer
 mitk::OneTissueCompartmentModelFactory::CreateDefaultConstraints() const
 {
   SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
 
-  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k1, 0.0);
+  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0.0);
   constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0.0);
 
-  constraints->SetUpperBarrier (ModelType::POSITION_PARAMETER_k1, 1.0);
+  constraints->SetUpperBarrier (ModelType::POSITION_PARAMETER_K1, 1.0);
   constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0);
 
 
   return constraints.GetPointer();
 };
 
 mitk::ModelParameterizerBase::ParametersType
 mitk::OneTissueCompartmentModelFactory::GetDefaultInitialParameterization() const
 {
   return OneTissueCompartmentModelParameterizer::New()->GetDefaultInitialParameterization();
 };
 
 mitk::OneTissueCompartmentModelFactory::OneTissueCompartmentModelFactory()
 {
 };
 
 mitk::OneTissueCompartmentModelFactory::~OneTissueCompartmentModelFactory()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelParameterizer.cpp
index 017db227a0..1dc058f326 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkOneTissueCompartmentModelParameterizer.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkOneTissueCompartmentModelParameterizer.h"
 
 mitk::OneTissueCompartmentModelParameterizer::ParametersType
 mitk::OneTissueCompartmentModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(2);
-  initialParameters[mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k1] = 0.5;
+  initialParameters[mitk::OneTissueCompartmentModel::POSITION_PARAMETER_K1] = 0.5;
   initialParameters[mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k2] = 0.5;
 
   return initialParameters;
 };
 
 mitk::OneTissueCompartmentModelParameterizer::OneTissueCompartmentModelParameterizer()
 {
 };
 
 mitk::OneTissueCompartmentModelParameterizer::~OneTissueCompartmentModelParameterizer()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkStandardToftsModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkStandardToftsModel.cpp
index 99600b4559..2dcc396a01 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkStandardToftsModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkStandardToftsModel.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 "mitkStandardToftsModel.h"
 #include "mitkConvolutionHelper.h"
 #include <vnl/algo/vnl_fft_1d.h>
 #include <fstream>
 
 const std::string mitk::StandardToftsModel::MODEL_DISPLAY_NAME = "Standard Tofts Model";
 
-const std::string mitk::StandardToftsModel::NAME_PARAMETER_Ktrans = "KTrans";
-const std::string mitk::StandardToftsModel::NAME_PARAMETER_ve = "ve";
+const std::string mitk::StandardToftsModel::NAME_PARAMETER_Ktrans = "K^trans";
+const std::string mitk::StandardToftsModel::NAME_PARAMETER_ve = "v_e";
 
 const std::string mitk::StandardToftsModel::UNIT_PARAMETER_Ktrans = "ml/min/100ml";
 const std::string mitk::StandardToftsModel::UNIT_PARAMETER_ve = "ml/ml";
 
 const unsigned int mitk::StandardToftsModel::POSITION_PARAMETER_Ktrans = 0;
 const unsigned int mitk::StandardToftsModel::POSITION_PARAMETER_ve = 1;
 
 const unsigned int mitk::StandardToftsModel::NUMBER_OF_PARAMETERS = 2;
 
+const std::string mitk::StandardToftsModel::NAME_DERIVED_PARAMETER_kep = "k_{e->p}";
+
+const unsigned int mitk::StandardToftsModel::NUMBER_OF_DERIVED_PARAMETERS = 1;
+
+const std::string mitk::StandardToftsModel::UNIT_DERIVED_PARAMETER_kep = "1/min";
+
+const std::string mitk::StandardToftsModel::MODEL_TYPE = "Perfusion.MR";
+
+
+
 std::string mitk::StandardToftsModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::StandardToftsModel::GetModelType() const
 {
-  return "Perfusion.MR";
+  return MODEL_TYPE;
 };
 
 mitk::StandardToftsModel::StandardToftsModel()
 {
 
 }
 
 mitk::StandardToftsModel::~StandardToftsModel()
 {
 
 }
 
 mitk::StandardToftsModel::ParameterNamesType mitk::StandardToftsModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_Ktrans);
   result.push_back(NAME_PARAMETER_ve);
 
   return result;
 }
 
 mitk::StandardToftsModel::ParametersSizeType  mitk::StandardToftsModel::GetNumberOfParameters()
 const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 mitk::StandardToftsModel::ParamterUnitMapType mitk::StandardToftsModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_Ktrans, UNIT_PARAMETER_Ktrans));
   result.insert(std::make_pair(NAME_PARAMETER_ve, UNIT_PARAMETER_ve));
 
   return result;
 };
 
 mitk::StandardToftsModel::ParameterNamesType
 mitk::StandardToftsModel::GetDerivedParameterNames() const
 {
   ParameterNamesType result;
-  result.push_back("kep");
+  result.push_back(NAME_DERIVED_PARAMETER_kep);
   return result;
 };
 
 mitk::StandardToftsModel::ParametersSizeType
 mitk::StandardToftsModel::GetNumberOfDerivedParameters() const
 {
-  return 1;
+  return NUMBER_OF_DERIVED_PARAMETERS;
 };
 
 mitk::StandardToftsModel::ParamterUnitMapType mitk::StandardToftsModel::GetDerivedParameterUnits() const
 {
   ParamterUnitMapType result;
 
-  result.insert(std::make_pair("kep", "1/min"));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_kep, UNIT_DERIVED_PARAMETER_kep));
 
   return result;
 };
 
 mitk::StandardToftsModel::ModelResultType mitk::StandardToftsModel::ComputeModelfunction(
   const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
   double ktrans = parameters[POSITION_PARAMETER_Ktrans] / 6000.0;
   double     ve = parameters[POSITION_PARAMETER_ve];
 
 
   double lambda =  ktrans / ve;
 
   mitk::ModelBase::ModelResultType convolution = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
       aterialInputFunction, lambda);
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
   mitk::ModelBase::ModelResultType::const_iterator res = convolution.begin();
 
 
   for (AterialInputFunctionType::iterator Cp = aterialInputFunction.begin();
        Cp != aterialInputFunction.end(); ++res, ++signalPos, ++Cp)
   {
     *signalPos = ktrans * (*res);
   }
 
   return signal;
 
 }
 
 
 mitk::ModelBase::DerivedParameterMapType mitk::StandardToftsModel::ComputeDerivedParameters(
   const mitk::ModelBase::ParametersType& parameters) const
 {
   DerivedParameterMapType result;
   double kep = parameters[POSITION_PARAMETER_Ktrans] / parameters[POSITION_PARAMETER_ve];
-  result.insert(std::make_pair("kep", kep));
+  result.insert(std::make_pair(NAME_DERIVED_PARAMETER_kep, kep));
   return result;
 };
 
 itk::LightObject::Pointer mitk::StandardToftsModel::InternalClone() const
 {
   StandardToftsModel::Pointer newClone = StandardToftsModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 };
 
 void mitk::StandardToftsModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 };
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModel.cpp
deleted file mode 100644
index 3c7483f464..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkThreeStepLinearModel.cpp
+++ /dev/null
@@ -1,275 +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 "mitkThreeStepLinearModel.h"
-#include <mitkIOUtil.h>
-
-
-const std::string mitk::ThreeStepLinearModel::MODEL_DISPLAY_NAME = "Three Step Linear Model";
-
-const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_s0 = "Baseline";
-const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_t1 = "Time_point_1";
-const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_t2 = "Time_point_2";
-const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_a1 = "Slope_1";
-const std::string mitk::ThreeStepLinearModel::NAME_PARAMETER_a2 = "Slope_2";
-
-// Assuming that Model is calculated on Signal intensities I
-const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_s0 = "I";
-const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_t1 = "s";
-const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_t2 = "s";
-const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_a1 = "I/s";
-const std::string mitk::ThreeStepLinearModel::UNIT_PARAMETER_a2 = "I/s";
-
-const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_s0 = 0;
-const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_t1 = 1;
-const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_t2 = 2;
-const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_a1 = 3;
-const unsigned int mitk::ThreeStepLinearModel::POSITION_PARAMETER_a2 = 4;
-
-const unsigned int mitk::ThreeStepLinearModel::NUMBER_OF_PARAMETERS = 5;
-
-std::string mitk::ThreeStepLinearModel::GetModelDisplayName() const
-{
-  return MODEL_DISPLAY_NAME;
-};
-
-std::string mitk::ThreeStepLinearModel::GetModelType() const
-{
-  return "Generic";
-};
-
-mitk::ThreeStepLinearModel::FunctionStringType mitk::ThreeStepLinearModel::GetFunctionString() const
-{
-  return "Baseline if t<Time_point_1; Slope_1*t+Y_intercept_1 if Time_point_1<=t<=Time_point_2; Slope_2*t+Y_intercept_2 if Time_point_2<t";
-};
-
-std::string mitk::ThreeStepLinearModel::GetXName() const
-{
-  return "x";
-};
-
-mitk::ThreeStepLinearModel::ParameterNamesType
-mitk::ThreeStepLinearModel::GetParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back(NAME_PARAMETER_s0);
-  result.push_back(NAME_PARAMETER_t1);
-  result.push_back(NAME_PARAMETER_t2);
-  result.push_back(NAME_PARAMETER_a1);
-  result.push_back(NAME_PARAMETER_a2);
-
-
-  return result;
-};
-
-mitk::ThreeStepLinearModel::ParametersSizeType
-mitk::ThreeStepLinearModel::GetNumberOfParameters() const
-{
-  return NUMBER_OF_PARAMETERS;
-};
-
-mitk::ThreeStepLinearModel::ParamterUnitMapType
-mitk::ThreeStepLinearModel::GetParameterUnits() const
-{
-  ParamterUnitMapType result;
-
-  result.insert(std::make_pair(NAME_PARAMETER_s0, UNIT_PARAMETER_s0));
-  result.insert(std::make_pair(NAME_PARAMETER_t1, UNIT_PARAMETER_t1));
-  result.insert(std::make_pair(NAME_PARAMETER_t2, UNIT_PARAMETER_t2));
-  result.insert(std::make_pair(NAME_PARAMETER_a1, UNIT_PARAMETER_a1));
-  result.insert(std::make_pair(NAME_PARAMETER_a2, UNIT_PARAMETER_a2));
-
-  return result;
-};
-
-mitk::ThreeStepLinearModel::ParameterNamesType
-mitk::ThreeStepLinearModel::GetDerivedParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back("AUC");
-  result.push_back("FinalTimePoint");
-  result.push_back("FinalUptake");
-  result.push_back("Smax");
-  result.push_back("y-intercept1");
-  result.push_back("y-intercept2");
-
-  return result;
-};
-
-mitk::ThreeStepLinearModel::ParametersSizeType
-mitk::ThreeStepLinearModel::GetNumberOfDerivedParameters() const
-{
-  return 6;
-};
-
-double mitk::ThreeStepLinearModel::ComputeSignalFromParameters(double x, double s0, double t1, double t2, double a1, double a2, double b1, double b2)
-{
-  double signal = 0.0;
-
-  if (x < t1)
-  {
-    signal = s0;
-  }
-  else if (x >= t1 && x <= t2)
-  {
-    signal = a1 * x + b1;
-  }
-  else
-  {
-    signal = a2 * x + b2;
-  }
-
-
-  return signal;
-};
-
-mitk::ThreeStepLinearModel::ParamterUnitMapType mitk::ThreeStepLinearModel::GetDerivedParameterUnits() const
-{
-  ParamterUnitMapType result;
-
-  result.insert(std::make_pair("AUC", "I*s"));
-  result.insert(std::make_pair("FinalTimePoint", "s"));
-  result.insert(std::make_pair("FinalUptake", "I"));
-  result.insert(std::make_pair("Smax", "I"));
-  result.insert(std::make_pair("y-intercept1", "I"));
-  result.insert(std::make_pair("y-intercept2", "I"));
-
-
-
-
-  return result;
-};
-
-mitk::ThreeStepLinearModel::ModelResultType
-mitk::ThreeStepLinearModel::ComputeModelfunction(const ParametersType& parameters) const
-{
-  //Model Parameters
-  const double     s0 = (double) parameters[POSITION_PARAMETER_s0];
-  const double     t1 = (double) parameters[POSITION_PARAMETER_t1] ;
-  const double     t2 = (double) parameters[POSITION_PARAMETER_t2] ;
-  const double     a1 = (double) parameters[POSITION_PARAMETER_a1] ;
-  const double     a2 = (double) parameters[POSITION_PARAMETER_a2] ;
-
-  double     b1 = s0 - a1 * t1;
-  double     b2 = (a1 * t2 + b1) - (a2 * t2);
-
-  ModelResultType signal(m_TimeGrid.GetSize());
-
-  TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
-
-  ModelResultType::iterator signalPos = signal.begin();
-
-  for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd; ++gridPos, ++signalPos)
-  {
-    *signalPos = ComputeSignalFromParameters(*gridPos, s0, t1, t2, a1, a2, b1, b2);
-  }
-
-  return signal;
-};
-
-mitk::ThreeStepLinearModel::ParameterNamesType mitk::ThreeStepLinearModel::GetStaticParameterNames() const
-{
-  ParameterNamesType result;
-
-  return result;
-}
-
-mitk::ThreeStepLinearModel::ParametersSizeType  mitk::ThreeStepLinearModel::GetNumberOfStaticParameters() const
-{
-  return 0;
-}
-
-void mitk::ThreeStepLinearModel::SetStaticParameter(const ParameterNameType&,
-    const StaticParameterValuesType&)
-{
-  //do nothing
-};
-
-mitk::ThreeStepLinearModel::StaticParameterValuesType mitk::ThreeStepLinearModel::GetStaticParameterValue(
-  const ParameterNameType&) const
-{
-  StaticParameterValuesType result;
-
-  //do nothing
-
-  return result;
-};
-
-mitk::ModelBase::DerivedParameterMapType mitk::ThreeStepLinearModel::ComputeDerivedParameters(
-  const mitk::ModelBase::ParametersType& parameters) const
-{
-    const double     s0 = (double) parameters[POSITION_PARAMETER_s0];
-    const double     t1 = (double) parameters[POSITION_PARAMETER_t1] ;
-    const double     t2 = (double) parameters[POSITION_PARAMETER_t2] ;
-    const double     a1 = (double) parameters[POSITION_PARAMETER_a1] ;
-    const double     a2 = (double) parameters[POSITION_PARAMETER_a2] ;
-
-    const double     b1 = s0 - a1 * t1;
-    const double     b2 = (a1 * t2 + b1) - (a2 * t2);
-
-    unsigned int timeSteps = m_TimeGrid.GetSize();
-
-    const double taq = (m_TimeGrid.empty() == false) ? (m_TimeGrid.GetElement(timeSteps - 1)) : ( mitkThrow() << "An exception occured because time grid is empty, method can't continue.");
-
-    const double sfin = a2 * taq + b2;
-
-    double smax = sfin;
-    if ((a1 >= 0) && (a2 >= 0))
-      smax = sfin;
-    else if ((a1 < 0) && (a2 < 0))
-      smax = s0;
-    else if ((a1 > 0) && (a2 < 0))
-      smax = (a1 * t2 + b1);
-    else
-    {
-      if (abs(a1 * (t2 - t1)) >= abs(a2 * (taq - t2)))
-        smax = s0;
-      else smax = sfin;
-    }
-
-    double auc = 0.0;
-    TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
-
-    for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd - 1; ++gridPos)
-    {
-      double currentGridPos = *gridPos;
-      double nextGridPos = *(++gridPos);
-      double deltaX = nextGridPos - currentGridPos;
-      double deltaY = ComputeSignalFromParameters(nextGridPos, s0, t1, t2, a1, a2, b1, b2) - ComputeSignalFromParameters(currentGridPos, s0, t1, t2, a1, a2, b1, b2);
-      double Yi = ComputeSignalFromParameters(currentGridPos, s0, t1, t2, a1, a2, b1, b2 );
-      double intI = 0.5 * deltaX * deltaY + Yi * deltaX;
-      auc += std::abs(intI);
-      --gridPos;
-    }
-
-
-    DerivedParameterMapType result;
-
-    result.insert(std::make_pair("AUC", auc));
-    result.insert(std::make_pair("FinalTimePoint", taq));
-    result.insert(std::make_pair("FinalUptake", sfin));
-    result.insert(std::make_pair("Smax", smax));
-    result.insert(std::make_pair("y-intercept1", b1));
-    result.insert(std::make_pair("y-intercept2", b2));
-
-
-    return result;
-};
-
-itk::LightObject::Pointer mitk::ThreeStepLinearModel::InternalClone() const
-{
-  ThreeStepLinearModel::Pointer newClone = ThreeStepLinearModel::New();
-
-  newClone->SetTimeGrid(this->m_TimeGrid);
-
-  return newClone.GetPointer();
-};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoCompartmentExchangeModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoCompartmentExchangeModel.cpp
index f59e917bed..18cc53af40 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoCompartmentExchangeModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoCompartmentExchangeModel.cpp
@@ -1,180 +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.
 
 ============================================================================*/
 
 #include "mitkTwoCompartmentExchangeModel.h"
 #include "mitkConvolutionHelper.h"
 #include <fstream>
 
-const std::string mitk::TwoCompartmentExchangeModel::MODEL_DISPLAY_NAME =
- "Two Compartment Exchange Model";
+const std::string mitk::TwoCompartmentExchangeModel::MODEL_DISPLAY_NAME = "Two Compartment Exchange Model";
 
-const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_F = "F";
+const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_F = "F_p";
 const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_PS = "PS";
-const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_ve = "ve";
-const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_vp = "vp";
+const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_ve = "v_e";
+const std::string mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_vp = "v_p";
 
 const std::string mitk::TwoCompartmentExchangeModel::UNIT_PARAMETER_F = "ml/min/100ml";
 const std::string mitk::TwoCompartmentExchangeModel::UNIT_PARAMETER_PS = "ml/min/100ml";
 const std::string mitk::TwoCompartmentExchangeModel::UNIT_PARAMETER_ve = "ml/ml";
 const std::string mitk::TwoCompartmentExchangeModel::UNIT_PARAMETER_vp = "ml/ml";
 
 const unsigned int mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_F = 0;
 const unsigned int mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_PS = 1;
 const unsigned int mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_ve = 2;
 const unsigned int mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_vp = 3;
 
 const unsigned int mitk::TwoCompartmentExchangeModel::NUMBER_OF_PARAMETERS = 4;
 
+const std::string mitk::TwoCompartmentExchangeModel::MODEL_TYPE = "Perfusion.MR";
+
+
+
 
 inline double square(double a)
 {
   return a * a;
 }
 
 std::string mitk::TwoCompartmentExchangeModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::TwoCompartmentExchangeModel::GetModelType() const
 {
-  return "Perfusion.MR";
+  return MODEL_TYPE;
 };
 
 mitk::TwoCompartmentExchangeModel::TwoCompartmentExchangeModel()
 {
 
 }
 
 mitk::TwoCompartmentExchangeModel::~TwoCompartmentExchangeModel()
 {
 
 }
 
 mitk::TwoCompartmentExchangeModel::ParameterNamesType
 mitk::TwoCompartmentExchangeModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_F);
   result.push_back(NAME_PARAMETER_PS);
   result.push_back(NAME_PARAMETER_ve);
   result.push_back(NAME_PARAMETER_vp);
 
   return result;
 }
 
 mitk::TwoCompartmentExchangeModel::ParametersSizeType
 mitk::TwoCompartmentExchangeModel::GetNumberOfParameters() const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
 mitk::TwoCompartmentExchangeModel::ParamterUnitMapType
 mitk::TwoCompartmentExchangeModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_F, UNIT_PARAMETER_F));
   result.insert(std::make_pair(NAME_PARAMETER_PS, UNIT_PARAMETER_PS));
   result.insert(std::make_pair(NAME_PARAMETER_vp, UNIT_PARAMETER_vp));
   result.insert(std::make_pair(NAME_PARAMETER_ve, UNIT_PARAMETER_ve));
 
   return result;
 };
 
 
 mitk::TwoCompartmentExchangeModel::ModelResultType
 mitk::TwoCompartmentExchangeModel::ComputeModelfunction(const ParametersType& parameters) const
 {
     typedef mitk::ModelBase::ModelResultType ConvolutionResultType;
 
     if (this->m_TimeGrid.GetSize() == 0)
     {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
     }
 
     AterialInputFunctionType aterialInputFunction;
     aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
     unsigned int timeSteps = this->m_TimeGrid.GetSize();
     mitk::ModelBase::ModelResultType signal(timeSteps);
     signal.fill(0.0);
 
     //Model Parameters
     double F = parameters[POSITION_PARAMETER_F] / 6000.0;
     double PS  = parameters[POSITION_PARAMETER_PS] / 6000.0;
     double ve = parameters[POSITION_PARAMETER_ve];
     double vp = parameters[POSITION_PARAMETER_vp];
 
     if(PS != 0)
     {
         double Tp = vp/(PS + F);
         double Te = ve/PS;
         double Tb = vp/F;
 
         double Kp = 0.5 *( 1/Tp + 1/Te + sqrt(( 1/Tp + 1/Te )*( 1/Tp + 1/Te ) - 4 * 1/Te*1/Tb) );
         double Km = 0.5 *( 1/Tp + 1/Te - sqrt(( 1/Tp + 1/Te )*( 1/Tp + 1/Te ) - 4 * 1/Te*1/Tb) );
 
         double E = ( Kp - 1/Tb )/( Kp - Km );
 
 
 
         ConvolutionResultType expp = mitk::convoluteAIFWithExponential(this->m_TimeGrid, aterialInputFunction,Kp);
         ConvolutionResultType expm = mitk::convoluteAIFWithExponential(this->m_TimeGrid, aterialInputFunction,Km);
 
         //Signal that will be returned by ComputeModelFunction
 
         mitk::ModelBase::ModelResultType::const_iterator exppPos = expp.begin();
         mitk::ModelBase::ModelResultType::const_iterator expmPos = expm.begin();
 
         for( mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin(); signalPos!=signal.end(); ++exppPos,++expmPos, ++signalPos)
         {
             *signalPos = F * ( *exppPos + E*(*expmPos - *exppPos) );
         }
     }
 
 
     else
     {
         double Kp = F/vp;
         ConvolutionResultType exp = mitk::convoluteAIFWithExponential(this->m_TimeGrid, aterialInputFunction,Kp);
         mitk::ModelBase::ModelResultType::const_iterator expPos = exp.begin();
 
         for( mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin(); signalPos!=signal.end(); ++expPos, ++signalPos)
         {
             *signalPos = F * ( *expPos );
         }
 
     }
 
     return signal;
 }
 
 
 itk::LightObject::Pointer mitk::TwoCompartmentExchangeModel::InternalClone() const
 {
   TwoCompartmentExchangeModel::Pointer newClone = TwoCompartmentExchangeModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 }
 
 void mitk::TwoCompartmentExchangeModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 }
 
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModel.cpp
deleted file mode 100644
index 19191106fa..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModel.cpp
+++ /dev/null
@@ -1,209 +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 "mitkTwoStepLinearModel.h"
-#include <mitkIOUtil.h>
-
-const std::string mitk::TwoStepLinearModel::MODELL_NAME = "Two Step Linear Model";
-
-const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_y1 = "BaseValue";
-const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_a1 = "Slope_1";
-const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_t = "Change_Point";
-const std::string mitk::TwoStepLinearModel::NAME_PARAMETER_a2 = "Slope_2";
-
-const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_y1 = 0;
-const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_t  = 1;
-const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_a1 = 2;
-const unsigned int mitk::TwoStepLinearModel::POSITION_PARAMETER_a2 = 3;
-
-const unsigned int mitk::TwoStepLinearModel::NUMBER_OF_PARAMETERS = 4;
-
-std::string mitk::TwoStepLinearModel::GetModelDisplayName() const
-{
-  return MODELL_NAME;
-};
-
-std::string mitk::TwoStepLinearModel::GetModelType() const
-{
-  return "Generic";
-};
-
-mitk::TwoStepLinearModel::FunctionStringType mitk::TwoStepLinearModel::GetFunctionString() const
-{
-  return "Slope_1*t+Y_intercept_1 if t<Change_Point; Slope_2*t+Y_intercept_2 if ChangePoint<=t";
-};
-
-std::string mitk::TwoStepLinearModel::GetXName() const
-{
-  return "x";
-};
-
-mitk::TwoStepLinearModel::ParameterNamesType
-mitk::TwoStepLinearModel::GetParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back(NAME_PARAMETER_y1);
-  result.push_back(NAME_PARAMETER_t);
-  result.push_back(NAME_PARAMETER_a1);
-  result.push_back(NAME_PARAMETER_a2);
-
-
-  return result;
-};
-
-mitk::TwoStepLinearModel::ParametersSizeType
-mitk::TwoStepLinearModel::GetNumberOfParameters() const
-{
-  return NUMBER_OF_PARAMETERS;
-};
-
-mitk::TwoStepLinearModel::ParameterNamesType
-mitk::TwoStepLinearModel::GetDerivedParameterNames() const
-{
-  ParameterNamesType result;
-  result.push_back("AUC");
-  result.push_back("FinalUptake");
-  result.push_back("Smax");
-  result.push_back("y-intercept2");
-
-  return result;
-};
-
-mitk::TwoStepLinearModel::ParametersSizeType
-mitk::TwoStepLinearModel::GetNumberOfDerivedParameters() const
-{
-  return 4;
-};
-
-double mitk::TwoStepLinearModel::ComputeSignalFromParameters(double x, double t, double a1, double a2, double b1, double b2)
-{
-  return (x < t) ? (a1 * x + b1) : (a2 * x + b2);
-};
-
-
-
-
-mitk::TwoStepLinearModel::ModelResultType
-mitk::TwoStepLinearModel::ComputeModelfunction(const ParametersType& parameters) const
-{
-
-  //Model Parameters
-  const auto t = parameters[POSITION_PARAMETER_t] ;
-  const auto a1 = parameters[POSITION_PARAMETER_a1] ;
-  const auto a2 = parameters[POSITION_PARAMETER_a2] ;
-  const auto b1 = parameters[POSITION_PARAMETER_y1] ;
-
-  double b2 = (a1 - a2) * t + b1;
-
-  ModelResultType signal(m_TimeGrid.GetSize());
-
-  TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
-
-  ModelResultType::iterator signalPos = signal.begin();
-
-  for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd; ++gridPos, ++signalPos)
-  {
-    *signalPos = ComputeSignalFromParameters(*gridPos, t, a1, a2, b1, b2);
-  }
-
-  return signal;
-};
-
-mitk::TwoStepLinearModel::ParameterNamesType mitk::TwoStepLinearModel::GetStaticParameterNames() const
-{
-  ParameterNamesType result;
-
-  return result;
-}
-
-mitk::TwoStepLinearModel::ParametersSizeType  mitk::TwoStepLinearModel::GetNumberOfStaticParameters() const
-{
-  return 0;
-}
-
-void mitk::TwoStepLinearModel::SetStaticParameter(const ParameterNameType& /*name*/,
-    const StaticParameterValuesType& /*values*/)
-{
-  //do nothing
-};
-
-mitk::TwoStepLinearModel::StaticParameterValuesType mitk::TwoStepLinearModel::GetStaticParameterValue(
-  const ParameterNameType& /*name*/) const
-{
-  StaticParameterValuesType result;
-
-  //do nothing
-
-  return result;
-};
-
-mitk::ModelBase::DerivedParameterMapType mitk::TwoStepLinearModel::ComputeDerivedParameters(
-  const mitk::ModelBase::ParametersType& parameters) const
-{
-    const auto t = parameters[POSITION_PARAMETER_t] ;
-    const auto a1 = parameters[POSITION_PARAMETER_a1] ;
-    const auto a2 = parameters[POSITION_PARAMETER_a2] ;
-    const auto b1 = parameters[POSITION_PARAMETER_y1] ;
-    const auto b2 = (a1 - a2) * t + b1;
-
-    unsigned int timeSteps = m_TimeGrid.GetSize();
-
-    const double taq = (m_TimeGrid.empty() == false) ? (m_TimeGrid.GetElement(timeSteps - 1)) : (mitkThrow() << "An exception occured because time grid is empty, method can't continue.");
-
-    const double sfin = a2 * taq + b2;
-
-    double smax = sfin;
-    if ((a1 >= 0) && (a2 >= 0))
-      smax = sfin;
-    else if ((a1 < 0) && (a2 < 0))
-      smax = b1;
-    else if ((a1 > 0) && (a2 < 0))
-      smax = (a1 * t + b1);
-    else
-    {
-      if (abs(a1 * t) >= abs(a2 * (taq - t)))
-        smax = b1;
-      else smax = sfin;
-    }
-
-    double auc = 0.0;
-    TimeGridType::const_iterator timeGridEnd = m_TimeGrid.end();
-    for (TimeGridType::const_iterator gridPos = m_TimeGrid.begin(); gridPos != timeGridEnd -1; ++gridPos)
-    {
-      double currentGridPos = *gridPos;
-      double nextGridPos = *(++gridPos);
-      double deltaX = nextGridPos - currentGridPos;
-      double deltaY = ComputeSignalFromParameters(nextGridPos, t, a1, a2, b1, b2) - ComputeSignalFromParameters(currentGridPos, t, a1, a2, b1, b2);
-      double Yi = ComputeSignalFromParameters(currentGridPos, t, a1, a2, b1, b2);
-      double intI = 0.5 * deltaX * deltaY + Yi * deltaX;
-      auc += std::abs(intI);
-      --gridPos;
-    }
-
-    DerivedParameterMapType result;
-
-    result.insert(std::make_pair("AUC", auc));
-    result.insert(std::make_pair("FinalUptake", sfin));
-    result.insert(std::make_pair("Smax", smax));
-    result.insert(std::make_pair("y-intercept2", b2));
-
-    return result;
-};
-
-itk::LightObject::Pointer mitk::TwoStepLinearModel::InternalClone() const
-{
-  TwoStepLinearModel::Pointer newClone = TwoStepLinearModel::New();
-
-  newClone->SetTimeGrid(this->m_TimeGrid);
-
-  return newClone.GetPointer();
-};
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelTest.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelTest.cpp
deleted file mode 100644
index de8b2e160f..0000000000
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoStepLinearModelTest.cpp
+++ /dev/null
@@ -1,66 +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.
-
-============================================================================*/
-
- //Testing
-#include "mitkModelTestFixture.h"
-
-//MITK includes
-#include "mitkTwoStepLinearModel.h"
-
-
-  class mitkTwoStepLinearModelTestSuite : public mitk::mitkModelTestFixture
-{
-  CPPUNIT_TEST_SUITE(mitkTwoStepLinearModelTestSuite);
-  MITK_TEST(GetModelInfoTest);
-  MITK_TEST(ComputeModelfunctionTest);
-  MITK_TEST(ComputeDerivedParametersTest);
-  CPPUNIT_TEST_SUITE_END();
-
-private:
-  mitk::TwoStepLinearModel::Pointer m_testmodel;
-
-  json m_profile_json_obj;
-  json m_modelValues_json_obj;
-
-public:
-  void setUp() override
-  {
-    // Parse JSON files
-    m_profile_json_obj = ParseJSONFile("Pharmacokinetics/mitkTwoStepLinearModelTest_profile.json");
-    m_modelValues_json_obj = ParseJSONFile("Pharmacokinetics/mitkTwoStepLinearModelTest_modelValues.json");
-
-    // Generate test model
-    m_testmodel = mitk::TwoStepLinearModel::New();
- }
-
-  void tearDown() override
-  {
-  }
-
-  void GetModelInfoTest()
-  {
-    // comparison of reference and testmodel profile
-    CompareModelAndReferenceProfile(m_testmodel, m_profile_json_obj);
-  }
-
-  void ComputeModelfunctionTest()
-  {
-      CompareModelAndReferenceSignal(m_testmodel, m_modelValues_json_obj, m_profile_json_obj);
-  }
-
-  void ComputeDerivedParametersTest()
-  {
-      CompareModelAndReferenceDerivedParameters(m_testmodel, m_modelValues_json_obj);
-  }
-};
-
-MITK_TEST_SUITE_REGISTRATION(mitkTwoStepLinearModel)
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModel.cpp
index c7c36c53b5..d978c4fdad 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModel.cpp
@@ -1,155 +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.
 
 ============================================================================*/
 
 #include "mitkTwoTissueCompartmentFDGModel.h"
 #include "mitkConvolutionHelper.h"
 #include <fstream>
 const std::string mitk::TwoTissueCompartmentFDGModel::MODEL_DISPLAY_NAME = "Two Tissue Compartment Model for FDG (Sokoloff Model)";
 
-const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_K1 = "K1";
-const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_k2 = "k2";
-const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_k3 = "k3";
-const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_VB = "V_B";
+const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_K1 = "K_1";
+const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_k2 = "k_2";
+const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_k3 = "k_3";
+const std::string mitk::TwoTissueCompartmentFDGModel::NAME_PARAMETER_vb = "v_b";
 
 const std::string mitk::TwoTissueCompartmentFDGModel::UNIT_PARAMETER_K1 = "1/min";
 const std::string mitk::TwoTissueCompartmentFDGModel::UNIT_PARAMETER_k2 = "1/min";
 const std::string mitk::TwoTissueCompartmentFDGModel::UNIT_PARAMETER_k3 = "1/min";
-const std::string mitk::TwoTissueCompartmentFDGModel::UNIT_PARAMETER_VB = "ml/ml";
+const std::string mitk::TwoTissueCompartmentFDGModel::UNIT_PARAMETER_vb = "ml/ml";
 
 const unsigned int mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_K1 = 0;
 const unsigned int mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_k2 = 1;
 const unsigned int mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_k3 = 2;
-const unsigned int mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_VB = 3;
+const unsigned int mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_vb = 3;
 
 const unsigned int mitk::TwoTissueCompartmentFDGModel::NUMBER_OF_PARAMETERS = 4;
 
+const std::string mitk::TwoTissueCompartmentFDGModel::MODEL_TYPE = "Dynamic.PET";
+
 std::string mitk::TwoTissueCompartmentFDGModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::TwoTissueCompartmentFDGModel::GetModelType() const
 {
-  return "Dynamic.PET";
+  return MODEL_TYPE;
 };
 
 mitk::TwoTissueCompartmentFDGModel::TwoTissueCompartmentFDGModel()
 {
 
 }
 
 mitk::TwoTissueCompartmentFDGModel::~TwoTissueCompartmentFDGModel()
 {
 
 }
 
 mitk::TwoTissueCompartmentFDGModel::ParameterNamesType
 mitk::TwoTissueCompartmentFDGModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_K1);
   result.push_back(NAME_PARAMETER_k2);
   result.push_back(NAME_PARAMETER_k3);
-  result.push_back(NAME_PARAMETER_VB);
+  result.push_back(NAME_PARAMETER_vb);
 
   return result;
 }
 
 mitk::TwoTissueCompartmentFDGModel::ParametersSizeType
 mitk::TwoTissueCompartmentFDGModel::GetNumberOfParameters() const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
+
 mitk::TwoTissueCompartmentFDGModel::ParamterUnitMapType
 mitk::TwoTissueCompartmentFDGModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_K1, UNIT_PARAMETER_K1));
   result.insert(std::make_pair(NAME_PARAMETER_k2, UNIT_PARAMETER_k2));
   result.insert(std::make_pair(NAME_PARAMETER_k3, UNIT_PARAMETER_k3));
-  result.insert(std::make_pair(NAME_PARAMETER_VB, UNIT_PARAMETER_VB));
+  result.insert(std::make_pair(NAME_PARAMETER_vb, UNIT_PARAMETER_vb));
 
   return result;
 };
 
 mitk::TwoTissueCompartmentFDGModel::ModelResultType
 mitk::TwoTissueCompartmentFDGModel::ComputeModelfunction(const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
-  double k1 = (double)parameters[POSITION_PARAMETER_K1] / 60.0;
+  double K1 = (double)parameters[POSITION_PARAMETER_K1] / 60.0;
   double k2 = (double)parameters[POSITION_PARAMETER_k2] / 60.0;
   double k3 = (double)parameters[POSITION_PARAMETER_k3] / 60.0;
-  double VB = parameters[POSITION_PARAMETER_VB];
+  double vb = parameters[POSITION_PARAMETER_vb];
 
 
 
 
   double lambda = k2+k3;
 
   mitk::ModelBase::ModelResultType exp = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
                                           aterialInputFunction, lambda);
   mitk::ModelBase::ModelResultType CA = mitk::convoluteAIFWithConstant(this->m_TimeGrid, aterialInputFunction, k3);
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::const_iterator expPos = exp.begin();
   mitk::ModelBase::ModelResultType::const_iterator CAPos = CA.begin();
   AterialInputFunctionType::const_iterator aifPos = aterialInputFunction.begin();
 
   for (mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
        signalPos != signal.end(); ++expPos, ++signalPos, ++aifPos)
   {
-      double Ci = k1 * k2 /lambda *(*expPos) + k1*k3/lambda*(*CAPos);
-      *signalPos = VB * (*aifPos) + (1 - VB) * Ci;
+      double Ci = K1 * k2 /lambda *(*expPos) + K1*k3/lambda*(*CAPos);
+      *signalPos = vb * (*aifPos) + (1 - vb) * Ci;
   }
 
   return signal;
 
 }
 
 
 
 
 itk::LightObject::Pointer mitk::TwoTissueCompartmentFDGModel::InternalClone() const
 {
   TwoTissueCompartmentFDGModel::Pointer newClone = TwoTissueCompartmentFDGModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 }
 
 void mitk::TwoTissueCompartmentFDGModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 }
 
 
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelFactory.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelFactory.cpp
index 8ada9c010b..cc2d11d4b7 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelFactory.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelFactory.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkTwoTissueCompartmentFDGModelFactory.h"
 
 #include <mitkImageTimeSelector.h>
 #include <mitkImageCast.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 
 mitk::ConstraintCheckerBase::Pointer
 mitk::TwoTissueCompartmentFDGModelFactory::CreateDefaultConstraints() const
 {
   SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
 
   constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0.0);
   constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0, 0);
   constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k3, 0, 0);
-  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_VB, 0, 0);
+  constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_vb, 0, 0);
 
   constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_K1, 1.0, 0);
   constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0, 0);
   constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k3, 1.0, 0);
-  constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_VB, 1, 0);
+  constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_vb, 1, 0);
 
 
   return constraints.GetPointer();
 };
 
 mitk::ModelParameterizerBase::ParametersType
 mitk::TwoTissueCompartmentFDGModelFactory::GetDefaultInitialParameterization() const
 {
   return TwoTissueCompartmentFDGModelParameterizer::New()->GetDefaultInitialParameterization();
 };
 
 mitk::TwoTissueCompartmentFDGModelFactory::TwoTissueCompartmentFDGModelFactory()
 {
 };
 
 mitk::TwoTissueCompartmentFDGModelFactory::~TwoTissueCompartmentFDGModelFactory()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp
index 328dfaa4d8..360b1aeab0 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp
@@ -1,34 +1,34 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkTwoTissueCompartmentFDGModelParameterizer.h"
 
 mitk::TwoTissueCompartmentFDGModelParameterizer::ParametersType
 mitk::TwoTissueCompartmentFDGModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(4);
   initialParameters[mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_K1] = 0.5;
   initialParameters[mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_k2] = 0.5;
   initialParameters[mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_k3] = 0.5;
-  initialParameters[mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_VB] = 0.5;
+  initialParameters[mitk::TwoTissueCompartmentFDGModel::POSITION_PARAMETER_vb] = 0.5;
 
   return initialParameters;
 };
 
 mitk::TwoTissueCompartmentFDGModelParameterizer::TwoTissueCompartmentFDGModelParameterizer()
 {
 };
 
 mitk::TwoTissueCompartmentFDGModelParameterizer::~TwoTissueCompartmentFDGModelParameterizer()
 {
 };
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModel.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModel.cpp
index a00a006665..9fccbe1f83 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModel.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModel.cpp
@@ -1,170 +1,173 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkTwoTissueCompartmentModel.h"
 #include "mitkConvolutionHelper.h"
 #include <fstream>
 const std::string mitk::TwoTissueCompartmentModel::MODEL_DISPLAY_NAME = "Two Tissue Compartment Model";
 
-const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_K1 = "K1";
-const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k2 = "k2";
-const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k3 = "k3";
-const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k4 = "k4";
-const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_VB = "V_B";
+const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_K1 = "K_1";
+const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k2 = "k_2";
+const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k3 = "k_3";
+const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k4 = "k_4";
+const std::string mitk::TwoTissueCompartmentModel::NAME_PARAMETER_vb = "v_b";
 
 const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_K1 = "1/min";
 const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_k2 = "1/min";
 const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_k3 = "1/min";
 const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_k4 = "1/min";
-const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_VB = "ml/ml";
+const std::string mitk::TwoTissueCompartmentModel::UNIT_PARAMETER_vb = "ml/ml";
 
 const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_K1 = 0;
 const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k2 = 1;
 const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k3 = 2;
 const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k4 = 3;
-const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_VB = 4;
+const unsigned int mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_vb = 4;
 
 const unsigned int mitk::TwoTissueCompartmentModel::NUMBER_OF_PARAMETERS = 5;
 
+const std::string mitk::TwoTissueCompartmentModel::MODEL_TYPE = "Dynamic.PET";
+
 
 inline double square(double a)
 {
   return a * a;
 }
 
 std::string mitk::TwoTissueCompartmentModel::GetModelDisplayName() const
 {
   return MODEL_DISPLAY_NAME;
 };
 
 std::string mitk::TwoTissueCompartmentModel::GetModelType() const
 {
-  return "Dynamic.PET";
+  return MODEL_TYPE;
 };
 
 mitk::TwoTissueCompartmentModel::TwoTissueCompartmentModel()
 {
 
 }
 
 mitk::TwoTissueCompartmentModel::~TwoTissueCompartmentModel()
 {
 
 }
 
 mitk::TwoTissueCompartmentModel::ParameterNamesType
 mitk::TwoTissueCompartmentModel::GetParameterNames() const
 {
   ParameterNamesType result;
 
   result.push_back(NAME_PARAMETER_K1);
   result.push_back(NAME_PARAMETER_k2);
   result.push_back(NAME_PARAMETER_k3);
   result.push_back(NAME_PARAMETER_k4);
-  result.push_back(NAME_PARAMETER_VB);
+  result.push_back(NAME_PARAMETER_vb);
 
   return result;
 }
 
 mitk::TwoTissueCompartmentModel::ParametersSizeType
 mitk::TwoTissueCompartmentModel::GetNumberOfParameters() const
 {
   return NUMBER_OF_PARAMETERS;
 }
 
+
 mitk::TwoTissueCompartmentModel::ParamterUnitMapType
 mitk::TwoTissueCompartmentModel::GetParameterUnits() const
 {
   ParamterUnitMapType result;
 
   result.insert(std::make_pair(NAME_PARAMETER_K1, UNIT_PARAMETER_K1));
   result.insert(std::make_pair(NAME_PARAMETER_k2, UNIT_PARAMETER_k2));
   result.insert(std::make_pair(NAME_PARAMETER_k3, UNIT_PARAMETER_k3));
   result.insert(std::make_pair(NAME_PARAMETER_k4, UNIT_PARAMETER_k4));
-  result.insert(std::make_pair(NAME_PARAMETER_VB, UNIT_PARAMETER_VB));
+  result.insert(std::make_pair(NAME_PARAMETER_vb, UNIT_PARAMETER_vb));
 
   return result;
 };
 
 mitk::TwoTissueCompartmentModel::ModelResultType
 mitk::TwoTissueCompartmentModel::ComputeModelfunction(const ParametersType& parameters) const
 {
   if (this->m_TimeGrid.GetSize() == 0)
   {
     itkExceptionMacro("No Time Grid Set! Cannot Calculate Signal");
   }
 
   AterialInputFunctionType aterialInputFunction;
   aterialInputFunction = GetAterialInputFunction(this->m_TimeGrid);
 
 
   unsigned int timeSteps = this->m_TimeGrid.GetSize();
 
   //Model Parameters
-  double k1 = (double)parameters[POSITION_PARAMETER_K1] / 60.0;
+  double K1 = (double)parameters[POSITION_PARAMETER_K1] / 60.0;
   double k2 = (double)parameters[POSITION_PARAMETER_k2] / 60.0;
   double k3 = (double)parameters[POSITION_PARAMETER_k3] / 60.0;
   double k4 = (double)parameters[POSITION_PARAMETER_k4] / 60.0;
-  double VB = parameters[POSITION_PARAMETER_VB];
+  double vb = parameters[POSITION_PARAMETER_vb];
 
 
 
   double alpha1 = 0.5 * ((k2 + k3 + k4) - sqrt(square(k2 + k3 + k4) - 4 * k2 * k4));
   double alpha2 = 0.5 * ((k2 + k3 + k4) + sqrt(square(k2 + k3 + k4) - 4 * k2 * k4));
 
   mitk::ModelBase::ModelResultType exp1 = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
                                           aterialInputFunction, alpha1);
   mitk::ModelBase::ModelResultType exp2 = mitk::convoluteAIFWithExponential(this->m_TimeGrid,
                                           aterialInputFunction, alpha2);
 
 
   //Signal that will be returned by ComputeModelFunction
   mitk::ModelBase::ModelResultType signal(timeSteps);
   signal.fill(0.0);
 
   mitk::ModelBase::ModelResultType::const_iterator exp1Pos = exp1.begin();
   mitk::ModelBase::ModelResultType::const_iterator exp2Pos = exp2.begin();
   AterialInputFunctionType::const_iterator aifPos = aterialInputFunction.begin();
 
   for (mitk::ModelBase::ModelResultType::iterator signalPos = signal.begin();
        signalPos != signal.end(); ++exp1Pos, ++exp2Pos, ++signalPos, ++aifPos)
   {
-    double Ci = k1 / (alpha2 - alpha1) * ((k4 - alpha1 + k3) * (*exp1Pos) + (alpha2 - k4 - k3) *
+    double Ci = K1 / (alpha2 - alpha1) * ((k4 - alpha1 + k3) * (*exp1Pos) + (alpha2 - k4 - k3) *
                                           (*exp2Pos));
-    *signalPos = VB * (*aifPos) + (1 - VB) * Ci;
+    *signalPos = vb * (*aifPos) + (1 - vb) * Ci;
   }
 
   return signal;
 
 }
 
 
 
 
 itk::LightObject::Pointer mitk::TwoTissueCompartmentModel::InternalClone() const
 {
   TwoTissueCompartmentModel::Pointer newClone = TwoTissueCompartmentModel::New();
 
   newClone->SetTimeGrid(this->m_TimeGrid);
 
   return newClone.GetPointer();
 }
 
 void mitk::TwoTissueCompartmentModel::PrintSelf(std::ostream& os, ::itk::Indent indent) const
 {
   Superclass::PrintSelf(os, indent);
 
 
 }
 
 
 
diff --git a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModelParameterizer.cpp b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModelParameterizer.cpp
index e724bb2d1e..7ddb0abd61 100644
--- a/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModelParameterizer.cpp
+++ b/Modules/Pharmacokinetics/src/Models/mitkTwoTissueCompartmentModelParameterizer.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkTwoTissueCompartmentModelParameterizer.h"
 
 mitk::TwoTissueCompartmentModelParameterizer::ParametersType
 mitk::TwoTissueCompartmentModelParameterizer::GetDefaultInitialParameterization() const
 {
   ParametersType initialParameters;
   initialParameters.SetSize(5);
   initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_K1] = 0.5;
   initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k2] = 0.5;
   initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k3] = 0.5;
   initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k4] = 0.5;
-  initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_VB] = 0.5;
+  initialParameters[mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_vb] = 0.5;
 
   return initialParameters;
 };
 
 mitk::TwoTissueCompartmentModelParameterizer::TwoTissueCompartmentModelParameterizer()
 {
 };
 
 mitk::TwoTissueCompartmentModelParameterizer::~TwoTissueCompartmentModelParameterizer()
 {
 };
diff --git a/Modules/Pharmacokinetics/test/files.cmake b/Modules/Pharmacokinetics/test/files.cmake
index 41a9258c17..0af3ec8b4a 100644
--- a/Modules/Pharmacokinetics/test/files.cmake
+++ b/Modules/Pharmacokinetics/test/files.cmake
@@ -1,14 +1,12 @@
 SET(MODULE_TESTS
   mitkDescriptivePharmacokineticBrixModelTest.cpp
   mitkStandardToftsModelTest.cpp
   mitkTwoCompartmentExchangeModelTest.cpp
   mitkExtendedToftsModelTest.cpp
   mitkConvertSignalToConcentrationTest.cpp
   mitkCurveDescriptiveParametersTest.cpp
-  mitkTwoStepLinearModelTest.cpp
-  mitkThreeStepLinearModelTest.cpp
   mitkOneTissueCompartmentModelTest.cpp
   mitkExtendedOneTissueCompartmentModelTest.cpp
   mitkTwoTissueCompartmentModelTest.cpp
   mitkTwoTissueCompartmentFDGModelTest.cpp
 )
diff --git a/Modules/QtWidgets/include/QmitkLevelWindowWidget.h b/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
index 573165361b..1dce4bebdc 100644
--- a/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
+++ b/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
@@ -1,37 +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 QmitkLevelWindowWidget_h
 #define QmitkLevelWindowWidget_h
 
 #include <MitkQtWidgetsExports.h>
-
-#include "ui_QmitkLevelWindowWidget.h"
+#include <mitkLevelWindowManager.h>
 
 #include <QWidget>
 
+// Forward declarations
+namespace Ui
+{
+  class QmitkLevelWindow;
+}
+
 /// \ingroup QmitkModule
-class MITKQTWIDGETS_EXPORT QmitkLevelWindowWidget : public QWidget, public Ui::QmitkLevelWindow
+class MITKQTWIDGETS_EXPORT QmitkLevelWindowWidget : public QWidget
 {
   Q_OBJECT
 public:
   QmitkLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
+  ~QmitkLevelWindowWidget() override;
+
   mitk::LevelWindowManager *GetManager();
 
 public slots:
   void SetDataStorage(mitk::DataStorage *ds);
 
 protected:
   // unsigned long m_ObserverTag;
   mitk::LevelWindowManager::Pointer m_Manager;
+
+private:
+  // GUI controls of this plugin
+  Ui::QmitkLevelWindow* ui;
+
 };
 #endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionButton.h b/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
index 2b400c5900..111c63a34a 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
@@ -1,71 +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 QmitkNodeSelectionButton_h
 #define QmitkNodeSelectionButton_h
 
 #include <MitkQtWidgetsExports.h>
 
 #include <mitkDataNode.h>
 
 #include <QPushButton>
 #include <QPixmap>
 
 /**
 * @class QmitkNodeSelectionButton
 * @brief Button class that can be used to display information about a given node.
 *        If the given node is a nullptr the node info text will be shown.
-*        The node info can be formated text (e.g. HTML code; like the tooltip text).
+*        The node info can be formatted text (e.g. HTML code; like the tooltip text).
 */
 class MITKQTWIDGETS_EXPORT QmitkNodeSelectionButton : public QPushButton
 {
   Q_OBJECT
 
 public:
   explicit QmitkNodeSelectionButton(QWidget *parent = nullptr);
   ~QmitkNodeSelectionButton() override;
 
   const mitk::DataNode* GetSelectedNode() const;
   bool GetSelectionIsOptional() const;
 
 public Q_SLOTS:
   virtual void SetSelectedNode(const mitk::DataNode* node);
   virtual void SetNodeInfo(QString info);
 
   /** Set the widget into an optional mode. Optional means that the selection of no valid
   node does not mean an invalid state. Thus no node is a valid "node" selection too.
   The state influences if the info text is handled as an information (optional) or a
   warning (optiona==false).*/
   void SetSelectionIsOptional(bool isOptional);
 
 protected:
   void paintEvent(QPaintEvent *p) override;
   void changeEvent(QEvent *event) override;
 
   void AddNodeObserver();
   void RemoveNodeObserver();
   void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
 
   mitk::DataNode::ConstPointer m_SelectedNode;
   QString m_Info;
   bool m_OutDatedThumbNail;
   QPixmap m_ThumbNail;
   itk::ModifiedTimeType m_DataMTime;
   itk::ModifiedTimeType m_SelectionPropMTime;
 
   bool m_IsOptional;
 
   unsigned long m_NodeModifiedObserverTag;
   bool m_NodeObserved;
 };
 
 #endif
diff --git a/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h b/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h
index 2ce34485c9..44130cb7e6 100644
--- a/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h
+++ b/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.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 QmitkSingleNodeSelectionWidget_h
 #define QmitkSingleNodeSelectionWidget_h
 
 #include <MitkQtWidgetsExports.h>
 
 #include <ui_QmitkSingleNodeSelectionWidget.h>
 
 #include <mitkDataStorage.h>
 #include <mitkWeakPointer.h>
 #include <mitkNodePredicateBase.h>
 
 #include <QmitkAbstractNodeSelectionWidget.h>
 #include <QmitkNodeSelectionButton.h>
 
 class QmitkAbstractDataStorageModel;
 
 /**
 * @class QmitkSingleNodeSelectionWidget
 * @brief Widget that represents a node selection of (max) one node. It acts like a button. Clicking on it
 *        allows to change the selection.
 *
 * @remark This class provides a public function 'SetAutoSelectNewNodes' that can be used to enable
 *         the auto selection mode (default is false).
 *         The user of this class calling this function has to make sure that the base-class Q_SIGNAL
 *         'CurrentSelectionChanged', which will be emitted by this function, is already
 *         connected to a receiving slot, if the initial valid auto selection should not get lost.
 */
 class MITKQTWIDGETS_EXPORT QmitkSingleNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget
 {
   Q_OBJECT
 
 public:
   explicit QmitkSingleNodeSelectionWidget(QWidget* parent = nullptr);
 
   mitk::DataNode::Pointer GetSelectedNode() const;
   bool GetAutoSelectNewNodes() const;
 
   using NodeList = QmitkAbstractNodeSelectionWidget::NodeList;
 
 public Q_SLOTS:
   void SetCurrentSelectedNode(mitk::DataNode* selectedNode);
 
   /**
   * Sets the auto selection mode (default is false).
-  * If auto select is true and the following conditions are fullfilled, the widget will
+  * If auto select is true and the following conditions are fulfilled, the widget will
   * select a node automatically from the data storage:
   *  - a data storage is set
   *  - data storage contains at least one node that matches the given predicate
   *  - no selection is set
   *
   * @remark Enabling the auto selection mode by calling 'SetAutoSelectNewNodes(true)'
   *         will directly emit a 'QmitkSingleNodeSelectionWidget::CurrentSelectionChanged' Q_SIGNAL
   *         if a valid auto selection was made.
   *         If this initial emission should not get lost, auto selection mode needs to be enabled after this
   *         selection widget has been connected via the 'QmitkSingleNodeSelectionWidget::CurrentSelectionChanged'
   *         Q_SIGNAL to a receiving function.
   */
   void SetAutoSelectNewNodes(bool autoSelect);
 
 protected Q_SLOTS:
   virtual void OnClearSelection();
 
 protected:
   void ReviseSelectionChanged(const NodeList& oldInternalSelection, NodeList& newInternalSelection) override;
 
   bool eventFilter(QObject *obj, QEvent *ev) override;
   void EditSelection();
   void UpdateInfo() override;
 
   void OnDataStorageChanged() override;
   void OnNodeAddedToStorage(const mitk::DataNode* node) override;
 
   void AutoSelectNodes();
 
   /** Helper function that gets a suitable auto selected node from the datastorage that fits to the predicate settings.
-   @param ignoreNodes You may pass a list of nodes that must not be choosen as auto selected node. */
+   @param ignoreNodes You may pass a list of nodes that must not be chosen as auto selected node. */
   mitk::DataNode::Pointer DetermineAutoSelectNode(const NodeList& ignoreNodes = {});
 
   /** See documentation of SetAutoSelectNewNodes for details*/
   bool m_AutoSelectNodes;
 
   Ui_QmitkSingleNodeSelectionWidget m_Controls;
 };
 
 #endif
diff --git a/Modules/QtWidgets/src/QmitkAbstractMultiWidget.cpp b/Modules/QtWidgets/src/QmitkAbstractMultiWidget.cpp
index 851cf60a9e..75cd50eac3 100644
--- a/Modules/QtWidgets/src/QmitkAbstractMultiWidget.cpp
+++ b/Modules/QtWidgets/src/QmitkAbstractMultiWidget.cpp
@@ -1,416 +1,415 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // mitk qt widgets module
 #include "QmitkAbstractMultiWidget.h"
-#include "QmitkLevelWindowWidget.h"
 #include "QmitkMultiWidgetLayoutManager.h"
 #include "QmitkRenderWindowWidget.h"
 
 // mitk core
 #include <mitkDataStorage.h>
 #include <mitkDisplayActionEventBroadcast.h>
 
 // qt
 #include <QMouseEvent>
 
 // c++
 #include <iomanip>
 
 struct QmitkAbstractMultiWidget::Impl final
 {
   Impl(QmitkAbstractMultiWidget* multiWidget, const QString& multiWidgetName);
   ~Impl();
 
   void SetDataStorage(mitk::DataStorage* dataStorage)
   {
     if (dataStorage == m_DataStorage)
     {
       return;
     }
 
     m_DataStorage = dataStorage;
     // set new data storage for the render window widgets
     for (const auto& renderWindowWidget : m_RenderWindowWidgets)
     {
       renderWindowWidget.second->SetDataStorage(m_DataStorage);
     }
   }
 
   void InitializeDisplayActionEventHandling()
   {
     m_DisplayActionEventBroadcast = mitk::DisplayActionEventBroadcast::New();
     m_DisplayActionEventBroadcast->LoadStateMachine("DisplayInteraction.xml");
   }
 
   mitk::DataStorage::Pointer m_DataStorage;
 
   QString m_MultiWidgetName;
 
   RenderWindowWidgetMap m_RenderWindowWidgets;
   RenderWindowWidgetPointer m_ActiveRenderWindowWidget;
 
   int m_MultiWidgetRows;
   int m_MultiWidgetColumns;
 
   // interaction
   unsigned long m_RenderWindowFocusObserverTag;
   mitk::DisplayActionEventBroadcast::Pointer m_DisplayActionEventBroadcast;
   std::unique_ptr<mitk::DisplayActionEventHandler> m_DisplayActionEventHandler;
   QmitkMultiWidgetLayoutManager* m_LayoutManager;
 };
 
 QmitkAbstractMultiWidget::Impl::Impl(QmitkAbstractMultiWidget* multiWidget, const QString& multiWidgetName)
   : m_DataStorage(nullptr)
   , m_MultiWidgetName(multiWidgetName)
   , m_MultiWidgetRows(0)
   , m_MultiWidgetColumns(0)
   , m_RenderWindowFocusObserverTag(0)
   , m_DisplayActionEventBroadcast(nullptr)
   , m_DisplayActionEventHandler(nullptr)
   , m_LayoutManager(new QmitkMultiWidgetLayoutManager(multiWidget))
 {
   auto command = itk::MemberCommand<QmitkAbstractMultiWidget>::New();
   command->SetCallbackFunction(multiWidget, &QmitkAbstractMultiWidget::OnFocusChanged);
   m_RenderWindowFocusObserverTag =
     mitk::RenderingManager::GetInstance()->AddObserver(mitk::FocusChangedEvent(), command);
 
   InitializeDisplayActionEventHandling();
 }
 
 QmitkAbstractMultiWidget::Impl::~Impl()
 {
   mitk::RenderingManager::GetInstance()->RemoveObserver(m_RenderWindowFocusObserverTag);
 }
 
 QmitkAbstractMultiWidget::QmitkAbstractMultiWidget(QWidget* parent,
                                                    Qt::WindowFlags f/* = 0*/,
                                                    const QString& multiWidgetName/* = "multiwidget"*/)
   : QWidget(parent, f)
   , m_Impl(std::make_unique<Impl>(this, multiWidgetName))
 {
   // nothing here
 }
 
 QmitkAbstractMultiWidget::~QmitkAbstractMultiWidget() { }
 
 void QmitkAbstractMultiWidget::SetDataStorage(mitk::DataStorage* dataStorage)
 {
   m_Impl->SetDataStorage(dataStorage);
 }
 
 mitk::DataStorage* QmitkAbstractMultiWidget::GetDataStorage() const
 {
   return m_Impl->m_DataStorage;
 }
 
 int QmitkAbstractMultiWidget::GetRowCount() const
 {
   return m_Impl->m_MultiWidgetRows;
 }
 
 int QmitkAbstractMultiWidget::GetColumnCount() const
 {
   return m_Impl->m_MultiWidgetColumns;
 }
 
 void QmitkAbstractMultiWidget::SetLayout(int row, int column)
 {
   m_Impl->m_MultiWidgetRows = row;
   m_Impl->m_MultiWidgetColumns = column;
   SetLayoutImpl();
 }
 
 void QmitkAbstractMultiWidget::SetInteractionScheme(mitk::InteractionSchemeSwitcher::InteractionScheme scheme)
 {
   auto interactionSchemeSwitcher = mitk::InteractionSchemeSwitcher::New();
   auto interactionEventHandler = GetInteractionEventHandler();
   try
   {
     interactionSchemeSwitcher->SetInteractionScheme(interactionEventHandler, scheme);
   }
   catch (const mitk::Exception&)
   {
     return;
   }
 
   SetInteractionSchemeImpl();
 }
 
 mitk::InteractionEventHandler* QmitkAbstractMultiWidget::GetInteractionEventHandler()
 {
   return m_Impl->m_DisplayActionEventBroadcast.GetPointer();
 }
 
 void QmitkAbstractMultiWidget::SetDisplayActionEventHandler(std::unique_ptr<mitk::DisplayActionEventHandler> displayActionEventHandler)
 {
   m_Impl->m_DisplayActionEventHandler = std::move(displayActionEventHandler);
   m_Impl->m_DisplayActionEventHandler->SetObservableBroadcast(m_Impl->m_DisplayActionEventBroadcast);
 }
 
 mitk::DisplayActionEventHandler* QmitkAbstractMultiWidget::GetDisplayActionEventHandler()
 {
   return m_Impl->m_DisplayActionEventHandler.get();
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetMap QmitkAbstractMultiWidget::GetRenderWindowWidgets() const
 {
   return m_Impl->m_RenderWindowWidgets;
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetMap QmitkAbstractMultiWidget::Get2DRenderWindowWidgets() const
 {
   RenderWindowWidgetMap renderWindowWidgets2D;
 
   auto renderWindowWidgets = GetRenderWindowWidgets();
   for (const auto& renderWindowWidget : renderWindowWidgets)
   {
     auto renderWindow = renderWindowWidget.second->GetRenderWindow();
     if(mitk::BaseRenderer::Standard2D == mitk::BaseRenderer::GetInstance(renderWindow->GetVtkRenderWindow())->GetMapperID())
     {
       renderWindowWidgets2D.insert(std::make_pair(renderWindowWidget.first, renderWindowWidget.second));
     }
   }
 
   return renderWindowWidgets2D;
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetMap QmitkAbstractMultiWidget::Get3DRenderWindowWidgets() const
 {
   RenderWindowWidgetMap renderWindowWidgets3D;
 
   auto renderWindowWidgets = GetRenderWindowWidgets();
   for (const auto& renderWindowWidget : renderWindowWidgets)
   {
     auto renderWindow = renderWindowWidget.second->GetRenderWindow();
     if (mitk::BaseRenderer::Standard3D == mitk::BaseRenderer::GetInstance(renderWindow->GetVtkRenderWindow())->GetMapperID())
     {
       renderWindowWidgets3D.insert(std::make_pair(renderWindowWidget.first, renderWindowWidget.second));
     }
   }
 
   return renderWindowWidgets3D;
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget(int row, int column) const
 {
   return GetRenderWindowWidget(GetNameFromIndex(row, column));
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget(const QString& widgetName) const
 {
   RenderWindowWidgetMap::const_iterator it = m_Impl->m_RenderWindowWidgets.find(widgetName);
   if (it != m_Impl->m_RenderWindowWidgets.end())
   {
     return it->second;
   }
 
   return nullptr;
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget(const QmitkRenderWindow* renderWindow) const
 {
   auto renderWindowWidgets = GetRenderWindowWidgets();
   for (const auto& renderWindowWidget : renderWindowWidgets)
   {
     if (renderWindowWidget.second->GetRenderWindow() == renderWindow)
     {
       return renderWindowWidget.second;
     }
   }
 
   return nullptr;
 }
 
 QmitkAbstractMultiWidget::RenderWindowHash QmitkAbstractMultiWidget::GetRenderWindows() const
 {
   RenderWindowHash result;
   // create QHash on demand
   auto renderWindowWidgets = GetRenderWindowWidgets();
   for (const auto& renderWindowWidget : renderWindowWidgets)
   {
     result.insert(renderWindowWidget.first, renderWindowWidget.second->GetRenderWindow());
   }
 
   return result;
 }
 
 QmitkRenderWindow* QmitkAbstractMultiWidget::GetRenderWindow(int row, int column) const
 {
   return GetRenderWindow(GetNameFromIndex(row, column));
 }
 
 QmitkRenderWindow* QmitkAbstractMultiWidget::GetRenderWindow(const QString& widgetName) const
 {
   RenderWindowWidgetPointer renderWindowWidget = GetRenderWindowWidget(widgetName);
   if (nullptr != renderWindowWidget)
   {
     return renderWindowWidget->GetRenderWindow();
   }
 
   return nullptr;
 }
 
 void QmitkAbstractMultiWidget::SetActiveRenderWindowWidget(RenderWindowWidgetPointer activeRenderWindowWidget)
 {
   m_Impl->m_ActiveRenderWindowWidget = activeRenderWindowWidget;
   emit ActiveRenderWindowChanged();
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetActiveRenderWindowWidget() const
 {
   return m_Impl->m_ActiveRenderWindowWidget;
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetFirstRenderWindowWidget() const
 {
   if (!m_Impl->m_RenderWindowWidgets.empty())
   {
     return m_Impl->m_RenderWindowWidgets.begin()->second;
   }
   else
   {
     return nullptr;
   }
 }
 
 QmitkAbstractMultiWidget::RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetLastRenderWindowWidget() const
 {
   if (!m_Impl->m_RenderWindowWidgets.empty())
   {
     return m_Impl->m_RenderWindowWidgets.rbegin()->second;
   }
   else
   {
     return nullptr;
   }
 }
 
 QString QmitkAbstractMultiWidget::GetNameFromIndex(int row, int column) const
 {
   if (0 <= row && m_Impl->m_MultiWidgetRows > row && 0 <= column && m_Impl->m_MultiWidgetColumns > column)
   {
     return GetNameFromIndex(row * m_Impl->m_MultiWidgetColumns + column);
   }
 
   return QString();
 }
 
 QString QmitkAbstractMultiWidget::GetNameFromIndex(size_t index) const
 {
   if (index <= m_Impl->m_RenderWindowWidgets.size())
   {
     return m_Impl->m_MultiWidgetName + ".widget" + QString::number(index);
   }
 
   return QString();
 }
 
 unsigned int QmitkAbstractMultiWidget::GetNumberOfRenderWindowWidgets() const
 {
   return m_Impl->m_RenderWindowWidgets.size();
 }
 
 void QmitkAbstractMultiWidget::RequestUpdate(const QString& widgetName)
 {
   RenderWindowWidgetPointer renderWindowWidget = GetRenderWindowWidget(widgetName);
   if (nullptr != renderWindowWidget)
   {
     return renderWindowWidget->RequestUpdate();
   }
 }
 
 void QmitkAbstractMultiWidget::RequestUpdateAll()
 {
   for (const auto& renderWindowWidget : m_Impl->m_RenderWindowWidgets)
   {
     renderWindowWidget.second->RequestUpdate();
   }
 }
 
 void QmitkAbstractMultiWidget::ForceImmediateUpdate(const QString& widgetName)
 {
   RenderWindowWidgetPointer renderWindowWidget = GetRenderWindowWidget(widgetName);
   if (nullptr != renderWindowWidget)
   {
     renderWindowWidget->ForceImmediateUpdate();
   }
 }
 
 void QmitkAbstractMultiWidget::ForceImmediateUpdateAll()
 {
   for (const auto& renderWindowWidget : m_Impl->m_RenderWindowWidgets)
   {
     renderWindowWidget.second->ForceImmediateUpdate();
   }
 }
 
 void QmitkAbstractMultiWidget::ActivateMenuWidget(bool state)
 {
   for (const auto& renderWindowWidget : m_Impl->m_RenderWindowWidgets)
   {
     auto renderWindow = renderWindowWidget.second->GetRenderWindow();
     renderWindow->ActivateMenuWidget(state);
   }
 }
 
 bool QmitkAbstractMultiWidget::IsMenuWidgetEnabled() const
 {
   return m_Impl->m_ActiveRenderWindowWidget->GetRenderWindow()->GetActivateMenuWidgetFlag();
 }
 
 QmitkMultiWidgetLayoutManager* QmitkAbstractMultiWidget::GetMultiWidgetLayoutManager() const
 {
   return m_Impl->m_LayoutManager;
 }
 
 void QmitkAbstractMultiWidget::OnFocusChanged(itk::Object*, const itk::EventObject& event)
 {
   auto focusEvent = dynamic_cast<const mitk::FocusChangedEvent*>(&event);
   if (nullptr == focusEvent)
   {
     return;
   }
 
   auto focusedRenderWindow = mitk::RenderingManager::GetInstance()->GetFocusedRenderWindow();
   RenderWindowWidgetMap renderWindowWidgets = this->GetRenderWindowWidgets();
   for (const auto& renderWindowWidget : renderWindowWidgets)
   {
     const auto vtkRenderWindow = renderWindowWidget.second->GetRenderWindow()->GetVtkRenderWindow();
     if (vtkRenderWindow == focusedRenderWindow)
     {
       this->SetActiveRenderWindowWidget(renderWindowWidget.second);
       break;
     }
   }
 }
 
 void QmitkAbstractMultiWidget::AddRenderWindowWidget(const QString& widgetName, RenderWindowWidgetPointer renderWindowWidget)
 {
   m_Impl->m_RenderWindowWidgets.insert(std::make_pair(widgetName, renderWindowWidget));
 }
 
 void QmitkAbstractMultiWidget::RemoveRenderWindowWidget()
 {
   auto iterator = m_Impl->m_RenderWindowWidgets.find(this->GetNameFromIndex(this->GetNumberOfRenderWindowWidgets() - 1));
   if (iterator == m_Impl->m_RenderWindowWidgets.end())
   {
     return;
   }
 
   // disconnect each signal of this render window widget
   RenderWindowWidgetPointer renderWindowWidgetToRemove = iterator->second;
   disconnect(renderWindowWidgetToRemove.get(), 0, 0, 0);
 
   // erase the render window from the map
   m_Impl->m_RenderWindowWidgets.erase(iterator);
 }
diff --git a/Modules/QtWidgets/src/QmitkDataStorageSimpleTreeModel.cpp b/Modules/QtWidgets/src/QmitkDataStorageSimpleTreeModel.cpp
index fa45000ca7..212a214bcb 100644
--- a/Modules/QtWidgets/src/QmitkDataStorageSimpleTreeModel.cpp
+++ b/Modules/QtWidgets/src/QmitkDataStorageSimpleTreeModel.cpp
@@ -1,378 +1,382 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 <QmitkDataStorageSimpleTreeModel.h>
 #include <QmitkDataStorageTreeModelInternalItem.h>
 #include <QmitkNodeDescriptorManager.h>
 
 // qt widgets module
 #include "QmitkCustomVariants.h"
 #include "QmitkEnums.h"
 
 QmitkDataStorageSimpleTreeModel::QmitkDataStorageSimpleTreeModel(QObject *parent)
   : QmitkAbstractDataStorageModel(parent)
   , m_Root(nullptr)
 {
   ResetTree();
 }
 
 QmitkDataStorageSimpleTreeModel::~QmitkDataStorageSimpleTreeModel()
 {
   m_Root->Delete();
   m_Root = nullptr;
 }
 
 void QmitkDataStorageSimpleTreeModel::ResetTree()
 {
   mitk::DataNode::Pointer rootDataNode = mitk::DataNode::New();
   rootDataNode->SetName("Data Storage");
   m_Root = new TreeItem(rootDataNode, nullptr);
 }
 
 void QmitkDataStorageSimpleTreeModel::DataStorageChanged()
 {
   if (m_Root)
   {
     m_Root->Delete();
   }
 
   beginResetModel();
   ResetTree();
   UpdateModelData();
   endResetModel();
 }
 
 void QmitkDataStorageSimpleTreeModel::NodePredicateChanged()
 {
   beginResetModel();
   ResetTree();
   UpdateModelData();
   endResetModel();
 }
 
 void QmitkDataStorageSimpleTreeModel::NodeAdded(const mitk::DataNode *node)
 {
   auto dataStorage = m_DataStorage.Lock();
 
   if (node == nullptr || dataStorage.IsNull() || !dataStorage->Exists(node) ||
       m_Root->Find(node) != nullptr)
     return;
 
   if (m_NodePredicate.IsNull() || m_NodePredicate->CheckNode(node))
   {
     this->AddNodeInternal(node);
   }
 }
 
 void QmitkDataStorageSimpleTreeModel::NodeChanged(const mitk::DataNode *node)
 {
   TreeItem *treeItem = m_Root->Find(node);
   if (treeItem)
   {
     TreeItem *parentTreeItem = treeItem->GetParent();
     // as the root node should not be removed one should always have a parent item
     if (!parentTreeItem)
       return;
     QModelIndex index = this->createIndex(treeItem->GetIndex(), 0, treeItem);
 
     // now emit the dataChanged signal
     emit dataChanged(index, index);
   }
 }
 
 void QmitkDataStorageSimpleTreeModel::NodeRemoved(const mitk::DataNode *node)
 {
   if (node == nullptr || !m_Root)
     return;
 
   TreeItem *treeItem = m_Root->Find(node);
   if (!treeItem)
     return; // return because there is no treeitem containing this node
 
   TreeItem *parentTreeItem = treeItem->GetParent();
   QModelIndex parentIndex = this->IndexFromTreeItem(parentTreeItem);
 
   // emit beginRemoveRows event (QModelIndex is empty because we dont have a tree model)
   this->beginRemoveRows(parentIndex, treeItem->GetIndex(), treeItem->GetIndex());
 
   // remove node
   std::vector<TreeItem *> children = treeItem->GetChildren();
   m_TreeItems.remove(treeItem);
   delete treeItem; //delete in tree
 
   if (!children.empty())
   {
     //if not empty we have to rebuild the whole representation,
     //because the children could be now top level, or at another
     //source/parent.
     this->UpdateModelData();
   }
 }
 
 QModelIndex QmitkDataStorageSimpleTreeModel::index(int row, int column, const QModelIndex &parent) const
 {
   TreeItem *parentItem;
 
   if (!parent.isValid() || parent.model() != this)
     parentItem = m_Root;
   else
     parentItem = static_cast<TreeItem *>(parent.internalPointer());
 
   if (parentItem)
   {
     TreeItem *childItem = parentItem->GetChild(row);
     if (childItem)
       return createIndex(row, column, childItem);
   }
 
   return QModelIndex();
 }
 
 QModelIndex QmitkDataStorageSimpleTreeModel::parent(const QModelIndex &child) const
 {
   if (!child.isValid() || !m_Root || child.model() != this)
     return QModelIndex();
 
   TreeItem *childItem = this->TreeItemFromIndex(child);
 
   if (!childItem)
     return QModelIndex();
 
   TreeItem *parentItem = childItem->GetParent();
 
   if (parentItem == m_Root)
     return QModelIndex();
 
   return this->createIndex(parentItem->GetIndex(), 0, parentItem);
 }
 
 QmitkDataStorageSimpleTreeModel::TreeItem *QmitkDataStorageSimpleTreeModel::TreeItemFromIndex(
   const QModelIndex &index) const
 {
   if (index.isValid() && index.model() == this)
   {
     auto item = static_cast<TreeItem *>(index.internalPointer());
     auto finding = std::find(std::begin(m_TreeItems), std::end(m_TreeItems), item);
     if (finding == std::end(m_TreeItems))
     {
       return nullptr;
     }
     return item;
   }
   else
     return m_Root;
 }
 
 int QmitkDataStorageSimpleTreeModel::rowCount(const QModelIndex &parent) const
 {
   TreeItem *parentTreeItem = this->TreeItemFromIndex(parent);
   if (parentTreeItem)
     return parentTreeItem->GetChildCount();
   else
     return 0;
 }
 
 int QmitkDataStorageSimpleTreeModel::columnCount(const QModelIndex &/*parent*/) const
 {
   return 1;
 }
 
 QVariant QmitkDataStorageSimpleTreeModel::data(const QModelIndex &index, int role) const
 {
   if (!index.isValid() || index.model() != this)
   {
     return QVariant();
   }
 
   auto treeItem = this->TreeItemFromIndex(index);
   if (!treeItem)
     return QVariant();
 
   mitk::DataNode *dataNode = treeItem->GetDataNode();
 
+  // No need to access dataNode if that is pointing to nullptr, it will always give segfault
+  if (!dataNode)
+    return QModelIndex();
+
   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();
 }
 
 bool QmitkDataStorageSimpleTreeModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
   if (!index.isValid() || index.model() != this)
     return false;
 
   auto treeItem = this->TreeItemFromIndex(index);
   if (!treeItem)
     return false;
 
   mitk::DataNode *dataNode = treeItem->GetDataNode();
   if (!dataNode)
     return false;
 
   if (role == Qt::EditRole && !value.toString().isEmpty())
   {
     dataNode->SetName(value.toString().toStdString().c_str());
   }
   else if (role == Qt::CheckStateRole)
   {
     // Please note: value.toInt() returns 2, independentely from the actual checkstate of the index element.
     // Therefore the checkstate is being estimated again here.
 
     QVariant qcheckstate = index.data(Qt::CheckStateRole);
     int checkstate = qcheckstate.toInt();
     bool isVisible = bool(checkstate);
     dataNode->SetVisibility(!isVisible);
   }
   // inform listeners about changes
   emit dataChanged(index, index);
   return true;
 }
 
 QVariant QmitkDataStorageSimpleTreeModel::headerData(int /*section*/, Qt::Orientation orientation, int role) const
 {
   if (orientation == Qt::Horizontal && role == Qt::DisplayRole && m_Root)
     return QString::fromStdString(m_Root->GetDataNode()->GetName());
 
   return QVariant();
 }
 
 Qt::ItemFlags QmitkDataStorageSimpleTreeModel::flags(const QModelIndex &index) const
 {
   if (index.isValid() && index.model() == this)
   {
     auto treeItem = this->TreeItemFromIndex(index);
     if (!treeItem)
       return Qt::NoItemFlags;
 
     const auto dataNode = treeItem->GetDataNode();
     if (m_NodePredicate.IsNull() || m_NodePredicate->CheckNode(dataNode))
     {
       return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
     }
     else
     {
       return Qt::NoItemFlags;
     }
 
   }
 
   return Qt::NoItemFlags;
 }
 
 mitk::DataNode *QmitkDataStorageSimpleTreeModel::GetParentNode(const mitk::DataNode *node) const
 {
   mitk::DataNode *dataNode = nullptr;
 
   mitk::DataStorage::SetOfObjects::ConstPointer _Sources = m_DataStorage.Lock()->GetSources(node);
 
   if (_Sources->Size() > 0)
     dataNode = _Sources->front();
 
   return dataNode;
 }
 
 void QmitkDataStorageSimpleTreeModel::AddNodeInternal(const mitk::DataNode *node)
 {
   auto dataStorage = m_DataStorage.Lock();
 
   if (node == nullptr || dataStorage.IsNull() || !dataStorage->Exists(node) || m_Root->Find(node) != nullptr)
     return;
 
   // find out if we have a root node
   TreeItem *parentTreeItem = m_Root;
   QModelIndex index;
   mitk::DataNode *parentDataNode = this->GetParentNode(node);
 
   if (parentDataNode) // no top level data node
   {
     parentTreeItem = m_Root->Find(parentDataNode); // find the corresponding tree item
     if (!parentTreeItem)
     {
       this->NodeAdded(parentDataNode);
       parentTreeItem = m_Root->Find(parentDataNode);
       if (!parentTreeItem)
         return;
     }
 
     // get the index of this parent with the help of the grand parent
     index = this->createIndex(parentTreeItem->GetIndex(), 0, parentTreeItem);
   }
 
   int firstRowWithASiblingBelow = 0;
   int nodeLayer = -1;
   node->GetIntProperty("layer", nodeLayer);
   for (TreeItem *siblingTreeItem : parentTreeItem->GetChildren())
   {
     int siblingLayer = -1;
     if (mitk::DataNode *siblingNode = siblingTreeItem->GetDataNode())
     {
       siblingNode->GetIntProperty("layer", siblingLayer);
     }
     if (nodeLayer > siblingLayer)
     {
       break;
     }
     ++firstRowWithASiblingBelow;
   }
   beginInsertRows(index, firstRowWithASiblingBelow, firstRowWithASiblingBelow);
   auto newNode = new TreeItem(const_cast<mitk::DataNode *>(node));
   parentTreeItem->InsertChild(newNode, firstRowWithASiblingBelow);
   m_TreeItems.push_back(newNode);
 
   endInsertRows();
 }
 
 QModelIndex QmitkDataStorageSimpleTreeModel::IndexFromTreeItem(TreeItem *item) const
 {
   if (item == m_Root)
     return QModelIndex();
   else
     return this->createIndex(item->GetIndex(), 0, item);
 }
 
 void QmitkDataStorageSimpleTreeModel::UpdateModelData()
 {
   auto dataStorage = m_DataStorage.Lock();
 
   if (dataStorage.IsNotNull())
   {
     auto nodeset = m_NodePredicate != nullptr
       ? dataStorage->GetSubset(m_NodePredicate)
       : dataStorage->GetAll();
 
     for (const auto& node : *nodeset)
     {
       this->AddNodeInternal(node);
     }
   }
 }
diff --git a/Modules/QtWidgets/src/QmitkLevelWindowWidget.cpp b/Modules/QtWidgets/src/QmitkLevelWindowWidget.cpp
index 422c98ccaf..6e04d83594 100644
--- a/Modules/QtWidgets/src/QmitkLevelWindowWidget.cpp
+++ b/Modules/QtWidgets/src/QmitkLevelWindowWidget.cpp
@@ -1,33 +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 "QmitkLevelWindowWidget.h"
 #include "QmitkSliderLevelWindowWidget.h"
 
-QmitkLevelWindowWidget::QmitkLevelWindowWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f)
+#include <ui_QmitkLevelWindowWidget.h>
+
+QmitkLevelWindowWidget::QmitkLevelWindowWidget(QWidget *parent, Qt::WindowFlags f)
+  : QWidget(parent, f), ui(new Ui::QmitkLevelWindow)
 {
-  this->setupUi(this);
+  ui->setupUi(this);
 
   m_Manager = mitk::LevelWindowManager::New();
 
-  SliderLevelWindowWidget->SetLevelWindowManager(m_Manager.GetPointer());
-  LineEditLevelWindowWidget->SetLevelWindowManager(m_Manager.GetPointer());
+  ui->SliderLevelWindowWidget->SetLevelWindowManager(m_Manager.GetPointer());
+  ui->LineEditLevelWindowWidget->SetLevelWindowManager(m_Manager.GetPointer());
+}
+
+QmitkLevelWindowWidget::~QmitkLevelWindowWidget()
+{
+     delete ui;
 }
 
 void QmitkLevelWindowWidget::SetDataStorage(mitk::DataStorage *ds)
 {
   m_Manager->SetDataStorage(ds);
 }
 
 mitk::LevelWindowManager *QmitkLevelWindowWidget::GetManager()
 {
   return m_Manager.GetPointer();
 }
diff --git a/Modules/Segmentation/Interactions/mitkProcessExecutor.h b/Modules/Segmentation/Interactions/mitkProcessExecutor.h
index 56aaed7dde..f67567de25 100644
--- a/Modules/Segmentation/Interactions/mitkProcessExecutor.h
+++ b/Modules/Segmentation/Interactions/mitkProcessExecutor.h
@@ -1,116 +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 mitkProcessExecutor_h
 #define mitkProcessExecutor_h
 
 #include <MitkSegmentationExports.h>
 #include <itkObject.h>
 #include <vector>
 #include <itksys/Process.h>
 
 namespace mitk
 {
   // Class is adapted from MatchPoint ProcessExecutor
 
   class ExternalProcessOutputEvent : public itk::AnyEvent
   {
   public:
     typedef ExternalProcessOutputEvent Self;
     typedef itk::AnyEvent Superclass;
 
     explicit ExternalProcessOutputEvent(const std::string &output = "") : m_Output(output) {}
     ~ExternalProcessOutputEvent() override {}
 
     const char *GetEventName() const override { return "ExternalProcessOutputEvent"; }
     bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
     itk::EventObject *MakeObject() const override { return new Self(m_Output); }
     std::string GetOutput() const { return m_Output; }
 
   private:
     std::string m_Output;
   };
 
 #define mitkProcessExecutorEventMacro(classname)                                                                       \
   class classname : public ExternalProcessOutputEvent                                                                  \
   {                                                                                                                    \
   public:                                                                                                              \
     typedef classname Self;                                                                                            \
     typedef ExternalProcessOutputEvent Superclass;                                                                     \
                                                                                                                        \
     explicit classname(const std::string &output) : Superclass(output) {}                                              \
     ~classname() override {}                                                                                           \
                                                                                                                        \
     virtual const char *GetEventName() const { return #classname; }                                                    \
     virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); }               \
     virtual ::itk::EventObject *MakeObject() const { return new Self(this->GetOutput()); }                             \
   };
 
   mitkProcessExecutorEventMacro(ExternalProcessStdOutEvent);
   mitkProcessExecutorEventMacro(ExternalProcessStdErrEvent);
 
   /**
    * @brief You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or
    * ExternalProcessStdErrEvent in order to get notified of any output.
    * @remark The events will only be invoked if the pipes are NOT(!) shared. By default the pipes are not shared.
    *
    */
   class MITKSEGMENTATION_EXPORT ProcessExecutor : public itk::Object
   {
   public:
     using Self = ProcessExecutor;
     using Superclass = ::itk::Object;
     using Pointer = ::itk::SmartPointer<Self>;
     using ConstPointer = ::itk::SmartPointer<const Self>;
 
     itkTypeMacro(ProcessExecutor, ::itk::Object);
     itkFactorylessNewMacro(Self);
 
     itkSetMacro(SharedOutputPipes, bool);
     itkGetConstMacro(SharedOutputPipes, bool);
 
     using ArgumentListType = std::vector<std::string>;
 
     bool Execute(const std::string &executionPath, const std::string &executableName, ArgumentListType &argumentList);
 
     /**
      * @brief Executes the process. This version assumes that the executable name is the first argument in the argument
      * list and has already been converted to its OS dependent name via the static convert function of this class.
      */
-    bool Execute(const std::string &executionPath, const ArgumentListType &argumentList);
+    virtual bool Execute(const std::string &executionPath, const ArgumentListType &argumentList);
 
     int GetExitValue();
     static std::string EnsureCorrectOSPathSeparator(const std::string &);
 
     static std::string GetOSDependendExecutableName(const std::string &name);
 
     void KillProcess();
 
   protected:
     ProcessExecutor();
     ~ProcessExecutor() override;
 
     int m_ExitValue;
 
     /**
      * @brief Specifies if the child process should share the output pipes (true) or not (false).
      * If pipes are not shared the output will be passed by invoking ExternalProcessOutputEvents
      * @remark The events will only be invoked if the pipes are NOT(!) shared.
      */
     bool m_SharedOutputPipes;
 
   private:
     itksysProcess *m_ProcessID = nullptr;
   };
 
 } // namespace mitk
 #endif
diff --git a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.cpp b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.cpp
index 9ff48f4df5..77ffb417cd 100644
--- a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.cpp
+++ b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.cpp
@@ -1,819 +1,842 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "mitkSegWithPreviewTool.h"
 
 #include "mitkToolManager.h"
 
 #include "mitkColorProperty.h"
 #include "mitkProperties.h"
 
 #include "mitkDataStorage.h"
 #include "mitkRenderingManager.h"
 #include <mitkTimeNavigationController.h>
 
 #include "mitkImageAccessByItk.h"
 #include "mitkImageCast.h"
 #include "mitkLabelSetImage.h"
 #include "mitkMaskAndCutRoiImageFilter.h"
 #include "mitkPadImageFilter.h"
 #include "mitkNodePredicateGeometry.h"
 #include "mitkSegTool2D.h"
 
 mitk::SegWithPreviewTool::SegWithPreviewTool(bool lazyDynamicPreviews): Tool("dummy"), m_LazyDynamicPreviews(lazyDynamicPreviews)
 {
   m_ProgressCommand = ToolCommand::New();
 }
 
 mitk::SegWithPreviewTool::SegWithPreviewTool(bool lazyDynamicPreviews, const char* interactorType, const us::Module* interactorModule) : Tool(interactorType, interactorModule), m_LazyDynamicPreviews(lazyDynamicPreviews)
 {
   m_ProgressCommand = ToolCommand::New();
 }
 
 mitk::SegWithPreviewTool::~SegWithPreviewTool()
 {
 }
 
 void mitk::SegWithPreviewTool::SetMergeStyle(MultiLabelSegmentation::MergeStyle mergeStyle)
 {
   m_MergeStyle = mergeStyle;
   this->Modified();
 }
 
 void mitk::SegWithPreviewTool::SetOverwriteStyle(MultiLabelSegmentation::OverwriteStyle overwriteStyle)
 {
   m_OverwriteStyle = overwriteStyle;
   this->Modified();
 }
 
 void mitk::SegWithPreviewTool::SetLabelTransferScope(LabelTransferScope labelTransferScope)
 {
   m_LabelTransferScope = labelTransferScope;
   this->Modified();
 }
 
 void mitk::SegWithPreviewTool::SetLabelTransferMode(LabelTransferMode labelTransferMode)
 {
   m_LabelTransferMode = labelTransferMode;
   this->Modified();
 }
 
 void mitk::SegWithPreviewTool::SetSelectedLabels(const SelectedLabelVectorType& labelsToTransfer)
 {
   m_SelectedLabels = labelsToTransfer;
   this->Modified();
 }
 
 bool mitk::SegWithPreviewTool::CanHandle(const BaseData* referenceData, const BaseData* workingData) const
 {
   if (!Superclass::CanHandle(referenceData, workingData))
     return false;
 
   if (workingData == nullptr)
     return false;
 
   auto* referenceImage = dynamic_cast<const Image*>(referenceData);
   if (referenceImage == nullptr)
     return false;
 
   auto* labelSet = dynamic_cast<const LabelSetImage*>(workingData);
   if (labelSet != nullptr)
     return true;
 
   auto* workingImage = dynamic_cast<const Image*>(workingData);
   if (workingImage == nullptr)
     return false;
 
   // If the working image is a normal image and not a label set image
   // it must have the same pixel type as a label set.
   return MakeScalarPixelType< DefaultSegmentationDataType >() == workingImage->GetPixelType();
 }
 
 void mitk::SegWithPreviewTool::Activated()
 {
   Superclass::Activated();
 
   this->GetToolManager()->RoiDataChanged +=
     MessageDelegate<SegWithPreviewTool>(this, &SegWithPreviewTool::OnRoiDataChanged);
 
   this->GetToolManager()->SelectedTimePointChanged +=
     MessageDelegate<SegWithPreviewTool>(this, &SegWithPreviewTool::OnTimePointChanged);
 
   m_ReferenceDataNode = this->GetToolManager()->GetReferenceData(0);
   m_SegmentationInputNode = m_ReferenceDataNode;
 
   m_LastTimePointOfUpdate = RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
 
   if (m_PreviewSegmentationNode.IsNull())
   {
     m_PreviewSegmentationNode = DataNode::New();
     m_PreviewSegmentationNode->SetProperty("color", ColorProperty::New(0.0, 1.0, 0.0));
     m_PreviewSegmentationNode->SetProperty("name", StringProperty::New(std::string(this->GetName())+" preview"));
     m_PreviewSegmentationNode->SetProperty("opacity", FloatProperty::New(0.3));
     m_PreviewSegmentationNode->SetProperty("binary", BoolProperty::New(true));
     m_PreviewSegmentationNode->SetProperty("helper object", BoolProperty::New(true));
   }
 
   if (m_SegmentationInputNode.IsNotNull())
   {
     this->ResetPreviewNode();
     this->InitiateToolByInput();
   }
   else
   {
     this->GetToolManager()->ActivateTool(-1);
   }
 }
 
 void mitk::SegWithPreviewTool::Deactivated()
 {
   this->GetToolManager()->RoiDataChanged -=
     MessageDelegate<SegWithPreviewTool>(this, &SegWithPreviewTool::OnRoiDataChanged);
 
   this->GetToolManager()->SelectedTimePointChanged -=
     MessageDelegate<SegWithPreviewTool>(this, &SegWithPreviewTool::OnTimePointChanged);
 
   m_SegmentationInputNode = nullptr;
   m_ReferenceDataNode = nullptr;
   m_WorkingPlaneGeometry = nullptr;
 
   try
   {
     if (DataStorage *storage = this->GetToolManager()->GetDataStorage())
     {
       storage->Remove(m_PreviewSegmentationNode);
       RenderingManager::GetInstance()->RequestUpdateAll();
     }
   }
   catch (...)
   {
     // don't care
   }
 
   if (m_PreviewSegmentationNode.IsNotNull())
   {
     m_PreviewSegmentationNode->SetData(nullptr);
   }
 
   Superclass::Deactivated();
 }
 
 void mitk::SegWithPreviewTool::ConfirmSegmentation()
 {
   bool labelChanged = this->EnsureUpToDateUserDefinedActiveLabel();
   if ((m_LazyDynamicPreviews && m_CreateAllTimeSteps) || labelChanged)
   { // The tool should create all time steps but is currently in lazy mode,
     // thus ensure that a preview for all time steps is available.
     this->UpdatePreview(true);
   }
 
   CreateResultSegmentationFromPreview();
 
   RenderingManager::GetInstance()->RequestUpdateAll();
 
   if (!m_KeepActiveAfterAccept)
   {
     this->GetToolManager()->ActivateTool(-1);
   }
+  this->ConfirmCleanUp();
 }
 
 void  mitk::SegWithPreviewTool::InitiateToolByInput()
 {
   //default implementation does nothing.
   //implement in derived classes to change behavior
 }
 
 mitk::LabelSetImage* mitk::SegWithPreviewTool::GetPreviewSegmentation()
 {
   if (m_PreviewSegmentationNode.IsNull())
   {
     return nullptr;
   }
 
   return dynamic_cast<LabelSetImage*>(m_PreviewSegmentationNode->GetData());
 }
 
 const mitk::LabelSetImage* mitk::SegWithPreviewTool::GetPreviewSegmentation() const
 {
   if (m_PreviewSegmentationNode.IsNull())
   {
     return nullptr;
   }
 
   return dynamic_cast<LabelSetImage*>(m_PreviewSegmentationNode->GetData());
 }
 
 mitk::DataNode* mitk::SegWithPreviewTool::GetPreviewSegmentationNode()
 {
   return m_PreviewSegmentationNode;
 }
 
 const mitk::Image* mitk::SegWithPreviewTool::GetSegmentationInput() const
 {
   if (m_SegmentationInputNode.IsNull())
   {
     return nullptr;
   }
 
   return dynamic_cast<const Image*>(m_SegmentationInputNode->GetData());
 }
 
 const mitk::Image* mitk::SegWithPreviewTool::GetReferenceData() const
 {
   if (m_ReferenceDataNode.IsNull())
   {
     return nullptr;
   }
 
   return dynamic_cast<const Image*>(m_ReferenceDataNode->GetData());
 }
 
 template <typename ImageType>
 void ClearBufferProcessing(ImageType* itkImage)
 {
   itkImage->FillBuffer(0);
 }
 
 void mitk::SegWithPreviewTool::ResetPreviewContentAtTimeStep(unsigned int timeStep)
 {
   auto previewImage = GetImageByTimeStep(this->GetPreviewSegmentation(), timeStep);
   if (nullptr != previewImage)
   {
     AccessByItk(previewImage, ClearBufferProcessing);
   }
 }
 
 void mitk::SegWithPreviewTool::ResetPreviewContent()
 {
   auto previewImage = this->GetPreviewSegmentation();
   if (nullptr != previewImage)
   {
     auto castedPreviewImage =
       dynamic_cast<LabelSetImage*>(previewImage);
     if (nullptr == castedPreviewImage) mitkThrow() << "Application is on wrong state / invalid tool implementation. Preview image should always be of type LabelSetImage now.";
     castedPreviewImage->ClearBuffer();
   }
 }
 
 void mitk::SegWithPreviewTool::ResetPreviewNode()
 {
   if (m_IsUpdating)
   {
     mitkThrow() << "Used tool is implemented incorrectly. ResetPreviewNode is called while preview update is ongoing. Check implementation!";
   }
 
   itk::RGBPixel<float> previewColor;
   previewColor[0] = 0.0f;
   previewColor[1] = 1.0f;
   previewColor[2] = 0.0f;
 
   const auto image = this->GetSegmentationInput();
   if (nullptr != image)
   {
     LabelSetImage::ConstPointer workingImage =
       dynamic_cast<const LabelSetImage *>(this->GetToolManager()->GetWorkingData(0)->GetData());
 
     if (workingImage.IsNotNull())
     {
       auto newPreviewImage = workingImage->Clone();
       if (this->GetResetsToEmptyPreview())
       {
         newPreviewImage->ClearBuffer();
       }
 
       if (newPreviewImage.IsNull())
       {
         MITK_ERROR << "Cannot create preview helper objects. Unable to clone working image";
         return;
       }
 
       m_PreviewSegmentationNode->SetData(newPreviewImage);
 
       auto* activeLabelSet = newPreviewImage->GetActiveLabelSet();
       if (nullptr == activeLabelSet)
       {
         newPreviewImage->AddLayer();
         activeLabelSet = newPreviewImage->GetActiveLabelSet();
       }
 
       auto* activeLabel = activeLabelSet->GetActiveLabel();
       if (nullptr == activeLabel)
       {
         activeLabel = activeLabelSet->AddLabel("toolresult", previewColor);
         activeLabelSet = newPreviewImage->GetActiveLabelSet();
         activeLabelSet->UpdateLookupTable(activeLabel->GetValue());
       }
       else if (m_UseSpecialPreviewColor)
       {
         // Let's paint the feedback node green...
         activeLabel->SetColor(previewColor);
         activeLabelSet->UpdateLookupTable(activeLabel->GetValue());
       }
       activeLabel->SetVisible(true);
     }
     else
     {
       Image::ConstPointer workingImageBin = dynamic_cast<const Image*>(this->GetToolManager()->GetWorkingData(0)->GetData());
       if (workingImageBin.IsNotNull())
       {
         Image::Pointer newPreviewImage;
         if (this->GetResetsToEmptyPreview())
         {
           newPreviewImage = Image::New();
           newPreviewImage->Initialize(workingImageBin);
         }
         else
         {
           auto newPreviewImage = workingImageBin->Clone();
         }
         if (newPreviewImage.IsNull())
         {
           MITK_ERROR << "Cannot create preview helper objects. Unable to clone working image";
           return;
         }
         m_PreviewSegmentationNode->SetData(newPreviewImage);
       }
       else
       {
         mitkThrow() << "Tool is an invalid state. Cannot setup preview node. Working data is an unsupported class and should have not been accepted by CanHandle().";
       }
     }
 
     m_PreviewSegmentationNode->SetColor(previewColor);
     m_PreviewSegmentationNode->SetOpacity(0.5);
 
     int layer(50);
     m_ReferenceDataNode->GetIntProperty("layer", layer);
     m_PreviewSegmentationNode->SetIntProperty("layer", layer + 1);
 
     if (DataStorage *ds = this->GetToolManager()->GetDataStorage())
     {
       if (!ds->Exists(m_PreviewSegmentationNode))
         ds->Add(m_PreviewSegmentationNode, m_ReferenceDataNode);
     }
   }
 }
 
 mitk::SegWithPreviewTool::LabelMappingType mitk::SegWithPreviewTool::GetLabelMapping() const
 {
   LabelSetImage::LabelValueType offset = 0;
   
   if (LabelTransferMode::AddLabel == m_LabelTransferMode && LabelTransferScope::ActiveLabel!=m_LabelTransferScope)
   {
     //If we are not just working on active label and transfer mode is add, we need to compute an offset for adding the
     //preview labels instat of just mapping them to existing segmentation labels.
     const auto segmentation = this->GetTargetSegmentation();
     if (nullptr == segmentation)
       mitkThrow() << "Invalid state of SegWithPreviewTool. Cannot GetLabelMapping if no target segmentation is set.";
 
     auto labels = segmentation->GetLabels();
     auto maxLabelIter = std::max_element(std::begin(labels), std::end(labels), [](const Label::Pointer& a, const Label::Pointer& b) {
       return a->GetValue() < b->GetValue();
     });
 
     if (maxLabelIter != labels.end())
     {
       offset = maxLabelIter->GetPointer()->GetValue();
     }
   }
 
   LabelMappingType labelMapping = {};
 
   switch (this->m_LabelTransferScope)
   {
     case LabelTransferScope::SelectedLabels:
       {
         for (auto label : this->m_SelectedLabels)
         {
           labelMapping.push_back({label, label + offset});
         }
       }
       break;
     case LabelTransferScope::AllLabels:
       {
         const auto labelSet = this->GetPreviewSegmentation()->GetActiveLabelSet();
         for (auto labelIter = labelSet->IteratorConstBegin(); labelIter != labelSet->IteratorConstEnd(); ++labelIter)
         {
         labelMapping.push_back({labelIter->second->GetValue(), labelIter->second->GetValue() + offset});
         }
       }
       break;
     default:
       {
         if (m_SelectedLabels.empty())
           mitkThrow() << "Failed to generate label transfer mapping. Tool is in an invalid state, as "
                          "LabelTransferScope==ActiveLabel but no label is indicated as selected label. Check "
                          "implementation of derived tool class.";
         if (m_SelectedLabels.size() > 1)
         mitkThrow() << "Failed to generate label transfer mapping. Tool is in an invalid state, as "
                        "LabelTransferScope==ActiveLabel but more then one selected label is indicated."
                        "Should be only one. Check implementation of derived tool class.";
         labelMapping.push_back({m_SelectedLabels.front(), this->GetUserDefinedActiveLabel()});
       }
       break;
   }
 
   return labelMapping;
 }
 
 void mitk::SegWithPreviewTool::TransferImageAtTimeStep(const Image* sourceImage, Image* destinationImage, const TimeStepType timeStep, const LabelMappingType& labelMapping)
 {
   try
   {
     Image::ConstPointer sourceImageAtTimeStep = this->GetImageByTimeStep(sourceImage, timeStep);
 
     if (sourceImageAtTimeStep->GetPixelType() != destinationImage->GetPixelType())
     {
       mitkThrow() << "Cannot transfer images. Tool is in an invalid state, source image and destination image do not have the same pixel type. "
         << "Source pixel type: " << sourceImage->GetPixelType().GetTypeAsString()
         << "; destination pixel type: " << destinationImage->GetPixelType().GetTypeAsString();
     }
 
     if (!Equal(*(sourceImage->GetGeometry(timeStep)), *(destinationImage->GetGeometry(timeStep)), NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION, NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION, false))
     {
       mitkThrow() << "Cannot transfer images. Tool is in an invalid state, source image and destination image do not have the same geometry.";
     }
 
     if (nullptr != this->GetWorkingPlaneGeometry())
     {
       auto sourceSlice = SegTool2D::GetAffectedImageSliceAs2DImage(this->GetWorkingPlaneGeometry(), sourceImage, timeStep);
-      SegTool2D::WriteBackSegmentationResult(this->GetTargetSegmentationNode(), m_WorkingPlaneGeometry, sourceSlice, timeStep);
+      auto resultSlice =
+        SegTool2D::GetAffectedImageSliceAs2DImage(this->GetWorkingPlaneGeometry(), destinationImage, timeStep)->Clone();
+      auto destLSImage = dynamic_cast<LabelSetImage *>(destinationImage);
+      //We need to transfer explictly to a copy of the current working image to ensure that labelMapping is done and things
+      //like merge style, overwrite style and locks are regarded.
+      TransferLabelContentAtTimeStep(sourceSlice,
+                                     resultSlice,
+                                     destLSImage->GetActiveLabelSet(),
+                                     timeStep,
+                                     0,
+                                     0,
+                                     destLSImage->GetUnlabeledLabelLock(),
+                                     labelMapping,
+                                     m_MergeStyle,
+                                     m_OverwriteStyle);
+      //We use WriteBackSegmentationResult to ensure undo/redo is supported also by derived tools of this class.
+      SegTool2D::WriteBackSegmentationResult(this->GetTargetSegmentationNode(), m_WorkingPlaneGeometry, resultSlice, timeStep);
     }
     else
     { //take care of the full segmentation volume
       auto sourceLSImage = dynamic_cast<const LabelSetImage*>(sourceImage);
       auto destLSImage = dynamic_cast<LabelSetImage*>(destinationImage);
 
       TransferLabelContentAtTimeStep(sourceLSImage, destLSImage, timeStep, labelMapping, m_MergeStyle, m_OverwriteStyle);
     }
   }
   catch (mitk::Exception& e)
   {
     Tool::ErrorMessage(e.GetDescription());
     mitkReThrow(e);
   }
 }
 
 void mitk::SegWithPreviewTool::CreateResultSegmentationFromPreview()
 {
   const auto segInput = this->GetSegmentationInput();
   auto previewImage = this->GetPreviewSegmentation();
   if (nullptr != segInput && nullptr != previewImage)
   {
     DataNode::Pointer resultSegmentationNode = GetTargetSegmentationNode();
 
     if (resultSegmentationNode.IsNotNull())
     {
       const TimePointType timePoint = RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
       auto resultSegmentation = dynamic_cast<Image*>(resultSegmentationNode->GetData());
 
       // REMARK: the following code in this scope assumes that previewImage and resultSegmentation
       // are clones of the working referenceImage (segmentation provided to the tool). Therefore they have
       // the same time geometry.
       if (previewImage->GetTimeSteps() != resultSegmentation->GetTimeSteps())
       {
         mitkThrow() << "Cannot confirm/transfer segmentation. Internal tool state is invalid."
           << " Preview segmentation and segmentation result image have different time geometries.";
       }
 
       auto labelMapping = this->GetLabelMapping();
       this->PreparePreviewToResultTransfer(labelMapping);
       if (m_CreateAllTimeSteps)
       {
         for (unsigned int timeStep = 0; timeStep < previewImage->GetTimeSteps(); ++timeStep)
         {
           this->TransferImageAtTimeStep(previewImage, resultSegmentation, timeStep, labelMapping);
         }
       }
       else
       {
         const auto timeStep = resultSegmentation->GetTimeGeometry()->TimePointToTimeStep(timePoint);
         this->TransferImageAtTimeStep(previewImage, resultSegmentation, timeStep, labelMapping);
       }
 
       // since we are maybe working on a smaller referenceImage, pad it to the size of the original referenceImage
       if (m_ReferenceDataNode.GetPointer() != m_SegmentationInputNode.GetPointer())
       {
         PadImageFilter::Pointer padFilter = PadImageFilter::New();
 
         padFilter->SetInput(0, resultSegmentation);
         padFilter->SetInput(1, dynamic_cast<Image*>(m_ReferenceDataNode->GetData()));
         padFilter->SetBinaryFilter(true);
         padFilter->SetUpperThreshold(1);
         padFilter->SetLowerThreshold(1);
         padFilter->Update();
 
         resultSegmentationNode->SetData(padFilter->GetOutput());
       }
       this->EnsureTargetSegmentationNodeInDataStorage();
     }
   }
 }
 
 void mitk::SegWithPreviewTool::OnRoiDataChanged()
 {
   DataNode::ConstPointer node = this->GetToolManager()->GetRoiData(0);
 
   if (node.IsNotNull())
   {
     MaskAndCutRoiImageFilter::Pointer roiFilter = MaskAndCutRoiImageFilter::New();
     Image::Pointer image = dynamic_cast<Image *>(m_SegmentationInputNode->GetData());
 
     if (image.IsNull())
       return;
 
     roiFilter->SetInput(image);
     roiFilter->SetRegionOfInterest(node->GetData());
     roiFilter->Update();
 
     DataNode::Pointer tmpNode = DataNode::New();
     tmpNode->SetData(roiFilter->GetOutput());
 
     m_SegmentationInputNode = tmpNode;
   }
   else
     m_SegmentationInputNode = m_ReferenceDataNode;
 
   this->ResetPreviewNode();
   this->InitiateToolByInput();
   this->UpdatePreview();
 }
 
 void mitk::SegWithPreviewTool::OnTimePointChanged()
 {
   if (m_IsTimePointChangeAware && m_PreviewSegmentationNode.IsNotNull() && m_SegmentationInputNode.IsNotNull())
   {
     const TimePointType timePoint = RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
 
     const bool isStaticSegOnDynamicImage = m_PreviewSegmentationNode->GetData()->GetTimeSteps() == 1 && m_SegmentationInputNode->GetData()->GetTimeSteps() > 1;
     if (timePoint!=m_LastTimePointOfUpdate && (isStaticSegOnDynamicImage || m_LazyDynamicPreviews))
     { //we only need to update either because we are lazzy
       //or because we have a static segmentation with a dynamic referenceImage 
       this->UpdatePreview();
     }
   }
 }
 
 bool mitk::SegWithPreviewTool::EnsureUpToDateUserDefinedActiveLabel()
 {
   bool labelChanged = true;
 
   const auto workingImage = dynamic_cast<const Image*>(this->GetToolManager()->GetWorkingData(0)->GetData());
   if (const auto& labelSetImage = dynamic_cast<const LabelSetImage*>(workingImage))
   {
     // this is a fix for T28131 / T28986, which should be refactored if T28524 is being worked on
     auto newLabel = labelSetImage->GetActiveLabel(labelSetImage->GetActiveLayer())->GetValue();
     labelChanged = newLabel != m_UserDefinedActiveLabel;
     m_UserDefinedActiveLabel = newLabel;
   }
   else
   {
     m_UserDefinedActiveLabel = 1;
     labelChanged = false;
   }
   return labelChanged;
 }
 
 void mitk::SegWithPreviewTool::UpdatePreview(bool ignoreLazyPreviewSetting)
 {
   const auto inputImage = this->GetSegmentationInput();
   auto previewImage = this->GetPreviewSegmentation();
   int progress_steps = 200;
 
   const auto workingImage = dynamic_cast<const Image*>(this->GetToolManager()->GetWorkingData(0)->GetData());
   this->EnsureUpToDateUserDefinedActiveLabel();
 
   this->CurrentlyBusy.Send(true);
   m_IsUpdating = true;
 
   this->UpdatePrepare();
 
   const TimePointType timePoint = RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
 
   try
   {
     if (nullptr != inputImage && nullptr != previewImage)
     {
       m_ProgressCommand->AddStepsToDo(progress_steps);
 
       if (previewImage->GetTimeSteps() > 1 && (ignoreLazyPreviewSetting || !m_LazyDynamicPreviews))
       {
         for (unsigned int timeStep = 0; timeStep < previewImage->GetTimeSteps(); ++timeStep)
         {
           Image::ConstPointer feedBackImage;
           Image::ConstPointer currentSegImage;
 
           auto previewTimePoint = previewImage->GetTimeGeometry()->TimeStepToTimePoint(timeStep);
           auto inputTimeStep = inputImage->GetTimeGeometry()->TimePointToTimeStep(previewTimePoint);
 
           if (nullptr != this->GetWorkingPlaneGeometry())
           { //only extract a specific slice defined by the working plane as feedback referenceImage.
             feedBackImage = SegTool2D::GetAffectedImageSliceAs2DImage(this->GetWorkingPlaneGeometry(), inputImage, inputTimeStep);
             currentSegImage = SegTool2D::GetAffectedImageSliceAs2DImageByTimePoint(this->GetWorkingPlaneGeometry(), workingImage, previewTimePoint);
           }
           else
           { //work on the whole feedback referenceImage
             feedBackImage = this->GetImageByTimeStep(inputImage, inputTimeStep);
             currentSegImage = this->GetImageByTimePoint(workingImage, previewTimePoint);
           }
 
           this->DoUpdatePreview(feedBackImage, currentSegImage, previewImage, timeStep);
         }
       }
       else
       {
         Image::ConstPointer feedBackImage;
         Image::ConstPointer currentSegImage;
 
         if (nullptr != this->GetWorkingPlaneGeometry())
         {
           feedBackImage = SegTool2D::GetAffectedImageSliceAs2DImageByTimePoint(this->GetWorkingPlaneGeometry(), inputImage, timePoint);
           currentSegImage = SegTool2D::GetAffectedImageSliceAs2DImageByTimePoint(this->GetWorkingPlaneGeometry(), workingImage, timePoint);
         }
         else
         {
           feedBackImage = this->GetImageByTimePoint(inputImage, timePoint);
           currentSegImage = this->GetImageByTimePoint(workingImage, timePoint);
         }
 
         auto timeStep = previewImage->GetTimeGeometry()->TimePointToTimeStep(timePoint);
 
         this->DoUpdatePreview(feedBackImage, currentSegImage, previewImage, timeStep);
       }
       RenderingManager::GetInstance()->RequestUpdateAll();
     }
   }
   catch (itk::ExceptionObject & excep)
   {
     MITK_ERROR << "Exception caught: " << excep.GetDescription();
 
     m_ProgressCommand->SetProgress(progress_steps);
 
     std::string msg = excep.GetDescription();
     ErrorMessage.Send(msg);
   }
   catch (...)
   {
     m_ProgressCommand->SetProgress(progress_steps);
     m_IsUpdating = false;
     CurrentlyBusy.Send(false);
     throw;
   }
 
   this->UpdateCleanUp();
   m_LastTimePointOfUpdate = timePoint;
   m_ProgressCommand->SetProgress(progress_steps);
   m_IsUpdating = false;
   CurrentlyBusy.Send(false);
 }
 
 bool mitk::SegWithPreviewTool::IsUpdating() const
 {
   return m_IsUpdating;
 }
 
 void mitk::SegWithPreviewTool::UpdatePrepare()
 {
   // default implementation does nothing
   //reimplement in derived classes for special behavior
 }
 
 void mitk::SegWithPreviewTool::UpdateCleanUp()
 {
   // default implementation does nothing
   //reimplement in derived classes for special behavior
 }
 
+void mitk::SegWithPreviewTool::ConfirmCleanUp()
+{
+  // default implementation does nothing
+  // reimplement in derived classes for special behavior
+}
+
 void mitk::SegWithPreviewTool::TransferLabelInformation(const LabelMappingType& labelMapping,
   const mitk::LabelSetImage* source, mitk::LabelSetImage* target)
 {
   for (const auto& [sourceLabel, targetLabel] : labelMapping)
   {
     if (LabelSetImage::UnlabeledValue != sourceLabel &&
         LabelSetImage::UnlabeledValue != targetLabel &&
         !target->ExistLabel(targetLabel, target->GetActiveLayer()))
     {
       if (!source->ExistLabel(sourceLabel, source->GetActiveLayer()))
       {
         mitkThrow() << "Cannot prepare segmentation for preview transfer. Preview seems invalid as label is missing. Missing label: " << sourceLabel;
       }
 
       auto clonedLabel = source->GetLabel(sourceLabel)->Clone();
       clonedLabel->SetValue(targetLabel);
       target->GetActiveLabelSet()->AddLabel(clonedLabel);
     }
   }
 }
 
 void mitk::SegWithPreviewTool::PreparePreviewToResultTransfer(const LabelMappingType& labelMapping)
 {
   DataNode::Pointer resultSegmentationNode = GetTargetSegmentationNode();
 
   if (resultSegmentationNode.IsNotNull())
   {
     auto resultSegmentation = dynamic_cast<LabelSetImage*>(resultSegmentationNode->GetData());
 
     if (nullptr == resultSegmentation)
     {
       mitkThrow() << "Cannot prepare segmentation for preview transfer. Tool is in invalid state as segmentation is not existing or of right type";
     }
 
     auto preview = this->GetPreviewSegmentation();
     TransferLabelInformation(labelMapping, preview, resultSegmentation);
   }
 }
 
 mitk::TimePointType mitk::SegWithPreviewTool::GetLastTimePointOfUpdate() const
 {
   return m_LastTimePointOfUpdate;
 }
 
 mitk::LabelSetImage::LabelValueType mitk::SegWithPreviewTool::GetActiveLabelValueOfPreview() const
 {
   const auto previewImage = this->GetPreviewSegmentation();
   const auto activeLabel = previewImage->GetActiveLabel(previewImage->GetActiveLayer());
   if (nullptr == activeLabel)
     mitkThrow() << this->GetNameOfClass() <<" is in an invalid state, as "
                    "preview has no active label indicated. Check "
                    "implementation of the class.";
 
   return activeLabel->GetValue();
 }
 
 const char* mitk::SegWithPreviewTool::GetGroup() const
 {
   return "autoSegmentation";
 }
 
 mitk::Image::ConstPointer mitk::SegWithPreviewTool::GetImageByTimeStep(const mitk::Image* image, TimeStepType timestep)
 {
   return SelectImageByTimeStep(image, timestep);
 }
 
 mitk::Image::Pointer mitk::SegWithPreviewTool::GetImageByTimeStep(mitk::Image* image, TimeStepType timestep)
 {
   return SelectImageByTimeStep(image, timestep);
 }
 
 mitk::Image::ConstPointer mitk::SegWithPreviewTool::GetImageByTimePoint(const mitk::Image* image, TimePointType timePoint)
 {
   return SelectImageByTimePoint(image, timePoint);
 }
 
 void mitk::SegWithPreviewTool::EnsureTargetSegmentationNodeInDataStorage() const
 {
   auto targetNode = this->GetTargetSegmentationNode();
   auto dataStorage = this->GetToolManager()->GetDataStorage();
   if (!dataStorage->Exists(targetNode))
   {
     dataStorage->Add(targetNode, this->GetToolManager()->GetReferenceData(0));
   }
 }
 
 std::string mitk::SegWithPreviewTool::GetCurrentSegmentationName()
 {
   auto workingData = this->GetToolManager()->GetWorkingData(0);
 
   return nullptr != workingData
     ? workingData->GetName()
     : "";
 }
 
 mitk::DataNode* mitk::SegWithPreviewTool::GetTargetSegmentationNode() const
 {
   return this->GetToolManager()->GetWorkingData(0);
 }
 
 mitk::LabelSetImage* mitk::SegWithPreviewTool::GetTargetSegmentation() const
 {
   auto node = this->GetTargetSegmentationNode();
 
   if (nullptr == node)
     return nullptr;
 
   return dynamic_cast<LabelSetImage*>(node->GetData());
 }
 
 void mitk::SegWithPreviewTool::TransferLabelSetImageContent(const LabelSetImage* source, LabelSetImage* target, TimeStepType timeStep)
 {
   mitk::ImageReadAccessor newMitkImgAcc(source);
 
   LabelMappingType labelMapping;
   const auto labelSet = source->GetActiveLabelSet();
   for (auto labelIter = labelSet->IteratorConstBegin(); labelIter != labelSet->IteratorConstEnd(); ++labelIter)
   {
     labelMapping.push_back({ labelIter->second->GetValue(),labelIter->second->GetValue() });
   }
   TransferLabelInformation(labelMapping, source, target);
 
   target->SetVolume(newMitkImgAcc.GetData(), timeStep);
 }
diff --git a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
index a4141de0b1..109fb9370e 100644
--- a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
+++ b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
@@ -1,321 +1,326 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkSegWithPreviewTool_h
 #define mitkSegWithPreviewTool_h
 
 #include "mitkTool.h"
 #include "mitkCommon.h"
 #include "mitkDataNode.h"
 #include "mitkToolCommand.h"
 #include <MitkSegmentationExports.h>
 
 namespace mitk
 {
   /**
   \brief Base class for any auto segmentation tool that provides a preview of the new segmentation.
 
   This tool class implements a lot basic logic to handle auto segmentation tools with preview,
   Time point and ROI support. Derived classes will ask to update the segmentation preview if needed
   (e.g. because the ROI or the current time point has changed) or because derived tools
   indicated the need to update themselves.
   This class also takes care to properly transfer a confirmed preview into the segementation
   result.
 
   \ingroup ToolManagerEtAl
   \sa mitk::Tool
   \sa QmitkInteractiveSegmentation
   */
   class MITKSEGMENTATION_EXPORT SegWithPreviewTool : public Tool
   {
   public:
 
     mitkClassMacro(SegWithPreviewTool, Tool);
 
     void Activated() override;
     void Deactivated() override;
 
     void ConfirmSegmentation();
 
     itkSetMacro(CreateAllTimeSteps, bool);
     itkGetMacro(CreateAllTimeSteps, bool);
     itkBooleanMacro(CreateAllTimeSteps);
 
     itkSetMacro(KeepActiveAfterAccept, bool);
     itkGetMacro(KeepActiveAfterAccept, bool);
     itkBooleanMacro(KeepActiveAfterAccept);
 
     itkSetMacro(IsTimePointChangeAware, bool);
     itkGetMacro(IsTimePointChangeAware, bool);
     itkBooleanMacro(IsTimePointChangeAware);
 
     itkSetMacro(ResetsToEmptyPreview, bool);
     itkGetMacro(ResetsToEmptyPreview, bool);
     itkBooleanMacro(ResetsToEmptyPreview);
 
     itkSetMacro(UseSpecialPreviewColor, bool);
     itkGetMacro(UseSpecialPreviewColor, bool);
     itkBooleanMacro(UseSpecialPreviewColor);
 
     /*itk macro was not used on purpose, to aviod the change of mtime.*/
     void SetMergeStyle(MultiLabelSegmentation::MergeStyle mergeStyle);
     itkGetMacro(MergeStyle, MultiLabelSegmentation::MergeStyle);
 
     /*itk macro was not used on purpose, to aviod the change of mtime.*/
     void SetOverwriteStyle(MultiLabelSegmentation::OverwriteStyle overwriteStyle);
     itkGetMacro(OverwriteStyle, MultiLabelSegmentation::OverwriteStyle);
 
     enum class LabelTransferScope
     {
       ActiveLabel, //Only the selected label will be transfered from the preview segmentation
                    //to the result segmentation.
                    //If this mode is selected the class expects that GetSelectedLabels indicate
                    //the label in the preview.
       SelectedLabels, //The labels defined as selected labels will be transfered.
       AllLabels //Transfer all labels of the preview
     };
     /*itk macro was not used on purpose, to aviod the change of mtime.*/
     void SetLabelTransferScope(LabelTransferScope labelTransferScope);
     itkGetMacro(LabelTransferScope, LabelTransferScope);
 
     using SelectedLabelVectorType = std::vector<Label::PixelType>;
     /** Specifies the labels that should be transfered form preview to the working image,
       if the segmentation is confirmed. The setting will be used, if LabelTransferScope is set to "ActiveLabel"
       or "SelectedLabels".
       @remark If the LabelTransferScope=="ActiveLabel", the class expects only one label to be selected.
       @remark The selected label IDs corespond to the labels of the preview image.*/
     void SetSelectedLabels(const SelectedLabelVectorType& labelsToTransfer);
     itkGetMacro(SelectedLabels, SelectedLabelVectorType);
 
     enum class LabelTransferMode
     {
       MapLabel, //Only the active label will be transfered from preview to segmentation.
       AddLabel //The labels defined as selected labels will be transfered.
     };
     /*itk macro was not used on purpose, to aviod the change of mtime.*/
     void SetLabelTransferMode(LabelTransferMode labelTransferMode);
     itkGetMacro(LabelTransferMode, LabelTransferMode);
 
     bool CanHandle(const BaseData* referenceData, const BaseData* workingData) const override;
 
     /** Triggers the actualization of the preview
      * @param ignoreLazyPreviewSetting If set true UpdatePreview will always
      * generate the preview for all time steps. If set to false, UpdatePreview
      * will regard the setting specified by the constructor.
      * To define the update generation for time steps implement DoUpdatePreview.
      * To alter what should be done directly before or after the update of the preview,
      * reimplement UpdatePrepare() or UpdateCleanUp().*/
     void UpdatePreview(bool ignoreLazyPreviewSetting = false);
 
     /** Indicate if currently UpdatePreview is triggered (true) or not (false).*/
     bool IsUpdating() const;
 
     /**
    * @brief Gets the name of the currently selected segmentation node
    * @return the name of the segmentation node or an empty string if
    *         none is selected
    */
     std::string GetCurrentSegmentationName();
 
     /**
      * @brief Returns the currently selected segmentation node
      * @return a mitk::DataNode which contains a segmentation image
      */
     virtual DataNode* GetTargetSegmentationNode() const;
     LabelSetImage* GetTargetSegmentation() const;
 
     /** Returns the image that contains the preview of the current segmentation.
      * Returns null if the node is not set or does not contain an image.*/
     LabelSetImage* GetPreviewSegmentation();
     const LabelSetImage* GetPreviewSegmentation() const;
     DataNode* GetPreviewSegmentationNode();
 
   protected:
     ToolCommand::Pointer m_ProgressCommand;
 
     SegWithPreviewTool(bool lazyDynamicPreviews = false); // purposely hidden
     SegWithPreviewTool(bool lazyDynamicPreviews, const char* interactorType, const us::Module* interactorModule = nullptr); // purposely hidden
 
     ~SegWithPreviewTool() override;
 
     const char* GetGroup() const override;
 
     /** Helper that extracts the image for the passed timestep, if the image has multiple time steps.*/
     static Image::ConstPointer GetImageByTimeStep(const Image* image, TimeStepType timestep);
     /** Helper that extracts the image for the passed timestep, if the image has multiple time steps.*/
     static Image::Pointer GetImageByTimeStep(Image* image, TimeStepType timestep);
     /** Helper that extracts the image for the passed time point, if the image has multiple time steps.*/
     static Image::ConstPointer GetImageByTimePoint(const Image* image, TimePointType timePoint);
 
     void EnsureTargetSegmentationNodeInDataStorage() const;
 
     /** Member is always called if GetSegmentationInput() has changed
      * (e.g. because a new ROI was defined, or on activation) to give derived
      * classes the posibility to initiate their state accordingly.
      * Reimplement this function to implement special behavior.
      */
     virtual void InitiateToolByInput();
 
     /** This member function offers derived classes the possibility to alter what should
     happen directly before the update of the preview is performed. It is called by
     UpdatePreview. Default implementation does nothing.*/
     virtual void UpdatePrepare();
 
     /** This member function offers derived classes the possibility to alter what should
     happen directly after the update of the preview is performed. It is called by
     UpdatePreview. Default implementation does nothing.*/
     virtual void UpdateCleanUp();
 
+    /** This member function offers derived classes the possibility to alter what should
+    happen directly after the Confirmation of the preview is performed. It is called by
+    ConfirmSegmentation. Default implementation does nothing.*/
+    virtual void ConfirmCleanUp();
+
     using LabelMappingType = std::vector<std::pair<Label::PixelType, Label::PixelType> >;
 
     /** This member function offers derived classes the possibility to alter what should
     happen directly before the content of the preview is transfered to the segmentation,
     when the segmentation is confirmed. It is called by CreateResultSegmentationFromPreview.
     Default implementation ensure that all labels that will be transfered, exist in the
     segmentation. If they are not existing before the transfer, the will be added by
     cloning the label information of the preview.
     @param labelMapping the mapping that should be used for transfering the labels.
     */
     virtual void PreparePreviewToResultTransfer(const LabelMappingType& labelMapping);
 
     static void TransferLabelInformation(const LabelMappingType& labelMapping,
       const mitk::LabelSetImage* source, mitk::LabelSetImage* target);
 
     /**Helper function that can be used to move the content of an LabelSetImage (the pixels of the active source layer and the labels).
      This is e.g. helpfull if you generate an LabelSetImage content in DoUpdatePreview and you want to transfer it into the preview image.*/
     static void TransferLabelSetImageContent(const LabelSetImage* source, LabelSetImage* target, TimeStepType timeStep);
 
     /** This function does the real work. Here the preview for a given
      * input image should be computed and stored in the also passed
      * preview image at the passed time step.
      * It also provides the current/old segmentation at the time point,
      * which can be used, if the preview depends on the the segmenation so far.
      */
     virtual void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) = 0;
 
     /** Returns the input that should be used for any segmentation/preview or tool update.
      * It is either the data of ReferenceDataNode itself or a part of it defined by a ROI mask
      * provided by the tool manager. Derived classes should regard this as the relevant
      * input data for any processing.
      * Returns null if the node is not set or does not contain an image.*/
     const Image* GetSegmentationInput() const;
 
     /** Returns the image that is provided by the ReferenceDataNode.
      * Returns null if the node is not set or does not contain an image.*/
     const Image* GetReferenceData() const;
 
     /** Resets the preview node so it is empty and ready to be filled by the tool
     @remark Calling this function will generate a new preview image, and the old
     might be invalidated. Therefore this function should not be used within the
     scope of UpdatePreview (m_IsUpdating == true).*/
     void ResetPreviewNode();
 
     /** Resets the complete content of the preview image. The instance of the preview image and its settings
     * stay the same.*/
     void ResetPreviewContent();
 
     /** Resets only the image content of the specified timeStep of the preview image. If the preview image or the specified
     time step does not exist, nothing happens.*/
     void ResetPreviewContentAtTimeStep(unsigned int timeStep);
 
     TimePointType GetLastTimePointOfUpdate() const;
 
     LabelSetImage::LabelValueType GetActiveLabelValueOfPreview() const;
 
     itkGetConstMacro(UserDefinedActiveLabel, Label::PixelType);
 
     itkSetObjectMacro(WorkingPlaneGeometry, PlaneGeometry);
     itkGetConstObjectMacro(WorkingPlaneGeometry, PlaneGeometry);
 
   private:
     void TransferImageAtTimeStep(const Image* sourceImage, Image* destinationImage, const TimeStepType timeStep, const LabelMappingType& labelMapping);
 
     void CreateResultSegmentationFromPreview();
 
     void OnRoiDataChanged();
     void OnTimePointChanged();
 
     /**Internal helper that ensures that the stored active label is up to date.
      This is a fix for T28131 / T28986. It should be refactored if T28524 is being worked on.
      On the long run, the active label will be communicated/set by the user/toolmanager as a
      state of the tool and the tool should react accordingly (like it does for other external
      state changes).
      @return indicates if the label has changed (true) or not.
      */
     bool EnsureUpToDateUserDefinedActiveLabel();
 
     /**Returns that label mapping between preview segmentation (first element of pair) and
      result segmentation (second element of pair).
      The content depends on the settings of LabelTransferMode and LabelTransferScope*/
     LabelMappingType GetLabelMapping() const;
 
     /** Node that containes the preview data generated and managed by this class or derived ones.*/
     DataNode::Pointer m_PreviewSegmentationNode;
     /** The reference data recieved from ToolManager::GetReferenceData when tool was activated.*/
     DataNode::Pointer m_ReferenceDataNode;
     /** Node that containes the data that should be used as input for any auto segmentation. It might
      * be the same like m_ReferenceDataNode (if no ROI is set) or a sub region (if ROI is set).*/
     DataNode::Pointer m_SegmentationInputNode;
 
     /** Indicates if Accepting the threshold should transfer/create the segmentations
      of all time steps (true) or only of the currently selected timepoint (false).*/
     bool m_CreateAllTimeSteps = false;
 
     /** Indicates if the tool should kept active after accepting the segmentation or not.*/
     bool m_KeepActiveAfterAccept = false;
 
     /** Relevant if the working data / preview image has multiple time steps (dynamic segmentations).
      * This flag has to be set by derived classes accordingly to there way to generate dynamic previews.
      * If LazyDynamicPreview is true, the tool generates only the preview for the current time step.
      * Therefore it always has to update the preview if current time point has changed and it has to (re)compute
      * all timeframes if ConfirmSegmentation() is called.*/
     bool m_LazyDynamicPreviews = false;
 
     bool m_IsTimePointChangeAware = true;
 
     /** Controls if ResetPreviewNode generates an empty content (true) or clones the current
     segmentation (false).*/
     bool m_ResetsToEmptyPreview = false;
 
     /** Controls if for the preview of the active label a special preview color is used.
      * If set to false, coloring will stay in the preview like it is in the working image.*/
     bool m_UseSpecialPreviewColor = true;
 
     TimePointType m_LastTimePointOfUpdate = 0.;
 
     bool m_IsUpdating = false;
 
     Label::PixelType m_UserDefinedActiveLabel = 1;
 
     /** This variable indicates if for the tool a working plane geometry is defined.
      * If a working plane is defined the tool will only work an the slice of the input
      * and the segmentation. Thus only the relevant input slice will be passed to
      * DoUpdatePreview(...) and only the relevant slice of the preview will be transfered when
      * ConfirmSegmentation() is called.*/
     PlaneGeometry::Pointer m_WorkingPlaneGeometry;
 
     /** This variable controles how the label pixel content of the preview should be transfered into the
       segmentation- For more details of the behavior see documentation of MultiLabelSegmentation::MergeStyle. */
     MultiLabelSegmentation::MergeStyle m_MergeStyle = MultiLabelSegmentation::MergeStyle::Replace;
     /** This variable controles how the label pixel content of the preview should be transfered into the
       segmentation- For more details of the behavior see documentation of MultiLabelSegmentation::OverwriteStyle. */
     MultiLabelSegmentation::OverwriteStyle m_OverwriteStyle = MultiLabelSegmentation::OverwriteStyle::RegardLocks;
 
     LabelTransferScope m_LabelTransferScope = LabelTransferScope::ActiveLabel;
     SelectedLabelVectorType m_SelectedLabels = {};
 
     LabelTransferMode m_LabelTransferMode = LabelTransferMode::MapLabel;
   };
 
 } // namespace
 
 #endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.cpp b/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.cpp
new file mode 100644
index 0000000000..517628a279
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.cpp
@@ -0,0 +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.
+
+============================================================================*/
+
+#include "mitkSegmentAnythingProcessExecutor.h"
+
+#include <itksys/SystemTools.hxx>
+
+bool mitk::SegmentAnythingProcessExecutor::Execute(const std::string &executionPath, const ArgumentListType &argumentList)
+{
+  std::vector<const char *> pArguments_(argumentList.size() + 1);
+
+  for (ArgumentListType::size_type index = 0; index < argumentList.size(); ++index)
+  {
+    pArguments_[index] = argumentList[index].c_str();
+  }
+  pArguments_.push_back(nullptr); // terminating null element as required by ITK
+  bool normalExit = false;
+  try
+  {
+    m_ProcessID = itksysProcess_New();
+    itksysProcess_SetCommand(m_ProcessID, pArguments_.data());
+
+    /* Place the process in a new process group for seamless interruption when required. */
+    itksysProcess_SetOption(m_ProcessID, itksysProcess_Option_CreateProcessGroup, 1);
+
+    itksysProcess_SetWorkingDirectory(m_ProcessID, executionPath.c_str());
+    if (this->m_SharedOutputPipes)
+    {
+      itksysProcess_SetPipeShared(m_ProcessID, itksysProcess_Pipe_STDOUT, 1);
+      itksysProcess_SetPipeShared(m_ProcessID, itksysProcess_Pipe_STDERR, 1);
+    }
+    itksysProcess_Execute(m_ProcessID);
+    char *rawOutput = nullptr;
+    int outputLength = 0;
+    double timer = m_Timeout;
+    while (!m_Stop)
+    {
+      double *timeout = &timer;
+      *timeout = m_Timeout; //re-assigning timeout since itksysProcess calls will tamper with input timeout argument.
+      int dataStatus = itksysProcess_WaitForData(m_ProcessID, &rawOutput, &outputLength, timeout);
+      if (dataStatus == itksysProcess_Pipe_STDOUT)
+      {
+        std::string data(rawOutput, outputLength);
+        this->InvokeEvent(ExternalProcessStdOutEvent(data));
+      }
+      else if (dataStatus == itksysProcess_Pipe_STDERR)
+      {
+        std::string data(rawOutput, outputLength);
+        this->InvokeEvent(ExternalProcessStdErrEvent(data));
+      }
+    }
+    timer = m_Timeout; //re-assigning timeout since itksysProcess calls will tamper with input timeout argument.
+    itksysProcess_Kill(m_ProcessID);
+    itksysProcess_WaitForExit(m_ProcessID, &timer);
+    auto state = static_cast<itksysProcess_State_e>(itksysProcess_GetState(m_ProcessID));
+    normalExit = (state == itksysProcess_State_Exited);
+    this->m_ExitValue = itksysProcess_GetExitValue(m_ProcessID);
+  }
+  catch (...)
+  {
+    throw;
+  }
+  return normalExit;
+};
+
+mitk::SegmentAnythingProcessExecutor::SegmentAnythingProcessExecutor(double &timeout)
+{
+  this->SetTimeout(timeout);
+}
+
+void mitk::SegmentAnythingProcessExecutor::SetTimeout(double &timeout)
+{
+  m_Timeout = timeout;
+}
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.h b/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.h
new file mode 100644
index 0000000000..9e45db8452
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingProcessExecutor.h
@@ -0,0 +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 mitkSegmentAnythingProcessExecutor_h
+#define mitkSegmentAnythingProcessExecutor_h
+
+#include <MitkSegmentationExports.h>
+#include <mitkProcessExecutor.h>
+#include <itksys/Process.h>
+#include <mitkCommon.h>
+
+namespace mitk
+{
+  /**
+   * @brief You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or
+   * ExternalProcessStdErrEvent in order to get notified of any output.
+   * @remark The events will only be invoked if the pipes are NOT(!) shared. By default the pipes are not shared.
+   *
+   */
+  class MITKSEGMENTATION_EXPORT SegmentAnythingProcessExecutor : public mitk::ProcessExecutor
+  {
+  public:
+    using Self = SegmentAnythingProcessExecutor;
+    using Superclass = mitk::ProcessExecutor;
+    using Pointer = ::itk::SmartPointer<Self>;
+    using ConstPointer = ::itk::SmartPointer<const Self>;
+    using mitk::ProcessExecutor::Execute;
+
+    itkTypeMacro(SegmentAnythingProcessExecutor, mitk::ProcessExecutor);
+    mitkNewMacro1Param(SegmentAnythingProcessExecutor, double&);
+
+    itkSetMacro(Stop, bool);
+    itkGetConstMacro(Stop, bool);
+
+    /**
+     * @brief Executes the process. This version assumes that the executable name is the first argument in the argument
+     * list and has already been converted to its OS dependent name via the static convert function of this class.
+     */
+    bool Execute(const std::string &executionPath, const ArgumentListType &argumentList);
+
+    void SetTimeout(double &timeout);
+
+  protected:
+    SegmentAnythingProcessExecutor() = delete;
+    SegmentAnythingProcessExecutor(double &);
+    ~SegmentAnythingProcessExecutor() = default;
+
+  private:
+    itksysProcess *m_ProcessID = nullptr;
+    double m_Timeout;
+    bool m_Stop = false; // Exit token to force stop the daemon.
+  };
+
+} // namespace mitk
+#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.cpp b/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.cpp
new file mode 100644
index 0000000000..13674f1066
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.cpp
@@ -0,0 +1,265 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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 "mitkSegmentAnythingPythonService.h"
+
+#include "mitkIOUtil.h"
+#include <mitkSegmentAnythingProcessExecutor.h>
+#include <itksys/SystemTools.hxx>
+#include <chrono>
+#include <thread>
+#include <filesystem>
+#include <itkImageFileWriter.h>
+#include "mitkImageAccessByItk.h"
+#include <mitkLocaleSwitch.h>
+
+using namespace std::chrono_literals;
+using sys_clock = std::chrono::system_clock;
+
+namespace mitk
+{
+  const std::string SIGNALCONSTANTS::READY = "READY";
+  const std::string SIGNALCONSTANTS::KILL = "KILL";
+  const std::string SIGNALCONSTANTS::OFF = "OFF";
+  const std::string SIGNALCONSTANTS::CUDA_OUT_OF_MEMORY_ERROR = "CudaOutOfMemoryError";
+  const std::string SIGNALCONSTANTS::TIMEOUT_ERROR = "TimeOut";
+  SegmentAnythingPythonService::Status SegmentAnythingPythonService::CurrentStatus =
+    SegmentAnythingPythonService::Status::OFF;
+}
+
+mitk::SegmentAnythingPythonService::SegmentAnythingPythonService(
+  std::string workingDir, std::string modelType, std::string checkPointPath, unsigned int gpuId)
+  : m_PythonPath(workingDir),
+    m_ModelType(modelType),
+    m_CheckpointPath(checkPointPath),
+    m_GpuId(gpuId)
+{
+  this->CreateTempDirs(PARENT_TEMP_DIR_PATTERN);
+}
+
+mitk::SegmentAnythingPythonService::~SegmentAnythingPythonService()
+{
+  if (CurrentStatus == Status::READY)
+  {
+    this->StopAsyncProcess();
+  }
+  CurrentStatus = Status::OFF;
+  std::filesystem::remove_all(this->GetMitkTempDir());
+ }
+
+void mitk::SegmentAnythingPythonService::onPythonProcessEvent(itk::Object*, const itk::EventObject &e, void*)
+{
+  std::string testCOUT,testCERR;
+  const auto *pEvent = dynamic_cast<const mitk::ExternalProcessStdOutEvent *>(&e);
+  if (pEvent)
+  {
+    testCOUT = testCOUT + pEvent->GetOutput();
+    testCOUT.erase(std::find_if(testCOUT.rbegin(), testCOUT.rend(), [](unsigned char ch) {
+        return !std::isspace(ch);}).base(), testCOUT.end()); // remove trailing whitespaces, if any
+    if (SIGNALCONSTANTS::READY == testCOUT)
+    {
+      CurrentStatus = Status::READY;
+    }
+    if (SIGNALCONSTANTS::KILL == testCOUT)
+    {
+      CurrentStatus = Status::KILLED;
+    }
+    if (SIGNALCONSTANTS::CUDA_OUT_OF_MEMORY_ERROR == testCOUT)
+    {
+      CurrentStatus = Status::CUDAError;
+    }
+    MITK_INFO << testCOUT;
+  }
+  const auto *pErrEvent = dynamic_cast<const mitk::ExternalProcessStdErrEvent *>(&e);
+  if (pErrEvent)
+  {
+    testCERR = testCERR + pErrEvent->GetOutput();
+    MITK_ERROR << testCERR;
+  }
+}
+
+void mitk::SegmentAnythingPythonService::StopAsyncProcess()
+{
+  std::stringstream controlStream;
+  controlStream << SIGNALCONSTANTS::KILL;
+  this->WriteControlFile(controlStream);
+  m_DaemonExec->SetStop(true);
+  m_Future.get();
+}
+
+void mitk::SegmentAnythingPythonService::StartAsyncProcess()
+{
+  if (nullptr != m_DaemonExec)
+  {
+    this->StopAsyncProcess();
+  }
+  if (this->GetMitkTempDir().empty())
+  {
+    this->CreateTempDirs(PARENT_TEMP_DIR_PATTERN);
+  }
+  std::stringstream controlStream;
+  controlStream << SIGNALCONSTANTS::READY;
+  this->WriteControlFile(controlStream);
+  double timeout = 1;
+  m_DaemonExec = SegmentAnythingProcessExecutor::New(timeout);
+  itk::CStyleCommand::Pointer spCommand = itk::CStyleCommand::New();
+  spCommand->SetCallback(&mitk::SegmentAnythingPythonService::onPythonProcessEvent);
+  m_DaemonExec->AddObserver(ExternalProcessOutputEvent(), spCommand);
+  m_Future = std::async(std::launch::async, &mitk::SegmentAnythingPythonService::start_python_daemon, this);
+  }
+
+void mitk::SegmentAnythingPythonService::TransferPointsToProcess(std::stringstream &triggerCSV)
+{
+  this->CheckStatus();
+  std::string triggerFilePath = m_InDir + IOUtil::GetDirectorySeparator() + TRIGGER_FILENAME;
+  std::ofstream csvfile;
+  csvfile.open(triggerFilePath, std::ofstream::out | std::ofstream::trunc);
+  csvfile << triggerCSV.rdbuf();
+  csvfile.close();
+}
+
+void mitk::SegmentAnythingPythonService::WriteControlFile(std::stringstream &statusStream)
+{
+  std::string controlFilePath = m_InDir + IOUtil::GetDirectorySeparator() + "control.txt";
+  std::ofstream controlFile;
+  controlFile.open(controlFilePath, std::ofstream::out | std::ofstream::trunc);
+  controlFile << statusStream.rdbuf();
+  controlFile.close();
+}
+
+void mitk::SegmentAnythingPythonService::start_python_daemon()
+{
+  ProcessExecutor::ArgumentListType args;
+  std::string command = "python";
+  args.push_back("-u");
+
+  args.push_back(SAM_PYTHON_FILE_NAME);
+  
+  args.push_back("--input-folder");
+  args.push_back(m_InDir);
+
+  args.push_back("--output-folder");
+  args.push_back(m_OutDir);
+
+  args.push_back("--trigger-file");
+  args.push_back(TRIGGER_FILENAME);
+
+  args.push_back("--model-type");
+  args.push_back(m_ModelType);
+
+  args.push_back("--checkpoint");
+  args.push_back(m_CheckpointPath);
+
+  args.push_back("--device");
+  if (m_GpuId == -1)
+  {
+    args.push_back("cpu");
+  }
+  else
+  {
+    args.push_back("cuda");
+    std::string cudaEnv = "CUDA_VISIBLE_DEVICES=" + std::to_string(m_GpuId);
+    itksys::SystemTools::PutEnv(cudaEnv.c_str());
+  }
+
+  try
+  {
+    std::stringstream logStream;
+    for (const auto &arg : args)
+      logStream << arg << " ";
+    logStream << m_PythonPath;
+    MITK_INFO << logStream.str();
+    m_DaemonExec->Execute(m_PythonPath, command, args);
+  }
+  catch (const mitk::Exception &e)
+  {
+    MITK_ERROR << e.GetDescription();
+    return;
+  }
+  MITK_INFO << "Python process ended.";
+}
+
+bool mitk::SegmentAnythingPythonService::CheckStatus()
+{
+  switch (CurrentStatus)
+  {
+    case mitk::SegmentAnythingPythonService::Status::READY:
+      return true;
+    case mitk::SegmentAnythingPythonService::Status::CUDAError:
+      mitkThrow() << "Error: Cuda Out of Memory. Change your model type in Preferences and Activate Segment Anything tool again.";
+    case mitk::SegmentAnythingPythonService::Status::KILLED:
+      mitkThrow() << "Error: Python process is already terminated. Cannot load requested segmentation. Activate Segment Anything tool again.";
+    default:
+      return false;
+  }
+}
+
+void mitk::SegmentAnythingPythonService::CreateTempDirs(const std::string &dirPattern)
+{
+  this->SetMitkTempDir(IOUtil::CreateTemporaryDirectory(dirPattern));
+  m_InDir = IOUtil::CreateTemporaryDirectory("sam-in-XXXXXX", m_MitkTempDir);
+  m_OutDir = IOUtil::CreateTemporaryDirectory("sam-out-XXXXXX", m_MitkTempDir);
+}
+
+mitk::LabelSetImage::Pointer mitk::SegmentAnythingPythonService::RetrieveImageFromProcess(long timeOut)
+{
+  std::string outputImagePath = m_OutDir + IOUtil::GetDirectorySeparator() + m_CurrentUId + ".nrrd";
+  auto start = sys_clock::now();
+  while (!std::filesystem::exists(outputImagePath))
+  {
+    this->CheckStatus();
+    std::this_thread::sleep_for(100ms);
+    if (timeOut != -1 && std::chrono::duration_cast<std::chrono::seconds>(sys_clock::now() - start).count() > timeOut) 
+    {
+      CurrentStatus = Status::OFF;
+      m_DaemonExec->SetStop(true);
+      mitkThrow() << SIGNALCONSTANTS::TIMEOUT_ERROR;
+      
+    }
+  }
+  LabelSetImage::Pointer outputBuffer = mitk::IOUtil::Load<LabelSetImage>(outputImagePath);
+  return outputBuffer;
+}
+
+void mitk::SegmentAnythingPythonService::TransferImageToProcess(const Image *inputAtTimeStep, std::string &UId)
+{
+  std::string inputImagePath = m_InDir + IOUtil::GetDirectorySeparator() + UId + ".nrrd";
+  if (inputAtTimeStep->GetPixelType().GetNumberOfComponents() < 2)
+  {
+    AccessByItk_n(inputAtTimeStep, ITKWriter, (inputImagePath));
+  }
+  else
+  {
+    mitk::IOUtil::Save(inputAtTimeStep, inputImagePath);
+  }
+  m_CurrentUId = UId;
+}
+
+template <typename TPixel, unsigned int VImageDimension>
+void mitk::SegmentAnythingPythonService::ITKWriter(const itk::Image<TPixel, VImageDimension> *image, std::string& outputFilename)
+{
+  typedef itk::Image<TPixel, VImageDimension> ImageType;
+  typedef itk::ImageFileWriter<ImageType> WriterType;
+  typename WriterType::Pointer writer = WriterType::New();
+  mitk::LocaleSwitch localeSwitch("C");
+  writer->SetFileName(outputFilename);
+  writer->SetInput(image);
+  try
+  {
+    writer->Update();
+  }
+  catch (const itk::ExceptionObject &error)
+  {
+    MITK_ERROR << "Error: " << error << std::endl;
+    mitkThrow() << "Error: " << error;
+  }
+}
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.h b/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.h
new file mode 100644
index 0000000000..1e54928e6b
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingPythonService.h
@@ -0,0 +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 mitkSegmentAnythingPythonService_h
+#define mitkSegmentAnythingPythonService_h
+
+#include <mitkSegmentAnythingProcessExecutor.h>
+#include <MitkSegmentationExports.h>
+#include <thread>
+#include <future>
+#include <mitkImage.h>
+#include <mitkLabelSetImage.h>
+#include <itkImage.h>
+
+namespace mitk
+{
+  /**
+   * @brief Segment Anything Model Python process handler class.
+   * 
+  */
+  class MITKSEGMENTATION_EXPORT SegmentAnythingPythonService : public itk::Object
+  {
+  public: 
+    enum Status
+    {
+      READY,
+      OFF,
+      KILLED,
+      CUDAError
+    };
+
+    SegmentAnythingPythonService(std::string, std::string, std::string, unsigned int);
+    ~SegmentAnythingPythonService();
+    
+    itkSetMacro(MitkTempDir, std::string);
+    itkGetConstMacro(MitkTempDir, std::string);
+
+    /**
+     * @brief Static function to print out everything from itk::EventObject.
+     * Used as callback in mitk::ProcessExecutor object.
+     *
+     */
+    static void onPythonProcessEvent(itk::Object*, const itk::EventObject&, void*);
+
+    /**
+     * @brief Checks CurrentStatus enum variable and returns 
+     * true if daemon is READY (to read files) state, false is OFF state or
+     * throws exception if daemon is found KILL or Cuda error state.
+     * 
+     * @return bool 
+     */
+    static bool CheckStatus() /*throw(mitk::Exception)*/;
+
+    /**
+     * @brief Creates temp directories and calls start_python_daemon
+     * function async.
+     * 
+     */
+    void StartAsyncProcess();
+
+    /**
+     * @brief Writes KILL to the control file to stop the daemon process.
+     * 
+     */
+    void StopAsyncProcess();
+
+    /**
+     * @brief Writes image as nifity file with unique id (UId) as file name. 
+     * 
+     */
+    void TransferImageToProcess(const Image*, std::string &UId);
+
+    /**
+     * @brief Writes csv stringstream of points to a csv file for 
+     * python daemon to read.
+     * 
+     */
+    void TransferPointsToProcess(std::stringstream&);
+
+    /**
+     * @brief Waits for output nifity file from the daemon to appear and 
+     * reads it as a mitk::Image
+     * 
+     * @return Image::Pointer 
+     */
+    LabelSetImage::Pointer RetrieveImageFromProcess(long timeOut= -1);
+
+    static Status CurrentStatus;
+
+  private:
+    /**
+     * @brief Runs SAM python daemon using mitk::ProcessExecutor
+     * 
+     */
+    void start_python_daemon();
+
+    /**
+     * @brief Writes stringstream content into control file.
+     * 
+     */
+    void WriteControlFile(std::stringstream&);
+
+    /**
+     * @brief Create a Temp Dirs
+     * 
+     */
+    void CreateTempDirs(const std::string&);
+
+    /**
+     * @brief ITK-based file writer for dumping inputs into python daemon
+     *
+     */
+    template <typename TPixel, unsigned int VImageDimension>
+    void ITKWriter(const itk::Image<TPixel, VImageDimension> *image, std::string& outputFilename);
+
+
+    std::string m_MitkTempDir;
+    std::string m_PythonPath;
+    std::string m_ModelType;
+    std::string m_CheckpointPath;
+    std::string m_InDir, m_OutDir;
+    std::string m_CurrentUId;
+    int m_GpuId = 0;
+    const std::string PARENT_TEMP_DIR_PATTERN = "mitk-sam-XXXXXX";
+    const std::string TRIGGER_FILENAME = "trigger.csv";
+    const std::string SAM_PYTHON_FILE_NAME = "run_inference_daemon.py";
+    std::future<void> m_Future;
+    SegmentAnythingProcessExecutor::Pointer m_DaemonExec;
+  };
+
+  struct SIGNALCONSTANTS
+  {
+    static const std::string READY;
+    static const std::string KILL;
+    static const std::string OFF;
+    static const std::string CUDA_OUT_OF_MEMORY_ERROR;
+    static const std::string TIMEOUT_ERROR;
+  };
+
+} // namespace
+
+#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.cpp b/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.cpp
new file mode 100644
index 0000000000..94b63e8320
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.cpp
@@ -0,0 +1,411 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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 "mitkSegmentAnythingTool.h"
+
+#include <chrono>
+#include <thread>
+#include <iomanip>
+#include "mitkInteractionPositionEvent.h"
+#include "mitkPointSetShapeProperty.h"
+#include "mitkProperties.h"
+#include "mitkToolManager.h"
+#include <mitkSegTool2D.h>
+// us
+#include <usGetModuleContext.h>
+#include <usModule.h>
+#include <usModuleContext.h>
+#include <usModuleResource.h>
+
+#include <itkIntensityWindowingImageFilter.h>
+#include "mitkImageAccessByItk.h"
+
+using namespace std::chrono_literals;
+
+namespace mitk
+{
+  MITK_TOOL_MACRO(MITKSEGMENTATION_EXPORT, SegmentAnythingTool, "SegmentAnythingTool");
+}
+
+mitk::SegmentAnythingTool::SegmentAnythingTool() : SegWithPreviewTool(true, "PressMoveReleaseAndPointSetting")
+{
+  this->ResetsToEmptyPreviewOn();
+  this->IsTimePointChangeAwareOff();
+  this->KeepActiveAfterAcceptOn();
+}
+
+const char **mitk::SegmentAnythingTool::GetXPM() const
+{
+  return nullptr;
+}
+
+const char *mitk::SegmentAnythingTool::GetName() const
+{
+  return "Segment Anything";
+}
+
+us::ModuleResource mitk::SegmentAnythingTool::GetIconResource() const
+{
+  us::Module *module = us::GetModuleContext()->GetModule();
+  us::ModuleResource resource = module->GetResource("AI.svg");
+  return resource;
+}
+
+void mitk::SegmentAnythingTool::Activated()
+{
+  Superclass::Activated();
+  m_PointSetPositive = mitk::PointSet::New();
+  m_PointSetNodePositive = mitk::DataNode::New();
+  m_PointSetNodePositive->SetData(m_PointSetPositive);
+  m_PointSetNodePositive->SetName(std::string(this->GetName()) + "_PointSetPositive");
+  m_PointSetNodePositive->SetBoolProperty("helper object", true);
+  m_PointSetNodePositive->SetColor(0.0, 1.0, 0.0);
+  m_PointSetNodePositive->SetVisibility(true);
+  m_PointSetNodePositive->SetProperty("Pointset.2D.shape",
+                              mitk::PointSetShapeProperty::New(mitk::PointSetShapeProperty::CIRCLE));
+  m_PointSetNodePositive->SetProperty("Pointset.2D.fill shape", mitk::BoolProperty::New(true));
+  this->GetDataStorage()->Add(m_PointSetNodePositive, this->GetToolManager()->GetWorkingData(0));
+
+  m_PointSetNegative = mitk::PointSet::New();
+  m_PointSetNodeNegative = mitk::DataNode::New();
+  m_PointSetNodeNegative->SetData(m_PointSetNegative);
+  m_PointSetNodeNegative->SetName(std::string(this->GetName()) + "_PointSetNegative");
+  m_PointSetNodeNegative->SetBoolProperty("helper object", true);
+  m_PointSetNodeNegative->SetColor(1.0, 0.0, 0.0);
+  m_PointSetNodeNegative->SetVisibility(true);
+  m_PointSetNodeNegative->SetProperty("Pointset.2D.shape",
+                                      mitk::PointSetShapeProperty::New(mitk::PointSetShapeProperty::CIRCLE));
+  m_PointSetNodeNegative->SetProperty("Pointset.2D.fill shape", mitk::BoolProperty::New(true));
+  this->GetDataStorage()->Add(m_PointSetNodeNegative, this->GetToolManager()->GetWorkingData(0));
+
+  this->SetLabelTransferScope(LabelTransferScope::ActiveLabel);
+  this->SetLabelTransferMode(LabelTransferMode::MapLabel);
+}
+
+void mitk::SegmentAnythingTool::Deactivated()
+{
+  this->ClearSeeds();
+  GetDataStorage()->Remove(m_PointSetNodePositive);
+  GetDataStorage()->Remove(m_PointSetNodeNegative);
+  m_PointSetNodePositive = nullptr;
+  m_PointSetNodeNegative = nullptr;
+  m_PointSetPositive = nullptr;
+  m_PointSetNegative = nullptr;
+  m_PythonService.reset();
+  Superclass::Deactivated();
+}
+
+void mitk::SegmentAnythingTool::ConnectActionsAndFunctions()
+{
+  CONNECT_FUNCTION("ShiftSecondaryButtonPressed", OnAddNegativePoint);
+  CONNECT_FUNCTION("ShiftPrimaryButtonPressed", OnAddPositivePoint);
+  CONNECT_FUNCTION("DeletePoint", OnDelete);
+}
+
+void mitk::SegmentAnythingTool::InitSAMPythonProcess()
+{
+  if (nullptr != m_PythonService)
+  {
+    m_PythonService.reset();
+  }
+  this->ClearPicks();
+  m_PythonService = std::make_unique<mitk::SegmentAnythingPythonService>(
+    this->GetPythonPath(), this->GetModelType(), this->GetCheckpointPath(), this->GetGpuId());
+  m_PythonService->StartAsyncProcess();
+}
+
+bool mitk::SegmentAnythingTool::IsPythonReady() const
+{
+  return m_PythonService->CheckStatus();
+}
+
+void mitk::SegmentAnythingTool::OnAddNegativePoint(StateMachineAction *, InteractionEvent *interactionEvent)
+{
+  if (!this->GetIsReady() || m_PointSetPositive->GetSize() == 0 || nullptr == this->GetWorkingPlaneGeometry() ||
+      !mitk::Equal(*(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()), *(this->GetWorkingPlaneGeometry())))
+  {
+    return;
+  }
+  if (!this->IsUpdating() && m_PointSetNegative.IsNotNull())
+  {
+    const auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent);
+    if (positionEvent != nullptr)
+    {
+      m_PointSetNegative->InsertPoint(m_PointSetCount, positionEvent->GetPositionInWorld());
+      m_PointSetCount++;
+      this->UpdatePreview();
+    }
+  }
+}
+
+void mitk::SegmentAnythingTool::OnAddPositivePoint(StateMachineAction *, InteractionEvent *interactionEvent)
+{
+  if (!this->GetIsReady())
+  {
+    return;
+  }
+  m_IsGenerateEmbeddings = false;
+  if ((nullptr == this->GetWorkingPlaneGeometry()) ||
+      !mitk::Equal(*(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()),
+                   *(this->GetWorkingPlaneGeometry())))
+  {
+    m_IsGenerateEmbeddings = true;
+    this->ClearSeeds();
+    this->SetWorkingPlaneGeometry(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()->Clone());
+  }
+  if (!this->IsUpdating() && m_PointSetPositive.IsNotNull())
+  {
+    const auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent);
+    if (positionEvent != nullptr)
+    {
+      m_PointSetPositive->InsertPoint(m_PointSetCount, positionEvent->GetPositionInWorld());
+      ++m_PointSetCount;
+      this->UpdatePreview();
+    }
+  }
+}
+
+void mitk::SegmentAnythingTool::OnDelete(StateMachineAction *, InteractionEvent *)
+{
+  if (!this->IsUpdating() && m_PointSetPositive.IsNotNull() && m_PointSetNegative.IsNotNull())
+  {
+    PointSet::Pointer removeSet = m_PointSetPositive;
+    decltype(m_PointSetPositive->GetMaxId().Index()) maxId = 0;
+    if (m_PointSetPositive->GetSize() > 0)
+    {
+      maxId = m_PointSetPositive->GetMaxId().Index();
+    }
+    if (m_PointSetNegative->GetSize() > 0 && (maxId < m_PointSetNegative->GetMaxId().Index()))
+    {
+      removeSet = m_PointSetNegative;
+    }
+    removeSet->RemovePointAtEnd(0);
+    --m_PointSetCount;
+    this->UpdatePreview();
+  }
+}
+
+void mitk::SegmentAnythingTool::ClearPicks()
+{
+  this->ClearSeeds();
+  this->UpdatePreview();
+}
+
+bool mitk::SegmentAnythingTool::HasPicks() const
+{
+  return this->m_PointSetPositive.IsNotNull() && this->m_PointSetPositive->GetSize() > 0;
+}
+
+void mitk::SegmentAnythingTool::ClearSeeds()
+{
+  if (this->m_PointSetPositive.IsNotNull())
+  {
+    m_PointSetCount -= m_PointSetPositive->GetSize();
+    this->m_PointSetPositive = mitk::PointSet::New(); // renew pointset
+    this->m_PointSetNodePositive->SetData(this->m_PointSetPositive);
+  }
+  if (this->m_PointSetNegative.IsNotNull())
+  {
+    m_PointSetCount -= m_PointSetNegative->GetSize();
+    this->m_PointSetNegative = mitk::PointSet::New(); // renew pointset
+    this->m_PointSetNodeNegative->SetData(this->m_PointSetNegative);
+  }
+}
+
+void mitk::SegmentAnythingTool::ConfirmCleanUp() 
+{
+  auto previewImage = this->GetPreviewSegmentation();
+  for (unsigned int timeStep = 0; timeStep < previewImage->GetTimeSteps(); ++timeStep)
+  {
+    this->ResetPreviewContentAtTimeStep(timeStep);
+  }
+  this->ClearSeeds();
+  RenderingManager::GetInstance()->RequestUpdateAll();
+}
+
+template <typename TPixel, unsigned int VImageDimension>
+void mitk::SegmentAnythingTool::ITKWindowing(const itk::Image<TPixel, VImageDimension> *inputImage,
+                                             Image *mitkImage,
+                                             ScalarType min,
+                                             ScalarType max)
+{
+  typedef itk::Image<TPixel, VImageDimension> ImageType;
+  typedef itk::IntensityWindowingImageFilter<ImageType, ImageType> IntensityFilterType;
+  typename IntensityFilterType::Pointer filter = IntensityFilterType::New();
+  filter->SetInput(inputImage);
+  filter->SetWindowMinimum(min);
+  filter->SetWindowMaximum(max);
+  filter->SetOutputMinimum(min);
+  filter->SetOutputMaximum(max);
+  filter->Update();
+
+  mitkImage->SetImportVolume((void *)(filter->GetOutput()->GetPixelContainer()->GetBufferPointer()), 0, 0, Image::ManageMemory);
+  filter->GetOutput()->GetPixelContainer()->ContainerManageMemoryOff();
+}
+
+void mitk::SegmentAnythingTool::DoUpdatePreview(const Image *inputAtTimeStep,
+                                                const Image * /*oldSegAtTimeStep*/,
+                                                LabelSetImage *previewImage,
+                                                TimeStepType timeStep)
+{
+  if (nullptr != previewImage && m_PointSetPositive.IsNotNull())
+  {
+    if (this->HasPicks() && nullptr != m_PythonService)
+    {
+      mitk::LevelWindow levelWindow;
+      this->GetToolManager()->GetReferenceData(0)->GetLevelWindow(levelWindow);
+      std::string uniquePlaneID = GetHashForCurrentPlane(levelWindow);
+      m_ProgressCommand->SetProgress(20);
+      try
+      {
+        std::stringstream csvStream;
+        this->EmitSAMStatusMessageEvent("Prompting Segment Anything Model...");
+        m_ProgressCommand->SetProgress(50);
+        if (inputAtTimeStep->GetPixelType().GetNumberOfComponents() < 2)
+        {
+          auto filteredImage = mitk::Image::New();
+          filteredImage->Initialize(inputAtTimeStep);
+          AccessByItk_n(inputAtTimeStep, ITKWindowing, // apply level window filter
+                        (filteredImage, levelWindow.GetLowerWindowBound(), levelWindow.GetUpperWindowBound()));
+          m_PythonService->TransferImageToProcess(filteredImage, uniquePlaneID);
+          csvStream = this->GetPointsAsCSVString(filteredImage->GetGeometry());
+        }
+        else
+        {
+          m_PythonService->TransferImageToProcess(inputAtTimeStep, uniquePlaneID);
+          csvStream = this->GetPointsAsCSVString(inputAtTimeStep->GetGeometry());
+        }
+        m_ProgressCommand->SetProgress(100);
+        m_PythonService->TransferPointsToProcess(csvStream);
+        m_ProgressCommand->SetProgress(150);
+        std::this_thread::sleep_for(100ms);
+        mitk::LabelSetImage::Pointer outputBuffer = m_PythonService->RetrieveImageFromProcess(this->GetTimeOutLimit());
+        m_ProgressCommand->SetProgress(180);
+        mitk::SegTool2D::WriteSliceToVolume(previewImage, this->GetWorkingPlaneGeometry(), outputBuffer.GetPointer(), timeStep, false);
+        this->SetSelectedLabels({MASK_VALUE});
+        this->EmitSAMStatusMessageEvent("Successfully generated segmentation.");
+      }
+      catch (const mitk::Exception &e)
+      {
+        this->ClearPicks();
+        this->EmitSAMStatusMessageEvent(e.GetDescription());
+        mitkThrow() << e.GetDescription();
+      }
+    }
+    else if (nullptr != this->GetWorkingPlaneGeometry())
+    {
+      this->ResetPreviewContentAtTimeStep(timeStep);
+      RenderingManager::GetInstance()->ForceImmediateUpdateAll();
+    }
+  }
+}
+
+std::string mitk::SegmentAnythingTool::GetHashForCurrentPlane(const mitk::LevelWindow &levelWindow)
+{
+  mitk::Vector3D normal = this->GetWorkingPlaneGeometry()->GetNormal();
+  mitk::Point3D center = this->GetWorkingPlaneGeometry()->GetCenter();
+  std::stringstream hashstream;
+  hashstream << std::setprecision(3) << std::fixed << normal[0]; //Consider only 3 digits after decimal 
+  hashstream << std::setprecision(3) << std::fixed << normal[1];
+  hashstream << std::setprecision(3) << std::fixed << normal[2];
+  hashstream << std::setprecision(3) << std::fixed << center[0];
+  hashstream << std::setprecision(3) << std::fixed << center[1];
+  hashstream << std::setprecision(3) << std::fixed << center[2];
+  hashstream << levelWindow.GetLowerWindowBound();
+  hashstream << levelWindow.GetUpperWindowBound();
+  size_t hashVal = std::hash<std::string>{}(hashstream.str());
+  return std::to_string(hashVal);
+}
+
+std::stringstream mitk::SegmentAnythingTool::GetPointsAsCSVString(const mitk::BaseGeometry *baseGeometry)
+{
+  MITK_INFO << "No.of points: " << m_PointSetPositive->GetSize();
+  std::stringstream pointsAndLabels;
+  pointsAndLabels << "Point,Label\n";
+  mitk::PointSet::PointsConstIterator pointSetItPos = m_PointSetPositive->Begin();
+  mitk::PointSet::PointsConstIterator pointSetItNeg = m_PointSetNegative->Begin();
+  const char SPACE = ' ';
+  while (pointSetItPos != m_PointSetPositive->End() || pointSetItNeg != m_PointSetNegative->End())
+  {
+    if (pointSetItPos != m_PointSetPositive->End())
+    {
+      mitk::Point3D point = pointSetItPos.Value();
+      if (baseGeometry->IsInside(point))
+      {
+        Point2D p2D = Get2DIndicesfrom3DWorld(baseGeometry, point);
+        pointsAndLabels << static_cast<int>(p2D[0]) << SPACE << static_cast<int>(p2D[1]) << ",1" << std::endl;
+      }
+      ++pointSetItPos;
+    }
+    if (pointSetItNeg != m_PointSetNegative->End())
+    {
+      mitk::Point3D point = pointSetItNeg.Value();
+      if (baseGeometry->IsInside(point))
+      {
+        Point2D p2D = Get2DIndicesfrom3DWorld(baseGeometry, point);
+        pointsAndLabels << static_cast<int>(p2D[0]) << SPACE << static_cast<int>(p2D[1]) << ",0" << std::endl;
+      }
+      ++pointSetItNeg;
+    }
+  }
+  return pointsAndLabels;
+}
+
+std::vector<std::pair<mitk::Point2D, std::string>> mitk::SegmentAnythingTool::GetPointsAsVector(
+  const mitk::BaseGeometry *baseGeometry)
+{
+  std::vector<std::pair<mitk::Point2D, std::string>> clickVec;
+  clickVec.reserve(m_PointSetPositive->GetSize() + m_PointSetNegative->GetSize());
+  mitk::PointSet::PointsConstIterator pointSetItPos = m_PointSetPositive->Begin();
+  mitk::PointSet::PointsConstIterator pointSetItNeg = m_PointSetNegative->Begin();
+  while (pointSetItPos != m_PointSetPositive->End() || pointSetItNeg != m_PointSetNegative->End())
+  {
+    if (pointSetItPos != m_PointSetPositive->End())
+    {
+      mitk::Point3D point = pointSetItPos.Value();
+      if (baseGeometry->IsInside(point))
+      {
+        Point2D p2D = Get2DIndicesfrom3DWorld(baseGeometry, point);
+        clickVec.push_back(std::pair(p2D, "1"));
+      }
+      ++pointSetItPos;
+    }
+    if (pointSetItNeg != m_PointSetNegative->End())
+    {
+      mitk::Point3D point = pointSetItNeg.Value();
+      if (baseGeometry->IsInside(point))
+      {
+        Point2D p2D = Get2DIndicesfrom3DWorld(baseGeometry, point);
+        clickVec.push_back(std::pair(p2D, "0"));
+      }
+      ++pointSetItNeg;
+    }
+  }
+  return clickVec;
+}
+
+mitk::Point2D mitk::SegmentAnythingTool::Get2DIndicesfrom3DWorld(const mitk::BaseGeometry *baseGeometry,
+                                                                 const mitk::Point3D &point3d)
+{
+  mitk::Point3D index3D;
+  baseGeometry->WorldToIndex(point3d, index3D);
+  MITK_INFO << index3D[0] << " " << index3D[1] << " " << index3D[2]; // remove
+  Point2D point2D;
+  point2D.SetElement(0, index3D[0]);
+  point2D.SetElement(1, index3D[1]);
+  return point2D;
+}
+
+void mitk::SegmentAnythingTool::EmitSAMStatusMessageEvent(const std::string& status)
+{
+  SAMStatusMessageEvent.Send(status);
+}
diff --git a/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.h b/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.h
new file mode 100644
index 0000000000..e096072cc2
--- /dev/null
+++ b/Modules/Segmentation/Interactions/mitkSegmentAnythingTool.h
@@ -0,0 +1,226 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef mitkSegmentAnythingTool_h
+#define mitkSegmentAnythingTool_h
+
+#include "mitkSegWithPreviewTool.h"
+#include "mitkPointSet.h"
+#include "mitkProcessExecutor.h"
+#include "mitkSegmentAnythingPythonService.h"
+#include <MitkSegmentationExports.h>
+#include <itkImage.h>
+#include <mitkLevelWindow.h>
+
+namespace us
+{
+  class ModuleResource;
+}
+
+namespace mitk
+{
+  /**
+  \brief Segment Anything Model interactive 2D tool class.
+
+  \ingroup ToolManagerEtAl
+  \sa mitk::Tool
+  \sa QmitkInteractiveSegmentation
+
+  */
+  class MITKSEGMENTATION_EXPORT SegmentAnythingTool : public SegWithPreviewTool
+  {
+  public:
+    mitkClassMacro(SegmentAnythingTool, SegWithPreviewTool);
+    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;
+
+    /**
+     * @brief  Clears all picks and updates the preview.
+     */
+    void ClearPicks();
+
+    /**
+     * @brief Checks if any point exists in the either
+     * of the pointsets
+     * 
+     * @return bool 
+     */
+    bool HasPicks() const;
+
+    itkSetMacro(MitkTempDir, std::string);
+    itkGetConstMacro(MitkTempDir, std::string);
+
+    itkSetMacro(PythonPath, std::string);
+    itkGetConstMacro(PythonPath, std::string);
+
+    itkSetMacro(ModelType, std::string);
+    itkGetConstMacro(ModelType, std::string);
+
+    itkSetMacro(CheckpointPath, std::string);
+    itkGetConstMacro(CheckpointPath, std::string);
+
+    itkSetMacro(GpuId, int);
+    itkGetConstMacro(GpuId, int);
+    
+    itkSetMacro(TimeOutLimit, long);
+    itkGetConstMacro(TimeOutLimit, long);
+
+    itkSetMacro(IsReady, bool);
+    itkGetConstMacro(IsReady, bool);
+    itkBooleanMacro(IsReady);
+
+    /**
+     * @brief Initializes python service and
+     * starts async python daemon of SegmentAnything model.
+     * 
+     */
+    void InitSAMPythonProcess();
+
+    /**
+     * @brief Checks if Python daemon is ready to accept inputs.
+     * 
+     * @return bool 
+     */
+    bool IsPythonReady() const;
+
+    Message1<const std::string&> SAMStatusMessageEvent;
+
+  protected:
+    SegmentAnythingTool();
+    ~SegmentAnythingTool() = default;
+
+    void ConnectActionsAndFunctions() override;
+
+    /*
+     * @brief Add positive seed point action of StateMachine pattern
+     */
+    virtual void OnAddPositivePoint(StateMachineAction*, InteractionEvent *interactionEvent);
+    
+    /*
+     * @brief Add negative seed point action of StateMachine pattern
+     */
+    virtual void OnAddNegativePoint(StateMachineAction*, InteractionEvent *interactionEvent);
+
+    /*
+     * @brief Delete action of StateMachine pattern. The function deletes positive or negative points in 
+       the reverse order of creation. This is done by finding & deleting the Point having the highest 
+       PointIdentifier value from either of the PointSets m_PointSetPositive & m_PointSetNegative.
+     */
+    virtual void OnDelete(StateMachineAction*, InteractionEvent*);
+
+    /*
+     * @brief Clear all seed points and call UpdatePreview to reset the segmentation Preview
+     */
+    void ClearSeeds();
+
+    /**
+     * @brief Overriden method from the tool manager to execute the segmentation
+     * Implementation:
+     * 1. Creates Hash for input image from current plane geometry.
+     * 2. Transfers image pointer to python service along with the hash code.
+     * 3. Creates seed points as CSV string & transfers to python service
+     * 3. Retrieves resulting segmentation Image pointer from python service and sets to previewImage.
+     *
+     * @param inputAtTimeStep
+     * @param oldSegAtTimeStep
+     * @param previewImage
+     * @param timeStep
+     */
+    void DoUpdatePreview(const Image *inputAtTimeStep, const Image *oldSegAtTimeStep, LabelSetImage *previewImage, TimeStepType timeStep) override;
+
+    /**
+     * @brief Get the Points from positive and negative pointsets as std::vector.
+     * 
+     * @param baseGeometry of Image
+     * @return std::vector<std::pair<mitk::Point2D, std::string>> 
+     */
+    std::vector<std::pair<mitk::Point2D, std::string>> GetPointsAsVector(const mitk::BaseGeometry*);
+
+    /**
+     * @brief Get the Points from positive and negative pointsets as csv string.
+     * 
+     * @param baseGeometry 
+     * @return std::stringstream 
+     */
+    std::stringstream GetPointsAsCSVString(const mitk::BaseGeometry *baseGeometry);
+
+    /**
+     * @brief Get the Hash For Current Plane from current working plane geometry.
+     * 
+     * @return std::string 
+     */
+    std::string GetHashForCurrentPlane(const mitk::LevelWindow&);
+
+    /**
+     * @brief Emits message to connected Listnerers.
+     * 
+     */
+    void EmitSAMStatusMessageEvent(const std::string&);
+
+    /**
+     * @brief Cleans up segmentation preview and clears all seeds.
+     * 
+     */
+    void ConfirmCleanUp() override;
+
+    /**
+     * @brief Applies ITK IntensityWindowing Filter to input image;
+     *
+     */
+    template <typename TPixel, unsigned int VImageDimension>
+    void ITKWindowing(const itk::Image<TPixel, VImageDimension>*, mitk::Image*, ScalarType, ScalarType);
+
+  private:
+    /**
+     * @brief Convert 3D world coordinates to 2D indices.
+     * 
+     * @param baseGeometry 
+     * @param mitk::Point3D
+     * @return mitk::Point2D 
+     */
+    static mitk::Point2D Get2DIndicesfrom3DWorld(const mitk::BaseGeometry*, const mitk::Point3D&);
+
+    /**
+     * @brief Checks if the image has valid size across each dimension. This function is 
+     * critical for 2D images since 2D image are not valid in Saggital and Coronal views.
+     * 
+     * @param inputAtTimeStep 
+     * @return bool 
+     */
+    bool IsImageAtTimeStepValid(const Image *inputAtTimeStep);
+
+    std::string m_MitkTempDir;
+    std::string m_PythonPath;
+    std::string m_ModelType;
+    std::string m_CheckpointPath;
+    int m_GpuId = 0;
+    PointSet::Pointer m_PointSetPositive;
+    PointSet::Pointer m_PointSetNegative;
+    DataNode::Pointer m_PointSetNodePositive;
+    DataNode::Pointer m_PointSetNodeNegative;
+    bool m_IsGenerateEmbeddings = true;
+    bool m_IsReady = false;
+    int m_PointSetCount = 0;
+    long m_TimeOutLimit = -1;
+    std::unique_ptr<SegmentAnythingPythonService> m_PythonService;
+    const Label::PixelType MASK_VALUE = 1;
+  };
+} // namespace
+
+#endif
diff --git a/Modules/Segmentation/files.cmake b/Modules/Segmentation/files.cmake
index f9c467ab8b..c43ee4e133 100644
--- a/Modules/Segmentation/files.cmake
+++ b/Modules/Segmentation/files.cmake
@@ -1,120 +1,123 @@
 set(CPP_FILES
   Algorithms/mitkCalculateSegmentationVolume.cpp
   Algorithms/mitkContourModelSetToImageFilter.cpp
   Algorithms/mitkContourSetToPointSetFilter.cpp
   Algorithms/mitkContourUtils.cpp
   Algorithms/mitkCorrectorAlgorithm.cpp
   Algorithms/mitkDiffImageApplier.cpp
   Algorithms/mitkDiffSliceOperation.cpp
   Algorithms/mitkDiffSliceOperationApplier.cpp
   Algorithms/mitkFeatureBasedEdgeDetectionFilter.cpp
   Algorithms/mitkGrowCutSegmentationFilter.cpp
   Algorithms/mitkImageLiveWireContourModelFilter.cpp
   Algorithms/mitkImageToContourFilter.cpp
   #Algorithms/mitkImageToContourModelFilter.cpp
   Algorithms/mitkImageToLiveWireContourFilter.cpp
   Algorithms/mitkManualSegmentationToSurfaceFilter.cpp
   Algorithms/mitkOtsuSegmentationFilter.cpp
   Algorithms/mitkSegmentationHelper.cpp
   Algorithms/mitkSegmentationObjectFactory.cpp
   Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp
   Algorithms/mitkShowSegmentationAsSmoothedSurface.cpp
   Algorithms/mitkShowSegmentationAsSurface.cpp
   Algorithms/mitkVtkImageOverwrite.cpp
   Controllers/mitkSegmentationInterpolationController.cpp
   Controllers/mitkToolManager.cpp
   Controllers/mitkSegmentationModuleActivator.cpp
   Controllers/mitkToolManagerProvider.cpp
   DataManagement/mitkContour.cpp
   DataManagement/mitkContourSet.cpp
   DataManagement/mitkExtrudedContour.cpp
   Interactions/mitkAddContourTool.cpp
   Interactions/mitkAutoCropTool.cpp
   Interactions/mitkSegWithPreviewTool.cpp
   Interactions/mitkBinaryThresholdBaseTool.cpp
   Interactions/mitkBinaryThresholdTool.cpp
   Interactions/mitkBinaryThresholdULTool.cpp
   Interactions/mitkCloseRegionTool.cpp
   Interactions/mitkContourModelInteractor.cpp
   Interactions/mitkContourModelLiveWireInteractor.cpp
   Interactions/mitkEditableContourTool.cpp
   Interactions/mitkLiveWireTool2D.cpp
   Interactions/mitkLassoTool.cpp
   Interactions/mitkContourTool.cpp
   Interactions/mitkDrawPaintbrushTool.cpp
   Interactions/mitkErasePaintbrushTool.cpp
   Interactions/mitkEraseRegionTool.cpp
   Interactions/mitkFeedbackContourTool.cpp
   Interactions/mitkFillRegionBaseTool.cpp
   Interactions/mitkFillRegionTool.cpp
   Interactions/mitkGrowCutTool.cpp
   Interactions/mitkOtsuTool3D.cpp
   Interactions/mitkPaintbrushTool.cpp
   Interactions/mitkRegionGrowingTool.cpp
   Interactions/mitkSegmentationsProcessingTool.cpp
   Interactions/mitkSegTool2D.cpp
   Interactions/mitkSubtractContourTool.cpp
   Interactions/mitkTool.cpp
   Interactions/mitkToolCommand.cpp
   Interactions/mitkPickingTool.cpp
   Interactions/mitknnUnetTool.cpp
   Interactions/mitkProcessExecutor.cpp
+  Interactions/mitkSegmentAnythingProcessExecutor.cpp
   Interactions/mitkMonaiLabelTool.cpp
   Interactions/mitkMonaiLabel2DTool.cpp
   Interactions/mitkMonaiLabel3DTool.cpp
   Interactions/mitkTotalSegmentatorTool.cpp
+  Interactions/mitkSegmentAnythingTool.cpp
+  Interactions/mitkSegmentAnythingPythonService.cpp
   Rendering/mitkContourMapper2D.cpp
   Rendering/mitkContourSetMapper2D.cpp
   Rendering/mitkContourSetVtkMapper3D.cpp
   Rendering/mitkContourVtkMapper3D.cpp
   SegmentationUtilities/BooleanOperations/mitkBooleanOperation.cpp
   SegmentationUtilities/MorphologicalOperations/mitkMorphologicalOperations.cpp
 #Added from ML
   Controllers/mitkSliceBasedInterpolationController.cpp
   Algorithms/mitkSurfaceStampImageFilter.cpp
 )
 
 set(RESOURCE_FILES
   Add.svg
   Add_Cursor.svg
   AI.svg
   AI_Cursor.svg
   Close.svg
   Close_Cursor.svg
   Erase.svg
   Erase_Cursor.svg
   Fill.svg
   Fill_Cursor.svg
   LiveWire.svg
   LiveWire_Cursor.svg
   Lasso.svg
   GrowCut.svg
   Lasso_Cursor.svg
   Otsu.svg
   Paint.svg
   Paint_Cursor.svg
   Picking.svg
   RegionGrowing.svg
   RegionGrowing_Cursor.svg
   Subtract.svg
   Subtract_Cursor.svg
   Threshold.svg
   ULThreshold.svg
   Wipe.svg
   Wipe_Cursor.svg
 
   Interactions/dummy.xml
   Interactions/EditableContourTool.xml
   Interactions/PickingTool.xml
   Interactions/MouseReleaseOnly.xml
   Interactions/PressMoveRelease.xml
   Interactions/PressMoveReleaseAndPointSetting.xml
   Interactions/PressMoveReleaseWithCTRLInversion.xml
   Interactions/PressMoveReleaseWithCTRLInversionAllMouseMoves.xml
   Interactions/SegmentationConfig.xml
   Interactions/SegmentationInteraction.xml
   Interactions/SegmentationToolsConfig.xml
 
   Interactions/ContourModelModificationConfig.xml
   Interactions/ContourModelModificationInteractor.xml
 )
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingGUIControls.ui b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingGUIControls.ui
new file mode 100644
index 0000000000..6f1f495a00
--- /dev/null
+++ b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingGUIControls.ui
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QmitkSegmentAnythingGUIControls</class>
+ <widget class="QWidget" name="QmitkSegmentAnythingGUIControls">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>699</width>
+    <height>490</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Ignored" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>100</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>100000</width>
+    <height>100000</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>QmitkSegmentAnythingToolWidget</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <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>
+    <layout class="QGridLayout" name="basicSettingsLayout">
+     <item row="0" column="0" colspan="4">
+      <widget class="QLabel" name="welcomeNote">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Welcome to Segment Anything Model (SAM) tool in MITK. [Experimental]&lt;/p&gt;&lt;p&gt;Please note that this is only an interface to SAM. MITK does not ship with SAM. Make sure to have a working internet connection to install Segment Anything Model via MITK. &lt;/p&gt;&lt;p&gt;Refer to &lt;a href=&quot;https://segment-anything.com/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://segment-anything.com&lt;/span&gt;&lt;/a&gt; to learn everything about the Segment Anything Model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="textFormat">
+        <enum>Qt::RichText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="instructLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>
+Press SHIFT+Left-click for positive seeds.
+Press SHIFT+Right-click for negative seeds.
+Press DEL to remove last seed.
+        </string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QPushButton" name="resetButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>100000</width>
+       <height>16777215</height>
+      </size>
+     </property>
+     <property name="text">
+      <string>Reset Picks</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QPushButton" name="activateButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>100000</width>
+       <height>16777215</height>
+      </size>
+     </property>
+     <property name="text">
+      <string>Initialize Segment Anything</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QLabel" name="statusLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QProgressBar" name="samProgressBar">
+     <property name="maximum">
+      <number>1</number>
+     </property>
+     <property name="value">
+      <number>0</number>
+     </property>
+     <property name="textVisible">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>ctkComboBox</class>
+   <extends>QComboBox</extends>
+   <header location="global">ctkComboBox.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ctkCollapsibleGroupBox</class>
+   <extends>QWidget</extends>
+   <header>ctkCollapsibleGroupBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.cpp b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.cpp
new file mode 100644
index 0000000000..59bcbfab63
--- /dev/null
+++ b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.cpp
@@ -0,0 +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.
+
+============================================================================*/
+
+#include "QmitkSegmentAnythingToolGUI.h"
+
+#include <mitkSegmentAnythingTool.h>
+#include <mitkProcessExecutor.h>
+#include <QApplication>
+#include <QDir>
+#include <QmitkStyleManager.h>
+#include <QDirIterator>
+#include <QFileDialog>
+
+#include <mitkCoreServices.h>
+#include <mitkIPreferencesService.h>
+
+MITK_TOOL_GUI_MACRO(MITKSEGMENTATIONUI_EXPORT, QmitkSegmentAnythingToolGUI, "")
+
+namespace
+{
+  mitk::IPreferences *GetPreferences()
+  {
+    auto *preferencesService = mitk::CoreServices::GetPreferencesService();
+    return preferencesService->GetSystemPreferences()->Node("org.mitk.views.segmentation");
+  }
+}
+
+QmitkSegmentAnythingToolGUI::QmitkSegmentAnythingToolGUI() : QmitkSegWithPreviewToolGUIBase(true)
+{
+  m_EnableConfirmSegBtnFnc = [this](bool enabled)
+  {
+    bool result = false;
+    auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+    if (nullptr != tool)
+    {
+      result = enabled && tool->HasPicks();
+    }
+    return result;
+  };
+  m_Preferences = GetPreferences();
+  m_Preferences->OnPropertyChanged +=
+    mitk::MessageDelegate1<QmitkSegmentAnythingToolGUI, const mitk::IPreferences::ChangeEvent &>(
+      this, &QmitkSegmentAnythingToolGUI::OnPreferenceChangedEvent);
+}
+
+QmitkSegmentAnythingToolGUI::~QmitkSegmentAnythingToolGUI() 
+{
+  auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+  if (nullptr != tool)
+  {
+    tool->SAMStatusMessageEvent -= mitk::MessageDelegate1<QmitkSegmentAnythingToolGUI, const std::string&>(
+      this, &QmitkSegmentAnythingToolGUI::StatusMessageListener);
+  }
+}
+
+void QmitkSegmentAnythingToolGUI::InitializeUI(QBoxLayout *mainLayout)
+{
+  m_Controls.setupUi(this);
+  m_Controls.statusLabel->setTextFormat(Qt::RichText);
+
+  QString welcomeText;
+  if (m_GpuLoader.GetGPUCount() != 0)
+  {
+    welcomeText = "<b>STATUS: </b><i>Welcome to Segment Anything tool. You're in luck: " +
+                  QString::number(m_GpuLoader.GetGPUCount()) + " GPU(s) were detected.</i>";
+  }
+  else
+  {
+    welcomeText = "<b>STATUS: </b><i>Welcome to Segment Anything tool. Sorry, " +
+                  QString::number(m_GpuLoader.GetGPUCount()) + " GPUs were detected.</i>";
+  }
+  connect(m_Controls.activateButton, SIGNAL(clicked()), this, SLOT(OnActivateBtnClicked()));
+  connect(m_Controls.resetButton, SIGNAL(clicked()), this, SLOT(OnResetPicksClicked()));
+
+  QIcon arrowIcon = QmitkStyleManager::ThemeIcon(
+    QStringLiteral(":/org_mitk_icons/icons/tango/scalable/actions/media-playback-start.svg"));
+  m_Controls.activateButton->setIcon(arrowIcon);
+
+  bool isInstalled = this->ValidatePrefences();
+  if (isInstalled)
+  {
+    QString modelType = QString::fromStdString(m_Preferences->Get("sam modeltype", ""));
+    welcomeText += " SAM is already found installed. Model type '" + modelType + "' selected in Preferences.";
+  }
+  else
+  {
+    welcomeText += " SAM tool is not configured correctly. Please go to Preferences (Cntl+P) > Segment Anything to configure and/or install SAM.";
+  }
+  this->EnableAll(isInstalled);
+  this->WriteStatusMessage(welcomeText);
+  this->ShowProgressBar(false);
+  m_Controls.samProgressBar->setMaximum(0);
+  mainLayout->addLayout(m_Controls.verticalLayout);
+  Superclass::InitializeUI(mainLayout);
+}
+
+bool QmitkSegmentAnythingToolGUI::ValidatePrefences()
+{
+  const QString storageDir = QString::fromStdString(m_Preferences->Get("sam python path", ""));
+  bool isInstalled = QmitkSegmentAnythingToolGUI::IsSAMInstalled(storageDir);
+  std::string modelType = m_Preferences->Get("sam modeltype", "");
+  std::string path = m_Preferences->Get("sam parent path", "");
+  return (isInstalled && !modelType.empty() && !path.empty());
+}
+
+void QmitkSegmentAnythingToolGUI::EnableAll(bool isEnable)
+{
+  m_Controls.activateButton->setEnabled(isEnable);
+}
+
+void QmitkSegmentAnythingToolGUI::WriteStatusMessage(const QString &message)
+{
+  m_Controls.statusLabel->setText(message);
+  m_Controls.statusLabel->setStyleSheet("font-weight: bold; color: white");
+  qApp->processEvents();
+}
+
+void QmitkSegmentAnythingToolGUI::WriteErrorMessage(const QString &message)
+{
+  m_Controls.statusLabel->setText(message);
+  m_Controls.statusLabel->setStyleSheet("font-weight: bold; color: red");
+  qApp->processEvents();
+}
+
+void QmitkSegmentAnythingToolGUI::ShowErrorMessage(const std::string &message, QMessageBox::Icon icon)
+{
+  this->setCursor(Qt::ArrowCursor);
+  QMessageBox *messageBox = new QMessageBox(icon, nullptr, message.c_str());
+  messageBox->exec();
+  delete messageBox;
+  MITK_WARN << message;
+}
+
+void QmitkSegmentAnythingToolGUI::StatusMessageListener(const std::string &message)
+{
+  if (message.rfind("Error", 0) == 0)
+  {
+    this->EnableAll(true);
+    this->WriteErrorMessage(QString::fromStdString(message));
+  }
+  else if (message == "TimeOut")
+  { // trying to re init the daemon
+    this->WriteErrorMessage(QString("<b>STATUS: </b><i>Sorry, operation timed out. Reactivating SAM tool...</i>"));
+    if (this->ActivateSAMDaemon())
+    {
+      this->WriteStatusMessage(QString("<b>STATUS: </b><i>Segment Anything tool re-initialized.</i>"));
+    }
+    else
+    {
+      this->WriteErrorMessage(QString("<b>STATUS: </b><i>Couldn't init tool backend.</i>"));
+      this->EnableAll(true);
+    }
+  }
+  else
+  {
+    this->WriteStatusMessage(QString::fromStdString(message));
+  }
+}
+
+void QmitkSegmentAnythingToolGUI::OnActivateBtnClicked()
+{
+  auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+  if (nullptr == tool)
+  {
+    return;
+  }
+  try
+  {
+    this->EnableAll(false);
+    qApp->processEvents();
+    QString pythonPath = QString::fromStdString(m_Preferences->Get("sam python path", ""));
+    if (!QmitkSegmentAnythingToolGUI::IsSAMInstalled(pythonPath))
+    {
+      throw std::runtime_error(WARNING_SAM_NOT_FOUND);
+    }
+    tool->SetPythonPath(pythonPath.toStdString());
+    tool->SetGpuId(m_Preferences->GetInt("sam gpuid", -1));
+    const QString modelType = QString::fromStdString(m_Preferences->Get("sam modeltype", ""));  
+    tool->SetModelType(modelType.toStdString());
+    tool->SetTimeOutLimit(m_Preferences->GetInt("sam timeout", 300));
+    tool->SetCheckpointPath(m_Preferences->Get("sam parent path", ""));
+    this->WriteStatusMessage(
+      QString("<b>STATUS: </b><i>Initializing Segment Anything Model...</i>"));
+    tool->SAMStatusMessageEvent += mitk::MessageDelegate1<QmitkSegmentAnythingToolGUI,const std::string&>(
+      this, &QmitkSegmentAnythingToolGUI::StatusMessageListener);
+    if (this->ActivateSAMDaemon())
+    {
+      this->WriteStatusMessage(QString("<b>STATUS: </b><i>Segment Anything tool initialized.</i>"));
+    }
+    else
+    {
+      this->WriteErrorMessage(QString("<b>STATUS: </b><i>Couldn't init tool backend.</i>"));
+      this->EnableAll(true);
+    }
+  }
+  catch (const std::exception &e)
+  {
+    std::stringstream errorMsg;
+    errorMsg << "<b>STATUS: </b>Error while processing parameters for Segment Anything segmentation. Reason: " << e.what();
+    this->ShowErrorMessage(errorMsg.str());
+    this->WriteErrorMessage(QString::fromStdString(errorMsg.str()));
+    this->EnableAll(true);
+    return;
+  }
+  catch (...)
+  {
+    std::string errorMsg = "Unkown error occured while generation Segment Anything segmentation.";
+    this->ShowErrorMessage(errorMsg);
+    this->EnableAll(true);
+    return;
+  }
+}
+
+bool QmitkSegmentAnythingToolGUI::ActivateSAMDaemon()
+{
+  auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+  if (nullptr == tool)
+  {
+    return false;
+  }
+  this->ShowProgressBar(true);
+  qApp->processEvents();
+  try
+  {
+    tool->InitSAMPythonProcess();
+    while (!tool->IsPythonReady())
+    {
+      qApp->processEvents();
+    }
+    tool->IsReadyOn();
+  }
+  catch (...)
+  {
+    tool->IsReadyOff();
+  }
+  this->ShowProgressBar(false);
+  return tool->GetIsReady();
+}
+
+void QmitkSegmentAnythingToolGUI::ShowProgressBar(bool enabled)
+{
+  m_Controls.samProgressBar->setEnabled(enabled);
+  m_Controls.samProgressBar->setVisible(enabled);
+}
+
+bool QmitkSegmentAnythingToolGUI::IsSAMInstalled(const QString &pythonPath)
+{
+  QString fullPath = pythonPath;
+  bool isPythonExists = false;
+  bool isSamExists = false;
+#ifdef _WIN32
+  isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python.exe"));
+  if (!(fullPath.endsWith("Scripts", Qt::CaseInsensitive) || fullPath.endsWith("Scripts/", Qt::CaseInsensitive)))
+  {
+    fullPath += QDir::separator() + QString("Scripts");
+    isPythonExists =
+      (!isPythonExists) ? QFile::exists(fullPath + QDir::separator() + QString("python.exe")) : isPythonExists;
+  }
+#else
+  isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python3"));
+  if (!(fullPath.endsWith("bin", Qt::CaseInsensitive) || fullPath.endsWith("bin/", Qt::CaseInsensitive)))
+  {
+    fullPath += QDir::separator() + QString("bin");
+    isPythonExists =
+      (!isPythonExists) ? QFile::exists(fullPath + QDir::separator() + QString("python3")) : isPythonExists;
+  }
+#endif
+  isSamExists = QFile::exists(fullPath + QDir::separator() + QString("run_inference_daemon.py"));
+  bool isExists = isSamExists && isPythonExists;
+  return isExists;
+}
+
+void QmitkSegmentAnythingToolGUI::OnResetPicksClicked()
+{
+  auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+  if (nullptr != tool)
+  {
+    tool->ClearPicks();
+  }
+}
+
+void QmitkSegmentAnythingToolGUI::OnPreferenceChangedEvent(const mitk::IPreferences::ChangeEvent&)
+{
+  this->EnableAll(true);
+  this->WriteStatusMessage("A Preference change was detected. Please initialize the tool again.");
+  auto tool = this->GetConnectedToolAs<mitk::SegmentAnythingTool>();
+  if (nullptr != tool)
+  {
+    tool->IsReadyOff();
+  }
+}
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.h
new file mode 100644
index 0000000000..7349f6a578
--- /dev/null
+++ b/Modules/SegmentationUI/Qmitk/QmitkSegmentAnythingToolGUI.h
@@ -0,0 +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 QmitkSegmentAnythingToolGUI_h
+#define QmitkSegmentAnythingToolGUI_h
+
+#include "QmitkSegWithPreviewToolGUIBase.h"
+#include <MitkSegmentationUIExports.h>
+#include "ui_QmitkSegmentAnythingGUIControls.h"
+#include "QmitknnUNetGPU.h"
+#include "QmitkSetupVirtualEnvUtil.h"
+#include <QMessageBox>
+#include <QStandardPaths>
+#include <mitkIPreferences.h>
+
+/**
+\ingroup org_mitk_gui_qt_interactivesegmentation_internal
+\brief GUI for mitk::SegmentAnythingTool.
+*/
+class MITKSEGMENTATIONUI_EXPORT QmitkSegmentAnythingToolGUI : public QmitkSegWithPreviewToolGUIBase
+{
+  Q_OBJECT
+
+public:
+  mitkClassMacro(QmitkSegmentAnythingToolGUI, QmitkSegWithPreviewToolGUIBase);
+  itkFactorylessNewMacro(Self);
+  itkCloneMacro(Self);
+
+  /**
+   * @brief Checks if SegmentAnything is found inside the selected python virtual environment.
+   * @return bool
+   */
+  static bool IsSAMInstalled(const QString &);
+
+protected slots:
+  /**
+   * @brief Qt Slot
+   */
+  void OnResetPicksClicked();
+
+  /**
+   * @brief Qt Slot
+   */
+  void OnActivateBtnClicked();
+
+protected:
+  QmitkSegmentAnythingToolGUI();
+  ~QmitkSegmentAnythingToolGUI();
+
+  void InitializeUI(QBoxLayout *mainLayout) override;
+  
+  /**
+   * @brief Writes any message in white on the tool pane.
+   */
+  void WriteStatusMessage(const QString&);
+
+  /**
+   * @brief Writes any message in red on the tool pane.
+   */
+  void WriteErrorMessage(const QString&);
+
+  /**
+   * @brief Function to listen to tool class status emitters.
+   */
+  void StatusMessageListener(const std::string&);
+
+  /**
+   * @brief Function to listen to preference emitters.
+   */
+  void OnPreferenceChangedEvent(const mitk::IPreferences::ChangeEvent&);
+
+  /**
+   * @brief Creates a QMessage object and shows on screen.
+   */
+  void ShowErrorMessage(const std::string&, QMessageBox::Icon = QMessageBox::Critical);
+
+  /**
+   * @brief Enable (or Disable) GUI elements. Currently, on the activate button 
+   * is affected.
+   */
+  void EnableAll(bool);
+
+  /**
+   * @brief Enable (or Disable) progressbar on GUI
+   * 
+   */
+  void ShowProgressBar(bool);
+
+  /**
+   * @brief Requests the tool class to spawn the SAM python daemon 
+   * process. Waits until the daemon is started.
+   * 
+   * @return bool 
+   */
+  bool ActivateSAMDaemon();
+
+  /**
+   * @brief Checks if the preferences are correctly set by the user.
+   * 
+   * @return bool 
+   */
+  bool ValidatePrefences();
+
+private:
+  mitk::IPreferences* m_Preferences;
+  Ui_QmitkSegmentAnythingGUIControls m_Controls;
+  QmitkGPULoader m_GpuLoader;
+  bool m_FirstPreviewComputation = true;
+    const std::string WARNING_SAM_NOT_FOUND =
+    "SAM is not detected in the selected python environment. Please reinstall SAM.";
+};
+#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSetupVirtualEnvUtil.cpp b/Modules/SegmentationUI/Qmitk/QmitkSetupVirtualEnvUtil.cpp
index 50c6fe88f9..2cd4e90488 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSetupVirtualEnvUtil.cpp
+++ b/Modules/SegmentationUI/Qmitk/QmitkSetupVirtualEnvUtil.cpp
@@ -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.s
 
 ============================================================================*/
 
 #include "QmitkSetupVirtualEnvUtil.h"
 
 #include "mitkLog.h"
 #include <QStandardPaths>
 #include <itkCommand.h>
 
 QmitkSetupVirtualEnvUtil::QmitkSetupVirtualEnvUtil()
 {
   m_BaseDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QDir::separator() +
               qApp->organizationName() + QDir::separator();
 }
 
 QmitkSetupVirtualEnvUtil::QmitkSetupVirtualEnvUtil(const QString &baseDir)
 {
   m_BaseDir = baseDir;
 }
 
 QString& QmitkSetupVirtualEnvUtil::GetBaseDir()
 {
   return m_BaseDir;
 }
 
 QString QmitkSetupVirtualEnvUtil::GetVirtualEnvPath()
 {
   return m_venvPath;
 }
 
 QString& QmitkSetupVirtualEnvUtil::GetSystemPythonPath()
 {
   return m_SysPythonPath;
 }
 
 QString& QmitkSetupVirtualEnvUtil::GetPythonPath()
 {
   return m_PythonPath;
 }
 
 QString& QmitkSetupVirtualEnvUtil::GetPipPath()
 {
   return m_PipPath;
 }
 
 void QmitkSetupVirtualEnvUtil::SetVirtualEnvPath(const QString &path)
 {
   m_venvPath = path;
 }
 
 void QmitkSetupVirtualEnvUtil::SetPipPath(const QString &path)
 {
   m_PipPath = path;
 }
 
 void QmitkSetupVirtualEnvUtil::SetPythonPath(const QString &path)
 {
   if (this->IsPythonPath(path))
   {
     m_PythonPath = path;
   }
   else
   {
     MITK_INFO << "Python was not detected in " + path.toStdString();
   }
 }
 
 void QmitkSetupVirtualEnvUtil::SetSystemPythonPath(const QString &path)
 {
   if (this->IsPythonPath(path))
   {
     m_SysPythonPath = path;
   }
   else
   {
     MITK_INFO << "Python was not detected in " + path.toStdString();
   }
 }
 
 void QmitkSetupVirtualEnvUtil::PrintProcessEvent(itk::Object * /*pCaller*/, const itk::EventObject &e, void *)
 {
   std::string testCOUT;
   std::string testCERR;
   const auto *pEvent = dynamic_cast<const mitk::ExternalProcessStdOutEvent *>(&e);
   if (pEvent)
   {
     testCOUT = testCOUT + pEvent->GetOutput();
     MITK_INFO << testCOUT;
   }
   const auto *pErrEvent = dynamic_cast<const mitk::ExternalProcessStdErrEvent *>(&e);
   if (pErrEvent)
   {
     testCERR = testCERR + pErrEvent->GetOutput();
     MITK_ERROR << testCERR;
   }
 }
 
 void QmitkSetupVirtualEnvUtil::InstallPytorch(const std::string &workingDir,
                                               void (*callback)(itk::Object *, const itk::EventObject &, void *))
 {
   mitk::ProcessExecutor::ArgumentListType args;
   auto spExec = mitk::ProcessExecutor::New();
   auto spCommand = itk::CStyleCommand::New();
   spCommand->SetCallback(callback);
   spExec->AddObserver(mitk::ExternalProcessOutputEvent(), spCommand);
   args.push_back("-m");
   args.push_back("pip");
   args.push_back("install");
   args.push_back("light-the-torch");
   spExec->Execute(workingDir, "python", args);
-  PipInstall("torch", workingDir, callback, "ltt");
+  PipInstall("torch==2.0.0", workingDir, callback, "ltt");
+  PipInstall("torchvision==0.15.0", workingDir, callback, "ltt");
 }
 
 void QmitkSetupVirtualEnvUtil::InstallPytorch()
 {
   this->InstallPytorch(GetPythonPath().toStdString(), &PrintProcessEvent);
 }
 
 void QmitkSetupVirtualEnvUtil::PipInstall(const std::string &library,
                                           const std::string &workingDir,
                                           void (*callback)(itk::Object *, const itk::EventObject &, void *),
                                           const std::string &command)
 {
   mitk::ProcessExecutor::ArgumentListType args;
   auto spExec = mitk::ProcessExecutor::New();
   auto spCommand = itk::CStyleCommand::New();
   spCommand->SetCallback(callback);
   spExec->AddObserver(mitk::ExternalProcessOutputEvent(), spCommand);
   args.push_back("install");
   args.push_back(library);
   spExec->Execute(workingDir, command, args);
 }
 
 void QmitkSetupVirtualEnvUtil::PipInstall(const std::string &library,
   void (*callback)(itk::Object*, const itk::EventObject&, void*),
   const std::string& command)
 {
   this->PipInstall(library, this->GetPipPath().toStdString(), callback, command);
 }
 
 void QmitkSetupVirtualEnvUtil::ExecutePython(const std::string &pythonCode,
                                              const std::string &workingDir,
                                              void (*callback)(itk::Object *, const itk::EventObject &, void *),
                                              const std::string &command)
 {
   mitk::ProcessExecutor::ArgumentListType args;
   auto spExec = mitk::ProcessExecutor::New();
   auto spCommand = itk::CStyleCommand::New();
   spCommand->SetCallback(callback);
   spExec->AddObserver(mitk::ExternalProcessOutputEvent(), spCommand);
   args.push_back("-c");
   args.push_back(pythonCode);
   spExec->Execute(workingDir, command, args);
 }
 
 void QmitkSetupVirtualEnvUtil::ExecutePython(const std::string &args,
                                              void (*callback)(itk::Object *, const itk::EventObject &, void *),
                                              const std::string &command)
 {
   this->ExecutePython(args, this->GetPythonPath().toStdString(), callback, command);
 }
 
 bool QmitkSetupVirtualEnvUtil::IsPythonPath(const QString &pythonPath)
 {
   QString fullPath = pythonPath;
   bool isExists =
 #ifdef _WIN32
     QFile::exists(fullPath + QDir::separator() + QString("python.exe"));
 #else
     QFile::exists(fullPath + QDir::separator() + QString("python3"));
 #endif
   return isExists;
 }
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
index 5344f253a6..331990c3ed 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
@@ -1,428 +1,428 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkSlicesInterpolator_h
 #define QmitkSlicesInterpolator_h
 
 #include "mitkDataNode.h"
 #include "mitkDataStorage.h"
 #include "mitkSegmentationInterpolationController.h"
 #include "mitkSurfaceInterpolationController.h"
 #include "mitkToolManager.h"
 #include <MitkSegmentationUIExports.h>
 
 #include "mitkFeatureBasedEdgeDetectionFilter.h"
 #include "mitkPointCloudScoringFilter.h"
 
 #include <QWidget>
 #include <map>
 
 #include <QCheckBox>
 #include <QComboBox>
 #include <QFrame>
 #include <QGroupBox>
 #include <QRadioButton>
 
 #include "mitkVtkRepresentationProperty.h"
 #include "vtkProperty.h"
 
 // For running 3D interpolation in background
 #include <QFuture>
 #include <QFutureWatcher>
 #include <QTimer>
 #include <QtConcurrentRun>
 
 namespace mitk
 {
   class PlaneGeometry;
   class SliceNavigationController;
   class TimeNavigationController;
 }
 
 class QPushButton;
 class QmitkRenderWindow;
 
 enum ModifyLabelActionTrigerred
 {
   Null,
   Erase,
   Merge
 };
 
 /**
   \brief GUI for slices interpolation.
 
   \ingroup ToolManagerEtAl
   \ingroup Widgets
 
   \sa QmitkInteractiveSegmentation
   \sa mitk::SegmentationInterpolation
 
   While mitk::SegmentationInterpolation does the bookkeeping of interpolation
   (keeping track of which slices contain how much segmentation) and the algorithmic work,
   QmitkSlicesInterpolator is responsible to watch the GUI, to notice, which slice is currently
   visible. It triggers generation of interpolation suggestions and also triggers acception of
   suggestions.
 
   \todo show/hide feedback on demand
 
   Last contributor: $Author: maleike $
 */
 class MITKSEGMENTATIONUI_EXPORT QmitkSlicesInterpolator : public QWidget
 {
   Q_OBJECT
 
 public:
   QmitkSlicesInterpolator(QWidget *parent = nullptr, const char *name = nullptr);
 
   /**
     To be called once before real use.
     */
   void Initialize(mitk::ToolManager *toolManager, const QList<QmitkRenderWindow*>& windows);
 
   /**
    * @brief
    *
    */
   void Uninitialize();
 
   ~QmitkSlicesInterpolator() override;
 
   /**
    * @brief Set the Data Storage object
    *
    * @param storage
    */
   void SetDataStorage(mitk::DataStorage::Pointer storage);
 
   /**
    * @brief Get the Data Storage object
    *
    * @return mitk::DataStorage*
    */
   mitk::DataStorage *GetDataStorage();
 
 
   /**
     Just public because it is called by itk::Commands. You should not need to call this.
   */
   void OnToolManagerWorkingDataModified();
 
   /**
     Just public because it is called by itk::Commands. You should not need to call this.
   */
   void OnToolManagerReferenceDataModified();
 
   /**
    * @brief Reacts to the time changed event.
    *
    * @param sender
    */
   void OnTimeChanged(itk::Object *sender, const itk::EventObject &);
 
   /**
    * @brief Reacts to the slice changed event
    *
    * @param sender
    */
   void OnSliceChanged(itk::Object *sender, const itk::EventObject &);
 
 
   void OnSliceNavigationControllerDeleted(const itk::Object *sender, const itk::EventObject &);
 
   /**
     Just public because it is called by itk::Commands. You should not need to call this.
   */
   void OnInterpolationInfoChanged(const itk::EventObject &);
 
   /**
     Just public because it is called by itk::Commands. You should not need to call this.
   */
   void OnInterpolationAborted(const itk::EventObject &);
 
   /**
     Just public because it is called by itk::Commands. You should not need to call this.
   */
   void OnSurfaceInterpolationInfoChanged(const itk::EventObject &);
 
 
 private:
   /**
    * @brief Set the visibility of the 3d interpolation
    */
   void Show3DInterpolationResult(bool);
 
   /**
    * @brief Function that reacts to a change in the activeLabel of the working segmentation image.
    *
    */
   void OnActiveLabelChanged(mitk::Label::PixelType);
 
   /**
    * @brief Function that reacts to a change in the layer.
    *
    */
   void OnLayerChanged();
 
   /**
    * @brief Function that handles label removal from the segmentation image.
    *
    */
   void OnRemoveLabel(mitk::Label::PixelType removedLabelValue);
 
   /**
    * @brief Function that to changes in the segmentation image. It handles the layer removal, addition, label erasure,
    *
    */
   void OnModifyLabelChanged(const itk::Object *caller,
                               const itk::EventObject & /*event*/);
 
   /**
    * @brief Add the necessary subscribers to the label set image, for UI responsiveness.
    *        It deals with remove label, change active label, layer changes and change in the label.
    *
    */
   void OnAddLabelSetConnection();
 
   /**
    * @brief Add the necessary subscribers to the current LabelSetImage at the layer input, for UI responsiveness.
    *        It deals with remove label, change active label, layer changes and change in the label.
    *
    * @param layerID
    */
   void OnAddLabelSetConnection(unsigned int layerID);
 
   /**
    * @brief Remove the subscribers for the different events to the segmentation image.
    *
    */
   void OnRemoveLabelSetConnection();
 
   /**
    * @brief Merge contours for the current layerID and current timeStep.
    *
    * @param timeStep
    * @param layerID
    */
   void MergeContours(unsigned int timeStep, unsigned int layerID);
 
 
   /**
    * @brief Prepare Inputs for 3D Interpolation.
    *
    */
   void PrepareInputsFor3DInterpolation();
 
 signals:
 
   void SignalRememberContourPositions(bool);
   void SignalShowMarkerNodes(bool);
 
 public slots:
 
   virtual void setEnabled(bool);
   /**
     Call this from the outside to enable/disable interpolation
   */
   void EnableInterpolation(bool);
 
   void Enable3DInterpolation(bool);
 
   /**
     Call this from the outside to accept all interpolations
   */
   void FinishInterpolation(mitk::SliceNavigationController *slicer = nullptr);
 
 protected slots:
 
   /**
     Reaction to button clicks.
   */
   void OnAcceptInterpolationClicked();
 
   /*
     Opens popup to ask about which orientation should be interpolated
   */
   void OnAcceptAllInterpolationsClicked();
 
   /*
    Reaction to button clicks
   */
   void OnAccept3DInterpolationClicked();
 
   /**
    * @brief Reaction to reinit 3D Interpolation. Re-reads the plane geometries of the image
    *         that should have generated the
    *
    */
   void OnReinit3DInterpolation();
 
   /*
    * Will trigger interpolation for all slices in given orientation (called from popup menu of
    * OnAcceptAllInterpolationsClicked)
    */
   void OnAcceptAllPopupActivated(QAction *action);
 
   /**
     Called on activation/deactivation
   */
   void OnInterpolationActivated(bool);
 
   void On3DInterpolationActivated(bool);
 
   void OnInterpolationMethodChanged(int index);
 
   // Enhancement for 3D interpolation
   void On2DInterpolationEnabled(bool);
   void On3DInterpolationEnabled(bool);
   void OnInterpolationDisabled(bool);
   void OnShowMarkers(bool);
 
   void Run3DInterpolation();
 
   /**
    * @brief Function triggers when the surface interpolation thread completes running.
    *        It is responsible for retrieving the data, rendering it in the active color label,
    *        storing the surface information in the feedback node.
    *
    */
   void OnSurfaceInterpolationFinished();
 
   void StartUpdateInterpolationTimer();
 
   void StopUpdateInterpolationTimer();
 
   void ChangeSurfaceColor();
 
   /**
    * @brief Removes all observers to the labelSetImage at the layerID specified.
    *        Is used when changing the segmentation image.
    *
    * @param labelSetImage
    * @param layerID
    */
   void OnRemoveLabelSetConnection(mitk::LabelSetImage* labelSetImage, unsigned int layerID);
 
 protected:
 
   typedef std::map<QAction*, mitk::SliceNavigationController*> ActionToSliceDimensionMapType;
   const ActionToSliceDimensionMapType CreateActionToSlicer(const QList<QmitkRenderWindow*>& windows);
   ActionToSliceDimensionMapType m_ActionToSlicerMap;
 
   void AcceptAllInterpolations(mitk::SliceNavigationController *slicer);
 
   /**
     Retrieves the currently selected PlaneGeometry from a SlicedGeometry3D that is generated by a
     SliceNavigationController
     and calls Interpolate to further process this PlaneGeometry into an interpolation.
 
     \param e is a actually a mitk::SliceNavigationController::GeometrySliceEvent, sent by a SliceNavigationController
-    \param slicer the SliceNavigationController
+    \param sliceNavigationController the SliceNavigationController
         */
   bool TranslateAndInterpolateChangedSlice(const itk::EventObject &e,
                                            mitk::SliceNavigationController *sliceNavigationController);
 
   bool TranslateAndInterpolateChangedSlice(const mitk::TimeGeometry* timeGeometry);
   /**
     Given a PlaneGeometry, this method figures out which slice of the first working image (of the associated
     ToolManager)
     should be interpolated. The actual work is then done by our SegmentationInterpolation object.
    */
   void Interpolate(mitk::PlaneGeometry *plane);
 
   /**
     Called internally to update the interpolation suggestion. Finds out about the focused render window and requests an
     interpolation.
    */
   void UpdateVisibleSuggestion();
 
   void SetCurrentContourListID();
 
 private:
   void InitializeWindow(QmitkRenderWindow* window);
   void HideAllInterpolationControls();
   void Show2DInterpolationControls(bool show);
   void Show3DInterpolationControls(bool show);
   void CheckSupportedImageDimension();
   void WaitForFutures();
   void NodeRemoved(const mitk::DataNode* node);
   void ClearSegmentationObservers();
 
   mitk::SegmentationInterpolationController::Pointer m_Interpolator;
   mitk::SurfaceInterpolationController::Pointer m_SurfaceInterpolator;
 
   mitk::FeatureBasedEdgeDetectionFilter::Pointer m_EdgeDetector;
   mitk::PointCloudScoringFilter::Pointer m_PointScorer;
 
   mitk::ToolManager::Pointer m_ToolManager;
   bool m_Initialized;
 
   unsigned int m_ControllerToTimeObserverTag;
   QHash<mitk::SliceNavigationController *, int> m_ControllerToSliceObserverTag;
   QHash<mitk::SliceNavigationController *, int> m_ControllerToDeleteObserverTag;
 
   std::map<mitk::LabelSetImage *, unsigned long> m_SegmentationObserverTags;
 
   unsigned int InterpolationInfoChangedObserverTag;
   unsigned int SurfaceInterpolationInfoChangedObserverTag;
   unsigned int InterpolationAbortedObserverTag;
 
   QGroupBox *m_GroupBoxEnableExclusiveInterpolationMode;
   QComboBox *m_CmbInterpolation;
   QPushButton *m_BtnApply2D;
   QPushButton *m_BtnApplyForAllSlices2D;
   QPushButton *m_BtnApply3D;
 
   // T28261
   // QPushButton *m_BtnSuggestPlane;
 
   QCheckBox *m_ChkShowPositionNodes;
   QPushButton *m_BtnReinit3DInterpolation;
 
   mitk::DataNode::Pointer m_FeedbackNode;
   mitk::DataNode::Pointer m_InterpolatedSurfaceNode;
   mitk::DataNode::Pointer m_3DContourNode;
 
   mitk::Image *m_Segmentation;
 
   mitk::SliceNavigationController *m_LastSNC;
   unsigned int m_LastSliceIndex;
 
   mitk::TimePointType m_TimePoint;
 
   bool m_2DInterpolationEnabled;
   bool m_3DInterpolationEnabled;
 
   unsigned int m_numTimesLabelSetConnectionAdded;
 
   mitk::DataStorage::Pointer m_DataStorage;
 
   QFuture<void> m_Future;
   QFutureWatcher<void> m_Watcher;
 
   QFuture<void> m_ModifyFuture;
   QFutureWatcher<void> m_ModifyWatcher;
 
   QTimer *m_Timer;
 
   QFuture<void> m_PlaneFuture;
   QFutureWatcher<void> m_PlaneWatcher;
 
   mitk::Label::PixelType m_PreviousActiveLabelValue;
   mitk::Label::PixelType m_CurrentActiveLabelValue;
 
   unsigned int m_PreviousLayerIndex;
   unsigned int m_CurrentLayerIndex;
   bool m_FirstRun;
 };
 
 #endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.cpp b/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.cpp
index 00837b995c..68dfb6aa6b 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.cpp
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.cpp
@@ -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.s
 
 ============================================================================*/
 
 #include "QmitknnUNetGPU.h"
 #include <QProcess>
 
 QmitkGPULoader::QmitkGPULoader()
 {
   QProcess process;
   process.start("nvidia-smi --query-gpu=name,memory.total --format=csv");
   process.waitForFinished(-1);
   QStringList infoStringList;
   while (process.canReadLine())
   {
     QString line = process.readLine();
     if (!line.startsWith("name"))
     {
       infoStringList << line;
     }
   }
   unsigned int count = 0;
   foreach (QString infoString, infoStringList)
   {
     QmitkGPUSpec spec;
     QStringList gpuDetails;
     gpuDetails = infoString.split(",");
     if(gpuDetails.count() == 2)
     {
-      spec.name = gpuDetails.at(0);
+      spec.name = gpuDetails.at(0).trimmed();
       spec.id = count;
-      spec.memory = gpuDetails.at(1);
+      spec.memory = gpuDetails.at(1).trimmed();
       this->m_Gpus.push_back(spec);
       ++count;
     }
   }
 }
 
 int QmitkGPULoader::GetGPUCount() const
 {
   return static_cast<int>(m_Gpus.size());
 }
 
 std::vector<QmitkGPUSpec> QmitkGPULoader::GetAllGPUSpecs()
 {
   return m_Gpus;
 }
diff --git a/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.cpp b/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.cpp
index 604206f78e..97327e8cab 100644
--- a/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.cpp
+++ b/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.cpp
@@ -1,258 +1,258 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkContourModelToImageWidget.h"
 #include <ui_QmitkContourModelToImageWidgetControls.h>
 
 #include <mitkDataStorage.h>
 #include <mitkImage.h>
 
 #include <mitkContourModelSet.h>
 #include <mitkContourModelSetToImageFilter.h>
 #include <mitkLabelSetImage.h>
 #include <mitkRenderingManager.h>
 #include <mitkTimeNavigationController.h>
 
 #include <QtConcurrentRun>
 #include <QFuture>
 #include <QFutureWatcher>
 #include <qmessagebox.h>
 
 static const char* const HelpText = "Select a image and a contour(set)";
 
 class QmitkContourModelToImageWidgetPrivate
 {
 public:
   QmitkContourModelToImageWidgetPrivate();
   ~QmitkContourModelToImageWidgetPrivate();
 
   /** @brief Check if selections is valid. */
   void SelectionControl( unsigned int index, const mitk::DataNode* selection);
 
-  /** @brief Enable buttons if data selction is valid. */
+  /** @brief Enable buttons if data selection is valid. */
   void EnableButtons(bool enable = true);
 
   /** @brief Does the actual contour filling */
   mitk::LabelSetImage::Pointer FillContourModelSetIntoImage(mitk::Image *image, mitk::ContourModelSet *contourSet, mitk::TimePointType timePoint);
 
   Ui::QmitkContourModelToImageWidgetControls m_Controls;
   QFutureWatcher<mitk::LabelSetImage::Pointer> m_Watcher;
 };
 
 QmitkContourModelToImageWidgetPrivate::QmitkContourModelToImageWidgetPrivate()
 {
 }
 
 QmitkContourModelToImageWidgetPrivate::~QmitkContourModelToImageWidgetPrivate()
 {
 }
 
 void QmitkContourModelToImageWidgetPrivate::EnableButtons(bool enable)
 {
   m_Controls.btnProcess->setEnabled(enable);
 }
 
 void QmitkContourModelToImageWidgetPrivate::SelectionControl(unsigned int index, const mitk::DataNode* /*selection*/)
 {
   QmitkDataSelectionWidget* dataSelectionWidget = m_Controls.dataSelectionWidget;
   mitk::DataNode::Pointer node = dataSelectionWidget->GetSelection(index);
 
   dataSelectionWidget->SetHelpText("");
   this->EnableButtons();
 }
 
 mitk::LabelSetImage::Pointer QmitkContourModelToImageWidgetPrivate::FillContourModelSetIntoImage(mitk::Image* image, mitk::ContourModelSet* contourSet, mitk::TimePointType timePoint)
 {
   // Use mitk::ContourModelSetToImageFilter to fill the ContourModelSet into the image
   mitk::ContourModelSetToImageFilter::Pointer contourFiller = mitk::ContourModelSetToImageFilter::New();
   auto timeStep = image->GetTimeGeometry()->TimePointToTimeStep(timePoint);
   contourFiller->SetTimeStep(timeStep);
   contourFiller->SetImage(image);
   contourFiller->SetInput(contourSet);
   contourFiller->MakeOutputBinaryOn();
 
   try
   {
     contourFiller->Update();
   }
   catch (const std::exception & e)
   {
     MITK_ERROR << "Error while converting contour model. "<< e.what();
   }
   catch (...)
   {
     MITK_ERROR << "Unknown error while converting contour model.";
   }
 
   if (nullptr == contourFiller->GetOutput())
   {
     MITK_ERROR<<"Could not write the selected contours into the image!";
   }
 
   auto result = mitk::LabelSetImage::New();
   result->InitializeByLabeledImage(contourFiller->GetOutput());
 
   return result;
 }
 
 void QmitkContourModelToImageWidget::OnSelectionChanged(unsigned int index, const mitk::DataNode* selection)
 {
   Q_D(QmitkContourModelToImageWidget);
   QmitkDataSelectionWidget* dataSelectionWidget = d->m_Controls.dataSelectionWidget;
   mitk::DataNode::Pointer node0 = dataSelectionWidget->GetSelection(0);
   mitk::DataNode::Pointer node1 = dataSelectionWidget->GetSelection(1);
 
   if (node0.IsNull() || node1.IsNull() )
   {
     d->EnableButtons(false);
     dataSelectionWidget->SetHelpText(HelpText);
   }
   else
   {
     d->SelectionControl(index, selection);
   }
 }
 
 void QmitkContourModelToImageWidget::OnProcessingFinished()
 {
   // Called when processing finished
   // Adding the result to the data storage
 
   Q_D(QmitkContourModelToImageWidget);
 
   // Adding the result to the data storage
   auto result = d->m_Watcher.result();
   if (result.IsNotNull())
   {
     QmitkDataSelectionWidget* dataSelectionWidget = d->m_Controls.dataSelectionWidget;
     mitk::DataNode::Pointer imageNode = dataSelectionWidget->GetSelection(0);
     mitk::DataNode::Pointer contourNode = dataSelectionWidget->GetSelection(1);
 
     mitk::DataNode::Pointer filled = mitk::DataNode::New();
     std::stringstream stream;
     stream << imageNode->GetName();
     stream << "_";
     stream << contourNode->GetName();
     filled->SetName(stream.str());
     filled->SetData(result);
 
     auto dataStorage = dataSelectionWidget->GetDataStorage();
     if (dataStorage.IsNull())
     {
       std::string exception = "Cannot add result to the data storage. Data storage invalid.";
       MITK_ERROR << "Error filling contours into an image: " << exception;
       QMessageBox::information(nullptr, "Error filling contours into an image", QString::fromStdString(exception));
     }
 
     dataStorage->Add(filled, imageNode);
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   }
   else
   {
     MITK_ERROR<<"Error filling contours into an image!";
   }
 
   d->EnableButtons();
 }
 
 void QmitkContourModelToImageWidget::OnProcessPressed()
 {
   Q_D(QmitkContourModelToImageWidget);
 
   QmitkDataSelectionWidget* dataSelectionWidget = d->m_Controls.dataSelectionWidget;
 
   mitk::DataNode::Pointer imageNode = dataSelectionWidget->GetSelection(0);
   mitk::DataNode::Pointer contourNode = dataSelectionWidget->GetSelection(1);
 
   // Check if data nodes are valid
   if(imageNode.IsNull() || contourNode.IsNull() )
   {
     MITK_ERROR << "Selection does not contain valid data";
     QMessageBox::information( this, "Contour To Image",
                               "Selection does not contain valid data, please select a binary image and a contour(set)",
                               QMessageBox::Ok );
     d->m_Controls.btnProcess->setEnabled(false);
     return;
   }
 
   mitk::Image::Pointer image = static_cast<mitk::Image*>(imageNode->GetData());
 
   // Check if the image is valid
   if (image.IsNull())
   {
     MITK_ERROR<<"Error writing contours into image! Invalid image data selected!";
     return;
   }
 
   const mitk::TimePointType timePoint = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
   if (!image->GetTimeGeometry()->IsValidTimePoint(timePoint))
   {
     MITK_ERROR << "Error writing contours into image! Currently selected time point is not supported by selected image data.";
     return;
   }
 
   // Check if the selected contours are valid
   mitk::ContourModelSet::Pointer contourSet;
   mitk::ContourModel::Pointer contour = dynamic_cast<mitk::ContourModel*>(contourNode->GetData());
   if (contour.IsNotNull())
   {
     contourSet = mitk::ContourModelSet::New();
     contourSet->AddContourModel(contour);
   }
   else
   {
     contourSet = static_cast<mitk::ContourModelSet*>(contourNode->GetData());
     if (contourSet.IsNull())
     {
       MITK_ERROR<<"Error writing contours into binary image! Invalid contour data selected!";
       return;
     }
   }
 
   //Disable Buttons during calculation and initialize Progressbar
   d->EnableButtons(false);
 
   // Start the computation in a background thread
   QFuture< mitk::LabelSetImage::Pointer > future = QtConcurrent::run(d, &QmitkContourModelToImageWidgetPrivate::FillContourModelSetIntoImage, image, contourSet, timePoint);
   d->m_Watcher.setFuture(future);
 }
 
 QmitkContourModelToImageWidget::QmitkContourModelToImageWidget(mitk::DataStorage* dataStorage, QWidget* parent)
   : QWidget(parent)
   , d_ptr(new QmitkContourModelToImageWidgetPrivate())
 {
   Q_D(QmitkContourModelToImageWidget);
 
   // Set up UI
   d->m_Controls.setupUi(this);
   d->m_Controls.dataSelectionWidget->SetDataStorage(dataStorage);
   d->m_Controls.dataSelectionWidget->AddDataSelection(QmitkDataSelectionWidget::ImageAndSegmentationPredicate);
   d->m_Controls.dataSelectionWidget->AddDataSelection(QmitkDataSelectionWidget::ContourModelPredicate);
   d->m_Controls.dataSelectionWidget->SetHelpText(HelpText);
   d->EnableButtons(false);
 
   // Create connections
   connect (d->m_Controls.btnProcess, SIGNAL(pressed()), this, SLOT(OnProcessPressed()));
   connect(d->m_Controls.dataSelectionWidget, SIGNAL(SelectionChanged(unsigned int, const mitk::DataNode*)),
           this, SLOT(OnSelectionChanged(unsigned int, const mitk::DataNode*)));
   connect(&d->m_Watcher, SIGNAL(finished()), this, SLOT(OnProcessingFinished()));
 
   if( d->m_Controls.dataSelectionWidget->GetSelection(0).IsNotNull() &&
       d->m_Controls.dataSelectionWidget->GetSelection(1).IsNotNull() )
   {
     OnSelectionChanged(0, d->m_Controls.dataSelectionWidget->GetSelection(0));
   }
 }
 
 QmitkContourModelToImageWidget::~QmitkContourModelToImageWidget()
 {
 }
diff --git a/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.h b/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.h
index 797def3584..fb346b446d 100644
--- a/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.h
+++ b/Modules/SegmentationUI/SegmentationUtilities/QmitkContourModelToImageWidget.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 QmitkContourModelToImageWidget_h
 #define QmitkContourModelToImageWidget_h
 
 #include <MitkSegmentationUIExports.h>
 
 #include <QScopedPointer>
 #include <QWidget>
 
 class QmitkContourModelToImageWidgetPrivate;
 
 namespace mitk
 {
   class DataNode;
   class DataStorage;
   class Image;
   class ContourModelSet;
   class ContourModel;
   class Geometry3D;
   class PlaneGeometry;
 }
 
 /*!
   \brief QmitkContourModelToImageWidget
 
   Tool masks an image with a binary image or a surface. The Method requires
   an image and a binary image mask or a surface. The input image and the binary
   image mask must be of the same size. Masking with a surface creates first a
   binary image of the surface and then use this for the masking of the input image.
 */
 class MITKSEGMENTATIONUI_EXPORT QmitkContourModelToImageWidget : public QWidget
 {
   Q_OBJECT
 
 public:
 
   /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */
   explicit QmitkContourModelToImageWidget(mitk::DataStorage* dataStorage, QWidget* parent = nullptr);
-  /** @brief Defaul destructor. */
+  /** @brief Default destructor. */
   ~QmitkContourModelToImageWidget() override;
 
 private slots:
 
   /** @brief This slot is called if the selection in the workbench is changed. */
   void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection);
 
   /** @brief This slot is called if user activates the button to mask an image. */
   void OnProcessPressed();
 
   /** @brief This slot is called after processing is finished */
   void OnProcessingFinished();
 
 private:
 
   QScopedPointer<QmitkContourModelToImageWidgetPrivate> d_ptr;
 
   Q_DECLARE_PRIVATE(QmitkContourModelToImageWidget)
   Q_DISABLE_COPY(QmitkContourModelToImageWidget)
 };
 
 #endif
diff --git a/Modules/SegmentationUI/SegmentationUtilities/QmitkImageMaskingWidget.h b/Modules/SegmentationUI/SegmentationUtilities/QmitkImageMaskingWidget.h
index 5769a75990..3f82fcd570 100644
--- a/Modules/SegmentationUI/SegmentationUtilities/QmitkImageMaskingWidget.h
+++ b/Modules/SegmentationUI/SegmentationUtilities/QmitkImageMaskingWidget.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 QmitkImageMaskingWidget_h
 #define QmitkImageMaskingWidget_h
 
 #include <MitkSegmentationUIExports.h>
 
 #include <mitkDataStorage.h>
 #include <mitkSurface.h>
 
 #include <QWidget>
 
 namespace Ui
 {
   class QmitkImageMaskingWidgetControls;
 }
 
 namespace mitk
 {
   class Image;
 }
 
 /*!
   \brief QmitkImageMaskingWidget
 
   Tool masks an image with a binary image or a surface. The Method requires
   an image and a binary image mask or a surface. The input image and the binary
   image mask must be of the same size. Masking with a surface creates first a
   binary image of the surface and then use this for the masking of the input image.
 */
 class MITKSEGMENTATIONUI_EXPORT QmitkImageMaskingWidget : public QWidget
 {
   Q_OBJECT
 
 public:
 
   /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */
   explicit QmitkImageMaskingWidget(mitk::DataStorage* dataStorage, QWidget* parent = nullptr);
 
-  /** @brief Defaul destructor. */
+  /** @brief Default destructor. */
   ~QmitkImageMaskingWidget() override;
 
 private slots:
 
   /** @brief This slot is called if the selection in the workbench is changed. */
   void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection);
 
   /** @brief This slot is called if user activates the button to mask an image. */
   void OnMaskImagePressed();
 
   /** @brief This slot is called if the user toggles the "Custom" radio button. */
   void OnCustomValueButtonToggled(bool checked);
 
 private:
 
   /** @brief Check if selections is valid. */
   void SelectionControl( unsigned int index, const mitk::DataNode* selection);
 
-  /** @brief Enable buttons if data selction is valid. */
+  /** @brief Enable buttons if data selection is valid. */
   void EnableButtons(bool enable = true);
 
   /** @brief Mask an image with a given binary mask. Note that the input image and the mask image must be of the same size. */
   itk::SmartPointer<mitk::Image> MaskImage(itk::SmartPointer<mitk::Image> referenceImage, itk::SmartPointer<mitk::Image> maskImage );
 
   /** @brief Convert a surface into an binary image. */
   itk::SmartPointer<mitk::Image> ConvertSurfaceToImage( itk::SmartPointer<mitk::Image> image, mitk::Surface::Pointer surface );
 
   /** @brief Adds a new data object to the DataStorage.*/
   void AddToDataStorage(mitk::DataStorage::Pointer dataStorage, itk::SmartPointer<mitk::Image> segmentation,
                         const std::string& name, mitk::DataNode::Pointer parent = nullptr);
 
   Ui::QmitkImageMaskingWidgetControls* m_Controls;
 };
 
 #endif
diff --git a/Modules/SegmentationUI/SegmentationUtilities/QmitkSurfaceToImageWidget.h b/Modules/SegmentationUI/SegmentationUtilities/QmitkSurfaceToImageWidget.h
index b218cf76c9..030a8cb8a7 100644
--- a/Modules/SegmentationUI/SegmentationUtilities/QmitkSurfaceToImageWidget.h
+++ b/Modules/SegmentationUI/SegmentationUtilities/QmitkSurfaceToImageWidget.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 QmitkSurfaceToImageWidget_h
 #define QmitkSurfaceToImageWidget_h
 
 #include <MitkSegmentationUIExports.h>
 
 #include "itkSmartPointer.h"
 
 #include <QWidget>
 
 namespace Ui
 {
   class QmitkSurfaceToImageWidgetControls;
 }
 
 namespace mitk
 {
   class DataNode;
   class DataStorage;
   class Surface;
   class Image;
   class LabelSetImage;
 }
 
 /*!
   \brief QmitkSurfaceToImageWidget
 
   The Tool converts a surface to a binary image. The Method requires
   a surface and an image, which header information defines the output
   image. The resulting binary image has the same dimension, size, and
   Geometry3D as the input image.
 */
 class MITKSEGMENTATIONUI_EXPORT QmitkSurfaceToImageWidget : public QWidget
 {
   Q_OBJECT
 
 public:
 
   /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */
   explicit QmitkSurfaceToImageWidget(mitk::DataStorage* dataStorage, QWidget* parent = nullptr);
 
-  /** @brief Defaul destructor. */
+  /** @brief Default destructor. */
   ~QmitkSurfaceToImageWidget() override;
 
 private slots:
 
   /** @brief This slot is called if the selection in the workbench is changed. */
   void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection);
 
   /** @brief This slot is called if user activates the button to convert a surface into a binary image. */
   void OnSurface2ImagePressed();
 
 private:
 
-  /** @brief Enable buttons if data selction is valid. */
+  /** @brief Enable buttons if data selection is valid. */
   void EnableButtons(bool enable = true);
 
   /** @brief Convert a surface into an binary image. */
   itk::SmartPointer<mitk::LabelSetImage> ConvertSurfaceToImage( itk::SmartPointer<mitk::Image> image, itk::SmartPointer<mitk::Surface> surface );
 
   Ui::QmitkSurfaceToImageWidgetControls* m_Controls;
 };
 
 #endif
diff --git a/Modules/SegmentationUI/files.cmake b/Modules/SegmentationUI/files.cmake
index 4ed19de407..d2b5aeed4d 100644
--- a/Modules/SegmentationUI/files.cmake
+++ b/Modules/SegmentationUI/files.cmake
@@ -1,130 +1,133 @@
 set(CPP_FILES
   Qmitk/QmitkSegWithPreviewToolGUIBase.cpp
   Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.cpp
   Qmitk/QmitkBinaryThresholdToolGUIBase.cpp
   Qmitk/QmitkBinaryThresholdToolGUI.cpp
   Qmitk/QmitkBinaryThresholdULToolGUI.cpp
   Qmitk/QmitkConfirmSegmentationDialog.cpp
   Qmitk/QmitkCopyToClipBoardDialog.cpp
   Qmitk/QmitkDrawPaintbrushToolGUI.cpp
   Qmitk/QmitkErasePaintbrushToolGUI.cpp
   Qmitk/QmitkEditableContourToolGUIBase.cpp
   Qmitk/QmitkGrowCutToolGUI.cpp
   Qmitk/QmitkLiveWireTool2DGUI.cpp
   Qmitk/QmitkLassoToolGUI.cpp
   Qmitk/QmitkOtsuTool3DGUI.cpp
   Qmitk/QmitkPaintbrushToolGUI.cpp
   Qmitk/QmitkPickingToolGUI.cpp
   Qmitk/QmitkSlicesInterpolator.cpp
   Qmitk/QmitkToolGUI.cpp
   Qmitk/QmitkToolGUIArea.cpp
   Qmitk/QmitkToolSelectionBox.cpp
   Qmitk/QmitknnUNetFolderParser.cpp
   Qmitk/QmitknnUNetToolGUI.cpp
   Qmitk/QmitknnUNetWorker.cpp
   Qmitk/QmitknnUNetGPU.cpp
   Qmitk/QmitkSurfaceStampWidget.cpp
   Qmitk/QmitkMaskStampWidget.cpp
   Qmitk/QmitkStaticDynamicSegmentationDialog.cpp
   Qmitk/QmitkSimpleLabelSetListWidget.cpp
   Qmitk/QmitkSegmentationTaskListWidget.cpp
   Qmitk/QmitkTotalSegmentatorToolGUI.cpp
   Qmitk/QmitkSetupVirtualEnvUtil.cpp
   Qmitk/QmitkMultiLabelInspector.cpp
   Qmitk/QmitkMultiLabelManager.cpp
   Qmitk/QmitkMultiLabelTreeModel.cpp
   Qmitk/QmitkMultiLabelTreeView.cpp
   Qmitk/QmitkMultiLabelPresetHelper.cpp
   Qmitk/QmitkLabelColorItemDelegate.cpp
   Qmitk/QmitkLabelToggleItemDelegate.cpp
   Qmitk/QmitkFindSegmentationTaskDialog.cpp
+  Qmitk/QmitkSegmentAnythingToolGUI.cpp
   Qmitk/QmitkMonaiLabelToolGUI.cpp
   Qmitk/QmitkMonaiLabel2DToolGUI.cpp
   Qmitk/QmitkMonaiLabel3DToolGUI.cpp
   SegmentationUtilities/QmitkBooleanOperationsWidget.cpp
   SegmentationUtilities/QmitkContourModelToImageWidget.cpp
   SegmentationUtilities/QmitkImageMaskingWidget.cpp
   SegmentationUtilities/QmitkMorphologicalOperationsWidget.cpp
   SegmentationUtilities/QmitkSurfaceToImageWidget.cpp
   SegmentationUtilities/QmitkDataSelectionWidget.cpp
 )
 
 set(H_FILES
   Qmitk/QmitkMultiLabelPresetHelper.h
 )
 set(MOC_H_FILES
   Qmitk/QmitkSegWithPreviewToolGUIBase.h
   Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h
   Qmitk/QmitkBinaryThresholdToolGUIBase.h
   Qmitk/QmitkBinaryThresholdToolGUI.h
   Qmitk/QmitkBinaryThresholdULToolGUI.h
   Qmitk/QmitkConfirmSegmentationDialog.h
   Qmitk/QmitkCopyToClipBoardDialog.h
   Qmitk/QmitkDrawPaintbrushToolGUI.h
   Qmitk/QmitkErasePaintbrushToolGUI.h
   Qmitk/QmitkEditableContourToolGUIBase.h
   Qmitk/QmitkGrowCutToolGUI.h
   Qmitk/QmitkLiveWireTool2DGUI.h
   Qmitk/QmitkLassoToolGUI.h
   Qmitk/QmitkOtsuTool3DGUI.h
   Qmitk/QmitkPaintbrushToolGUI.h
   Qmitk/QmitkPickingToolGUI.h
   Qmitk/QmitkSlicesInterpolator.h
   Qmitk/QmitkToolGUI.h
   Qmitk/QmitkToolGUIArea.h
   Qmitk/QmitkToolSelectionBox.h
   Qmitk/QmitknnUNetFolderParser.h
   Qmitk/QmitknnUNetToolGUI.h
   Qmitk/QmitknnUNetGPU.h
   Qmitk/QmitknnUNetWorker.h
   Qmitk/QmitknnUNetEnsembleLayout.h
   Qmitk/QmitkSurfaceStampWidget.h
   Qmitk/QmitkMaskStampWidget.h
   Qmitk/QmitkStaticDynamicSegmentationDialog.h
   Qmitk/QmitkSimpleLabelSetListWidget.h
   Qmitk/QmitkSegmentationTaskListWidget.h
   Qmitk/QmitkTotalSegmentatorToolGUI.h
   Qmitk/QmitkSetupVirtualEnvUtil.h
   Qmitk/QmitkMultiLabelInspector.h
   Qmitk/QmitkMultiLabelManager.h
   Qmitk/QmitkMultiLabelTreeModel.h
   Qmitk/QmitkMultiLabelTreeView.h
   Qmitk/QmitkLabelColorItemDelegate.h
   Qmitk/QmitkLabelToggleItemDelegate.h
   Qmitk/QmitkFindSegmentationTaskDialog.h
+  Qmitk/QmitkSegmentAnythingToolGUI.h
   Qmitk/QmitkMonaiLabelToolGUI.h
   Qmitk/QmitkMonaiLabel2DToolGUI.h
   Qmitk/QmitkMonaiLabel3DToolGUI.h
   SegmentationUtilities/QmitkBooleanOperationsWidget.h
   SegmentationUtilities/QmitkContourModelToImageWidget.h
   SegmentationUtilities/QmitkImageMaskingWidget.h
   SegmentationUtilities/QmitkMorphologicalOperationsWidget.h
   SegmentationUtilities/QmitkSurfaceToImageWidget.h
   SegmentationUtilities/QmitkDataSelectionWidget.h
 )
 
 set(UI_FILES
   Qmitk/QmitkConfirmSegmentationDialog.ui
   Qmitk/QmitkGrowCutToolWidgetControls.ui
   Qmitk/QmitkOtsuToolWidgetControls.ui
   Qmitk/QmitkSurfaceStampWidgetGUIControls.ui
   Qmitk/QmitkMaskStampWidgetGUIControls.ui
   Qmitk/QmitknnUNetToolGUIControls.ui
   Qmitk/QmitkEditableContourToolGUIControls.ui
   Qmitk/QmitkSegmentationTaskListWidget.ui
   Qmitk/QmitkTotalSegmentatorGUIControls.ui
   Qmitk/QmitkMultiLabelInspectorControls.ui
   Qmitk/QmitkMultiLabelManagerControls.ui
   Qmitk/QmitkFindSegmentationTaskDialog.ui
+  Qmitk/QmitkSegmentAnythingGUIControls.ui
   Qmitk/QmitkMonaiLabelToolGUIControls.ui
   SegmentationUtilities/QmitkBooleanOperationsWidgetControls.ui
   SegmentationUtilities/QmitkContourModelToImageWidgetControls.ui
   SegmentationUtilities/QmitkImageMaskingWidgetControls.ui
   SegmentationUtilities/QmitkMorphologicalOperationsWidgetControls.ui
   SegmentationUtilities/QmitkSurfaceToImageWidgetControls.ui
   SegmentationUtilities/QmitkDataSelectionWidgetControls.ui
 )
 
 set(QRC_FILES
   resources/SegmentationUI.qrc
 )
diff --git a/Plugins/org.blueberry.core.commands/src/berryCommandEvent.h b/Plugins/org.blueberry.core.commands/src/berryCommandEvent.h
index 2fc3296faa..86348fa8ce 100755
--- a/Plugins/org.blueberry.core.commands/src/berryCommandEvent.h
+++ b/Plugins/org.blueberry.core.commands/src/berryCommandEvent.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 BERRYCOMMANDEVENT_H_
 #define BERRYCOMMANDEVENT_H_
 
 #include "common/berryAbstractNamedHandleEvent.h"
 
 #include <org_blueberry_core_commands_Export.h>
 
 namespace berry {
 
 class Command;
 
 /**
  * An instance of this class describes changes to an instance of
  * <code>Command</code>.
  * <p>
  * This class is not intended to be extended by clients.
  * </p>
  *
  * @see ICommandListener#CommandChanged(CommandEvent::Pointer)
  */
 class BERRY_COMMANDS CommandEvent : public AbstractNamedHandleEvent {
 
 public:
 
   berryObjectMacro(CommandEvent);
 
   /**
    * Creates a new instance of this class.
    *
    * @param command
    *            the instance of the interface that changed.
    * @param categoryChanged
    *            <code>true</code>, iff the category property changed.
    * @param definedChanged
    *            <code>true</code>, iff the defined property changed.
    * @param descriptionChanged
    *            <code>true</code>, iff the description property changed.
    * @param handledChanged
    *            <code>true</code>, iff the handled property changed.
    * @param nameChanged
    *            <code>true</code>, iff the name property changed.
    * @param parametersChanged
    *            <code>true</code> if the parameters have changed;
    *            <code>false</code> otherwise.
    * @param returnTypeChanged
    *            <code>true</code> iff the return type property changed;
    *            <code>false</code> otherwise.
    * @param helpContextIdChanged
    *            <code>true</code> iff the help context identifier changed;
    *            <code>false</code> otherwise.
    * @param enabledChanged
-   *            <code>true</code> iff the comand enablement changed;
+   *            <code>true</code> iff the command enablement changed;
    *            <code>false</code> otherwise.
    * @since 3.3
    */
   CommandEvent(const SmartPointer<Command> command, bool categoryChanged,
       bool definedChanged, bool descriptionChanged,
       bool handledChanged, bool nameChanged,
       bool parametersChanged, bool returnTypeChanged = false,
       bool helpContextIdChanged = false, bool enabledChanged = false);
 
   /**
    * Returns the instance of the interface that changed.
    *
    * @return the instance of the interface that changed. Guaranteed not to be
    *         <code>null</code>.
    */
   SmartPointer<Command> GetCommand() const;
 
   /**
    * Returns whether or not the category property changed.
    *
    * @return <code>true</code>, iff the category property changed.
    */
   bool IsCategoryChanged() const;
 
   /**
    * Returns whether or not the handled property changed.
    *
    * @return <code>true</code>, iff the handled property changed.
    */
   bool IsHandledChanged() const;
 
   /**
    * Returns whether or not the help context identifier changed.
    *
    * @return <code>true</code>, iff the help context identifier changed.
    * @since 3.2
    */
   bool IsHelpContextIdChanged() const;
 
   /**
    * Returns whether or not the parameters have changed.
    *
    * @return <code>true</code>, iff the parameters property changed.
    */
   bool IsParametersChanged() const;
 
   /**
    * Returns whether or not the return type property changed.
    *
    * @return <code>true</code>, iff the return type property changed.
    * @since 3.2
    */
   bool IsReturnTypeChanged() const;
 
   /**
    * Return whether the enable property changed.
    *
-   * @return <code>true</code> iff the comand enablement changed
+   * @return <code>true</code> iff the command enablement changed
    * @since 3.3
    */
   bool IsEnabledChanged() const;
 
 private:
 
   /**
    * The bit used to represent whether the command has changed its category.
    */
   static int CHANGED_CATEGORY(); // = LAST_USED_BIT << 1;
 
   /**
    * The bit used to represent whether the command has changed its handler.
    */
   static int CHANGED_HANDLED(); // = LAST_USED_BIT << 2;
 
   /**
    * The bit used to represent whether the command has changed its parameters.
    */
   static int CHANGED_PARAMETERS(); // = LAST_USED_BIT << 3;
 
   /**
    * The bit used to represent whether the command has changed its return
    * type.
    *
    * @since 3.2
    */
   static int CHANGED_RETURN_TYPE(); // = LAST_USED_BIT << 4;
 
   /**
    * The bit used to represent whether the command has changed its help
    * context identifier.
    *
    * @since 3.2
    */
   static int CHANGED_HELP_CONTEXT_ID(); // = LAST_USED_BIT << 5;
 
   /**
    * The bit used to represent whether this commands active handler has
    * changed its enablement state.
    *
    * @since 3.3
    */
   static int CHANGED_ENABLED(); // = LAST_USED_BIT << 6;
 
   /**
    * The command that has changed; this value is never <code>null</code>.
    */
   const SmartPointer<Command> command;
 
 };
 
 }
 
 #endif /* BERRYCOMMANDEVENT_H_ */
diff --git a/Plugins/org.blueberry.core.commands/src/berryIParameterValueConverter.h b/Plugins/org.blueberry.core.commands/src/berryIParameterValueConverter.h
index 487a0f66ee..f1139aeef0 100755
--- a/Plugins/org.blueberry.core.commands/src/berryIParameterValueConverter.h
+++ b/Plugins/org.blueberry.core.commands/src/berryIParameterValueConverter.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 BERRYABSTRACTPARAMETERVALUECONVERTER_H_
 #define BERRYABSTRACTPARAMETERVALUECONVERTER_H_
 
 #include <berryObject.h>
 #include <berryMacros.h>
 
 #include <org_blueberry_core_commands_Export.h>
 
 namespace berry {
 
 /**
  * <p>
  * Supports conversion between objects and strings for command parameter values.
  * Extenders must produce strings that identify objects (of a specific command
  * parameter type) as well as consume the strings to locate and return the
  * objects they identify.
  * </p>
  * <p>
  * This class offers multiple handlers of a command a consistent way of
  * converting string parameter values into the objects that the handlers would
  * prefer to deal with. This class also gives clients a way to serialize
  * object parameters as strings so that entire parameterized commands can be
  * serialized, stored and later deserialized and executed.
  * </p>
  * <p>
  * This class will typically be extended so the subclass can be referenced from
  * the <code>converter</code> attribute of the
- * <code>commandParameterType</code> elemement of the
+ * <code>commandParameterType</code> element of the
  * <code>org.blueberry.ui.commands</code> extension-point. Objects implementing
  * this interface may also be passed directly to
  * {@link ParameterType#Define} by clients.
  * </p>
  *
  * @see ParameterType#Define(IParameterValueConverter::Pointer)
  * @see ParameterizedCommand#Serialize()
  */
 struct BERRY_COMMANDS IParameterValueConverter {
 
   virtual ~IParameterValueConverter();
 
   /**
    * Converts a string encoded command parameter value into the parameter
    * value object.
    *
    * @param parameterValue
    *            a command parameter value string describing an object; may be
    *            <code>null</code>
    * @return the object described by the command parameter value string; may
    *         be <code>null</code>
    * @throws ParameterValueConversionException
    *             if an object cannot be produced from the
    *             <code>parameterValue</code> string
    */
   virtual Object::Pointer ConvertToObject(const QString& parameterValue) = 0;
 
   /**
    * Converts a command parameter value object into a string that encodes a
    * reference to the object or serialization of the object.
    *
    * @param parameterValue
    *            an object to convert into an identifying string; may be
    *            <code>null</code>
    * @return a string describing the provided object; may be <code>null</code>
    * @throws ParameterValueConversionException
    *             if a string reference or serialization cannot be provided for
    *             the <code>parameterValue</code>
    */
   virtual QString ConvertToString(const Object::Pointer& parameterValue) = 0;
 
 };
 
 }
 
 Q_DECLARE_INTERFACE(berry::IParameterValueConverter, "org.blueberry.core.commands.IParameterValueConverter")
 
 #endif /* BERRYABSTRACTPARAMETERVALUECONVERTER_H_ */
diff --git a/Plugins/org.blueberry.core.commands/src/common/berryCommandExceptions.h b/Plugins/org.blueberry.core.commands/src/common/berryCommandExceptions.h
index a0bbaf6124..e0523ac0b5 100644
--- a/Plugins/org.blueberry.core.commands/src/common/berryCommandExceptions.h
+++ b/Plugins/org.blueberry.core.commands/src/common/berryCommandExceptions.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 BERRYCOMMANDEXCEPTIONS_H_
 #define BERRYCOMMANDEXCEPTIONS_H_
 
 #include <org_blueberry_core_commands_Export.h>
 
 #include <ctkException.h>
 
 namespace berry {
 
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, CommandException, ctkRuntimeException)
 
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, ExecutionException, CommandException)
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, NotHandledException, CommandException)
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, NotDefinedException, CommandException)
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, NotEnabledException, CommandException)
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, ParameterValueConversionException, CommandException)
 
 /**
  * Signals that a problem has occurred while trying to create an instance of
  * <code>IParameterValues</code>. In applications based on the registry
  * provided by core, this usually indicates a problem creating an
  * <code>IExecutableExtension</code>. For other applications, this exception
  * could be used to signify any general problem during initialization.
  *
  */
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, ParameterValuesException, CommandException)
 
 /**
- * Signals that an exception occured while serializing a
+ * Signals that an exception occurred while serializing a
  * {@link ParameterizedCommand} to a string or deserializing a string to a
  * {@link ParameterizedCommand}.
  *
  * This class is not intended to be extended by clients.
  *
  */
 CTK_DECLARE_EXCEPTION(BERRY_COMMANDS, SerializationException, CommandException)
 
 
 }
 
 #endif /*BERRYCOMMANDEXCEPTIONS_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/plugin.xml b/Plugins/org.blueberry.core.expressions/plugin.xml
index 3509a3e70b..ed9cf70941 100644
--- a/Plugins/org.blueberry.core.expressions/plugin.xml
+++ b/Plugins/org.blueberry.core.expressions/plugin.xml
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?BlueBerry version="0.1"?>
 
 <plugin>
   <extension-point id="org.blueberry.core.expressions.propertyTesters" name="Property Tester Extension-Point" schema="schema/propertyTesters.exsd"/>
-  <extension-point id="org.blueberry.core.expressions.definitions" name="Defintions Extension-Point" schema="schema/definitions.exsd"/>
+  <extension-point id="org.blueberry.core.expressions.definitions" name="Definitions Extension-Point" schema="schema/definitions.exsd"/>
   <extension-point id="org.blueberry.core.expressions.commonExpression" name="Common Expressions Extension-Point" schema="schema/expressionLanguage.exsd"/>
 
   <extension point="org.blueberry.core.expressions.propertyTesters">
     <propertyTester
       id="org.blueberry.core.expressions.pluginPropertyTester"
       type="berry::ObjectTypeInfo"
       namespace="org.blueberry.core.runtime"
       properties="product,isPluginInstalled,pluginState"
       class="berry::PlatformPropertyTester">
     </propertyTester>
   </extension>
 </plugin>
diff --git a/Plugins/org.blueberry.core.expressions/src/berryPropertyTester.h b/Plugins/org.blueberry.core.expressions/src/berryPropertyTester.h
index ca5b531d59..aef7eeadf8 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryPropertyTester.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryPropertyTester.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 BERRYPROPERTYTESTER_H_
 #define BERRYPROPERTYTESTER_H_
 
 #include <berryIConfigurationElement.h>
 
 #include "internal/berryPropertyTesterDescriptor.h"
 
 #include <org_blueberry_core_expressions_Export.h>
 
 
 namespace berry {
 
 /**
  * Abstract superclass of all property testers. Implementation classes of
- * the extension point <code>org.blueberry.core.expresssions.propertyTesters
+ * the extension point <code>org.blueberry.core.expressions.propertyTesters
  * </code> must extend <code>PropertyTester</code>.
  * <p>
  * A property tester implements the property tests enumerated in the property
  * tester extension point. For the following property test extension
  * \code{.unparsed}
  * <propertyTester
  *   namespace="org.blueberry.jdt.core"
  *   id="org.blueberry.jdt.core.IPackageFragmentTester"
  *   properties="isDefaultPackage"
  *   type="org.blueberry.jdt.core.IPackageFragment"
  *   class="org.blueberry.demo.MyPackageFragmentTester">
  * </propertyTester>
  * \endcode
  * the corresponding implementation class looks like:
  * \code
  *   public class MyPackageFragmentTester {
  *       public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
  *           IPackageFragment fragement= (IPackageFragment)receiver;
  *           if ("isDefaultPackage".equals(property)) {
  *               return expectedValue == null
  *                ? fragement.isDefaultPackage()
  *                : fragement.isDefaultPackage() == ((Boolean)expectedValue).booleanValue();
  *           }
  *           Assert.isTrue(false);
  *           return false;
  *       }
  *   }
  * \endcode
  * The property can then be used in a test expression as follows:
  * <pre>
  *   &lt;instanceof value="org.blueberry.core.IPackageFragment"/&gt;
  *   &lt;test property="org.blueberry.jdt.core.isDefaultPackage"/&gt;
  * </pre>
  * </p>
  * <p>
  * There is no guarantee that the same instance of a property tester is used
  * to handle &lt;test property="..."/&gt; requests. So property testers
  * should always be implemented in a stateless fashion.
  * </p>
  */
 class BERRY_EXPRESSIONS PropertyTester : public QObject, public IPropertyTester
 {
   Q_OBJECT
   Q_INTERFACES(berry::IPropertyTester)
 
 private:
   IConfigurationElement::Pointer fConfigElement;
   QString fNamespace;
   QString fProperties;
 
 public:
   /**
    * Initialize the property tester with the given name space and property.
    * <p>
    * Note: this method is for internal use only. Clients must not call
    * this method.
    * </p>
    * @param descriptor the descriptor object for this tester
    */
   void InternalInitialize(PropertyTesterDescriptor::Pointer descriptor);
 
   /**
    * Note: this method is for internal use only. Clients must not call
    * this method.
    *
    * @return the property tester descriptor
    */
   PropertyTesterDescriptor::Pointer InternalCreateDescriptor();
 
   /**
    * {@inheritDoc}
    */
   bool Handles(const QString& namespaze, const QString& property) override;
 
   /**
    * {@inheritDoc}
    */
   bool IsInstantiated() override;
 
   /**
    * {@inheritDoc}
    */
   bool IsDeclaringPluginActive() override;
 
   /**
    * {@inheritDoc}
    */
   IPropertyTester* Instantiate() override;
 
 };
 
 }  // namespace berry
 
 #endif /*BERRYPROPERTYTESTER_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtensionManager.h b/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtensionManager.h
index aeace05b79..580fdc1752 100644
--- a/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtensionManager.h
+++ b/Plugins/org.blueberry.core.expressions/src/internal/berryTypeExtensionManager.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 BERRYTYPEEXTENSIONMANAGER_H_
 #define BERRYTYPEEXTENSIONMANAGER_H_
 
 #include "berryIPropertyTester.h"
 
 #include "berryTypeExtension.h"
 #include "berryPropertyCache.h"
 
 #include "berryProperty.h"
 
 #include <berryIConfigurationElement.h>
 #include <berryIRegistryEventListener.h>
 
 #include <QHash>
 #include <typeinfo>
 
 namespace berry {
 
 class TypeExtensionManager : private IRegistryEventListener
 {
 
 private:
   QString fExtensionPoint;
 
   static const QString TYPE;
 
   class nullptr_PROPERTY_TESTER_ : public IPropertyTester
   {
   public:
     bool Handles(const QString&  /*namespaze*/, const QString&  /*property*/) override
     {
       return false;
     }
     bool IsInstantiated() override
     {
       return true;
     }
     bool IsDeclaringPluginActive() override
     {
       return true;
     }
     IPropertyTester* Instantiate() override
     {
       return this;
     }
     bool Test(Object::ConstPointer, const QString& /*property*/,
               const QList<Object::Pointer>&  /*args*/, Object::Pointer  /*expectedValue*/) override
     {
       return false;
     }
   };
 
   static const nullptr_PROPERTY_TESTER_ nullptr_PROPERTY_TESTER;
 
   /*
    * Map containing all already created type extension object.
    */
   QHash<QString, TypeExtension::Pointer> fTypeExtensionMap;
 
   /*
    * Table containing mapping of class name to configuration element
    */
   QHash<QString, QList<IConfigurationElement::Pointer> > fConfigurationElementMap;
 
   /*
    * A cache to give fast access to the last 1000 method invocations.
    */
   PropertyCache* fPropertyCache;
 
 public:
 
   static bool DEBUG;
 
   TypeExtensionManager(const QString& extensionPoint);
   ~TypeExtensionManager() override;
 
   Property::Pointer GetProperty(Object::ConstPointer receiver,
                                 const QString& namespaze, const QString& method);
 
   /*synchronized*/Property::Pointer GetProperty(Object::ConstPointer receiver,
       const QString& namespaze, const QString& method, bool forcePluginActivation);
 
 protected:
 
   friend class TypeExtension;
 
   /*
    * This method doesn't need to be synchronized since it is called
-   * from withing the getProperty method which is synchronized
+   * from within the getProperty method which is synchronized
    */
   TypeExtension::Pointer Get(const Reflection::TypeInfo& typeInfo);
 
   /*
    * This method doesn't need to be synchronized since it is called
-   * from withing the getProperty method which is synchronized
+   * from within the getProperty method which is synchronized
    */
   QList<IPropertyTester::Pointer> LoadTesters(const QString& typeName);
 
 private:
 
   /*synchronized*/void InitializeCaches();
 
   void Added(const QList<SmartPointer<IExtension> >& extensions) override;
   void Removed(const QList<SmartPointer<IExtension> >& extensions) override;
   void Added(const QList<SmartPointer<IExtensionPoint> >& extensionPoints) override;
   void Removed(const QList<SmartPointer<IExtensionPoint> >& extensionPoints) override;
 };
 
 }
 
 #endif /*BERRYTYPEEXTENSIONMANAGER_H_*/
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
index 1d8e41422f..bd400e9ba1 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
@@ -1,140 +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 BERRYIJOBCHANGELISTENER_H_
 #define BERRYIJOBCHANGELISTENER_H_
 
 #include "berryIJobChangeEvent.h"
 
 namespace berry
 {
 
 /**
  * Callback interface for clients interested in being notified when jobs change state.
  * <p>
  * A single job listener instance can be added either to the job manager, for notification
  * of all scheduled jobs, or to any set of individual jobs.  A single listener instance should
  * not be added to both the job manager, and to individual jobs (such a listener may
  * receive duplicate notifications).
  * </p><p>
  * Clients should not rely on the result of the <code>Job#GetState()</code>
  * method on jobs for which notification is occurring. Listeners are notified of
  * all job state changes, but whether the state change occurs before, during, or
  * after listeners are notified is unspecified.
  * </p><p>
  * Clients may implement this interface.
  * </p>
  * @see IJobManager#AddJobChangeListener(IJobChangeListener::Pointer)
  * @see IJobManager#RemoveJobChangeListener(IJobChangeListener::Pointer)
  * @see Job#AddJobChangeListener(IJobChangeListener::Pointer)
  * @see Job#GetState()
  * @see Job#RemoveJobChangeListener(IJobChangeListener::Pointer)
  */
 
 struct BERRY_JOBS IJobChangeListener
 {
 
   struct BERRY_JOBS Events
   {
 
     typedef Message1<const IJobChangeEvent::ConstPointer&> JobChangeEventType;
 
     enum Type
     {
       NONE = 0x00000000,
       ABOUT_TO_RUN = 0x00000001,
       AWAKE = 0x00000002,
       DONE = 0x00000004,
       RUNNING = 0x00000008,
       SCHEDULED = 0x00000010,
       SLEEPING = 0x00000020,
 
       ALL = 0xffffffff
     };
 
     Q_DECLARE_FLAGS(Types, Type)
 
     JobChangeEventType jobAboutToRun;
     JobChangeEventType jobAwake;
     JobChangeEventType jobDone;
     JobChangeEventType jobRunning;
     JobChangeEventType jobScheduled;
     JobChangeEventType jobSleeping;
 
     void AddListener(IJobChangeListener* listener);
     void RemoveListener(IJobChangeListener* listener);
 
     void SetExceptionHandler(const AbstractExceptionHandler& handler);
 
     typedef MessageDelegate1<IJobChangeListener, const IJobChangeEvent::ConstPointer&>
         Delegate;
   };
 
   virtual Events::Types GetEventTypes() = 0;
 
   /**
    * Notification that a job is about to be run. Listeners are allowed to sleep, cancel,
    * or change the priority of the job before it is started (and as a result may prevent
    * the run from actually occurring).
    */
   virtual void AboutToRun(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
   /**
    * Notification that a job was previously sleeping and has now been rescheduled
    * to run.
    */
   virtual void Awake(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
   /**
-   * Notification that a job has completed execution, either due to cancelation, successful
+   * Notification that a job has completed execution, either due to cancellation, successful
    * completion, or failure.  The event status object indicates how the job finished,
    * and the reason for failure, if applicable.
    */
   virtual void Done(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
   /**
    * Notification that a job has started running.
    */
   virtual void Running(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
   /**
    * Notification that a job is being added to the queue of scheduled jobs.
    * The event details includes the scheduling delay before the job should start
    * running.
    */
   virtual void Scheduled(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
   /**
    * Notification that a job was waiting to run and has now been put in the
    * sleeping state.
    */
   virtual void Sleeping(const IJobChangeEvent::ConstPointer& /*event*/)
   {
   }
 
 };
 
 }
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IJobChangeListener::Events::Types)
 
 #endif /* BERRYIJOBCHANGELISTENER_H_ */
diff --git a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp b/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp
index 7bb26f7cfc..43fda5b558 100644
--- a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp
+++ b/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp
@@ -1,1202 +1,1202 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 NOMINMAX
 #include "berryJobManager.h"
 
 #include "berryIProgressMonitor.h"
 #include "berryNullProgressMonitor.h"
 #include "berryIStatus.h"
 #include "berryJobStatus.h"
 
 #include <iostream>
 #include <algorithm>
 
 namespace berry
 {
 
 /**
  *  test class implementing ISchedulingRule to validate client defined rules
  */
 struct NullRule: public ISchedulingRule
 {
   bool Contains(ISchedulingRule::Pointer myRule) const override;
   bool IsConflicting(ISchedulingRule::Pointer myRule) const override;
 };
 
 bool NullRule::IsConflicting(ISchedulingRule::Pointer dummyRule) const
 {
   return dummyRule == this;
 }
 
 bool NullRule::Contains(ISchedulingRule::Pointer dummyRule) const
 {
   return dummyRule == this;
 }
 
 
 JobManager::JobManager() :
   sptr_testRule(new NullRule()),m_active(true), m_Pool(new WorkerPool(this)), m_sptr_progressProvider(nullptr),
       m_JobQueueSleeping(true), m_JobQueueWaiting(false),m_suspended(false), m_waitQueueCounter(0)
 
 {
   m_JobListeners.global.SetExceptionHandler(MessageExceptionHandler<
       JobListeners> (&m_JobListeners, &JobListeners::HandleException));
 }
 
 // DEBUG VARIABLES
 
 
 const QString& JobManager::PI_JOBS()
 {
   static const QString id("org.blueberry.core.jobs");
   return id;
 }
 
 bool JobManager::DEBUG = false;
 
 bool JobManager::DEBUG_BEGIN_END = false;
 
 bool JobManager::DEBUG_DEADLOCK = false;
 
 bool JobManager::DEBUG_LOCKS = false;
 
 bool JobManager::DEBUG_TIMING = false;
 
 bool JobManager::DEBUG_SHUTDOWN = false;
 
 const int JobManager::PLUGIN_ERROR = 2;
 
 JobManager*
 JobManager::GetInstance()
 {
   // we don't need to lock the creation of "instance" because GetInstance() is
   // called when statically initializing InternalJob::ptr_manager (which happens
   // in single-threaded mode)
   static JobManager instance;
   return &instance;
 }
 
 std::string JobManager::PrintState(int state)
 {
   switch (state)
   {
   case Job::NONE:
     return "NONE";
   case Job::WAITING:
     return "WAITING";
   case Job::SLEEPING:
     return "SLEEPING";
   case Job::RUNNING:
     return "RUNNING";
   case InternalJob::BLOCKED:
     return "BLOCKED";
   case InternalJob::ABOUT_TO_RUN:
     return "ABOUT_TO_RUN";
   case InternalJob::ABOUT_TO_SCHEDULE:
     return "ABOUT_TO_SCHEDULE";
   }
   return "UNKNOWN";
 }
 
 void JobManager::Shutdown()
 {
   JobManager* ptr_instance(GetInstance());
   if (ptr_instance != nullptr)
   {
     ptr_instance->DoShutdown();
     // ptr_instance = 0; // need to call the destructor of the static object  ..
   }
 }
 
 //void
 //JobManager
 //::Cancel(Object family) {
 //    //don't synchronize because cancel calls listeners
 //    for (Iterator it = select(family).iterator(); it.hasNext();)
 //      cancel((Job) it.next());
 //  }
 
 
 IProgressMonitor::Pointer JobManager::CreateProgressGroup()
 {
   if (m_sptr_progressProvider != 0)
     return (m_sptr_progressProvider->CreateProgressGroup());
   NullProgressMonitor::Pointer sptr_defaultProgressMonitor(
       new NullProgressMonitor);
   return sptr_defaultProgressMonitor;
 }
 
 Job*
 JobManager::CurrentJob()
 {
   //Poco::Thread* ptr_current = Poco::Thread::current();
   //if (Worker* worker = dynamic_cast<Worker*>(ptr_current) )
   //  return ((Worker) ptr_current).currentJob();
   // {
   //    Poco::ScopedLock<Poco::Mutex> lockMe (m_mutex);
   //    Poco::HashSet<InternalJob::Pointer, Object::Hash>::Iterator it ;
   //    for (it = m_running.begin(); it != m_running.end(); it ++) {
   //    Job job* = dynamic_cast<Job*> (it);
   //    if (job->GetThread() == ptr_current)
   //      return job;
   //  }
   //}
   return nullptr;
 }
 
 //void
 //JobManager
 //::EndRule(ISchedulingRule rule) {
 //implicitJobs.end(rule, false);
 //  }
 
 
 //Job[]
 //JobManager
 //::Find(Object family) {
 //    List members = select(family);
 //    return (Job[]) members.toArray(new Job[members.size()]);
 //  }
 //
 //    LockManager GetLockManager() {
 //    return lockManager;
 //  }
 //
 
 bool JobManager::IsIdle()
 {
   {
     Poco::ScopedLock<Poco::Mutex> m_managerLock(m_mutex);
     return m_running.empty() && m_JobQueueWaiting.IsEmpty();
   }
 }
 
 bool JobManager::IsSuspended()
 {
   {
     Poco::ScopedLock<Poco::Mutex> m_managerLock(m_mutex);
     m_suspended = true;
   }
   return m_suspended;
 
 }
 //
 //    /*
 //   * @see IJobManager#join(String, IProgressMonitor)
 //   */
 //void
 //JobManager
 //::Join(final Object family, IProgressMonitor monitor) throws InterruptedException, OperationCanceledException {
 //    monitor = monitorFor(monitor);
 //    IJobChangeListener listener = null;
 //    final Set jobs;
 //    int jobCount;
 //    Job blocking = null;
 //    synchronized (lock) {
 //      //don't join a waiting or sleeping job when suspended (deadlock risk)
 //      int states = suspended ? Job.RUNNING : Job.RUNNING | Job.WAITING | Job.SLEEPING;
 //      jobs = Collections.synchronizedSet(new HashSet(select(family, states)));
 //      jobCount = jobs.size();
 //      if (jobCount > 0) {
 //        //if there is only one blocking job, use it in the blockage callback below
 //        if (jobCount == 1)
 //          blocking = (Job) jobs.iterator().next();
 //        listener = new JobChangeAdapter() {
 //          public void done(IJobChangeEvent event) {
 //            //don't remove from list if job is being rescheduled
 //            if (!((JobChangeEvent) event).reschedule)
 //              jobs.remove(event.getJob());
 //          }
 //
 //          //update the list of jobs if new ones are added during the join
 //          public void scheduled(IJobChangeEvent event) {
 //            //don't add to list if job is being rescheduled
 //            if (((JobChangeEvent) event).reschedule)
 //              return;
 //            Job job = event.getJob();
 //            if (job.belongsTo(family))
 //              jobs.add(job);
 //          }
 //        };
 //        addJobChangeListener(listener);
 //      }
 //    }
 //    if (jobCount == 0) {
 //      //use up the monitor outside synchronized block because monitors call untrusted code
 //      monitor.beginTask(JobMessages.jobs_blocked0, 1);
 //      monitor.done();
 //      return;
 //    }
 //    //spin until all jobs are completed
 //    try {
 //      monitor.beginTask(JobMessages.jobs_blocked0, jobCount);
 //      monitor.subTask(NLS.bind(JobMessages.jobs_waitFamSub, Integer.toString(jobCount)));
 //      reportBlocked(monitor, blocking);
 //      int jobsLeft;
 //      int reportedWorkDone = 0;
 //      while ((jobsLeft = jobs.size()) > 0) {
 //        //don't let there be negative work done if new jobs have
 //        //been added since the join began
 //        int actualWorkDone = Math.max(0, jobCount - jobsLeft);
 //        if (reportedWorkDone < actualWorkDone) {
 //          monitor.worked(actualWorkDone - reportedWorkDone);
 //          reportedWorkDone = actualWorkDone;
 //          monitor.subTask(NLS.bind(JobMessages.jobs_waitFamSub, Integer.toString(jobsLeft)));
 //        }
 //        if (Thread.interrupted())
 //          throw new InterruptedException();
 //        if (monitor.isCanceled())
 //          throw new OperationCanceledException();
 //        //notify hook to service pending syncExecs before falling asleep
 //        lockManager.aboutToWait(null);
 //        Thread.sleep(100);
 //      }
 //    } finally {
 //      lockManager.aboutToRelease();
 //      removeJobChangeListener(listener);
 //      reportUnblocked(monitor);
 //      monitor.done();
 //    }
 //  }
 
 //JobManager
 //::NewLock() {
 //    return lockManager.newLock();
 //  }
 
 void JobManager::RemoveJobChangeListener(IJobChangeListener* listener)
 {
   m_JobListeners.Remove(listener);
 }
 
 void JobManager::ReportBlocked(IProgressMonitor::Pointer sptr_monitor, InternalJob::Pointer sptr_blockingJob) const
 {
   if ( sptr_monitor.Cast<IProgressMonitorWithBlocking>() == 0 )
       return ;
 
   if (sptr_blockingJob == 0 || sptr_blockingJob->IsSystem())
   {
     Status::Pointer sptr_reason(
           new Status(IStatus::INFO_TYPE, JobManager::PI_JOBS(), 1,
                      "the user operation is waiting for  background work to complete",
                      BERRY_STATUS_LOC));
   }
   else
   {
     QString msg = "the user operation is waiting for : " + sptr_blockingJob->GetName() +
         " to complete. ";
     JobStatus::Pointer sptr_reason(
           new JobStatus(IStatus::INFO_TYPE, sptr_blockingJob.Cast<Job>(), msg,
                         BERRY_STATUS_LOC));
   }
   //  ((IProgressmonitorWithBlocking) sptr_monitor)->SetBlocked(sptr_reason);
 }
 
 
 void JobManager::ReportUnblocked(IProgressMonitor::Pointer sptr_monitor) const
 {
   if ( IProgressMonitorWithBlocking::Pointer sptr_monitorWithBlocking = sptr_monitor.Cast<IProgressMonitorWithBlocking>() )
     sptr_monitorWithBlocking->ClearBlocked();
 }
 
 
 void JobManager::Resume()
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe(m_mutex);
     m_suspended = false;
     //poke the job pool
     m_Pool->JobQueued();
   }
 }
 
 //TODO implicit Jobs
 //void
 //JobManager
 //::Resume(ISchedulingRule rule)const {
 //    implicitJobs.resume(rule);
 //  }
 
 
 void JobManager::SetProgressProvider(ProgressProvider::Pointer provider)
 {
   m_sptr_progressProvider = provider;
 }
 
 void JobManager::SetRule(InternalJob::Pointer job,
     ISchedulingRule::Pointer sptr_rule)
 {
   Poco::ScopedLock<Poco::Mutex> m_managerLock(m_mutex);
   //cannot change the rule of a job that is already running ( GetRule is set to protected which should be
   // changed if this assert is needed
   // assert(job->GetState() == Job.NONE);
   ValidateRule(sptr_rule);
   job->InternalSetRule(sptr_rule);
 
 }
 
 //void
 //JobManager
 //::Sleep(Object family) {
 //    //don't synchronize because sleep calls listeners
 //    for (Iterator it = select(family).iterator(); it.hasNext();) {
 //      sleep((InternalJob) it.next());
 //    }
 //  }
 
 
 void JobManager::Suspend()
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe(m_mutex);
     m_suspended = true;
   }
 }
 
 //void
 //JobManager
 //::Suspend(ISchedulingRule rule, IProgressMonitor monitor)const {
 //    Assert.isNotNull(rule);
 //    implicitJobs.suspend(rule, monitorFor(monitor));
 //  }
 
 //void
 //JobManager
 //::TransferRule(ISchedulingRule rule, Thread destinationThread) {
 //    implicitJobs.transfer(rule, destinationThread);
 //  }
 
 //void
 //JobManager
 //::SetLockListener(LockListener listener) {
 //    lockManager.setLockListener(listener);
 //  }
 
 //void
 //JobManager
 //::WakeUp(Object family) {
 //    //don't synchronize because wakeUp calls listeners
 //    for (Iterator it = select(family).iterator(); it.hasNext();) {
 //      wakeUp((InternalJob) it.next(), 0L);
 //    }
 //  }
 
 void JobManager::AddJobChangeListener(IJobChangeListener* listener)
 {
   m_JobListeners.Add(listener);
 }
 
 //void
 //JobManager
 //::BeginRule(ISchedulingRule rule, IProgressMonitor monitor) {
 //    validateRule(rule);
 //    implicitJobs.begin(rule, monitorFor(monitor), false);
 //  }
 //
 //  /**
 //   * For debugging purposes only
 //   */
 //std::String
 //JobManager
 //::PrintJobName(Job job) {
 //    if (job instanceof ThreadJob) {
 //      Job realJob = ((ThreadJob) job).realJob;
 //      if (realJob != null)
 //        return realJob.getClass().getName();
 //      return "ThreadJob on rule: " + job.getRule(); //$NON-NLS-1$
 //    }
 //    return job.getClass().getName();
 //  }
 //
 
 //  instance = this;
 //  initDebugOptions();
 //  synchronized (lock) {
 
 //    running = new HashSet(10);
 //  }
 //  pool.setDaemon(JobOSGiUtils.getDefault().useDaemonThreads());
 //}
 
 
 void JobManager::ChangeState(InternalJob::Pointer sptr_job, int newState)
 {
 
   bool blockedJobs = false;
   {
     Poco::ScopedLock<Poco::Mutex> m_managerLock(m_mutex);
 
     int tmp_oldState = sptr_job->InternalGetState();
     switch (tmp_oldState)
     {
     case Job::NONE:
 
     case InternalJob::ABOUT_TO_SCHEDULE:
       break;
     case InternalJob::BLOCKED:
       //remove this job from the linked list of blocked jobs
       sptr_job->Remove();
       break;
     case Job::WAITING:
       m_JobQueueWaiting.Remove(sptr_job);
 
       // assert(false, "Tried to remove a job that wasn't in the queue");
       break;
     case Job::SLEEPING:
       m_JobQueueSleeping.Remove(sptr_job);
       // assert(false, "Tried to remove a job that wasn't in the queue");
       // this silences the warning but should be checked:
       // FALLTHRU
     case Job::RUNNING:
     case InternalJob::ABOUT_TO_RUN:
       m_running.remove(sptr_job);
       //add any blocked jobs back to the wait queue
       InternalJob::Pointer sptr_blocked(sptr_job->Previous());
       sptr_job->Remove();
       blockedJobs = sptr_blocked != 0;
       while (sptr_blocked != 0)
       {
         InternalJob::Pointer previous = sptr_blocked->Previous();
         ChangeState(sptr_blocked, Job::WAITING);
         sptr_blocked = previous;
       }
       break;
       // default :
       // Assert.isLegal(false, "Invalid job state: " + job + ", state: " + oldState);
     }
 
     sptr_job->InternalSetState(newState);
     switch (newState)
     {
     case Job::NONE:
       sptr_job->SetStartTime(InternalJob::T_NONE);
       sptr_job->SetWaitQueueStamp(InternalJob::T_NONE);
     case InternalJob::BLOCKED:
       break;
     case Job::WAITING:
       m_JobQueueWaiting.Enqueue(sptr_job);
       break;
     case Job::SLEEPING:
       //try {
       m_JobQueueSleeping.Enqueue(sptr_job);
       //} catch (RuntimeException e) {
       //  throw new RuntimeException("Error changing from state: " + oldState);
       //}
       break;
     case Job::RUNNING:
     case InternalJob::ABOUT_TO_RUN:
       sptr_job->SetStartTime(InternalJob::T_NONE);
       sptr_job->SetWaitQueueStamp(InternalJob::T_NONE);
       m_running.insert(sptr_job);
       break;
     case InternalJob::ABOUT_TO_SCHEDULE:
       break;
       //  default :
       //    Assert.isLegal(false, "Invalid job state: " + job + ", state: " + newState);
     }
   }
 
   //notify queue outside sync block
   if (blockedJobs)
     m_Pool->JobQueued();
 }
 
 
 
 Poco::Timestamp::TimeDiff JobManager::DelayFor(int priority)
 {
   //these values may need to be tweaked based on machine speed
   switch (priority)
   {
   case Job::INTERACTIVE:
     return 0;
   case Job::SHORT:
     return 50;
   case Job::LONG:
     return 100;
   case Job::BUILD:
     return 500;
   case Job::DECORATE:
     return 1000;
   default:
     //  Assert.isTrue(false, "Job has invalid priority: " + priority); //$NON-NLS-1$
     return 0;
   }
 }
 
 
 void JobManager::DoSchedule(InternalJob::Pointer job,
     Poco::Timestamp::TimeDiff delay)
 {
   Poco::ScopedLock<Poco::Mutex> managerLock(m_mutex);
 
   //job may have been canceled already
   int state = job->InternalGetState();
   if (state != InternalJob::ABOUT_TO_SCHEDULE && state != Job::SLEEPING)
     return;
 
   //if it's a decoration job with no rule, don't run it right now if the system is busy
   if (job->GetPriority() == Job::DECORATE && job->GetRule() == 0)
   {
     Poco::Timestamp::TimeDiff tmp_minDelay = m_running.size() * 100;
     delay = std::max(delay, tmp_minDelay);
   }
   if (delay > 0)
   {
     job->SetStartTime(Poco::Timestamp() + delay * 100);
     InternalJob::Pointer sptr_job(job);
     ChangeState(sptr_job, Job::SLEEPING);
   }
   else
   {
     job->SetStartTime(Poco::Timestamp() + DelayFor(job->GetPriority()) * 100);
     job->SetWaitQueueStamp(m_waitQueueCounter++);
     InternalJob::Pointer sptr_job(job);
     ChangeState(sptr_job, Job::WAITING);
   }
 
 }
 
 void JobManager::DoShutdown()
 {
   std::vector<InternalJob::Pointer> vec_ToCancel;
   {
     Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
     if (m_active)
     {
       m_active = false;
       //cancel all running jobs
       vec_ToCancel.assign(m_running.begin(), m_running.end());
       //clean up
       m_JobQueueSleeping.Clear();
       m_JobQueueWaiting.Clear();
       m_running.clear();
     }
   }
 
   // Give running jobs a chance to finish. Wait 0.1 seconds for up to 3 times.
   if (!vec_ToCancel.empty())
   {
     for (std::size_t i = 0; i < vec_ToCancel.size(); i++)
     {
       // cancel jobs outside sync block to avoid deadlock
       Cancel(vec_ToCancel[i]);
     }
 
     for (int waitAttempts = 0; waitAttempts < 3; waitAttempts++)
     {
       Poco::Thread::yield();
       {
         Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
         if (m_running.empty())
           break;
       }
       if (DEBUG_SHUTDOWN)
       {
         //  JobManager.debug("Shutdown - job wait cycle #" + (waitAttempts + 1));
         std::vector<InternalJob::Pointer> vec_StillRunning;
         {
           Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
           vec_StillRunning.assign(m_running.begin(), m_running.end());
 
           //   if (!vec_StillRunning.empty()) {
           //for (int j = 0; j < stillRunning.length; j++) {
           //  JobManager.debug("\tJob: " + printJobName(stillRunning[j])); //$NON-NLS-1$
           //}
         }
       }
       Poco::Thread::sleep(100);
       Poco::Thread::yield();
     }
     // retrieve list of the jobs that are still running
 
     {
       Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
       vec_ToCancel.assign(m_running.begin(), m_running.end());
     }
   }
 
   if (!vec_ToCancel.empty())
   {
     /*for (int i = 0; i < vec_ToCancel.size(); i++) {*/
     //  std::string  tmp_jobName = PrintJobName(toCancel[i]);
     //        //this doesn't need to be translated because it's just being logged
     //        String msg = "Job found still running after platform shutdown.  Jobs should be canceled by the plugin that
     //        scheduled them during shutdown: " + jobName;
     //        RuntimeLog.log(new Status(IStatus.WARNING, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, null));
     //
     //        // TODO the RuntimeLog.log in its current implementation won't produce a log
     //        // during this stage of shutdown. For now add a standard error output.
     //        // One the logging story is improved, the System.err output below can be removed:
     //        System.err.println(msg);
     //      }
   }
 
   m_Pool->Shutdown();
 }
 
 Job::Pointer JobManager::NextJob()
 {
   {
     Poco::ScopedLock<Poco::Mutex> managerLock(m_mutex);
 
     //do nothing if the job manager is suspended
     if (m_suspended)
       return Job::Pointer(nullptr);
 
     // tickle the sleep queue to see if anyone wakes up
 
     Poco::Timestamp now;
     InternalJob::Pointer ptr_job = m_JobQueueSleeping.Peek();
 
     while (ptr_job != 0 && ptr_job->GetStartTime() < now)
     {
       // a job that slept to long is set a new start time and is put into the waiting queue
       ptr_job->SetStartTime(now + DelayFor(ptr_job->GetPriority()));
       ptr_job->SetWaitQueueStamp(m_waitQueueCounter++);
       InternalJob::Pointer sptr_job(ptr_job);
       ChangeState(sptr_job, Job::WAITING);
       ptr_job = m_JobQueueSleeping.Peek();
     }
     //process the wait queue until we find a job whose rules are satisfied.
     while ((ptr_job = m_JobQueueWaiting.Peek()) != 0)
     {
       InternalJob::Pointer sptr_job(ptr_job);
       InternalJob::Pointer sptr_blocker = FindBlockingJob(sptr_job);
       if (sptr_blocker == 0)
         break;
       //queue this job after the job that's blocking it
       ChangeState(sptr_job, InternalJob::BLOCKED);
       //assert job does not already belong to some other data structure
       //Assert.isTrue(job.next() == null);
       //Assert.isTrue(job.previous() == null);
       sptr_blocker->AddLast(ptr_job);
     }
     // the job to run must be in the running list before we exit
     // the sync block, otherwise two jobs with conflicting rules could start at once
     if (ptr_job != 0)
     {
       InternalJob::Pointer sptr_job(ptr_job);
       ChangeState(sptr_job, InternalJob::ABOUT_TO_RUN);
     }
 
     return ptr_job.Cast<Job> ();
 
   }
 }
 
 //TODO Job families
 //void
 //JobManager
 //::Select(List members, Object family, InternalJob firstJob, int stateMask) {
 //    if (firstJob == null)
 //      return;
 //    InternalJob job = firstJob;
 //    do {
 //      //note that job state cannot be NONE at this point
 //      if ((family == null || job.belongsTo(family)) && ((job.getState() & stateMask) != 0))
 //        members.add(job);
 //      job = job.previous();
 //    } while (job != null && job != firstJob);
 //  }
 
 //List
 //JobManager
 //::Select(Object family) {
 //    return select(family, Job.WAITING | Job.SLEEPING | Job.RUNNING);
 //  }
 
 //List
 //JobManager
 //::Select(Object family, int stateMask) {
 //    List members = new ArrayList();
 //    synchronized (lock) {
 //      if ((stateMask & Job.RUNNING) != 0) {
 //        for (Iterator it = running.iterator(); it.hasNext();) {
 //          select(members, family, (InternalJob) it.next(), stateMask);
 //        }
 //      }
 //      if ((stateMask & Job.WAITING) != 0)
 //        select(members, family, waiting.peek(), stateMask);
 //      if ((stateMask & Job.SLEEPING) != 0)
 //        select(members, family, sleeping.peek(), stateMask);
 //    }
 //    return members;
 //  }
 
-// dummy validateRule implemenation
+// dummy validateRule implementation
 void JobManager::ValidateRule(ISchedulingRule::Pointer sptr_rule)
 {
   //null rule always valid
   if (sptr_rule == 0)
     return;
 
   //contains method must be reflexive
   poco_assert(sptr_rule->Contains(sptr_rule))
 ; //contains method must return false when given an unknown rule
   poco_assert(!sptr_rule->Contains(sptr_testRule));
   //isConflicting method must be reflexive
   poco_assert(sptr_rule->IsConflicting(sptr_rule));
   //isConflicting method must return false when given an unknown rule
   poco_assert(!sptr_rule->IsConflicting(sptr_testRule));
 
 }
 
 bool JobManager::Cancel(InternalJob::Pointer sptr_job)
 {
   IProgressMonitor::Pointer sptr_progressMonitor(nullptr);
   bool runCanceling = false;
   {
     Poco::ScopedLock<Poco::Mutex> mangerMutex (m_mutex);
 
     switch (sptr_job->GetState())
     {
       case Job::NONE :
       return true;
       case Job::RUNNING :
       //cannot cancel a job that has already started (as opposed to ABOUT_TO_RUN)
       if (sptr_job->InternalGetState() == Job::RUNNING)
       {
       sptr_progressMonitor = sptr_job->GetProgressMonitor();
       runCanceling = sptr_job->IsRunCanceled();
       if(runCanceling)
           sptr_job->SetRunCanceled(true);
       break ;
       }
       //signal that the job should be canceled before it gets a chance to run
       sptr_job->SetAboutToRunCanceled(true);
       return false;
    default :
       ChangeState(sptr_job, Job::NONE);
     }
   }
   //call monitor outside sync block
   if (sptr_progressMonitor != 0)
   {
     if(runCanceling)
       {
        if (!sptr_progressMonitor->IsCanceled())
           sptr_progressMonitor->SetCanceled(true);
        sptr_job->Canceling();
 
       }
     return false;
   }
   //only notify listeners if the job was waiting or sleeping
   m_JobListeners.Done(sptr_job.Cast<Job>(), Status::CANCEL_STATUS(BERRY_STATUS_LOC), false);
   return true;
 }
 
 
 IProgressMonitor::Pointer JobManager::CreateMonitor(
     Job::Pointer sptr_jobToMonitor)
 {
   IProgressMonitor::Pointer sptr_monitor(nullptr);
   if (m_sptr_progressProvider != 0)
     sptr_monitor = m_sptr_progressProvider->CreateMonitor(sptr_jobToMonitor);
   if (sptr_monitor == 0)
   {
     NullProgressMonitor::Pointer sptr_defaultMonitor(new NullProgressMonitor());
       return sptr_defaultMonitor;
    }
     return sptr_monitor;
 }
 
 
 IProgressMonitor::Pointer JobManager::CreateMonitor(InternalJob::Pointer sptr_job, IProgressMonitor::Pointer group, int ticks)
 {
  {
      Poco::ScopedLock<Poco::Mutex> managerLock(m_mutex);
 
     //group must be set before the job is scheduled
     //this includes the ABOUT_TO_SCHEDULE state, during which it is still
     //valid to set the progress monitor
     if (sptr_job->GetState() != Job::NONE)
     {
       IProgressMonitor::Pointer dummy(nullptr);
       return dummy;
     }
     IProgressMonitor::Pointer sptr_monitor(nullptr);
     if (m_sptr_progressProvider != 0)
       sptr_monitor = m_sptr_progressProvider->CreateMonitor(sptr_job.Cast<Job>() , group, ticks);
     if (sptr_monitor == 0)
     {
       // return a default NullprogressMonitor
       NullProgressMonitor::Pointer sptr_defaultMonitor(new NullProgressMonitor() );
       return sptr_defaultMonitor;
     }
 
     return sptr_monitor;
   }
 }
 
 
 void JobManager::EndJob(InternalJob::Pointer ptr_job, IStatus::Pointer result, bool notify)
 {
   Poco::Timestamp::TimeDiff rescheduleDelay(InternalJob::T_NONE);
   {
     Poco::ScopedLock<Poco::Mutex> lock ( m_mutex);
 
     //  if the job is finishing asynchronously, there is nothing more to do for now
     if (result == Job::ASYNC_FINISH)
       return;
 
     //if job is not known then it cannot be done
     if (ptr_job->GetState() == Job::NONE)
        return;
     ptr_job->SetResult(result);
     ptr_job->SetProgressMonitor(IProgressMonitor::Pointer(nullptr));
     ptr_job->SetThread(nullptr);
     rescheduleDelay = ptr_job->GetStartTime().epochMicroseconds();
     InternalJob::Pointer sptr_job(ptr_job);
     ChangeState(sptr_job, Job::NONE);
   }
 
   //notify listeners outside sync block
   bool reschedule = m_active && rescheduleDelay > InternalJob::T_NONE && ptr_job->ShouldSchedule();
   if (notify)
     m_JobListeners.Done(ptr_job.Cast<Job>(), result, reschedule);
   //reschedule the job if requested and we are still active
   if (reschedule)
     Schedule(ptr_job, rescheduleDelay, reschedule);
 }
 
 
 InternalJob::Pointer JobManager::FindBlockingJob(InternalJob::Pointer waitingJob)
 {
   if (waitingJob->GetRule() == 0)
   return InternalJob::Pointer(nullptr);
 
   {
     Poco::ScopedLock<Poco::Mutex> managerLock (m_mutex);
 
     if (m_running.empty() )
     {
       InternalJob::Pointer dummy;
       return (dummy);
     }
     //check the running jobs
     bool hasBlockedJobs = false;
     QSet<InternalJob::Pointer>::Iterator it;
     for ( it = m_running.begin(); it != m_running.end(); it ++ )
     {
       InternalJob::Pointer sptr_job = *it ++;
       if (waitingJob->IsConflicting(sptr_job))
       return sptr_job;
       if (!hasBlockedJobs)
       hasBlockedJobs = sptr_job->Previous() != 0;
     }
     //  there are no blocked jobs, so we are done
     if (!hasBlockedJobs)
     {
       InternalJob::Pointer dummy;
       return (dummy);
     }
     //check all jobs blocked by running jobs
     QSet<InternalJob::Pointer>::Iterator it_blocked;
     for( it_blocked = m_running.begin(); it_blocked != m_running.end(); it_blocked ++ )
     {
       InternalJob::Pointer sptr_job = *it_blocked ++;
       while (true)
       {
         sptr_job = sptr_job->Previous();
         if (sptr_job == 0)
         break;
         if (waitingJob->IsConflicting(sptr_job))
         return sptr_job;
       }
     }
   }
 
   InternalJob::Pointer sptr_null;
   return (sptr_null);
 }
 
 bool JobManager::IsActive()
 {
   return m_active;
 }
 
 bool JobManager::IsBlocking(InternalJob::Pointer sptr_runningJob)
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe (m_mutex);
     // if this job isn't running, it can't be blocking anyone
     if (sptr_runningJob->GetState() != Job::RUNNING)
     return false;
     // if any job is queued behind this one, it is blocked by it
     InternalJob::Pointer ptr_previous = sptr_runningJob->Previous();
     while (ptr_previous != 0)
     {
       // ignore jobs of lower priority (higher priority value means lower priority)
       if (ptr_previous->GetPriority() < sptr_runningJob->GetPriority())
       {
         if (!ptr_previous->IsSystem())
         return true;
         // TODO Implicit Jobs
         // implicit jobs should interrupt unless they act on behalf of system jobs
         // if (previous instanceof ThreadJob && ((ThreadJob) previous).shouldInterrupt())
         // return true;
       }
       ptr_previous = ptr_previous->previous;
     }
     // none found
     return false;
   }
 }
 
 //void
 //JobManager
 //::Join(InternalJob job) {
 //    final IJobChangeListener listener;
 //    final Semaphore barrier;
 //    synchronized (lock) {
 //      int state = job.getState();
 //      if (state == Job.NONE)
 //        return;
 //      //don't join a waiting or sleeping job when suspended (deadlock risk)
 //      if (suspended && state != Job.RUNNING)
 //        return;
 //      //it's an error for a job to join itself
 //      if (state == Job.RUNNING && job.getThread() == Thread.currentThread())
 //        throw new IllegalStateException("Job attempted to join itself"); //$NON-NLS-1$
 //      //the semaphore will be released when the job is done
 //      barrier = new Semaphore(null);
 //      listener = new JobChangeAdapter() {
 //        public void done(IJobChangeEvent event) {
 //          barrier.release();
 //        }
 //      };
 //      job.addJobChangeListener(listener);
 //      //compute set of all jobs that must run before this one
 //      //add a listener that removes jobs from the blocking set when they finish
 //    }
 //    //wait until listener notifies this thread.
 //    try {
 //      while (true) {
 //        //notify hook to service pending syncExecs before falling asleep
 //        lockManager.aboutToWait(job.getThread());
 //        try {
 //          if (barrier.acquire(Long.MAX_VALUE))
 //            break;
 //        } catch (InterruptedException e) {
 //          //loop and keep trying
 //        }
 //      }
 //    } finally {
 //      lockManager.aboutToRelease();
 //      job.removeJobChangeListener(listener);
 //    }
 //  }
 
 
 bool JobManager::RunNow(InternalJob::Pointer sptr_job)
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe (m_mutex);
 
     //cannot start if there is a conflicting job
     if (FindBlockingJob(sptr_job) != 0)
     return false;
     ChangeState(sptr_job, Job::RUNNING);
     sptr_job->SetProgressMonitor(IProgressMonitor::Pointer(new NullProgressMonitor()));
     sptr_job->Run(IProgressMonitor::Pointer(nullptr));
   }
   return true;
 }
 
 void JobManager::Schedule(InternalJob::Pointer job, Poco::Timestamp::TimeDiff delay, bool reschedule)
 {
   if (!m_active)
   throw Poco::IllegalStateException("Job manager has been shut down.");
 
   poco_assert(job); // "Job is null"
   poco_assert(delay >= 0); // "Scheduling delay is negative"
 
   {
     Poco::ScopedLock<Poco::Mutex> managerLock (m_mutex);
     //if the job is already running, set it to be rescheduled when done
     if (job->GetState() == Job::RUNNING)
     {
       job->SetStartTime(delay);
       return;
     }
     //can't schedule a job that is waiting or sleeping
     if (job->InternalGetState() != Job::NONE)
     return;
 
     //remember that we are about to schedule the job
     //to prevent multiple schedule attempts from succeeding (bug 68452)
     InternalJob::Pointer sptr_job(job);
     ChangeState(sptr_job, InternalJob::ABOUT_TO_SCHEDULE);
   }
   //notify listeners outside sync block
   m_JobListeners.Scheduled(job.Cast<Job>(), delay, reschedule);
   //schedule the job
   DoSchedule(job, delay);
   //call the pool outside sync block to avoid deadlock
   m_Pool->JobQueued();
 }
 
 bool JobManager::Sleep(InternalJob::Pointer job)
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe (m_mutex);
     InternalJob::Pointer sptr_job(job);
     switch (job->GetState())
     {
       case Job::RUNNING :
       //cannot be paused if it is already running (as opposed to ABOUT_TO_RUN)
       if (job->InternalGetState() == Job::RUNNING)
       return false;
       //job hasn't started running yet (aboutToRun listener)
       break;
       case Job::SLEEPING :
       //update the job wake time
       job->SetStartTime(InternalJob::T_INFINITE);
       //change state again to re-shuffle the sleep queue
 
       ChangeState(sptr_job, Job::SLEEPING);
       return true;
       case Job::NONE :
       return true;
       case Job::WAITING :
       //put the job to sleep
       break;
     }
     job->SetStartTime(InternalJob::T_INFINITE);
     ChangeState(sptr_job, Job::SLEEPING);
   }
   m_JobListeners.Sleeping(job.Cast<Job>());
   return true;
 }
 
 void JobManager::SetPriority(InternalJob::Pointer job, int newPriority)
 {
   {
     Poco::ScopedLock<Poco::Mutex> lockMe (m_mutex);
     InternalJob::Pointer sptr_job(job);
     int oldPriority = job->GetPriority();
     if (oldPriority == newPriority)
     return;
     job->InternalSetPriority(newPriority);
     //if the job is waiting to run, re-shuffle the queue
     if (sptr_job->GetState() == Job::WAITING)
     {
       Poco::Timestamp oldStart = job->GetStartTime();
       job->SetStartTime(oldStart += (DelayFor(newPriority) - DelayFor(oldPriority)));
       m_JobQueueWaiting.Resort(job);
     }
   }
 }
 
 Poco::Timespan::TimeDiff JobManager::SleepHint()
 {
 
   Poco::ScopedLock<Poco::Mutex> managerLock (m_mutex);
   // wait forever if job manager is suspended
   if (m_suspended)
   return InternalJob::T_INFINITE;
   if (!m_JobQueueWaiting.IsEmpty())
   return 0;
   // return the anticipated time that the next sleeping job will wake
   InternalJob::Pointer ptr_next(nullptr);
   ptr_next = m_JobQueueSleeping.Peek();
   if (ptr_next == 0)
   return InternalJob::T_INFINITE;
 
   Poco::Timestamp tmp_startTime = ptr_next->GetStartTime();
   Poco::Timestamp tmp_currentTime;
   Poco::Timestamp::TimeDiff timeToStart = tmp_startTime - tmp_currentTime;
 
   return timeToStart;
 }
 
 Job::Pointer JobManager::StartJob()
 {
   Job::Pointer job(nullptr);
   while (true)
   {
     job = NextJob();
     if (!job)
     return Job::Pointer(nullptr);
     //must perform this outside sync block because it is third party code
     bool shouldRun = job->ShouldRun();
     //check for listener veto
     if (shouldRun)
     m_JobListeners.AboutToRun(job);
     //listeners may have canceled or put the job to sleep
     bool endJob = false;
     {
       Poco::ScopedLock<Poco::Mutex> lock(m_mutex);
       InternalJob::Pointer internal = job;
       if (internal->InternalGetState() == InternalJob::ABOUT_TO_RUN)
       {
         if (shouldRun && !internal->IsAboutToRunCanceled())
         {
           internal->SetProgressMonitor(CreateMonitor(job));
           //change from ABOUT_TO_RUN to RUNNING
           internal->InternalSetState(Job::RUNNING);
           break;
         }
         internal->SetAboutToRunCanceled(false);
         endJob = true;
         //fall through and end the job below
       }
     }
     if (endJob)
     {
       //job has been vetoed or canceled, so mark it as done
       EndJob(job,Status::CANCEL_STATUS(BERRY_STATUS_LOC), true);
       continue;
     }
   }
   m_JobListeners.Running(job);
   return job;
 }
 
 void JobManager::WakeUp(InternalJob::Pointer job, Poco::Timestamp::TimeDiff delay)
 {
   poco_assert(delay >= 0); // "Scheduling delay is negative"
 
   {
     Poco::ScopedLock<Poco::Mutex> m_managerLock (m_mutex);
     //cannot wake up if it is not sleeping
     if (job->GetState() != Job::SLEEPING)
     return;
     DoSchedule(job, delay);
   }
   //call the pool outside sync block to avoid deadlock
   m_Pool->JobQueued();
 
   /// IListenerExtension only notify of wake up if immediate
   if (delay == 0)
   m_JobListeners.Awake(job.Cast<Job>());
 }
 
 IProgressMonitor::Pointer JobManager::MonitorFor(IProgressMonitor::Pointer sptr_monitor)
 {
   if(sptr_monitor == 0 || sptr_monitor.Cast<NullProgressMonitor>() )
   {
     if(m_sptr_progressProvider != 0 )
     sptr_monitor = m_sptr_progressProvider->GetDefaultMonitor();
   }
   if(sptr_monitor == 0)
   {
     IProgressMonitor::Pointer sptr_nullProgressMonitor(new NullProgressMonitor());
     return sptr_nullProgressMonitor;
   }
   return sptr_monitor;
 }
 
 }
diff --git a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.h b/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.h
index dfc3597689..49f7e5d91b 100644
--- a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.h
+++ b/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.h
@@ -1,431 +1,431 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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_JOBMANAGER_H
 #define _BERRY_JOBMANAGER_H
 
 #include "berryInternalJob.h"
 #include "berryJobQueue.h"
 #include "berryWorkerPool.h"
 #include "berryJobListeners.h"
 
 #include "berryJob.h"
 #include "berryIProgressMonitorWithBlocking.h"
 #include "berryIJobManager.h"
 #include "berryISchedulingRule.h"
 
 #include <org_blueberry_core_jobs_Export.h>
 
 #include <Poco/Mutex.h>
 #include <Poco/ScopedLock.h>
 #include <Poco/HashSet.h>
 #include <Poco/Timestamp.h>
 #include <Poco/Timespan.h>
 
 #include <string>
 #include <sstream>
 #include <assert.h>
 
 namespace berry
 {
 
 /**
  * Implementation of API type IJobManager
  *
  * Implementation note: all the data structures of this class are protected
  * by a single lock object held as a private field in this class.  The JobManager
  * instance itself is not used because this class is publicly reachable, and third
  * party clients may try to synchronize on it.
  *
  * The WorkerPool class uses its own monitor for synchronizing its data
  * structures. To avoid deadlock between the two classes, the JobManager
  * must NEVER call the worker pool while its own monitor is held.
  */
 struct BERRY_JOBS JobManager: public IJobManager
 {
 
 public:
 
   friend class WorkerPool;
   friend struct InternalJob;
   friend struct NullRule;
 
 
   berryObjectMacro(JobManager);
   /**
    * The unique identifier constant of this plug-in.
    */
   static const QString& PI_JOBS();
 
   static bool DEBUG;
   static bool DEBUG_BEGIN_END;
   static bool DEBUG_DEADLOCK;
   static bool DEBUG_LOCKS;
   static bool DEBUG_TIMING;
   static bool DEBUG_SHUTDOWN;
 
   /**
    * Status code constant indicating an error occurred while running a plug-in.
    * For backward compatibility with Platform.PLUGIN_ERROR left at (value = 2).
    */
   static const int PLUGIN_ERROR;
 
   /// const ImplicitJobs iImplicitJobs = new ImplicitJobs(this);
 
   /**
    * The singleton job manager instance. It must be a singleton because
    * all job instances maintain a reference (as an optimization) and have no way
    * of updating it.
    */
   static JobManager* GetInstance();
 
   /**
    * For debugging purposes only
    */
   static std::string PrintState(int state);
 
   /**
    * Note that although this method is not API, clients have historically used
    * it to force jobs shutdown in cases where OSGi shutdown does not occur.
    * For this reason, this method should be considered near-API and should not
    * be changed if at all possible.
    */
   static void Shutdown();
 
   //   void Cancel(Object family) ;
 
   IProgressMonitor::Pointer CreateProgressGroup() override;
 
   Job* CurrentJob();
 
   //   void EndRule(ISchedulingRule rule) ;
 
   //  Job[] Find(Object family) ;
   //    LockManager GetLockManager() {
   //    return lockManager;
   //  }
 
   bool IsIdle() override;
 
   bool IsSuspended() override;
 
   //  void Join(final Object family, IProgressMonitor monitor) throws InterruptedException, OperationCanceledException );
 
 
   //   ILock NewLock() ;
 
   /**
    *  @see IJobManager#RemoveChangeListener(IJobChangeListener*)
    */
   void RemoveJobChangeListener(IJobChangeListener* listener) override;
 
   // /**
   //* report to the progress monitor that this thread is blocked, supplying
   //* an information message, and if possible the job that is causing the blockage.
   //* important: an invocation of this method must be followed eventually be
   //* an invocation of ReportUnblocked.
   //* @param monitor the monitor to report blocking to
   //* @param BlockingJob the job that is blocking this thread, or <code>null</code>
   //* @see #Reportunblocked
   //*/
    void ReportBlocked( IProgressMonitor::Pointer monitor, InternalJob::Pointer blockingjob) const ;
 
   /**
    * Reports that this thread was blocked, but is no longer blocked and is able
    * to proceed.
    * @param monitor The monitor to report unblocking to.
    * @see #ReportBlocked
    */
   void ReportUnblocked(IProgressMonitor::Pointer monitor) const ;
   /**
    *  @have a look at IJobManager Resume
    */
   void Resume();
 
   // /**
   //  *  @have a look at IJobManager Resume
   //  */
 
   //  void Resume(ISchedulingRule::Pointer rule)const ;
 
   /**
    *  @have a look at IJobManager SetProgressProvider
    */
   void SetProgressProvider(ProgressProvider::Pointer provider) override;
 
   void SetRule(InternalJob::Pointer job, ISchedulingRule::Pointer rule);
 
   // /*
   //  * @see IJobManager#sleep(std::string)
   //  */
 
   //   void Sleep(Object family) ;
 
   void Suspend();
 
   /*
    * @see schedule(long)
    */
   void Schedule(InternalJob::Pointer job, Poco::Timestamp::TimeDiff delay, bool reschedule);
 
   //   void Suspend(ISchedulingRule::Pointer rule, IProgressMonitor::Pointer monitor)const ;
 
   //  void TransferRule(ISchedulingRule rule, Thread destinationThread) ;
 
   //   void SetLockListener(LockListener listener) ;
 
 
   // /**
   // * Puts a job to sleep. Returns true if the job was successfully put to sleep.
   // */
 
   //  void WakeUp(Object family) ;
 
 
   void AddJobChangeListener(IJobChangeListener* listener) override;
 
   //  void beginRule(ISchedulingRule rule, IProgressMonitor monitor) ;
 
 
 protected:
 
   /**
    * Cancels a job
    */
   bool Cancel(InternalJob::Pointer job);
 
 
   /**
    * Returns a new progress monitor for this job, belonging to the given
    * progress group.  Returns null if it is not a valid time to set the job's group.
    */
   IProgressMonitor::Pointer CreateMonitor(InternalJob::Pointer job,
       IProgressMonitor::Pointer group, int ticks);
 
   /**
    * Indicates that a job was running, and has now finished.  Note that this method
    * can be called under OutOfMemoryError conditions and thus must be paranoid
    * about allocating objects.
    */
   /// optional Extension IStatus for implementation help have a look at the Java JobAPI
   void EndJob(InternalJob::Pointer job,IStatus::Pointer result, bool notify);
 
   /**
    * Returns a running or blocked job whose scheduling rule conflicts with the
    * scheduling rule of the given waiting job.  Returns null if there are no
    * conflicting jobs.  A job can only run if there are no running jobs and no blocked
    * jobs whose scheduling rule conflicts with its rule.
    */
   InternalJob::Pointer FindBlockingJob(InternalJob::Pointer waitingJob);
 
   /**
    * Returns whether the job manager is active (has not been shutdown).
    */
   bool IsActive();
 
   /**
    * Returns true if the given job is blocking the execution of a non-system
    * job.
    */
   bool IsBlocking(InternalJob::Pointer runningJob);
 
   //   void Join(InternalJob job) ;
 
   /**
    * Attempts to immediately start a given job.  Returns true if the job was
    * successfully started, and false if it could not be started immediately
    * due to a currently running job with a conflicting rule.  Listeners will never
    * be notified of jobs that are run in this way.
    */
   bool RunNow(InternalJob::Pointer sptr_job);
 
   /**
    * Puts a job to sleep. Returns true if the job was successfully put to sleep.
    */
   bool Sleep(InternalJob::Pointer job);
 
   /**
    * Changes a job priority.
    */
   void SetPriority(InternalJob::Pointer job, int newPriority);
 
   /**
    * Returns the estimated time in milliseconds before the next job is scheduled
    * to wake up. The result may be negative.  Returns InternalJob.T_INFINITE if
    * there are no sleeping or waiting jobs.
    */
   Poco::Timespan::TimeDiff SleepHint();
 
   /**
    * Returns the next job to be run, or null if no jobs are waiting to run.
    * The worker must call endJob when the job is finished running.
    */
   Job::Pointer StartJob();
 
   /*
    * @see Job#WakeUp(long)
    */
   void WakeUp(InternalJob::Pointer job, Poco::Timestamp::TimeDiff delay);
 
 private:
 
   JobManager();
 
   /* Poco Mutex for synchronizing purposes */
   Poco::Mutex m_mutex;
 
   // Dummy Null rule to validate SchedulingRules implemented by clients
   SmartPointer<ISchedulingRule> sptr_testRule;
 
   //   //ToDO static const ISchedulingRule nullRule = new ISchedulingRule() {
 
   //    public bool Contains(ISchedulingRule rule) ;
   //    public boolean IsConflicting(ISchedulingRule rule) ;
 
 
   /**
    * True if this manager is active, and false otherwise.  A job manager
    * starts out active, and becomes inactive if it has been shutdown
    * and not restarted.
    */
   volatile bool m_active;
 
 
   JobListeners m_JobListeners;
 
   //
   //  /**
   //   * The lock for synchronizing all activity in the job manager.  To avoid deadlock,
   //   * this lock must never be held for extended periods, and must never be
   //   * held while third party code is being called.
   //   */
   //  // private final Object lock = new Object();
   //   static const Object lock ;
   //
   //  //private LockManager lockManager = new LockManager();
-  //   static const LockManger lockManager;
+  //   static const LockManager lockManager;
   /**
    * The pool of worker threads.
    */
   WorkerPool::Pointer m_Pool;
 
   ProgressProvider::Pointer m_sptr_progressProvider;
 
   /**
    * Jobs that are currently running. Should only be modified from changeState
    */
   QSet<InternalJob::Pointer> m_running;
 
   /**
    * Jobs that are sleeping.  Some sleeping jobs are scheduled to wake
    * up at a given start time, while others will sleep indefinitely until woken.
    * Should only be modified from changeState
    */
   JobQueue m_JobQueueSleeping;
 
   /**
    * jobs that are waiting to be run. Should only be modified from changeState
    */
   JobQueue m_JobQueueWaiting;
   /**
    * True if this manager has been suspended, and false otherwise.  A job manager
    * starts out not suspended, and becomes suspended when <code>suspend</code>
    * is invoked. Once suspended, no jobs will start running until <code>resume</code>
    * is cancelled.
    */
   bool m_suspended;
 
   /**
    * Counter to record wait queue insertion order.
    */
   long long m_waitQueueCounter;
 
   //  /**
   //   * For debugging purposes only
   //   */
   //  const std::string PrintJobName(Job job);
 
 
   /**
    * Atomically updates the state of a job, adding or removing from the
    * necessary queues or sets.
    */
   void ChangeState(InternalJob::Pointer job, int newState);
 
   /**
    * Returns a new progress monitor for this job.  Never returns null.
    */
   IProgressMonitor::Pointer CreateMonitor(Job::Pointer sptr_jobToMonitor);
 
   /**
    * Returns the delay in milliseconds that a job with a given priority can
    * tolerate waiting.
    */
   Poco::Timestamp::TimeDiff DelayFor(int priority);
 
   /**
    * Performs the scheduling of a job.  Does not perform any notifications.
    */
   void DoSchedule(InternalJob::Pointer job, Poco::Timestamp::TimeDiff delay);
 
   /**
    * Shuts down the job manager.  Currently running jobs will be told
    * to stop, but worker threads may still continue processing.
    * (note: This implemented IJobManager.Shutdown which was removed
    * due to problems caused by premature shutdown)
    */
   void DoShutdown();
 
   //  void InitDebugOptions() ;
 
   /**
    * Removes and returns the first waiting job in the queue. Returns null if there
    * are no items waiting in the queue.  If an item is removed from the queue,
    * it is moved to the running jobs list.
    */
   Job::Pointer NextJob();
 
   /**
    * Returns a non-null progress monitor instance.  If the monitor is null,
    * returns the default monitor supplied by the progress provider, or a
    * NullProgressMonitor if no default monitor is available.
    */
   IProgressMonitor::Pointer MonitorFor(IProgressMonitor::Pointer monitor);
 
   //    /**
   //   * Adds all family members in the list of jobs to the collection
   //   */
   //  void Select(List members, Object family, InternalJob firstJob, int stateMask) ;
   //
   //  /**
   //   * Returns a list of all jobs known to the job manager that belong to the given family.
   //   */
   //  List Select(Object family) ;
   //
   //  /**
   //   * Returns a list of all jobs known to the job manager that belong to the given
   //   * family and are in one of the provided states.
   //   */
   //   List Select(Object family, int stateMask) ;
 
    /**
     * Validates that the given scheduling rule obeys the constraints of
     * scheduling rules as described in the <code>ISchedulingRule</code>
     */
   void ValidateRule(ISchedulingRule::Pointer rule);
 
 };
 
 }
 #endif /* _BERRY_TEMPLATE_H */
diff --git a/Plugins/org.blueberry.core.jobs/src/internal/berryJobQueue.cpp b/Plugins/org.blueberry.core.jobs/src/internal/berryJobQueue.cpp
index 8818936f83..6d2dd57b5c 100644
--- a/Plugins/org.blueberry.core.jobs/src/internal/berryJobQueue.cpp
+++ b/Plugins/org.blueberry.core.jobs/src/internal/berryJobQueue.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "berryJobQueue.h"
 
 // changed Java JobQueue implementation ..
 // if only one element is in the queue than  InternalJob->next and InternalJob->previous pointer are pointing to 0 and not to the Element itself
 // I think its better .. will see
 namespace berry
 {
 
 class DummyJob: public InternalJob
 {
 
 public:
 
   IStatus::Pointer Run(IProgressMonitor::Pointer) override
   {
     return Status::OK_STATUS(BERRY_STATUS_LOC);
   }
 
   DummyJob() :
     InternalJob("Queue-Head")
   {
   }
 
 };
 
 JobQueue::JobQueue(bool allowConflictOvertaking) :
   dummy(new DummyJob()), m_allowConflictOvertaking(allowConflictOvertaking)
 {
   dummy->SetNext(dummy);
   dummy->SetPrevious(dummy);
 }
 
-//TODO JobQueue Constructor IStatus Implementierung
+//TODO JobQueue Constructor IStatus Implementation
 //TODO Constructor JobQueue IStatus .. implementation
 //  public JobQueue(boolean allowConflictOvertaking) {
 //  //compareTo on dummy is never called
 //  dummy = new InternalJob("Queue-Head") {//$NON-NLS-1$
 //    public IStatus run(IProgressMonitor m) {
 //      return Status.OK_STATUS;
 //    }
 //  };
 //  dummy.setNext(dummy);
 //  dummy.setPrevious(dummy);
 //  this.allowConflictOvertaking = allowConflictOvertaking;
 //}
 
 
 bool JobQueue::CanOvertake(InternalJob::Pointer newEntry,
     InternalJob::Pointer queueEntry)
 {
   //can never go past the end of the queue
 
   if (queueEntry == dummy.GetPointer())
     return false;
   //if the new entry was already in the wait queue, ensure it is re-inserted in correct position (bug 211799)
   if (newEntry->GetWaitQueueStamp() > 0 && newEntry->GetWaitQueueStamp()
       < queueEntry->GetWaitQueueStamp())
     return true;
   //if the new entry has lower priority, there is no need to overtake the existing entry
   if ((queueEntry == newEntry))
     return false;
 
   // the new entry has higher priority, but only overtake the existing entry if the queue allows it
   InternalJob::Pointer sptr_queueEntry(queueEntry);
   return m_allowConflictOvertaking || !newEntry->IsConflicting(sptr_queueEntry);
 
 }
 
 void JobQueue::Clear()
 {
 
   dummy->SetNext(dummy);
   dummy->SetPrevious(dummy);
 
 }
 
 // notice: important that the first element in the queue is internally set as a dummy element
 InternalJob::Pointer JobQueue::Dequeue()
 {
 
   InternalJob::Pointer ptr_dummyPrevious = dummy->Previous();
   // sets previous pointer to 0 if there is only 1 Element in the queue
   if (ptr_dummyPrevious == dummy)
   {
     dummy->previous = nullptr;
     return dummy;
   }
   return ptr_dummyPrevious->Remove();
 }
 
 void JobQueue::Enqueue(InternalJob::Pointer newEntry)
 {
   InternalJob::Pointer tail = dummy->Next();
   //overtake lower priority jobs. Only overtake conflicting jobs if allowed to
   while (CanOvertake(newEntry, tail))
     tail = tail->Next();
   InternalJob::Pointer tailPrevious = tail->Previous();
   newEntry->SetNext(tail);
   newEntry->SetPrevious(tailPrevious);
   tailPrevious->SetNext(newEntry);
   tail->SetPrevious(newEntry);
 
 }
 
 void JobQueue::Remove(InternalJob::Pointer jobToRemove)
 {
   jobToRemove->Remove();
 }
 
 void JobQueue::Resort(InternalJob::Pointer entry)
 {
   this->Remove(entry);
   this->Enqueue(entry);
 }
 
 bool JobQueue::IsEmpty()
 {
 
   return this->dummy->next == dummy;
 }
 
 InternalJob::Pointer JobQueue::Peek()
 {
 
   return dummy->Previous() == dummy ? InternalJob::Pointer(nullptr)
       : dummy->Previous();
 
 }
 
 }
diff --git a/Plugins/org.blueberry.core.jobs/src/internal/berryWorkerPool.cpp b/Plugins/org.blueberry.core.jobs/src/internal/berryWorkerPool.cpp
index 9360e6ea59..41abb8fc98 100644
--- a/Plugins/org.blueberry.core.jobs/src/internal/berryWorkerPool.cpp
+++ b/Plugins/org.blueberry.core.jobs/src/internal/berryWorkerPool.cpp
@@ -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.
 
 ============================================================================*/
 
 #define NOMINMAX
 
 #include "berryWorkerPool.h"
 #include "berryJobManager.h"
 
 #include <Poco/Timestamp.h>
 #include <Poco/Timespan.h>
 
 #include <math.h>
 
 namespace berry
 {
 
 WorkerPool::WorkerPool(JobManager* myJobManager) :
   m_ptrManager(myJobManager), m_numThreads(0), m_sleepingThreads(0), m_threads(
       10), m_busyThreads(0)
 // m_isDaemon(false),
 {
 }
 
 const long WorkerPool::BEST_BEFORE = 60000;
 const int WorkerPool::MIN_THREADS = 1;
 
 
 void WorkerPool::Shutdown()
 {
   Poco::ScopedLock<Poco::Mutex> LockMe(m_mutexOne);
   for(int i = 0; i<= m_numThreads; i++)
     {
       notify();
     }
 }
 
 void WorkerPool::Add(Worker::Pointer worker)
 {
   Poco::Mutex::ScopedLock lock(m_mutexOne);
   m_threads.push_back(worker);
 }
 
 void WorkerPool::DecrementBusyThreads()
 {
   Poco::ScopedLock<Poco::Mutex> lockOne(m_mutexOne);
   //impossible to have less than zero busy threads
   if (--m_busyThreads < 0)
   {
     //TODO Decrementbusythreads if (jobmanager.debug) assert.istrue(false, integer.tostring(busythreads));
     m_busyThreads = 0;
   }
 }
 
 void WorkerPool::IncrementBusyThreads()
 {
   Poco::ScopedLock<Poco::Mutex> lockOne(m_mutexOne);
   if (++m_busyThreads > m_numThreads)
   {
     m_busyThreads = m_numThreads;
   }
 }
 
 bool WorkerPool::Remove(Worker::Pointer worker)
 {
   Poco::ScopedLock<Poco::Mutex> lockOne(m_mutexOne);
 
   auto end = std::remove(m_threads.begin(),
       m_threads.end(), worker);
   bool removed = end != m_threads.end();
   m_threads.erase(end);
 
   return removed;
 }
 
 void WorkerPool::EndWorker(Worker::Pointer sptr_worker)
 {
   Poco::ScopedLock<Poco::Mutex> lock(m_mutexOne);
   Remove(sptr_worker);
 }
 
 void WorkerPool::Sleep(long duration)
 {
   Poco::ScopedLock<Poco::Mutex> lock(m_mutexOne);
   m_sleepingThreads++;
   m_busyThreads--;
 
   try
   {
     wait(duration);
     throw FinallyThrowException();
   } catch (FinallyThrowException&)
   {
     m_sleepingThreads--;
     m_busyThreads++;
   } catch (...)
   {
     m_sleepingThreads--;
     m_busyThreads++;
   }
 }
 
 InternalJob::Pointer WorkerPool::StartJob(Worker* worker)
 {
   // if we're above capacity, kill the thread
   {
     Poco::Mutex::ScopedLock lockOne(m_mutexOne);
     if (!m_ptrManager->IsActive())
     {
       //  must remove the worker immediately to prevent all threads from expiring
       Worker::Pointer sptr_worker(worker);
       EndWorker(sptr_worker);
       return InternalJob::Pointer(nullptr);
     }
     //set the thread to be busy now in case of reentrant scheduling
     IncrementBusyThreads();
   }
   Job::Pointer ptr_job(nullptr);
   try
   {
     ptr_job = m_ptrManager->StartJob();
     //spin until a job is found or until we have been idle for too long
     Poco::Timestamp idleStart;
     while (m_ptrManager->IsActive() && ptr_job == 0)
     {
       long tmpSleepTime = long(m_ptrManager->SleepHint());
       if (tmpSleepTime > 0)
         Sleep(std::min(tmpSleepTime, BEST_BEFORE));
       ptr_job = m_ptrManager->StartJob();
       //if we were already idle, and there are still no new jobs, then the thread can expire
       {
         Poco::Mutex::ScopedLock lockOne(m_mutexOne);
         Poco::Timestamp tmpCurrentTime;
         long long tmpTime = tmpCurrentTime - idleStart;
         if (ptr_job == 0 && (tmpTime > BEST_BEFORE) && (m_numThreads
             - m_busyThreads) > MIN_THREADS)
         {
           //must remove the worker immediately to prevent all threads from expiring
           Worker::Pointer sptr_worker(worker);
           EndWorker(sptr_worker);
           return InternalJob::Pointer(nullptr);
         }
       }
     }
     if (ptr_job != 0)
     {
       //if this job has a rule, then we are essentially acquiring a lock
       //if ((job.getRule() != 0) && !(job instanceof ThreadJob)) {
-      // //don't need to re-aquire locks because it was not recorded in the graph
+      // //don't need to re-acquire locks because it was not recorded in the graph
       // //that this thread waited to get this rule
       //  manager.getLockManager().addLockThread(Thread.currentThread(), job.getRule());
       //        }
       //see if we need to wake another worker
       if (m_ptrManager->SleepHint() <= 0)
         JobQueued();
     }
     throw FinallyThrowException();
   } catch (FinallyThrowException&)
   {
     //decrement busy thread count if we're not running a job
     if (ptr_job == 0)
       DecrementBusyThreads();
   } catch (...)
   {
     DecrementBusyThreads();
   }
   return ptr_job;
 }
 
 
 void WorkerPool::JobQueued()
 {
   Poco::ScopedLock<Poco::Mutex> lockOne(m_mutexOne);
   //if there is a sleeping thread, wake it up
   if (m_sleepingThreads > 0)
   {
     notify();
     return;
   }
   //create a thread if all threads are busy
   if (m_busyThreads >= m_numThreads)
   {
     WorkerPool::WeakPtr wp_WorkerPool(WorkerPool::Pointer(this));
     Worker::Pointer sptr_worker(new Worker(wp_WorkerPool));
     Add(sptr_worker);
     sptr_worker->Start();
     return;
   }
 }
 
 
 
 void WorkerPool::EndJob(InternalJob::Pointer job, IStatus::Pointer result) {
       DecrementBusyThreads();
   //TODO LockManager
   //    //need to end rule in graph before ending job so that 2 threads
   //    //do not become the owners of the same rule in the graph
   //    if ((job.getRule() != null) && !(job instanceof ThreadJob)) {
   //      //remove any locks this thread may be owning on that rule
   //      manager.getLockManager().removeLockCompletely(Thread.currentThread(), job.getRule());
   //    }
       m_ptrManager->EndJob(job, result, true);
   //    //ensure this thread no longer owns any scheduling rules
   //    manager.implicitJobs.endJob(job);
     }
 
 }
diff --git a/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h b/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
index 96fa476b20..1c09fe9261 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIAdapterManager.h
@@ -1,280 +1,280 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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's <code>IAdapterManager.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>
  *
  * \code
  *  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);
  * \endcode
  *
  * </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);
 
   /**
    * 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>)
    * @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 adaptableType the adaptable object being queried (usually an instance
    * of <code>IAdaptable</code>)
    * @param adapterType 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 adaptableType the adaptable object being queried (usually an instance
    * of <code>IAdaptable</code>)
    * @param adapterType 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>)
    * @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
    */
   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
    */
   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
    */
   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/berryIStatus.h b/Plugins/org.blueberry.core.runtime/src/berryIStatus.h
index cad224941c..c5fa114bf4 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryIStatus.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryIStatus.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 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);
 
   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. */
+    /** Status type severity (bit mask, value 8) indicating this status represents a cancellation. */
     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>CANCEL_TYPE</code> - cancellation 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>
    */
   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/berryObject.h b/Plugins/org.blueberry.core.runtime/src/berryObject.h
index 325abc974d..513786dcd5 100644
--- a/Plugins/org.blueberry.core.runtime/src/berryObject.h
+++ b/Plugins/org.blueberry.core.runtime/src/berryObject.h
@@ -1,241 +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.
 
 ============================================================================*/
 
 #ifndef BERRYOBJECT_H_
 #define BERRYOBJECT_H_
 
 #include <org_blueberry_core_runtime_Export.h>
 
 #include "berryMacros.h"
 #include "berryMessage.h"
 
 #include <berryConfig.h>
 
 #include <QString>
 #include <QMetaType>
 #include <QMutex>
 #include <QAtomicInt>
 
 #ifdef _MSC_VER
 // disable inheritance by dominance warnings
 #pragma warning( disable : 4250 4275 )
 #endif
 
 class QDebug;
 class QTextStream;
 
 namespace berry {
 
 class org_blueberry_core_runtime_EXPORT Indent
 {
 
 public:
 
   /** Standard class typedefs. */
   typedef Indent  Self;
 
   /** Construct the object with an initial Indentation level. */
   Indent(int ind = 0) { m_Indent=ind; }
 
   /**
    * Determine the next Indentation level. Keep Indenting by two until the
    * a maximum of forty spaces is reached.
    */
   Indent GetNextIndent();
 
   /** Print out the Indentation. Basically output a bunch of spaces.  */
   friend org_blueberry_core_runtime_EXPORT QDebug operator<<(QDebug os, const Indent& o);
 
 private:
 
   int m_Indent;
 };
 
 
 /** \class Object
  * \brief Light weight base class for most BlueBerry classes.
  *
  * Object is copied from itk::LightObject and is the highest
  * level base class for most BlueBerry objects. It
  * implements reference counting and the API for object printing.
  *
  */
 class org_blueberry_core_runtime_EXPORT Object
 {
 
 private:
 
   mutable Message<> m_DestroyMessage;
 
 public:
 
   typedef Object Self;
   typedef berry::SmartPointer<Self> Pointer;
   typedef berry::SmartPointer<const Self>  ConstPointer;
   typedef berry::WeakPointer<Self> WeakPtr;
   typedef berry::WeakPointer<const Self> ConstWeakPtr;
 
   static const char* GetStaticClassName();
   virtual QString GetClassName() const;
 
   static Reflection::TypeInfo GetStaticTypeInfo();
   virtual Reflection::TypeInfo GetTypeInfo() const;
 
   static QList<Reflection::TypeInfo> GetStaticSuperclasses();
   virtual QList<Reflection::TypeInfo> GetSuperclasses() const;
 
   /** Delete an BlueBerry object. This method should always be used to delete an
    * object when the new operator was used to create it. Using the C
    * delete method will not work with reference counting.  */
   virtual void Delete();
 
 
 #ifdef _WIN32
   /** Used to avoid dll boundary problems.  */
   void* operator new(size_t);
   void* operator new[](size_t);
   void operator delete(void*);
   void operator delete[](void*, size_t);
 #endif
 
   /**
    * Cause the object to print itself out. This is usually used to provide
    * detailed information about the object's state. It just calls the
-   * header/self/trailer virtual print methods, which can be overriden by
+   * header/self/trailer virtual print methods, which can be overridden by
    * subclasses.
    */
   QDebug Print(QDebug os, Indent Indent=0) const;
 
   /**
    * Returns a string representation of this object. The default
    * implementation returns an empty string.
    */
   virtual QString ToString() const;
 
   /**
    * Returns a hash code value for the object.
    */
   virtual uint HashCode() const;
 
   /**
    * Override this method to implement a specific "less than" operator
    * for associative STL containers.
    */
   virtual bool operator<(const Object*) const;
 
   /** Increase the reference count (mark as used by another object).  */
   void Register() const;
 
   /** Decrease the reference count (release by another object).
    * Set del to false if you do not want the object to be deleted if
    * the reference count is zero (use with care!) */
   void UnRegister(bool del = true) const;
 
   /** Gets the reference count on this object. */
   int GetReferenceCount() const
   {
     return m_ReferenceCount.load();
   }
 
   /** Sets the reference count on this object. This is a dangerous
    * method, use it with care. */
   void SetReferenceCount(int);
 
   inline void AddDestroyListener(const MessageAbstractDelegate<>& delegate) const
   { m_DestroyMessage += delegate; }
   inline void RemoveDestroyListener(const MessageAbstractDelegate<>& delegate) const
   { m_DestroyMessage -= delegate; }
 
 
   /**
    * A generic comparison method. Override this method in subclasses and
    * cast to your derived class to provide a more detailed comparison.
    */
   virtual bool operator==(const Object*) const;
 
 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
   unsigned int GetTraceId() const;
 private:
   unsigned int m_TraceId;
   unsigned int& GetTraceIdCounter() const;
 public:
 #endif
 
 protected:
 
   friend struct QScopedPointerObjectDeleter;
 
   Object();
   virtual ~Object();
 
   /**
    * Methods invoked by Print() to print information about the object
    * including superclasses. Typically not called by the user (use Print()
    * instead) but used in the hierarchical print process to combine the
    * output of several classes.
    */
   virtual QDebug PrintSelf(QDebug os, Indent indent) const;
   virtual QDebug PrintHeader(QDebug os, Indent indent) const;
   virtual QDebug PrintTrailer(QDebug os, Indent indent) const;
 
   /** Number of uses of this object by other objects. */
   mutable QAtomicInt m_ReferenceCount;
 
   /** Mutex lock to protect modification to the reference count */
   mutable QMutex m_ReferenceCountLock;
 
 private:
 
   Object(const Self&); //purposely not implemented
   void operator=(const Self&); //purposely not implemented
 
 };
 
 // A custom deleter for QScopedPointer
 // berry::Object instances in a QScopedPointer should have reference count one,
 // such that they are not accidentally deleted when a temporary smart pointer
 // pointing to it goes out of scope. This deleter fixes the reference count and
 // always deletes the instance. Use a berry::SmartPointer if the lifetime should
 // exceed the one of the pointer.
 struct QScopedPointerObjectDeleter
 {
   static inline void cleanup(Object* obj)
   {
     if (obj == nullptr) return;
     obj->UnRegister(false);
     delete obj;
   }
 };
 
 org_blueberry_core_runtime_EXPORT QDebug operator<<(QDebug os, const berry::Indent& o);
 
 }
 
 /**
  * This operator allows all subclasses of Object to be printed via QDebug <<.
  * It in turn invokes the Print method, which in turn will invoke the
  * PrintSelf method that all objects should define, if they have anything
  * interesting to print out.
  */
 org_blueberry_core_runtime_EXPORT QDebug operator<<(QDebug os, const berry::Object& o);
 org_blueberry_core_runtime_EXPORT QDebug operator<<(QDebug os, const berry::SmartPointer<const berry::Object>& o);
 org_blueberry_core_runtime_EXPORT QDebug operator<<(QDebug os, const berry::SmartPointer<berry::Object>& o);
 
 org_blueberry_core_runtime_EXPORT QTextStream& operator<<(QTextStream& os, const berry::Object& o);
 org_blueberry_core_runtime_EXPORT QTextStream& operator<<(QTextStream& os, const berry::SmartPointer<const berry::Object>& o);
 //org_blueberry_core_runtime_EXPORT QTextStream& operator<<(QTextStream& os, const berry::SmartPointer<berry::Object>& o);
 
 Q_DECLARE_METATYPE(berry::Object::Pointer)
 
 org_blueberry_core_runtime_EXPORT uint qHash(const berry::Object& o);
 
 #endif /*BERRYOBJECT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h b/Plugins/org.blueberry.core.runtime/src/berryPlatformObject.h
index c36c7381eb..e89a1ace00 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:
+ * adapter 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);
 
   /**
    * 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/berryApplicationContainer.h b/Plugins/org.blueberry.core.runtime/src/internal/berryApplicationContainer.h
index 45c092537d..778bce9295 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryApplicationContainer.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryApplicationContainer.h
@@ -1,180 +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 BERRYAPPLICATIONCONTAINER_H
 #define BERRYAPPLICATIONCONTAINER_H
 
 #include <berryIRegistryEventListener.h>
 
 #include <ctkServiceTracker.h>
 #include <ctkServiceTrackerCustomizer.h>
 
 #include <QObject>
 #include <QMutex>
 
 struct ctkApplicationLauncher;
 struct ctkApplicationRunnable;
 
 namespace berry {
 
 struct IBranding;
 struct IExtensionRegistry;
 
 class ApplicationDescriptor;
 class ApplicationHandle;
 class MainApplicationLauncher;
 
 /*
  * This container will discover installed BlueBerry applications and register the
  * appropriate ctkApplicationDescriptor service with the service registry.
  */
 class ApplicationContainer : public QObject, public QMutex, private IRegistryEventListener,
     private ctkServiceTrackerCustomizer<ctkApplicationLauncher*>
 {
   Q_OBJECT
 
 private:
 
   static const QString PI_RUNTIME; // = "org.blueberry.core.runtime";
   static const QString PT_APPLICATIONS; // = "applications";
   static const QString PT_APP_VISIBLE; // = "visible";
   static const QString PT_APP_THREAD; // = "thread";
   static const QString PT_APP_THREAD_ANY; // = "any";
   static const QString PT_APP_CARDINALITY; // = "cardinality";
   static const QString PT_APP_CARDINALITY_SINGLETON_GLOBAL; // = "singleton-global";
   static const QString PT_APP_CARDINALITY_SINGLETON_SCOPED; // = "singleton-scoped";
   static const QString PT_APP_CARDINALITY_UNLIMITED; // = "*";
   static const QString PT_APP_ICON; // = "icon";
   static const QString PT_PRODUCTS; // = "products";
   static const QString EXT_ERROR_APP; // = "org.blueberry.core.runtime.app.error";
 
   static const QString PROP_PRODUCT; // = "blueberry.product";
   static const QString PROP_BLUEBERRY_APPLICATION; // = "blueberry.application";
   static const QString PROP_BLUEBERRY_APPLICATION_LAUNCH_DEFAULT; // = "blueberry.application.launchDefault";
 
   static const int NOT_LOCKED; // = 0;
   static const int LOCKED_SINGLETON_GLOBAL_RUNNING; // = 1;
   static const int LOCKED_SINGLETON_GLOBAL_APPS_RUNNING; // = 2;
   static const int LOCKED_SINGLETON_SCOPED_RUNNING; // = 3;
   static const int LOCKED_SINGLETON_LIMITED_RUNNING; // = 4;
   static const int LOCKED_MAIN_THREAD_RUNNING; // = 5;
 
   ctkPluginContext* context;
 
   QMutex lock;
 
   // A map of ApplicationDescriptors keyed by application ID
   /* @GuardedBy(lock) */
   QHash<QString, ApplicationDescriptor*> apps;
 
   IExtensionRegistry* extensionRegistry;
   QScopedPointer<ctkServiceTracker<ctkApplicationLauncher*>> launcherTracker;
   mutable QScopedPointer<IBranding> branding;
   mutable bool missingProductReported;
 
   /* @GuardedBy(lock) */
   QList<ApplicationHandle*> activeHandles; // the currently active application handles
   /* @GuardedBy(lock) */
   ApplicationHandle* activeMain; // the handle currently running on the main thread
   /* @GuardedBy(lock) */
   ApplicationHandle* activeGlobalSingleton; // the current global singleton handle
   /* @GuardedBy(lock) */
   ApplicationHandle* activeScopedSingleton; // the current scoped singleton handle
   /* @GuardedBy(lock) */
   QHash<QString, QList<ApplicationHandle*> > activeLimited; // Map of handles that have cardinality limits
 
   mutable QString defaultAppId;
   //DefaultApplicationListener defaultAppListener;
   ctkApplicationRunnable* defaultMainThreadAppHandle; // holds the default app handle to be run on the main thread
   volatile bool missingApp;
   QScopedPointer<MainApplicationLauncher> missingAppLauncher;
 
 public:
 
   ApplicationContainer(ctkPluginContext* context, IExtensionRegistry* extensionRegistry);
   ~ApplicationContainer() override;
 
   void Start();
   void Stop();
 
   IBranding* GetBranding() const;
 
   ctkPluginContext* GetContext() const;
 
   void Launch(ApplicationHandle* appHandle);
 
   void Lock(ApplicationHandle* appHandle);
   void Unlock(ApplicationHandle* appHandle);
   int IsLocked(const ApplicationDescriptor* eclipseApp) const;
 
   void StartDefaultApp(bool delayError);
 
 private:
 
   Q_DISABLE_COPY(ApplicationContainer)
 
   friend class ApplicationHandle;
 
   /*
    * Only used to find the default application
    */
   ApplicationDescriptor* GetAppDescriptor(const QString& applicationId);
 
   ApplicationDescriptor* CreateAppDescriptor(const SmartPointer<IExtension>& appExtension);
 
   ApplicationDescriptor* RemoveAppDescriptor(const QString& applicationId);
 
   /*
    * Registers an ApplicationDescriptor service for each eclipse application
    * available in the extension registry.
    */
   void RegisterAppDescriptors();
 
   void RegisterAppDescriptor(const QString& applicationId);
 
   /*
    * Returns a list of all the available application IDs which are available
    * in the extension registry.
    */
   QList<SmartPointer<IExtension> > GetAvailableAppExtensions() const;
 
   QString GetAvailableAppsMsg() const;
 
   /*
-   * Returns the application extension for the specified applicaiton ID.
+   * Returns the application extension for the specified application ID.
    * A RuntimeException is thrown if the extension does not exist for the
    * given application ID.
    */
   SmartPointer<IExtension> GetAppExtension(const QString& applicationId) const;
 
   Q_SLOT void PluginChanged(const ctkPluginEvent& event);
 
   void StopAllApps();
 
   QString GetDefaultAppId() const;
 
   ctkApplicationLauncher* addingService(const ctkServiceReference& reference) override;
   void modifiedService(const ctkServiceReference& reference, ctkApplicationLauncher* service) override;
   void removedService(const ctkServiceReference& reference, ctkApplicationLauncher* service) override;
 
   void Added(const QList<SmartPointer<IExtension> >& extensions) override;
   void Added(const QList<SmartPointer<IExtensionPoint> >& extensionPoints) override;
   void Removed(const QList<SmartPointer<IExtension> >& extensions) override;
   void Removed(const QList<SmartPointer<IExtensionPoint> >& extensionPoints) override;
 
   void RefreshAppDescriptors();
 
 };
 
 }
 
 #endif // BERRYAPPLICATIONCONTAINER_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionRegistry.cpp b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionRegistry.cpp
index d83da9b8cc..bd600d2bcc 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionRegistry.cpp
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryExtensionRegistry.cpp
@@ -1,1340 +1,1340 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryExtensionRegistry.h"
 
 #include "berryCombinedEventDelta.h"
 #include "berryConfigurationElement.h"
 #include "berryConfigurationElementAttribute.h"
 #include "berryConfigurationElementDescription.h"
 #include "berryExtension.h"
 #include "berryExtensionHandle.h"
 #include "berryExtensionPoint.h"
 #include "berryExtensionPointHandle.h"
 #include "berryExtensionsParser.h"
 #include "berryIConfigurationElement.h"
 #include "berryIExtension.h"
 #include "berryIExtensionPoint.h"
 #include "berrySimpleExtensionPointFilter.h"
 #include "berryMultiStatus.h"
 #include "berryRegistryConstants.h"
 #include "berryRegistryContribution.h"
 #include "berryRegistryContributor.h"
 #include "berryRegistryMessages.h"
 #include "berryRegistryObjectFactory.h"
 #include "berryRegistryObjectManager.h"
 #include "berryRegistryProperties.h"
 #include "berryRegistryStrategy.h"
 #include "berryStatus.h"
 
 #include <QThread>
 #include <QTime>
 
 namespace berry {
 
 struct ExtensionRegistry::ListenerInfo {
   IExtensionPointFilter filter;
   IRegistryEventListener* listener;
 
   ListenerInfo(IRegistryEventListener* listener, const IExtensionPointFilter& filter)
     : filter(filter), listener(listener)
   {
   }
 
   /**
    * Used by ListenerList to ensure uniqueness.
    */
   bool operator==(const ListenerInfo& another) const
   {
     return another.listener == this->listener;
   }
 
 };
 
 void ExtensionRegistry::Add(const SmartPointer<RegistryContribution> &element)
 {
   QWriteLocker l(&access);
   eventDelta = CombinedEventDelta::RecordAddition();
   BasicAdd(element, true);
   FireRegistryChangeEvent();
   eventDelta.Reset();
 }
 
 QString ExtensionRegistry::AddExtension(int extension)
 {
   Extension::Pointer addedExtension = registryObjects->GetObject(extension, RegistryObjectManager::EXTENSION).Cast<Extension>();
   QString extensionPointToAddTo = addedExtension->GetExtensionPointIdentifier();
   ExtensionPoint::Pointer extPoint = registryObjects->GetExtensionPointObject(extensionPointToAddTo);
   //orphan extension
   if (extPoint.IsNull())
   {
     registryObjects->AddOrphan(extensionPointToAddTo, extension);
     return QString();
   }
   // otherwise, link them
   QList<int> newExtensions = extPoint->GetRawChildren();
   newExtensions.push_back(extension);
   Link(extPoint, newExtensions);
   if (!eventDelta.IsNull())
     eventDelta.RememberExtension(extPoint, extension);
   return extPoint->GetNamespace();
   //return RecordChange(extPoint, extension, ExtensionDelta::ADDED);
 }
 
 QString ExtensionRegistry::AddExtensionPoint(int extPoint)
 {
   ExtensionPoint::Pointer extensionPoint = registryObjects->GetObject(extPoint, RegistryObjectManager::EXTENSION_POINT).Cast<ExtensionPoint>();
   if (!eventDelta.IsNull())
     eventDelta.RememberExtensionPoint(extensionPoint);
   QList<int> orphans = registryObjects->RemoveOrphans(extensionPoint->GetUniqueIdentifier());
   if (orphans.empty())
     return QString();
   Link(extensionPoint, orphans);
   if (!eventDelta.IsNull())
     eventDelta.RememberExtensions(extensionPoint, orphans);
   return extensionPoint->GetNamespace();
   //return RecordChange(extensionPoint, orphans, ExtensionDelta::ADDED);
 }
 
 QSet<QString> ExtensionRegistry::AddExtensionsAndExtensionPoints(const SmartPointer<RegistryContribution>& element)
 {
   // now add and resolve extensions and extension points
   QSet<QString> affectedNamespaces;
   QList<int> extPoints = element->GetExtensionPoints();
   for (int i = 0; i < extPoints.size(); i++)
   {
     QString namespaze = this->AddExtensionPoint(extPoints[i]);
     if (!namespaze.isEmpty())
       affectedNamespaces.insert(namespaze);
   }
   QList<int> extensions = element->GetExtensions();
   for (int i = 0; i < extensions.size(); i++)
   {
     QString namespaze = this->AddExtension(extensions[i]);
     if (!namespaze.isEmpty())
       affectedNamespaces.insert(namespaze);
   }
   return affectedNamespaces;
 }
 
 void ExtensionRegistry::AddListenerInternal(IRegistryEventListener* listener, const IExtensionPointFilter& filter)
 {
   listeners.Add(ListenerInfo(listener, filter));
 }
 
 void ExtensionRegistry::BasicAdd(const SmartPointer<RegistryContribution>& element, bool link)
 {
   registryObjects->AddContribution(element);
   if (!link)
     return;
   AddExtensionsAndExtensionPoints(element);
   SetObjectManagers(registryObjects->CreateDelegatingObjectManager(
                       registryObjects->GetAssociatedObjects(element->GetContributorId())));
 }
 
 void ExtensionRegistry::SetObjectManagers(const SmartPointer<IObjectManager>& manager)
 {
   if (!eventDelta.IsNull())
     eventDelta.SetObjectManager(manager);
 }
 
 void ExtensionRegistry::BasicRemove(const QString& contributorId)
 {
   // ignore anonymous namespaces
   RemoveExtensionsAndExtensionPoints(contributorId);
   QHash<int, RegistryObject::Pointer> associatedObjects = registryObjects->GetAssociatedObjects(contributorId);
   registryObjects->RemoveObjects(associatedObjects);
   registryObjects->AddNavigableObjects(associatedObjects); // put the complete set of navigable objects
   SetObjectManagers(registryObjects->CreateDelegatingObjectManager(associatedObjects));
 
   registryObjects->RemoveContribution(contributorId);
   registryObjects->RemoveContributor(contributorId);
 }
 
 void ExtensionRegistry::FireRegistryChangeEvent()
 {
   // if there is nothing to say, just bail out
   if (listeners.IsEmpty())
   {
     return;
   }
   // for thread safety, create tmp collections
   QList<ListenerInfo> tmpListeners = listeners.GetListeners();
   // do the notification asynchronously
   //strategy->ScheduleChangeEvent(tmpListeners, tmpDeltas, this);
   this->ScheduleChangeEvent(tmpListeners, eventDelta);
 }
 
 //RegistryDelta ExtensionRegistry::GetDelta(const QString& namespaze) const
 //{
 //  // is there a delta for the plug-in?
 //  RegistryDelta existingDelta = deltas.value(namespaze);
 //  if (existingDelta != null)
 //    return existingDelta;
 
 //  //if not, create one
 //  RegistryDelta delta = new RegistryDelta();
 //  deltas.put(namespace, delta);
 //  return delta;
 //}
 
 void ExtensionRegistry::Link(const SmartPointer<ExtensionPoint>& extPoint, const QList<int>& extensions)
 {
   extPoint->SetRawChildren(extensions);
   registryObjects->Add(extPoint, true);
 }
 
 //QString ExtensionRegistry::RecordChange(const SmartPointer<ExtensionPoint>& extPoint, int extension, int kind)
 //{
 //  // avoid computing deltas when there are no listeners
 //  if (listeners.isEmpty())
 //    return QString();
 //  ExtensionDelta extensionDelta = new ExtensionDelta();
 //  extensionDelta.setExtension(extension);
 //  extensionDelta.setExtensionPoint(extPoint.getObjectId());
 //  extensionDelta.setKind(kind);
 //  getDelta(extPoint.getNamespace()).addExtensionDelta(extensionDelta);
 //  return extPoint.getNamespace();
 //}
 
 //QString ExtensionRegistry::RecordChange(const SmartPointer<ExtensionPoint>& extPoint, const QList<int>& extensions, int kind)
 //{
 //  if (listeners.isEmpty())
 //    return null;
 //    QString namespace = extPoint.getNamespace();
 //  if (extensions == null || extensions.length == 0)
 //    return namespace;
 //  RegistryDelta pluginDelta = getDelta(extPoint.getNamespace());
 //  for (int i = 0; i < extensions.length; i++) {
 //    ExtensionDelta extensionDelta = new ExtensionDelta();
 //    extensionDelta.setExtension(extensions[i]);
 //    extensionDelta.setExtensionPoint(extPoint.getObjectId());
 //    extensionDelta.setKind(kind);
 //    pluginDelta.addExtensionDelta(extensionDelta);
 //  }
 //  return namespace;
 //}
 
 QString ExtensionRegistry::RemoveExtension(int extensionId)
 {
   Extension::Pointer extension = registryObjects->GetObject(extensionId, RegistryObjectManager::EXTENSION).Cast<Extension>();
   registryObjects->RemoveExtensionFromNamespaceIndex(extensionId, extension->GetNamespaceIdentifier());
   QString xptName = extension->GetExtensionPointIdentifier();
   ExtensionPoint::Pointer extPoint = registryObjects->GetExtensionPointObject(xptName);
   if (extPoint.IsNull())
   {
     registryObjects->RemoveOrphan(xptName, extensionId);
     return QString();
   }
   // otherwise, unlink the extension from the extension point
   QList<int> existingExtensions = extPoint->GetRawChildren();
   QList<int> newExtensions;
   if (existingExtensions.size() > 1)
   {
     for (int i = 0; i < existingExtensions.size(); ++i)
       if (existingExtensions[i] != extension->GetObjectId())
         newExtensions.push_back(existingExtensions[i]);
   }
   Link(extPoint, newExtensions);
   if (!eventDelta.IsNull())
     eventDelta.RememberExtension(extPoint, extensionId);
   return extPoint->GetNamespace();
   //return recordChange(extPoint, extension.getObjectId(), IExtensionDelta.REMOVED);
 }
 
 QString ExtensionRegistry::RemoveExtensionPoint(int extPoint)
 {
   ExtensionPoint::Pointer extensionPoint = registryObjects->GetObject(
         extPoint, RegistryObjectManager::EXTENSION_POINT).Cast<ExtensionPoint>();
   registryObjects->RemoveExtensionPointFromNamespaceIndex(extPoint, extensionPoint->GetNamespace());
   QList<int> existingExtensions = extensionPoint->GetRawChildren();
   if (!existingExtensions.empty())
   {
     registryObjects->AddOrphans(extensionPoint->GetUniqueIdentifier(), existingExtensions);
     Link(extensionPoint, QList<int>());
   }
   if (!eventDelta.IsNull())
   {
     eventDelta.RememberExtensionPoint(extensionPoint);
     eventDelta.RememberExtensions(extensionPoint, existingExtensions);
   }
   return extensionPoint->GetNamespace();
   //return recordChange(extensionPoint, existingExtensions, IExtensionDelta.REMOVED);
 }
 
 QSet<QString> ExtensionRegistry::RemoveExtensionsAndExtensionPoints(const QString& contributorId)
 {
   QSet<QString> affectedNamespaces;
   QList<int> extensions = registryObjects->GetExtensionsFrom(contributorId);
   for (int i = 0; i < extensions.size(); i++)
   {
     QString namespaze = this->RemoveExtension(extensions[i]);
     if (!namespaze.isEmpty())
       affectedNamespaces.insert(namespaze);
   }
 
   // remove extension points
   QList<int> extPoints = registryObjects->GetExtensionPointsFrom(contributorId);
   for (int i = 0; i < extPoints.size(); i++)
   {
     QString namespaze = this->RemoveExtensionPoint(extPoints[i]);
     if (!namespaze.isEmpty())
       affectedNamespaces.insert(namespaze);
   }
   return affectedNamespaces;
 }
 
 struct ExtensionRegistry::QueueElement
 {
   QList<ListenerInfo> listenerInfos;
   CombinedEventDelta scheduledDelta;
 
   QueueElement()
   {
   }
 
   QueueElement(const QList<ListenerInfo>& infos, const CombinedEventDelta& delta)
     : listenerInfos(infos), scheduledDelta(delta)
   {
   }
 };
 
 class ExtensionRegistry::RegistryEventThread : public QThread
 {
 
 private:
 
   QAtomicInt stop;
   ExtensionRegistry* registry;
   Queue& queue;
 
 public:
 
   RegistryEventThread(ExtensionRegistry* registry, Queue& queue)
     : stop(0), registry(registry), queue(queue)
   {
     this->setObjectName("Extension Registry Event Dispatcher");
   }
 
   void interrupt()
   {
     stop.fetchAndStoreOrdered(1);
   }
 
   void run() override
   {
     while (!stop.fetchAndAddOrdered(0))
     {
       QueueElement element;
       {
         Queue::Locker l(&queue);
         while (queue.empty())
           queue.wait();
         element = queue.takeFirst();
       }
       registry->ProcessChangeEvent(element.listenerInfos, element.scheduledDelta);
     }
   }
 };
 
 bool ExtensionRegistry::CheckReadWriteAccess(QObject* key, bool persist) const
   {
   if (masterToken == key)
     return true;
   if (userToken == key && !persist)
     return true;
   return false;
 }
 
 void ExtensionRegistry::LogError(const QString& owner, const QString& contributionName, const ctkException& e)
 {
   QString message = QString("Could not parse XML contribution for \"%1\". Any contributed extensions "
                             "and extension points will be ignored.").arg(QString(owner) + "/" + contributionName);
   IStatus::Pointer status(new Status(IStatus::ERROR_TYPE, RegistryMessages::OWNER_NAME, 0, message, e, BERRY_STATUS_LOC));
   Log(status);
 }
 
 void ExtensionRegistry::CreateExtensionData(const QString& contributorId,
                                             const ConfigurationElementDescription& description,
                                             const SmartPointer<RegistryObject>& parent, bool persist)
 {
   ConfigurationElement::Pointer currentConfigurationElement = GetElementFactory()->CreateConfigurationElement(persist);
   currentConfigurationElement->SetContributorId(contributorId);
   currentConfigurationElement->SetName(description.GetName());
 
   QList<ConfigurationElementAttribute> descriptionProperties = description.GetAttributes();
 
   QList<QString> properties;
   if (!descriptionProperties.empty())
   {
     for (int i = 0; i < descriptionProperties.size(); i++)
     {
       properties.push_back(descriptionProperties[i].GetName());
       properties.push_back(Translate(descriptionProperties[i].GetValue(), nullptr));
     }
   }
   currentConfigurationElement->SetProperties(properties);
 
   QString value = description.GetValue();
   if (!value.isEmpty())
     currentConfigurationElement->SetValue(value);
 
   GetObjectManager()->Add(currentConfigurationElement, true);
 
   // process children
   QList<ConfigurationElementDescription> children = description.GetChildren();
   if (!children.empty())
   {
     for (int i = 0; i < children.size(); i++)
     {
       CreateExtensionData(contributorId, children[i], currentConfigurationElement, persist);
     }
   }
 
   QList<int> newValues = parent->GetRawChildren();
   newValues.push_back(currentConfigurationElement->GetObjectId());
   parent->SetRawChildren(newValues);
   currentConfigurationElement->SetParentId(parent->GetObjectId());
   currentConfigurationElement->SetParentType(parent.Cast<ConfigurationElement>() ?
                                                RegistryObjectManager::CONFIGURATION_ELEMENT :
                                                RegistryObjectManager::EXTENSION);
 }
 
 bool ExtensionRegistry::RemoveObject(const SmartPointer<RegistryObject>& registryObject,
                   bool isExtensionPoint, QObject* token)
 {
   if (!CheckReadWriteAccess(token, registryObject->ShouldPersist()))
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry.removeExtension() method. Check if proper access token is supplied.");
   int id = registryObject->GetObjectId();
 
   QWriteLocker l(&access);
   eventDelta = CombinedEventDelta::RecordRemoval();
   if (isExtensionPoint)
   {
     RemoveExtensionPoint(id);
   }
   else
   {
     RemoveExtension(id);
   }
   QHash<int, RegistryObject::Pointer> removed;
   removed.insert(id, registryObject);
   // There is some asymmetry between extension and extension point removal. Removing extension point makes
   // extensions "orphans" but does not remove them. As a result, only extensions needs to be processed.
   if (!isExtensionPoint)
   {
     registryObjects->AddAssociatedObjects(removed, registryObject);
   }
   registryObjects->RemoveObjects(removed);
   registryObjects->AddNavigableObjects(removed);
   IObjectManager::Pointer manager = registryObjects->CreateDelegatingObjectManager(removed);
   //GetDelta(namespaze)->SetObjectManager(manager);
   //eventDelta->SetObjectManager(manager);
 
   registryObjects->UnlinkChildFromContributions(id);
   FireRegistryChangeEvent();
   eventDelta.Reset();
   return true;
 }
 
 void ExtensionRegistry::SetFileManager(const QString& /*cacheBase*/, bool /*isCacheReadOnly*/)
 {
 //  if (cacheStorageManager != nullptr)
 //    cacheStorageManager->Close(); // close existing file manager first
 
 //  if (cacheBase != null) {
 //    cacheStorageManager = new StorageManager(cacheBase, isCacheReadOnly ? "none" : null, isCacheReadOnly); //$NON-NLS-1$
 //    try {
 //      cacheStorageManager.open(!isCacheReadOnly);
 //    } catch (IOException e) {
 //      // Ignore the exception. The registry will be rebuilt from source.
 //    }
 //  }
 }
 
 void ExtensionRegistry::EnterRead()
 {
   access.lockForRead();
 }
 
 void ExtensionRegistry::ExitRead()
 {
   access.unlock();
 }
 
 void ExtensionRegistry::SetElementFactory()
 {
   if (isMultiLanguage)
   {
     throw ctkRuntimeException("Multi-language registry not supported yet.");
     //theRegistryObjectFactory = new RegistryObjectFactoryMulti(this);
   }
   else
   {
     theRegistryObjectFactory.reset(new RegistryObjectFactory(this));
   }
 }
 
 //TableReader ExtensionRegistry::getTableReader() const
 //{
 //  return theTableReader;
 //}
 
 bool ExtensionRegistry::CheckCache()
 {
 //  for (int index = 0; index < strategy.getLocationsLength(); index++) {
 //    File possibleCacheLocation = strategy.getStorage(index);
 //    if (possibleCacheLocation == null)
 //      break; // bail out on the first null
 //    setFileManager(possibleCacheLocation, strategy.isCacheReadOnly(index));
 //    if (cacheStorageManager != null) {
 //      // check this new location:
 //      File cacheFile = null;
 //      try {
 //        cacheFile = cacheStorageManager.lookup(TableReader.getTestFileName(), false);
 //      } catch (IOException e) {
 //        //Ignore the exception. The registry will be rebuilt from the xml files.
 //      }
 //      if (cacheFile != null && cacheFile.isFile())
 //        return true; // found the appropriate location
 //    }
 //  }
   return false;
 }
 
 void ExtensionRegistry::StopChangeEventScheduler()
 {
   if (!eventThread.isNull())
   {
     Queue::Locker l(&queue);
     eventThread->interrupt();
     eventThread->wait();
     eventThread.reset();
   }
 }
 
 SmartPointer<RegistryObjectManager> ExtensionRegistry::GetObjectManager() const
 {
   return registryObjects;
 }
 
 void ExtensionRegistry::AddListener(IRegistryEventListener* listener, const QString& extensionPointId)
 {
   AddListenerInternal(listener, extensionPointId.isEmpty() ? IExtensionPointFilter(nullptr)
                                                            : IExtensionPointFilter(new SimpleExtensionPointFilter(extensionPointId)));
 }
 
 void ExtensionRegistry::AddListener(IRegistryEventListener* listener, const IExtensionPointFilter& filter)
 {
   this->AddListenerInternal(listener, filter);
 }
 
 QList<SmartPointer<IConfigurationElement> > ExtensionRegistry::GetConfigurationElementsFor(const QString& extensionPointId) const
 {
   // this is just a convenience API - no need to do any sync'ing here
   int lastdot = extensionPointId.lastIndexOf('.');
   if (lastdot == -1)
   {
     QList<IConfigurationElement::Pointer>();
   }
   return GetConfigurationElementsFor(extensionPointId.left(lastdot), extensionPointId.mid(lastdot + 1));
 }
 
 QList<SmartPointer<IConfigurationElement> > ExtensionRegistry::GetConfigurationElementsFor(const QString& pluginId,
                                                                         const QString& extensionPointSimpleId) const
 {
   // this is just a convenience API - no need to do any sync'ing here
   IExtensionPoint::Pointer extPoint = this->GetExtensionPoint(pluginId, extensionPointSimpleId);
   if (extPoint.IsNull())
     return QList<IConfigurationElement::Pointer>();
   return extPoint->GetConfigurationElements();
 }
 
 QList<SmartPointer<IConfigurationElement> > ExtensionRegistry::GetConfigurationElementsFor(const QString& pluginId,
                                                                         const QString& extensionPointName,
                                                                         const QString& extensionId) const
 {
   // this is just a convenience API - no need to do any sync'ing here
   IExtension::Pointer extension = this->GetExtension(pluginId, extensionPointName, extensionId);
   if (extension.IsNull())
     return QList<IConfigurationElement::Pointer>();
   return extension->GetConfigurationElements();
 }
 
 SmartPointer<IExtension> ExtensionRegistry::GetExtension(const QString& extensionId) const
 {
   if (extensionId.isEmpty())
     return IExtension::Pointer();
   int lastdot = extensionId.lastIndexOf('.');
   if (lastdot == -1)
     return IExtension::Pointer();
   QString namespaze = extensionId.left(lastdot);
 
   QList<ExtensionHandle::Pointer> extensions;
   {
     QReadLocker l(&access);
     extensions = registryObjects->GetExtensionsFromNamespace(namespaze);
   }
 
   for (int i = 0; i < extensions.size(); i++)
   {
     ExtensionHandle::Pointer suspect = extensions[i];
     if (extensionId == suspect->GetUniqueIdentifier())
       return suspect;
   }
   return IExtension::Pointer();
 }
 
 SmartPointer<IExtension> ExtensionRegistry::GetExtension(const QString& extensionPointId, const QString& extensionId) const
 {
   // this is just a convenience API - no need to do any sync'ing here
   int lastdot = extensionPointId.lastIndexOf('.');
   if (lastdot == -1)
     return IExtension::Pointer();
   return GetExtension(extensionPointId.left(lastdot), extensionPointId.mid(lastdot + 1), extensionId);
 }
 
 SmartPointer<IExtension> ExtensionRegistry::GetExtension(const QString& pluginId,
                                       const QString& extensionPointName,
                                       const QString& extensionId) const
 {
   // this is just a convenience API - no need to do any sync'ing here
   IExtensionPoint::Pointer extPoint = GetExtensionPoint(pluginId, extensionPointName);
   if (extPoint.IsNotNull())
     return extPoint->GetExtension(extensionId);
   return IExtension::Pointer();
 }
 
 SmartPointer<IExtensionPoint> ExtensionRegistry::GetExtensionPoint(const QString& xptUniqueId) const
 {
   QReadLocker l(&access);
   return registryObjects->GetExtensionPointHandle(xptUniqueId);
 }
 
 SmartPointer<IExtensionPoint> ExtensionRegistry::GetExtensionPoint(const QString& elementName, const QString& xpt) const
 {
   QReadLocker l(&access);
   return registryObjects->GetExtensionPointHandle(elementName + '.' + xpt);
 }
 
 QList<SmartPointer<IExtensionPoint> > ExtensionRegistry::GetExtensionPoints() const
 {
   QList<ExtensionPointHandle::Pointer> handles;
   {
     QReadLocker l(&access);
     handles = registryObjects->GetExtensionPointsHandles();
   }
   QList<IExtensionPoint::Pointer> result;
   foreach(ExtensionPointHandle::Pointer handle, handles)
   {
     result.push_back(handle);
   }
   return result;
 }
 
 QList<SmartPointer<IExtensionPoint> > ExtensionRegistry::GetExtensionPoints(const QString& namespaceName) const
 {
   QList<ExtensionPointHandle::Pointer> handles;
   {
     QReadLocker l(&access);
     handles = registryObjects->GetExtensionPointsFromNamespace(namespaceName);
   }
   QList<IExtensionPoint::Pointer> result;
   foreach(ExtensionPointHandle::Pointer handle, handles)
   {
     result.push_back(handle);
   }
   return result;
 }
 
 QList<SmartPointer<IExtension> > ExtensionRegistry::GetExtensions(const QString& namespaceName) const
 {
   QList<ExtensionHandle::Pointer> handles;
   {
     QReadLocker l(&access);
     handles = registryObjects->GetExtensionsFromNamespace(namespaceName);
   }
   QList<IExtension::Pointer> result;
   foreach (ExtensionHandle::Pointer handle, handles)
   {
     result.push_back(handle);
   }
   return result;
 }
 
 QList<SmartPointer<IExtension> > ExtensionRegistry::GetExtensions(const SmartPointer<IContributor>& contributor) const
 {
   RegistryContributor::Pointer regContributor = contributor.Cast<RegistryContributor>();
   if (regContributor.IsNull())
     throw ctkInvalidArgumentException("Contributor must be a RegistryContributor."); // should never happen
 
   QString contributorId = regContributor->GetActualId();
 
   QList<ExtensionHandle::Pointer> handles;
   {
     QReadLocker l(&access);
     handles = registryObjects->GetExtensionsFromContributor(contributorId);
   }
   QList<IExtension::Pointer> result;
   foreach (ExtensionHandle::Pointer handle, handles)
   {
     result.push_back(handle);
   }
   return result;
 }
 
 QList<SmartPointer<IExtensionPoint> > ExtensionRegistry::GetExtensionPoints(const SmartPointer<IContributor>& contributor) const
 {
   RegistryContributor::Pointer regContributor = contributor.Cast<RegistryContributor>();
   if (regContributor.IsNull())
     throw ctkInvalidArgumentException("Contributor must be a RegistryContributor."); // should never happen
 
   QString contributorId = regContributor->GetActualId();
 
   QList<ExtensionPointHandle::Pointer> handles;
   {
     QReadLocker l(&access);
     handles = registryObjects->GetExtensionPointsFromContributor(contributorId);
   }
   QList<IExtensionPoint::Pointer> result;
   foreach (ExtensionPointHandle::Pointer handle, handles)
   {
     result.push_back(handle);
   }
   return result;
 }
 
 QList<QString> ExtensionRegistry::GetNamespaces() const
 {
   QReadLocker l(&access);
   QList<KeyedElement::Pointer> namespaceElements = registryObjects->GetNamespacesIndex().Elements();
   QList<QString> namespaceNames;
   for (int i = 0; i < namespaceElements.size(); i++)
   {
     namespaceNames.push_back(namespaceElements[i]->GetKey());
   }
   return namespaceNames;
 }
 
 bool ExtensionRegistry::HasContributor(const SmartPointer<IContributor>& contributor) const
 {
   RegistryContributor::Pointer regContributor = contributor.Cast<RegistryContributor>();
   if (regContributor.IsNull())
     throw ctkInvalidArgumentException("Contributor must be a RegistryContributor."); // should never happen
 
   QString contributorId = regContributor->GetActualId();
   return HasContributor(contributorId);
 }
 
 bool ExtensionRegistry::HasContributor(const QString& contributorId) const
 {
   QReadLocker l(&access);
   return registryObjects->HasContribution(contributorId);
 }
 
 void ExtensionRegistry::Remove(const QString& removedContributorId, long timestamp)
 {
   Remove(removedContributorId);
   if (timestamp != 0)
     aggregatedTimestamp.Remove(timestamp);
 }
 
 void ExtensionRegistry::RemoveContributor(const SmartPointer<IContributor>& contributor, QObject* key)
 {
   RegistryContributor::Pointer regContributor = contributor.Cast<RegistryContributor>();
   if (regContributor.IsNull())
     throw ctkInvalidArgumentException("Contributor must be a RegistryContributor."); // should never happen
 
   if (!CheckReadWriteAccess(key, true))
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry.removeContributor() method. Check if proper access token is supplied.");
   QString contributorId = regContributor->GetActualId();
   Remove(contributorId);
 }
 
 void ExtensionRegistry::Remove(const QString& removedContributorId)
 {
   QWriteLocker l(&access);
   eventDelta = CombinedEventDelta::RecordRemoval();
   BasicRemove(removedContributorId);
   FireRegistryChangeEvent();
   eventDelta.Reset();
 }
 
 void ExtensionRegistry::RemoveListener(IRegistryEventListener* listener)
 {
   listeners.Remove(ListenerInfo(listener, IExtensionPointFilter(nullptr)));
 }
 
 ExtensionRegistry::ExtensionRegistry(RegistryStrategy* registryStrategy, QObject* masterToken, QObject* userToken)
   : registryObjects(nullptr), isMultiLanguage(false), mlErrorLogged(false), eventThread(nullptr)
 {
   isMultiLanguage = RegistryProperties::GetProperty(RegistryConstants::PROP_REGISTRY_MULTI_LANGUAGE) == "true";
 
   if (registryStrategy != nullptr)
     strategy.reset(registryStrategy);
   else
     strategy.reset(new RegistryStrategy(QList<QString>(), QList<bool>(), nullptr));
 
   this->masterToken = masterToken;
   this->userToken = userToken;
   registryObjects = new RegistryObjectManager(this);
 
   bool isRegistryFilledFromCache = false; // indicates if registry was able to use cache to populate it's content
 
   if (strategy->CacheUse())
   {
     // Try to read the registry from the cache first. If that fails, create a new registry
     QTime timer;
     if (Debug())
       timer.start();
 
     //The cache is made of several files, find the real names of these other files. If all files are found, try to initialize the objectManager
     if (CheckCache())
     {
       // TODO Registry Cache
 //      try {
 //        theTableReader.setTableFile(cacheStorageManager.lookup(TableReader.TABLE, false));
 //        theTableReader.setExtraDataFile(cacheStorageManager.lookup(TableReader.EXTRA, false));
 //        theTableReader.setMainDataFile(cacheStorageManager.lookup(TableReader.MAIN, false));
 //        theTableReader.setContributionsFile(cacheStorageManager.lookup(TableReader.CONTRIBUTIONS, false));
 //        theTableReader.setContributorsFile(cacheStorageManager.lookup(TableReader.CONTRIBUTORS, false));
 //        theTableReader.setNamespacesFile(cacheStorageManager.lookup(TableReader.NAMESPACES, false));
 //        theTableReader.setOrphansFile(cacheStorageManager.lookup(TableReader.ORPHANS, false));
 //        long timestamp = strategy.getContributionsTimestamp();
 //        isRegistryFilledFromCache = registryObjects.init(timestamp);
 //        if (isRegistryFilledFromCache)
 //          aggregatedTimestamp.set(timestamp);
 //      } catch (IOException e) {
 //        // The registry will be rebuilt from the xml files. Make sure to clear anything filled
 //        // from cache so that we won't have partially filled items.
 //        isRegistryFilledFromCache = false;
 //        clearRegistryCache();
 //        log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.registry_bad_cache, e));
 //      }
     }
 
 //    if (!isRegistryFilledFromCache)
 //    {
 //      // set cache storage manager to a first writable location
 //      for (int index = 0; index < strategy.getLocationsLength(); index++) {
 //        if (!strategy.isCacheReadOnly(index)) {
 //          setFileManager(strategy.getStorage(index), false);
 //          break;
 //        }
 //      }
 //    }
 
     if (Debug() && isRegistryFilledFromCache)
       BERRY_INFO << "Reading registry cache: " << timer.elapsed() << "ms";
 
     if (Debug())
     {
       if (!isRegistryFilledFromCache)
         BERRY_INFO << "Reloading registry from manifest files...";
       else
         BERRY_INFO << "Using registry cache...";
     }
   }
 
   if (DebugEvents())
   {
     struct DebugRegistryListener : public IRegistryEventListener
     {
       void Added(const QList<IExtension::Pointer>& extensions) override
       {
         BERRY_INFO << "Registry extensions ADDED:";
         foreach(IExtension::Pointer extension, extensions)
         {
           BERRY_INFO << "\t" << extension->GetExtensionPointUniqueIdentifier() << " - "
                      << extension->GetNamespaceIdentifier() << "." << extension->GetSimpleIdentifier();
         }
       }
 
       void Removed(const QList<IExtension::Pointer>& extensions) override
       {
         BERRY_INFO << "Registry extensions REMOVED:";
         foreach(IExtension::Pointer extension, extensions)
         {
           BERRY_INFO << "\t" << extension->GetExtensionPointUniqueIdentifier() << " - "
                      << extension->GetNamespaceIdentifier() << "." << extension->GetSimpleIdentifier();
         }
       }
 
       void Added(const QList<IExtensionPoint::Pointer>& extensionPoints) override
       {
         BERRY_INFO << "Registry extension-points ADDED:";
         foreach(IExtensionPoint::Pointer extensionPoint, extensionPoints)
         {
           BERRY_INFO << "\t" << extensionPoint->GetUniqueIdentifier();
         }
       }
 
       void Removed(const QList<IExtensionPoint::Pointer>& extensionPoints) override
       {
         BERRY_INFO << "Registry extension-points REMOVED:";
         foreach(IExtensionPoint::Pointer extensionPoint, extensionPoints)
         {
           BERRY_INFO << "\t" << extensionPoint->GetUniqueIdentifier();
         }
       }
     };
 
     debugRegistryListener.reset(new DebugRegistryListener());
     AddListener(debugRegistryListener.data());
   }
 
   // Do extra start processing if specified in the registry strategy
   strategy->OnStart(this, isRegistryFilledFromCache);
 }
 
 ExtensionRegistry::~ExtensionRegistry()
 {
 }
 
 void ExtensionRegistry::Stop(QObject* /*key*/)
 {
   // If the registry creator specified a key token, check that the key mathches it
-  // (it is assumed that registry owner keeps the key to prevent unautorized accesss).
+  // (it is assumed that registry owner keeps the key to prevent unautorized access).
   if (masterToken != nullptr && masterToken != nullptr)
   {
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry.stop() method. Check if proper access token is supplied."); //$NON-NLS-1$
   }
 
   // Do extra stop processing if specified in the registry strategy
   strategy->OnStop(this);
 
   StopChangeEventScheduler();
 
 //  if (cacheStorageManager == nullptr)
 //    return;
 
 //  if (!registryObjects.isDirty() || cacheStorageManager.isReadOnly()) {
 //    cacheStorageManager.close();
 //    theTableReader.close();
 //    return;
 //  }
 
 //  File tableFile = null;
 //  File mainFile = null;
 //  File extraFile = null;
 //  File contributionsFile = null;
 //  File contributorsFile = null;
 //  File namespacesFile = null;
 //  File orphansFile = null;
 
 //  TableWriter theTableWriter = new TableWriter(this);
 
 //  try {
 //    cacheStorageManager.lookup(TableReader.TABLE, true);
 //    cacheStorageManager.lookup(TableReader.MAIN, true);
 //    cacheStorageManager.lookup(TableReader.EXTRA, true);
 //    cacheStorageManager.lookup(TableReader.CONTRIBUTIONS, true);
 //    cacheStorageManager.lookup(TableReader.CONTRIBUTORS, true);
 //    cacheStorageManager.lookup(TableReader.NAMESPACES, true);
 //    cacheStorageManager.lookup(TableReader.ORPHANS, true);
 //    tableFile = File.createTempFile(TableReader.TABLE, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    mainFile = File.createTempFile(TableReader.MAIN, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    extraFile = File.createTempFile(TableReader.EXTRA, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    contributionsFile = File.createTempFile(TableReader.CONTRIBUTIONS, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    contributorsFile = File.createTempFile(TableReader.CONTRIBUTORS, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    namespacesFile = File.createTempFile(TableReader.NAMESPACES, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    orphansFile = File.createTempFile(TableReader.ORPHANS, ".new", cacheStorageManager.getBase()); //$NON-NLS-1$
 //    theTableWriter.setTableFile(tableFile);
 //    theTableWriter.setExtraDataFile(extraFile);
 //    theTableWriter.setMainDataFile(mainFile);
 //    theTableWriter.setContributionsFile(contributionsFile);
 //    theTableWriter.setContributorsFile(contributorsFile);
 //    theTableWriter.setNamespacesFile(namespacesFile);
 //    theTableWriter.setOrphansFile(orphansFile);
 //  } catch (IOException e) {
 //    cacheStorageManager.close();
 //    return; //Ignore the exception since we can recompute the cache
 //  }
 //  try {
 //    long timestamp;
 //    // A bit of backward compatibility: if registry was modified, but timestamp was not,
 //    // it means that the new timestamp tracking mechanism was not used. In this case
 //    // explicitly obtain timestamps for all contributions. Note that this logic
 //    // maintains a problem described in the bug 104267 for contributions that
 //    // don't use the timestamp tracking mechanism.
 //    if (aggregatedTimestamp.isModifed())
 //      timestamp = aggregatedTimestamp.getContentsTimestamp(); // use timestamp tracking
 //    else
 //      timestamp = strategy.getContributionsTimestamp(); // use legacy approach
 
 //    if (theTableWriter.saveCache(registryObjects, timestamp))
 //      cacheStorageManager.update(new   QString[] {TableReader.TABLE, TableReader.MAIN, TableReader.EXTRA, TableReader.CONTRIBUTIONS, TableReader.CONTRIBUTORS, TableReader.NAMESPACES, TableReader.ORPHANS}, new   QString[] {tableFile.getName(), mainFile.getName(), extraFile.getName(), contributionsFile.getName(), contributorsFile.getName(), namespacesFile.getName(), orphansFile.getName()});
 //  } catch (IOException e) {
 //    //Ignore the exception since we can recompute the cache
 //  }
 //  theTableReader.close();
 //  cacheStorageManager.close();
 }
 
 void ExtensionRegistry::ClearRegistryCache()
 {
 //  QString[] keys = new   QString[] {TableReader.TABLE, TableReader.MAIN, TableReader.EXTRA, TableReader.CONTRIBUTIONS, TableReader.ORPHANS};
 //  for (int i = 0; i < keys.length; i++)
 //    try {
 //      cacheStorageManager.remove(keys[i]);
 //    } catch (IOException e) {
 //      log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IStatus.ERROR, RegistryMessages.meta_registryCacheReadProblems, e));
 //    }
   aggregatedTimestamp.Reset();
 }
 
 RegistryObjectFactory* ExtensionRegistry::GetElementFactory()
 {
   if (theRegistryObjectFactory.isNull())
     SetElementFactory();
   return theRegistryObjectFactory.data();
 }
 
 void ExtensionRegistry::Log(const SmartPointer<IStatus>& status) const
 {
   strategy->Log(status);
 }
 
 QString ExtensionRegistry::Translate(const QString& key, QTranslator* resources) const
 {
   if (isMultiLanguage)
     return key;
   return strategy->Translate(key, resources);
 }
 
 bool ExtensionRegistry::Debug() const
 {
   return strategy->Debug();
 }
 
 bool ExtensionRegistry::DebugEvents() const
 {
   return strategy->DebugRegistryEvents();
 }
 
 bool ExtensionRegistry::UseLazyCacheLoading() const
 {
   return strategy->CacheLazyLoading();
 }
 
 long ExtensionRegistry::ComputeState() const
 {
   return strategy->GetContainerTimestamp();
 }
 
 QObject* ExtensionRegistry::CreateExecutableExtension(const SmartPointer<RegistryContributor>& defaultContributor,
                                                       const QString& className, const QString& requestedContributorName)
 {
   return strategy->CreateExecutableExtension(defaultContributor, className, requestedContributorName);
 }
 
 void ExtensionRegistry::ProcessChangeEvent(
     const QList<ListenerInfo>& listenerInfos, const CombinedEventDelta& scheduledDelta)
 {
   for (int i = 0; i < listenerInfos.size(); i++)
   {
     const ListenerInfo& listenerInfo = listenerInfos[i];
 
     IRegistryEventListener* extensionListener = listenerInfo.listener;
     QList<IExtension::Pointer> extensions = scheduledDelta.GetExtensions(listenerInfo.filter);
     QList<IExtensionPoint::Pointer> extensionPoints = scheduledDelta.GetExtensionPoints(listenerInfo.filter);
 
     // notification order - on addition: extension points; then extensions
     if (scheduledDelta.IsAddition())
     {
       if (!extensionPoints.empty())
         extensionListener->Added(extensionPoints);
       if (!extensions.empty())
         extensionListener->Added(extensions);
     }
     else
     { // on removal: extensions; then extension points
       if (!extensions.empty())
         extensionListener->Removed(extensions);
       if (!extensionPoints.empty())
         extensionListener->Removed(extensionPoints);
     }
   }
   IObjectManager::Pointer manager = scheduledDelta.GetObjectManager();
   if (manager.IsNotNull())
     manager->Close();
 }
 
 void ExtensionRegistry::ScheduleChangeEvent(const QList<ListenerInfo>& listenerInfos,
                                             const CombinedEventDelta& scheduledDelta)
 {
   QueueElement newElement(listenerInfos, scheduledDelta);
   if (eventThread.isNull())
   {
     eventThread.reset(new RegistryEventThread(this, queue));
     eventThread->start();
   }
 
   {
     Queue::Locker l(&queue);
     queue.push_back(newElement);
     queue.notify();
   }
 }
 
 bool ExtensionRegistry::AddContribution(QIODevice* is, const SmartPointer<IContributor>& contributor,
                                         bool persist, const QString& contributionName,
                                         QTranslator* translationBundle, QObject* key, long timestamp)
 {
   bool result = AddContribution(is, contributor, persist, contributionName, translationBundle, key);
   if (timestamp != 0)
     aggregatedTimestamp.Add(timestamp);
   return result;
 }
 
 bool ExtensionRegistry::AddContribution(QIODevice* is, const SmartPointer<IContributor>& contributor, bool persist,
                      const QString& contributionName, QTranslator* translationBundle, QObject* key)
 {
   if (!CheckReadWriteAccess(key, persist))
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry::AddContribution() method. Check if proper access token is supplied.");
 
   RegistryContributor::Pointer internalContributor = contributor.Cast<RegistryContributor>();
   registryObjects->AddContributor(internalContributor); // only adds a contributor if it is not already present
 
   QString ownerName = internalContributor->GetActualName();
   QString message = QString("Problems parsing plug-in manifest for: \"%1\".").arg(ownerName);
   MultiStatus::Pointer problems(new MultiStatus(RegistryMessages::OWNER_NAME,
                                                 ExtensionsParser::PARSE_PROBLEM, message, BERRY_STATUS_LOC));
   ExtensionsParser parser(problems, this);
   RegistryContribution::Pointer contribution =
       GetElementFactory()->CreateContribution(internalContributor->GetActualId(), persist);
 
   try
   {
     QXmlInputSource xmlInput(is);
     bool success = parser.parseManifest(strategy->GetXMLParser(), &xmlInput, contributionName,
                                         GetObjectManager().GetPointer(), contribution, translationBundle);
     int status = problems->GetSeverity();
     if (status != IStatus::OK_TYPE || !success)
     {
       Log(problems);
       if (status == IStatus::ERROR_TYPE || status == IStatus::CANCEL_TYPE || !success)
         return false;
     }
   }
   catch (const ctkException& e)
   {
     LogError(ownerName, contributionName, e);
     return false;
   }
 
   Add(contribution); // the add() method does synchronization
   return true;
 }
 
 bool ExtensionRegistry::AddExtensionPoint(const QString& identifier, const SmartPointer<IContributor>& contributor,
                        bool persist, const QString& label, const QString& schemaReference, QObject* token)
 {
   if (!CheckReadWriteAccess(token, persist))
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry::AddExtensionPoint() method. Check if proper access token is supplied.");
 
   RegistryContributor::Pointer internalContributor = contributor.Cast<RegistryContributor>();
   registryObjects->AddContributor(internalContributor); // only adds a contributor if it is not already present
   QString contributorId = internalContributor->GetActualId();
 
   // Extension point Id might not be null
   if (identifier.isEmpty())
   {
     QString message = QString("Missing ID for the extension point \"%1\". Element ignored.").arg(label);
     IStatus::Pointer status(new Status(IStatus::ERROR_TYPE, RegistryMessages::OWNER_NAME, 0, message, BERRY_STATUS_LOC));
     Log(status);
   }
 
   // addition wraps in a contribution
   RegistryContribution::Pointer contribution = GetElementFactory()->CreateContribution(contributorId, persist);
   ExtensionPoint::Pointer currentExtPoint = GetElementFactory()->CreateExtensionPoint(persist);
 
   QString uniqueId;
   QString namespaceName;
   int simpleIdStart = identifier.lastIndexOf('.');
   if (simpleIdStart == -1)
   {
     namespaceName = contribution->GetDefaultNamespace();
     uniqueId = namespaceName + '.' + identifier;
   }
   else
   {
     namespaceName = identifier.left(simpleIdStart);
     uniqueId = identifier;
   }
   currentExtPoint->SetUniqueIdentifier(uniqueId);
   currentExtPoint->SetNamespace(namespaceName);
   QString labelNLS = Translate(label, nullptr);
   currentExtPoint->SetLabel(labelNLS);
   currentExtPoint->SetSchema(schemaReference);
 
   if (!GetObjectManager()->AddExtensionPoint(currentExtPoint, true))
   {
     if (Debug())
     {
       QString msg = QString("Ignored duplicate extension point \"%1\" supplied by \"%2\".").arg(uniqueId).arg(contribution->GetDefaultNamespace());
       IStatus::Pointer status(new Status(IStatus::ERROR_TYPE, RegistryMessages::OWNER_NAME, 0, msg, BERRY_STATUS_LOC));
       Log(status);
     }
     return false;
   }
 
   currentExtPoint->SetContributorId(contributorId);
 
   // array format: {Number of extension points, Number of extensions, Extension Id}
   QList<int> contributionChildren;
   // Put the extension points into this namespace
   contributionChildren.push_back(1);
   contributionChildren.push_back(0);
   contributionChildren.push_back(currentExtPoint->GetObjectId());
 
   contribution->SetRawChildren(contributionChildren);
 
   Add(contribution);
   return true;
 }
 
 bool ExtensionRegistry::AddExtension(const QString& identifier, const SmartPointer<IContributor>& contributor,
                   bool persist, const QString& label, const QString& extensionPointId,
                   const ConfigurationElementDescription& configurationElements, QObject* token)
 {
   if (!CheckReadWriteAccess(token, persist))
     throw ctkInvalidArgumentException("Unauthorized access to the ExtensionRegistry::AddExtensionPoint() method. Check if proper access token is supplied.");
 
   // prepare namespace information
   RegistryContributor::Pointer internalContributor = contributor.Cast<RegistryContributor>();
   registryObjects->AddContributor(internalContributor); // only adds a contributor if it is not already present
   QString contributorId = internalContributor->GetActualId();
 
   // addition wraps in a contribution
   RegistryContribution::Pointer contribution = GetElementFactory()->CreateContribution(contributorId, persist);
   Extension::Pointer currentExtension = GetElementFactory()->CreateExtension(persist);
 
   QString simpleId;
   QString namespaceName;
   int simpleIdStart = identifier.lastIndexOf('.');
   if (simpleIdStart != -1)
   {
     simpleId = identifier.mid(simpleIdStart + 1);
     namespaceName = identifier.left(simpleIdStart);
   }
   else
   {
     simpleId = identifier;
     namespaceName = contribution->GetDefaultNamespace();
   }
   currentExtension->SetSimpleIdentifier(simpleId);
   currentExtension->SetNamespaceIdentifier(namespaceName);
 
   QString extensionLabelNLS = Translate(label, nullptr);
   currentExtension->SetLabel(extensionLabelNLS);
 
     QString targetExtensionPointId;
   if (extensionPointId.indexOf('.') == -1) // No dots -> namespace name added at the start
     targetExtensionPointId = contribution->GetDefaultNamespace() + '.' + extensionPointId;
   else
     targetExtensionPointId = extensionPointId;
   currentExtension->SetExtensionPointIdentifier(targetExtensionPointId);
 
   // if we have an Id specified, check for duplicates. Only issue warning if duplicate found
   // as it might still work fine - depending on the access pattern.
   if (!simpleId.isNull() && Debug())
   {
     QString uniqueId = namespaceName + '.' + simpleId;
     IExtension::Pointer existingExtension = GetExtension(uniqueId);
     if (existingExtension.IsNotNull())
     {
       QString currentSupplier = contribution->GetDefaultNamespace();
       QString existingSupplier = existingExtension->GetContributor()->GetName();
       QString msg = QString("Extensions supplied by \"%1\" and \"%2\" have the same Id: \"%3\".")
           .arg(currentSupplier).arg(existingSupplier).arg(uniqueId);
       IStatus::Pointer status(new Status(IStatus::WARNING_TYPE, RegistryMessages::OWNER_NAME, 0, msg, BERRY_STATUS_LOC));
       Log(status);
       return false;
     }
   }
 
   GetObjectManager()->Add(currentExtension, true);
 
   CreateExtensionData(contributorId, configurationElements, currentExtension, persist);
 
   currentExtension->SetContributorId(contributorId);
 
   QList<int> contributionChildren;
 
   contributionChildren.push_back(0);
   contributionChildren.push_back(1);
   contributionChildren.push_back(currentExtension->GetObjectId());
   contribution->SetRawChildren(contributionChildren);
 
   Add(contribution);
   return true;
 }
 
 bool ExtensionRegistry::RemoveExtension(const SmartPointer<IExtension>& extension, QObject* token)
 {
   ExtensionHandle::Pointer handle = extension.Cast<ExtensionHandle>();
   if (handle.IsNull())
     return false;
   return RemoveObject(handle->GetObject(), false, token);
 }
 
 bool ExtensionRegistry::RemoveExtensionPoint(const SmartPointer<IExtensionPoint>& extensionPoint, QObject* token)
 {
   ExtensionPointHandle::Pointer handle = extensionPoint.Cast<ExtensionPointHandle>();
   if (handle.IsNull())
     return false;
   return RemoveObject(handle->GetObject(), true, token);
 }
 
 QList<SmartPointer<IContributor> > ExtensionRegistry::GetAllContributors() const
 {
   QList<IContributor::Pointer> result;
 
   QReadLocker l(&access);
   foreach(RegistryContributor::Pointer contributor, registryObjects->GetContributors().values())
   {
     result.push_back(contributor);
   }
   return result;
 }
 
 bool ExtensionRegistry::IsMultiLanguage() const
 {
   return isMultiLanguage;
 }
 
 QList<QString> ExtensionRegistry::Translate(const QList<QString>& nonTranslated, const SmartPointer<IContributor>& contributor,
                          const QLocale& locale) const
 {
   return strategy->Translate(nonTranslated, contributor, locale);
 }
 
 QLocale ExtensionRegistry::GetLocale() const
 {
   return strategy->GetLocale();
 }
 
 void ExtensionRegistry::LogMultiLangError() const
 {
   if (mlErrorLogged) // only log this error ones
     return;
 
   IStatus::Pointer status(new Status(IStatus::ERROR_TYPE, RegistryMessages::OWNER_NAME, 0,
                                      QString("The requested multi-language operation is not enabled. See runtime option \"")
                                      + RegistryConstants::PROP_REGISTRY_MULTI_LANGUAGE + "\".", ctkInvalidArgumentException(""), BERRY_STATUS_LOC));
   Log(status);
   mlErrorLogged = true;
 }
 
 }
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryContributor.h
index 2e27c93a20..2ffe88e19b 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);
 
   /**
    * 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.
+   * There should be 1-to-1 mapping between the contributor and the contributor 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/berryRegistryObject.cpp b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.cpp
index 3a5f23ef26..402bf7a6ed 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.cpp
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "berryRegistryObject.h"
 
 #include "berryExtensionRegistry.h"
 #include "berryRegistryObjectManager.h"
 
 namespace berry {
 
 // 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 #30 - persistence flag
 // bit #31 - registry object has no extra data offset
 // the bit#31 is a sign bit; bit#30 is the highest mantissa bit
 const int RegistryObject::EMPTY_MASK = 0x80000000; // only taking bit #31
 const int RegistryObject::PERSIST_MASK = 0x40000000; // only taking bit #30
 const int RegistryObject::OFFSET_MASK = 0x3FFFFFFF; // all bits but #30, #31
 
 RegistryObject::RegistryObject()
   : registry(nullptr), objectId(RegistryObjectManager::UNKNOWN), extraDataOffset(EMPTY_MASK)
 {
   objectKey = QString::number(objectId);
 }
 
 QString RegistryObject::GetKey() const
 {
   return objectKey;
 }
 
 bool RegistryObject::IsEqual(const KeyedElement& other) const
 {
   return objectId == static_cast<const RegistryObject&>(other).objectId;
 }
 
 RegistryObject::RegistryObject(ExtensionRegistry* registry, bool persist)
   : registry(registry), objectId(RegistryObjectManager::UNKNOWN), extraDataOffset(EMPTY_MASK)
 {
   objectKey = QString::number(objectId);
   SetPersist(persist);
 }
 
 void RegistryObject::SetRawChildren(const QList<int>& values)
 {
   children = values;
 }
 
 QList<int> RegistryObject::GetRawChildren() const
 {
   return children;
 }
 
 void RegistryObject::SetObjectId(int value)
 {
   objectId = value;
   objectKey = QString::number(value);
 }
 
 int RegistryObject::GetObjectId() const
 {
   return objectId;
 }
 
 bool RegistryObject::ShouldPersist() const
 {
   return (extraDataOffset & PERSIST_MASK) == PERSIST_MASK;
 }
 
 bool RegistryObject::NoExtraData() const
 {
   return (extraDataOffset & EMPTY_MASK) == EMPTY_MASK;
 }
 
 int RegistryObject::GetExtraDataOffset() const
 {
   if (NoExtraData())
     return -1;
   return extraDataOffset & OFFSET_MASK;
 }
 
 void RegistryObject::SetExtraDataOffset(int offset)
 {
   if (offset == -1)
   {
     extraDataOffset &= ~OFFSET_MASK; // clear all offset bits
     extraDataOffset |= EMPTY_MASK;
     return;
   }
 
   if ((offset & OFFSET_MASK) != offset)
     throw ctkInvalidArgumentException("Registry object: extra data offset is out of range");
 
   extraDataOffset &= ~(OFFSET_MASK | EMPTY_MASK); // clear all offset bits; mark as non-empty
   extraDataOffset |= (offset & OFFSET_MASK); // set all offset bits
 }
 
 QLocale RegistryObject::GetLocale() const
 {
   return registry->GetLocale();
 }
 
 void RegistryObject::SetPersist(bool persist)
 {
   if (persist)
     extraDataOffset |= PERSIST_MASK;
   else
     extraDataOffset &= ~PERSIST_MASK;
 }
 
 }
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObject.h
index 2158df3d03..aecc42ad76 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);
 
   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 #30 - persistence 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 f962c2496f..566231a86a 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);
 
   //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
+  // The current implementation 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.
+  KeyedHashSet newContributions; //represents the contributors added during this session.
+  mutable KeyedHashSet formerContributions; //represents the contributors 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/berryRegistryObjectReferenceMap.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectReferenceMap.h
index 85e6f1ba51..398fe6d6b1 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectReferenceMap.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryObjectReferenceMap.h
@@ -1,140 +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 BERRYREGISTRYOBJECTREFERENCEMAP_H
 #define BERRYREGISTRYOBJECTREFERENCEMAP_H
 
 #include <berrySmartPointer.h>
 
 #include <QHash>
 
 namespace berry {
 
 class RegistryObject;
 
 class RegistryObjectReferenceMap
 {
 public:
 
   enum ReferenceType {
     /**
      *  Constant indicating that hard references should be used.
      */
     HARD = 0,
 
     /**
-     *  Constant indiciating that soft references should be used.
+     *  Constant indicating that soft references should be used.
      */
     SOFT = 1
   };
 
   /**
    *  Constructs a new <Code>ReferenceMap</Code> with the
    *  specified reference type, load factor and initial
    *  capacity.
    *
    *  @param referenceType  the type of reference to use for values;
    *   must be {@link #HARD} or {@link #SOFT}
    *  @param capacity  the initial capacity for the map
    */
   RegistryObjectReferenceMap(ReferenceType referenceType, int capacity);
 
   ~RegistryObjectReferenceMap();
 
   /**
    *  Returns the value associated with the given key, if any.
    *
    *  @return the value associated with the given key, or <Code>null</Code>
    *   if the key maps to no value
    */
   SmartPointer<RegistryObject> Get(int key) const;
 
   /**
    *  Associates the given key with the given value.<P>
    *  The value may be null.
    *
    *  @param key  the key of the mapping
    *  @param value  the value of the mapping
    *  @throws ctkInvalidArgumentException if either the key or value
    *   is null
    */
   void Put(int key, const SmartPointer<RegistryObject>& value);
 
   /**
    *  Removes the key and its associated value from this map.
    *
    *  @param key  the key to remove
    *  @return the value associated with that key, or null if
    *   the key was not in the map
    */
   SmartPointer<RegistryObject> Remove(int key);
 
 private:
 
   /**
    * The common interface for all elements in the map.  Both
    * smart and weak pointer map values conform to this interface.
    */
   struct IEntry;
 
   /**
    * IEntry implementation that acts as a hard reference.
    * The value of a hard reference entry is never garbage
    * collected until it is explicitly removed from the map.
    */
   class SmartRef;
 
   /**
    * IEntry implementation that acts as a weak reference.
    */
   class WeakRef;
 
   typedef QHash<int, IEntry*> ReferenceMapType;
   mutable ReferenceMapType references;
   ReferenceType valueType;
 
   /**
    * Constructs a new table entry for the given data
    *
    * @param key The entry key
    * @param value The entry value
    * @param next The next value in the entry's collision chain
    * @return The new table entry
    */
   IEntry* NewEntry(const SmartPointer<RegistryObject>& value) const;
 
   /**
    *  Purges stale mappings from this map.<P>
    *
    *  Ordinarily, stale mappings are only removed during
    *  a write operation; typically a write operation will
    *  occur often enough that you'll never need to manually
    *  invoke this method.<P>
    *
    *  Note that this method is not synchronized!  Special
    *  care must be taken if, for instance, you want stale
    *  mappings to be removed on a periodic basis by some
    *  background thread.
    */
   void Purge() const;
 
   /**
    * @param key The key to remove
    * @param cleanup true if doing map maintenance; false if it is a real request to remove
    * @return The removed map value
    */
   SmartPointer<RegistryObject> DoRemove(int key, bool cleanup);
 };
 
 }
 
 #endif // BERRYREGISTRYOBJECTREFERENCEMAP_H
diff --git a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryTimestamp.h b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryTimestamp.h
index 91093af976..16be398138 100644
--- a/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryTimestamp.h
+++ b/Plugins/org.blueberry.core.runtime/src/internal/berryRegistryTimestamp.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 BERRYREGISTRYTIMESTAMP_H
 #define BERRYREGISTRYTIMESTAMP_H
 
 namespace berry {
 
 /**
  * Aggregated registry timestamp. Corresponds to the current contents of the registry.
  * <p>
  * This class may be instantiated.
  * </p><p>
- * This class is not indended to be subclassed.
+ * This class is not intended to be subclassed.
  */
 class RegistryTimestamp
 {
 
 private:
 
   /**
    * Current aggregated timestamp
    */
   long aggregateTimestamp;
 
   bool modified;
 
 public:
 
   /**
    * Public constructor.
    */
   RegistryTimestamp();
 
   /**
    * Returns value of the aggregated timestamp.
    * @return value of the aggregated timestamp
    */
   long GetContentsTimestamp() const;
 
   /**
    * Set value of the aggregated timestamp.
    * @param timestamp the aggregated timestamp of the current registry contents
    */
   void Set(long timestamp);
 
   /**
    * Sets aggregated timestamp to the value corresponding to an empty registry.
    */
   void Reset();
 
   /**
    * Determines if the aggregate timestamp was modified using add() or remove()
    * methods.
    * @return true: the timestamp was modified after the last set/reset
    */
   bool IsModifed() const;
 
   /**
    * Add individual contribution timestamp to the aggregated timestamp.
    * @param timestamp the time stamp of the contribution being added to the registry
    */
   void Add(long timestamp);
 
   /**
    * Remove individual contribution timestamp from the aggregated timestamp.
    * @param timestamp the time stamp of the contribution being removed from the registry
    */
   void Remove(long timestamp);
 };
 
 }
 
 #endif // BERRYREGISTRYTIMESTAMP_H
diff --git a/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpIndexView.h b/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpIndexView.h
index e2819f5db0..cb4c05330b 100644
--- a/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpIndexView.h
+++ b/Plugins/org.blueberry.ui.qt.help/src/internal/berryHelpIndexView.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 BERRYHELPINDEXVIEW_H_
 #define BERRYHELPINDEXVIEW_H_
 
 #include <berryQtViewPart.h>
 
 #include <QModelIndex>
 #include <QListView>
 
 class ctkSearchBox;
 class QHelpIndexWidget;
 
 namespace berry {
 
 class HelpIndexWidget : public QListView
 {
   Q_OBJECT
 
 Q_SIGNALS:
 
   /**
    * This signal is emitted when an item is activated and its
    * associated \a link should be shown. To know where the link
-   * belongs to, the \a keyword is given as a second paremeter.
+   * belongs to, the \a keyword is given as a second parameter.
    */
   void linkActivated(const QUrl &link, const QString &keyword);
 
   /**
    * This signal is emitted when the item representing the \a keyword
    * is activated and the item has more than one link associated.
    * The \a links consist of the document title and their URL.
    */
   void linksActivated(const QMap<QString, QUrl> &links,
                       const QString &keyword);
 
 public:
 
   HelpIndexWidget();
 
 public Q_SLOTS:
 
   /**
    * Filters the indices according to \a filter or \a wildcard.
    * The item with the best match is set as current item.
    */
   void filterIndices(const QString &filter,
                      const QString &wildcard = QString());
 
   /**
    * Activates the current item which will result eventually in
    * the emitting of a linkActivated() or linksActivated()
    * signal.
    */
   void activateCurrentItem();
 
 private Q_SLOTS:
   void showLink(const QModelIndex &index);
 };
 
 class HelpIndexView : public QtViewPart
 {
   Q_OBJECT
 
 public:
 
   HelpIndexView();
   ~HelpIndexView() override;
 
   void SetFocus() override;
 
 protected:
 
   void CreateQtPartControl(QWidget* parent) override;
 
   void setSearchLineEditText(const QString &text);
   QString searchLineEditText() const;
 
 protected Q_SLOTS:
 
   void linkActivated(const QUrl& link);
   void linksActivated(const QMap<QString, QUrl> &links, const QString &keyword);
 
 private Q_SLOTS:
 
   void filterIndices(const QString &filter);
   void enableSearchLineEdit();
   void disableSearchLineEdit();
 
   void setIndexWidgetBusy();
   void unsetIndexWidgetBusy();
 
 private:
 
   bool eventFilter(QObject *obj, QEvent *e) override;
   void focusInEvent(QFocusEvent *e);
   void open(HelpIndexWidget *indexWidget, const QModelIndex &index);
 
   Q_DISABLE_COPY(HelpIndexView)
 
   ctkSearchBox* m_SearchLineEdit;
   HelpIndexWidget* m_IndexWidget;
 
 };
 
 } // namespace berry
 
 #endif /*BERRYHELPINDEXVIEW_H_*/
diff --git a/Plugins/org.blueberry.ui.qt.log/documentation/UserManual/blueberrylogview.dox b/Plugins/org.blueberry.ui.qt.log/documentation/UserManual/blueberrylogview.dox
index f4a0815bae..1dee9db8bc 100644
--- a/Plugins/org.blueberry.ui.qt.log/documentation/UserManual/blueberrylogview.dox
+++ b/Plugins/org.blueberry.ui.qt.log/documentation/UserManual/blueberrylogview.dox
@@ -1,16 +1,16 @@
 /**
 \page org_blueberry_views_logview The Logging Plugin
 
 \imageMacro{logview-dox.svg,"Icon of the Logging Plugin",2.00}
 
 This plug-in records all logging output of events and progress as specified in the source code with time of occurrence, level of importance (Info, Warning, Error, Fatal, Debug), the message given and the origin of the message (source code section).
 
 \imageMacro{LogView.png,"Screenshot of the Logging Plugin",16.00}
 
 There are different features available in the view. The 'Filter' text field provides the possibility to search for all log events containing a certain substring. The 'Copy to clipboard' button allows you to copy the current content of the logging view to your clipboard. This enables you to insert the logging information to any text processing application.
 
 In the simple logging view, you'll see logging messages and logging levels. A brief description of the logging levels can be found in the \ref LoggingPage "logging concept documentation". With two checkboxes more information on every logging message can be activated. The checkbox 'categories' adds a column for the category. The checkbox 'advanced fields' additionally displays the time from application start to the log message entry and the function, filename and line number of the logging message origin.
 
-\imageMacro{LogViewExplain.png,"Details on the Vizualized Logging Information",16.00}
+\imageMacro{LogViewExplain.png,"Details on the Visualized Logging Information",16.00}
 
 */
diff --git a/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.cpp b/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.cpp
index 6dd5f99784..3e506e8aea 100644
--- a/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.cpp
+++ b/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.cpp
@@ -1,332 +1,332 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryQtPlatformLogModel.h"
 #include "berryQtLogPlugin.h"
 
 #include <mitkLogLevel.h>
 
 #include <sstream>
 #include <string>
 #include <iostream>
 #include <iomanip>
 
 #include <QTimer>
 #include <QIcon>
 #include <QModelIndex>
 #include <QDebug>
 
 namespace berry {
 
 const QString QtPlatformLogModel::Error = QString("Error");
 const QString QtPlatformLogModel::Warn = QString("Warning");
 const QString QtPlatformLogModel::Fatal = QString("Fatal");
 const QString QtPlatformLogModel::Info = QString("Info");
 const QString QtPlatformLogModel::Debug = QString("Debug");
 
 void QtPlatformLogModel::slotFlushLogEntries()
 {
   m_Mutex.lock();
   QList<ExtendedLogMessage> *tmp=m_Active;
   m_Active=m_Pending; m_Pending=tmp;
   m_Mutex.unlock();
 
   int num = static_cast<int>(m_Pending->size());
 
   if (num > 0)
   {
     int row = static_cast<int>(m_Entries.size());
     this->beginInsertRows(QModelIndex(), row, row+num-1);
     do {
       m_Entries.push_back(m_Pending->front());
       m_Pending->pop_front();
 
 
 
     } while(--num);
     this->endInsertRows();
   }
 }
 
 void QtPlatformLogModel::addLogEntry(const mitk::LogMessage &msg)
 {
   m_Mutex.lock();
   //mitk::LogBackendCout::FormatSmart(msg); FormatSmart is not static any more. So commented out this statement. Todo: fix
   m_Active->push_back(ExtendedLogMessage(msg));
   m_Mutex.unlock();
 
   emit signalFlushLogEntries();
 }
 
 void
 QtPlatformLogModel::SetShowAdvancedFiels( bool showAdvancedFiels )
 {
   if( m_ShowAdvancedFiels != showAdvancedFiels )
   {
     m_ShowAdvancedFiels = showAdvancedFiels;
     this->beginResetModel();
     this->endResetModel();
   }
 }
 
 void QtPlatformLogModel::SetShowCategory( bool showCategory )
 {
   if( m_ShowCategory != showCategory )
   {
     m_ShowCategory = showCategory;
     this->beginResetModel();
     this->endResetModel();
   }
 }
 
 void
 QtPlatformLogModel::addLogEntry(const ctkPluginFrameworkEvent& event)
 {
   auto level = mitk::LogLevel::Info;
   if (event.getType() == ctkPluginFrameworkEvent::PLUGIN_ERROR)
   {
     level = mitk::LogLevel::Error;
   }
   else if (event.getType() == ctkPluginFrameworkEvent::FRAMEWORK_WAIT_TIMEDOUT ||
            event.getType() == ctkPluginFrameworkEvent::PLUGIN_WARNING)
   {
     level = mitk::LogLevel::Warn;
   }
 
   mitk::LogMessage msg(level,"n/a",-1,"n/a");
 
   QString str;
   QDebug dbg(&str);
   dbg << event;
   msg.Message = str.toStdString();
   //msg.moduleName = event.getPlugin()->getSymbolicName().toStdString();
 
   addLogEntry(msg);
 }
 
 QtPlatformLogModel::QtPlatformLogModel(QObject* parent) : QAbstractTableModel(parent),
 m_ShowAdvancedFiels(false),
 m_ShowCategory(true)
 {
   m_Active=new QList<ExtendedLogMessage>;
   m_Pending=new QList<ExtendedLogMessage>;
   connect(this, SIGNAL(signalFlushLogEntries()), this, SLOT( slotFlushLogEntries() ), Qt::QueuedConnection );
   QtLogPlugin::GetInstance()->GetContext()->connectFrameworkListener(this, SLOT(addLogEntry(ctkPluginFrameworkEvent)));
   myBackend = new QtLogBackend(this);
 }
 
 QtPlatformLogModel::~QtPlatformLogModel()
 {
   disconnect(this, SIGNAL(signalFlushLogEntries()), this, SLOT( slotFlushLogEntries() ));
   QtLogPlugin::GetInstance()->GetContext()->disconnectFrameworkListener(this);
 
-  // dont delete and unregister backend, only deactivate it to avoid thread syncronization issues cause mitk::UnregisterBackend is not threadsafe
+  // dont delete and unregister backend, only deactivate it to avoid thread synchronization issues cause mitk::UnregisterBackend is not threadsafe
   // will be fixed.
   //  delete myBackend;
   //  delete m_Active;
   //  delete m_Pending;
   m_Mutex.lock();
   myBackend->Deactivate();
   m_Mutex.unlock();
 }
 
 // QT Binding
 
 int
 QtPlatformLogModel::rowCount(const QModelIndex&) const
 {
   return static_cast<int>(m_Entries.size());
 }
 
 int
 QtPlatformLogModel::columnCount(const QModelIndex&) const
 {
   int returnValue = 2;
   if( m_ShowAdvancedFiels ) returnValue += 7;
   if( m_ShowCategory ) returnValue += 1;
   return returnValue;
 }
           /*
   struct LogEntry {
     LogEntry(const std::string& msg, const std::string& src, std::time_t t)
     : message(msg.c_str()), moduleName(src.c_str()),time(std::clock())
     {
     }
 
     QString message;
     clock_t time;
 
     QString level;
     QString filePath;
     QString lineNumber;
     QString moduleName;
     QString category;
     QString function;
 
     LogEntry(const mitk::LogMessage &msg)
     {
       message = msg.Message.c_str();
 
 
       filePath = msg.filePath;
 
       std::stringstream out;
       out << msg.LineNumber;
       lineNumber = out.str().c_str();
 
       moduleName = msg.ModuleName;
       category = msg.Category.c_str();
       function = msg.FunctionName;
 
       time=std::clock();
     }
   };        */
 
 
 QVariant QtPlatformLogModel::data(const QModelIndex& index, int role) const
 {
   const ExtendedLogMessage *msg = &m_Entries[index.row()];
 
   if (role == Qt::DisplayRole)
     {
     switch (index.column())
       {
       case 0:
         if (m_ShowAdvancedFiels) return msg->getTime();
         else return msg->getLevel();
       case 1:
         if (m_ShowAdvancedFiels) return msg->getLevel();
         else return msg->getMessage();
       case 2:
         if (m_ShowAdvancedFiels) return msg->getMessage();
         else return msg->getCategory();
       case 3:
         if (m_ShowAdvancedFiels && m_ShowCategory) return msg->getCategory();
         else if (m_ShowAdvancedFiels && !m_ShowCategory) return msg->getModuleName();
         else break;
       case 4:
         if (m_ShowAdvancedFiels && m_ShowCategory) return msg->getModuleName();
         else if (m_ShowAdvancedFiels && !m_ShowCategory) return msg->getFunctionName();
         else break;
       case 5:
         if (m_ShowAdvancedFiels && m_ShowCategory) return msg->getFunctionName();
         else if (m_ShowAdvancedFiels && !m_ShowCategory) return msg->getPath();
         else break;
       case 6:
         if (m_ShowAdvancedFiels && m_ShowCategory) return msg->getPath();
         else if (m_ShowAdvancedFiels && !m_ShowCategory) return msg->getLine();
         else break;
       case 7:
         if (m_ShowAdvancedFiels && m_ShowCategory) return msg->getLine();
         else break;
       }
     }
 
   else if(  role == Qt::DecorationRole )
   {
     if ( (m_ShowAdvancedFiels && index.column()==1)
       || (!m_ShowAdvancedFiels && index.column()==0) )
     {
       QString file ( ":/org_blueberry_ui_qt_log/information.png" );
 
       if( msg->message.Level == mitk::LogLevel::Error )
         file = ":/org_blueberry_ui_qt_log/error.png";
       else if( msg->message.Level == mitk::LogLevel::Warn )
         file = ":/org_blueberry_ui_qt_log/warning.png";
       else if( msg->message.Level == mitk::LogLevel::Debug )
         file = ":/org_blueberry_ui_qt_log/debug.png";
       else if( msg->message.Level == mitk::LogLevel::Fatal )
         file = ":/org_blueberry_ui_qt_log/fatal.png";
 
       QIcon icon(file);
       return QVariant(icon);
 
     }
   }
 
 
   return QVariant();
 }
 
 QVariant
 QtPlatformLogModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
   if (role == Qt::DisplayRole && orientation == Qt::Horizontal)
   {
     if( m_ShowAdvancedFiels && m_ShowCategory )
     {
       switch (section)
       {
         case 0: return QVariant(" Time ");
         case 1: return QVariant(" Level ");
         case 2: return QVariant(" Message ");
         case 3: return QVariant(" Category ");
         case 4: return QVariant(" Module ");
         case 5: return QVariant(" Function ");
         case 6: return QVariant(" File ");
         case 7: return QVariant(" Line ");
       }
     }
     else if (m_ShowAdvancedFiels && !m_ShowCategory)
     {
       switch (section)
       {
         case 0: return QVariant(" Time ");
         case 1: return QVariant(" Level ");
         case 2: return QVariant(" Message ");
         case 3: return QVariant(" Module ");
         case 4: return QVariant(" Function ");
         case 5: return QVariant(" File ");
         case 6: return QVariant(" Line ");
       }
     }
-    else //!m_ShowAdvancedFiels, m_ShowCategory is not handled seperately because it only activates case 2
+    else //!m_ShowAdvancedFiels, m_ShowCategory is not handled separately because it only activates case 2
     {
       switch (section)
       {
         case 0: return QVariant(" Level ");
         case 1: return QVariant(" Message ");
         case 2: return QVariant(" Category ");
       }
     }
   }
 
   return QVariant();
 }
 
 QVariant QtPlatformLogModel::ExtendedLogMessage::getTime() const
     {
     std::stringstream ss;
     std::locale C("C");
     ss.imbue(C);
     ss << std::setw(7) << std::setprecision(3) << std::fixed << ((double)this->time)/CLOCKS_PER_SEC;
     return QVariant(QString(ss.str().c_str()));
     }
 
 QString QtPlatformLogModel::GetDataAsString()
     {
     QString returnValue("");
 
     for (int message=0; message<this->rowCount(QModelIndex()); message++)
       {
       for (int column=0; column<this->columnCount(QModelIndex()); column++)
         {
         returnValue += " " + this->data(this->index(message,column),Qt::DisplayRole).toString();
         }
       returnValue += "\n";
       }
 
     return returnValue;
     }
 
 
 }
diff --git a/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.h b/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.h
index bd6b7f567e..561b148d9b 100644
--- a/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.h
+++ b/Plugins/org.blueberry.ui.qt.log/src/internal/berryQtPlatformLogModel.h
@@ -1,211 +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 BERRYQTPLATFORMLOGMODEL_H_
 #define BERRYQTPLATFORMLOGMODEL_H_
 
 #include "berryLog.h"
 
 #include "ctkPluginFrameworkEvent.h"
 
 #include <QtCore/QAbstractTableModel>
 #include <QtCore/QDateTime>
 
 #include <ctime>
 #include <sstream>
 
 #include "berryLog.h"
 
 #include <QMutex>
 
 
 namespace berry {
 
 /** Documentation
  *  @brief An object of this class represents a table of logging data.
  *         The table presentation can be modified by the methods
  *         SetShowAdvancedFiels() and SetShowCategory().
  */
 class QtPlatformLogModel : public QAbstractTableModel
 {
   Q_OBJECT
 
 public:
 
   QtPlatformLogModel(QObject* parent = nullptr);
   ~QtPlatformLogModel() override;
 
   void SetShowAdvancedFiels( bool showAdvancedFiels );
   void SetShowCategory( bool showCategory );
   int rowCount(const QModelIndex&) const override;
   int columnCount(const QModelIndex&) const override;
   QVariant data(const QModelIndex& index, int) const override;
 
   /** Documentation
-   *  @return Retruns the complete table data as string representation.
+   *  @return Returns the complete table data as string representation.
    */
   QString GetDataAsString();
 
   QVariant headerData(int section, Qt::Orientation orientation, int) const override;
 
   void addLogEntry(const mitk::LogMessage &msg);
 
   Q_SLOT void addLogEntry(const ctkPluginFrameworkEvent& event);
 
 private:
   bool m_ShowAdvancedFiels;
   bool m_ShowCategory;
 
   /** Documentation
    *  @brief An object of this struct internally represents a logging message.
    *         It offers methods to convert the logging data into QVaraint objects
    *         and also adds time and threadid as logging data. The struct is
    *         internally used to store logging data in the table data model.
    */
   struct ExtendedLogMessage {
     mitk::LogMessage message;
     clock_t time;
     int threadid;
 
     ExtendedLogMessage(const ExtendedLogMessage &src):message(src.message),time(src.time),threadid(src.threadid)
     {
     }
 
     ExtendedLogMessage(const mitk::LogMessage &msg):message(msg),time(std::clock()),threadid(0)
     {
     }
 
     ExtendedLogMessage operator = (const ExtendedLogMessage& src)
     {
       return ExtendedLogMessage(src);
     }
 
     QVariant getLevel() const
     {
     switch(this->message.Level)
         {
           default:
           case mitk::LogLevel::Info:
             return QVariant(Info);
 
           case mitk::LogLevel::Warn:
             return QVariant(Warn);
 
           case mitk::LogLevel::Error:
             return QVariant(Error);
 
           case mitk::LogLevel::Fatal:
             return QVariant(Fatal);
 
           case mitk::LogLevel::Debug:
             return QVariant(Debug);
         }
     }
 
     QVariant getMessage() const
     {
     return QVariant(QString::fromStdString(this->message.Message));
     }
 
     QVariant getCategory() const
     {
     return QVariant(QString::fromStdString(this->message.Category));
     }
 
     QVariant getModuleName() const
     {
     return QVariant(QString::fromStdString(this->message.ModuleName));
     }
 
     QVariant getFunctionName() const
     {
     return QVariant(QString::fromStdString(this->message.FunctionName));
     }
 
     QVariant getPath() const
     {
     return QVariant(QString::fromStdString(this->message.FilePath));
     }
 
     QVariant getLine() const
     {
     return QVariant(QString::number(this->message.LineNumber));
     }
 
     /** This method is implemented in the cpp file to save includes. */
     QVariant getTime() const;
 
   };
 
   class QtLogBackend : public mitk::LogBackendBase
   {
     public:
 
       QtLogBackend(QtPlatformLogModel *_myModel)
       {
         myModel=_myModel;
         deactivated = false;
         mitk::RegisterBackend(this);
         BERRY_INFO << "BlueBerry log backend registered";
       }
 
       ~QtLogBackend() override
       {
         mitk::UnregisterBackend(this);
       }
 
       void ProcessMessage(const mitk::LogMessage &l ) override
       {
         if(!deactivated)
           myModel->addLogEntry(l);
       }
 
       mitk::LogBackendBase::OutputType GetOutputType() const override
       {
         return mitk::LogBackendBase::OutputType::Other;
       }
 
       void Deactivate()
       {
         deactivated=true;
       }
 
     private:
 
       QtPlatformLogModel *myModel;
       bool deactivated;
 
   } *myBackend;
 
   QList<ExtendedLogMessage> m_Entries;
   QList<ExtendedLogMessage> *m_Active,*m_Pending;
 
   static const QString Error;
   static const QString Warn;
   static const QString Fatal;
   static const QString Info;
   static const QString Debug;
 
   QMutex m_Mutex;
 
   signals:
 
     void signalFlushLogEntries();
 
   protected slots:
 
     void slotFlushLogEntries();
 };
 
 }
 
 #endif /*BERRYQTPLATFORMLOGMODEL_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h b/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h
index 52cb8ea7ff..b847146713 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryCommandContributionItemParameter.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 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);
 
   /**
    * 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.
+   * STYLE_* constants.
    */
   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.
+   *            The style of this menu contribution. See the STYLE_* constants.
    */
   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 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.
+   *            The style of this menu contribution. See the STYLE_* constants.
    * @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.
    * @note 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/berryContributionItemFactory.h b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItemFactory.h
index ade6420acf..2dda3b6f0c 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItemFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionItemFactory.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 BERRYCONTRIBUTIONITEMFACTORY_H
 #define BERRYCONTRIBUTIONITEMFACTORY_H
 
 #include <QString>
 
 #include <berrySmartPointer.h>
 #include <org_blueberry_ui_qt_Export.h>
 
 namespace berry {
 
 struct IContributionItem;
 struct IWorkbenchWindow;
 
 /**
  * Access to standard contribution items provided by the workbench.
  * <p>
  * Most of the functionality of this class is provided by
  * static methods and fields.
  * Example usage:
  * <pre>
  * MenuManager menu = ...;
  * IContributionItem::Pointer reEdit
  *     = ContributionItemFactory::REOPEN_EDITORS->Create(window);
  * menu->Add(reEdit);
  * </pre>
  * </p>
  * <p>
  * Clients may declare subclasses that provide additional application-specific
  * contribution item factories.
  * </p>
  */
 class BERRY_UI_QT ContributionItemFactory
 {
 
 private:
 
   /**
    * Id of contribution items created by this factory.
    */
   const QString contributionItemId;
 
 protected:
 
   /**
    * Creates a new workbench contribution item factory with the given id.
    *
    * @param contributionItemId the id of contribution items created by this factory
    */
   ContributionItemFactory(const QString& contributionItemId);
 
 public:
 
    /**
     * Creates a new standard contribution item for the given workbench window.
     * <p>
     * A typical contribution item automatically registers listeners against the
     * workbench window so that it can keep its enablement state up to date.
     * Ordinarily, the window's references to these listeners will be dropped
     * automatically when the window closes. However, if the client needs to get
     * rid of a contribution item while the window is still open, the client must
     * call IContributionItem#dispose to give the item an
     * opportunity to deregister its listeners and to perform any other cleanup.
     * </p>
     *
     * @param window the workbench window
     * @return the workbench contribution item
     */
    virtual SmartPointer<IContributionItem> Create(IWorkbenchWindow* window) = 0;
 
    /**
     * Returns the id of this contribution item factory.
     *
     * @return the id of contribution items created by this factory
     */
    QString GetId() const;
 
    /**
     * Workbench contribution item (id "openWindows"): A list of windows
     * currently open in the workbench. Selecting one of the items makes the
     * corresponding window the active window.
     * This action dynamically maintains the list of windows.
     */
    static const QScopedPointer<ContributionItemFactory> OPEN_WINDOWS;
 
    /**
     * Workbench contribution item (id "viewsShortlist"): A list of views
     * available to be opened in the window, arranged as a shortlist of
     * promising views and an "Other" subitem. Selecting
     * one of the items opens the corresponding view in the active window.
     * This action dynamically maintains the view shortlist.
     */
    static const QScopedPointer<ContributionItemFactory> VIEWS_SHORTLIST;
 
    /**
     * Workbench contribution item (id "reopenEditors"): A list of recent
     * editors (with inputs) available to be reopened in the window. Selecting
     * one of the items reopens the corresponding editor on its input in the
     * active window. This action dynamically maintains the list of editors.
     */
    static const QScopedPointer<ContributionItemFactory> REOPEN_EDITORS;
 
    /**
     * Workbench contribution item (id "perspectivesShortlist"): A list of
     * perspectives available to be opened, arranged as a shortlist of
     * promising perspectives and an "Other" subitem. Selecting
     * one of the items makes the corresponding perspective active. Should a
     * new perspective need to be opened, a workbench user preference controls
-    * whether the prespective is opened in the active window or a new window.
+    * whether the perspective is opened in the active window or a new window.
     * This action dynamically maintains the perspectives shortlist.
     */
    static const QScopedPointer<ContributionItemFactory> PERSPECTIVES_SHORTLIST;
 
    virtual ~ContributionItemFactory() = default;
 
 };
 
 }
 
 #endif // BERRYCONTRIBUTIONITEMFACTORY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
index 7c2600b8bf..33b39e7e9e 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
@@ -1,194 +1,194 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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>,
  * 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
  */
 struct IContributionItem : public virtual Object
 {
 
   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 before
    */
   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 before
    */
   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 before
    */
   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.
+   * Returns whether this contribution item is visible 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.
+   * Sets whether this contribution item is visible 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/berryIContributionManagerOverrides.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
index 8fdb67e9a7..e80564f5a8 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.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 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
+ * to determine if the values for certain properties have been overridden
  * by their manager.
  * <p>
  * This interface is internal to the framework; it should not be implemented outside
  * the framework.
  * </p>
  */
 struct BERRY_UI_QT IContributionManagerOverrides : virtual Object
 {
 
   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
    * @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.
+   * Visibility 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/berryMenuManager.cpp b/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.cpp
index c3bc449562..1a3064882e 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.cpp
@@ -1,675 +1,675 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryMenuManager.h"
 
 #include "berryIContributionManagerOverrides.h"
 #include "berryQActionProperties.h"
 #include "berrySubContributionItem.h"
 
 #include <QMenu>
 #include <QMenuBar>
 
 
 class QMenuProxy
 {
 
 public:
 
   QMenu* menu;
   QMenuBar* menuBar;
 
   enum Type {
     MenuBar,
     Menu
   };
 
   QMenuProxy(Type type, QWidget* parent = nullptr)
     : menu(nullptr), menuBar(nullptr)
   {
     switch (type)
     {
     case MenuBar: menuBar = new QMenuBar(parent); break;
     case Menu: menu = new QMenu(parent); break;
     }
   }
 
   bool isMenuBar() const
   {
     return menuBar != nullptr;
   }
 
   void setTitle(const QString& title)
   {
     if (menu)
       menu->setTitle(title);
   }
 
   void setIcon(const QIcon& icon)
   {
     if (menu)
       menu->setIcon(icon);
   }
 
   QList<QAction*> actions() const
   {
     return menu ? menu->actions() : menuBar->actions();
   }
 
   void removeAction(QAction* action)
   {
     menu ? menu->removeAction(action) : menuBar->removeAction(action);
   }
 
   bool isEnabled() const
   {
     return menu ? menu->isEnabled() : menuBar->isEnabled();
   }
 
   void setEnabled(bool enabled)
   {
     menu ? menu->setEnabled(enabled) : menuBar->setEnabled(enabled);
   }
 
   QAction* getParentItem() const
   {
     return menu ? menu->menuAction() : nullptr;
   }
 
 };
 
 namespace berry
 {
 
 struct NullOverrides: public IContributionManagerOverrides
 {
 public:
 
   int GetEnabled(const IContributionItem* /*item*/) const override
   {
     return -1;
   }
 
   int GetVisible(const IContributionItem* /*item*/) const override
   {
     return -1;
   }
 };
 
 void MenuManager::HandleAboutToShow()
 {
   if (this->removeAllWhenShown)
   {
     this->RemoveAll();
   }
   emit AboutToShow(this);
   this->Update(false, false);
 }
 
 void MenuManager::HandleAboutToHide()
 {
   emit AboutToHide(this);
 }
 
 MenuManager::MenuManager(const QString& text, const QString& id)
   : id(id), menu(nullptr), menuItem(nullptr)
   , menuText(text), parent(nullptr)
   , removeAllWhenShown(false), visible(true)
 {
 
 }
 
 MenuManager::MenuManager(const QString& text, const QIcon& image, const QString& id)
   : id(id), menu(nullptr), menuItem(nullptr)
   , menuText(text), image(image)
   , parent(nullptr), removeAllWhenShown(false), visible(true)
 {
 
 }
 
 bool MenuManager::IsDirty() const
 {
   return ContributionManager::IsDirty();
 }
 
 MenuManager::~MenuManager()
 {
   delete menu;
 }
 
 QMenu* MenuManager::CreateContextMenu(QWidget* parent)
 {
   if (!menu)
   {
     menu = new QMenuProxy(QMenuProxy::Menu, parent);
     this->InitializeMenu();
   }
   return menu->menu;
 }
 
 QMenuBar* MenuManager::CreateMenuBar(QWidget* parent)
 {
   if (!menu)
   {
     menu = new QMenuProxy(QMenuProxy::MenuBar, parent);
     this->Update(false);
   }
   return menu->menuBar;
 }
 
 void MenuManager::AddMenuListener(QObject* listener)
 {
   this->connect(this, SIGNAL(AboutToShow(IMenuManager*)), listener, SLOT(MenuAboutToShow(IMenuManager*)));
   this->connect(this, SIGNAL(AboutToHide(IMenuManager*)), listener, SLOT(MenuAboutToHide(IMenuManager*)));
 }
 
 void MenuManager::RemoveMenuListener(QObject* listener)
 {
   this->disconnect(listener);
 }
 
 void MenuManager::Fill(QStatusBar* /*parent*/)
 {
 }
 
 void MenuManager::Fill(QToolBar* /*parent*/, QAction* /*before*/)
 {
 }
 
 void MenuManager::Fill(QMenu* parent, QAction* before)
 {
   this->FillMenu(parent, before);
 }
 
 void MenuManager::Fill(QMenuBar* parent, QAction* before)
 {
   this->FillMenu(parent, before);
 }
 
 void MenuManager::FillMenu(QWidget* parent, QAction* before)
 {
   if (!menuItem)
   {
     menuItem = new QAction(parent);
     if (parent)
     {
       parent->insertAction(before, menuItem);
     }
 
     menuItem->setText(GetMenuText());
     menuItem->setIcon(image);
 
     if(!menu)
     {
       menu = new QMenuProxy(QMenuProxy::Menu, parent);
     }
 
     if (!menu->isMenuBar())
       menuItem->setMenu(menu->menu);
 
     this->InitializeMenu();
 
     this->SetDirty(true);
   }
 }
 
 IMenuManager::Pointer MenuManager::FindMenuUsingPath(const QString& path) const
 {
   IContributionItem::Pointer item(this->FindUsingPath(path));
   if (IMenuManager::Pointer manager = item.Cast<IMenuManager>())
   {
     return manager;
   }
   return IMenuManager::Pointer(nullptr);
 }
 
 IContributionItem::Pointer MenuManager::FindUsingPath(const QString& path) const
 {
   QString id(path);
   QString rest;
   int separator = path.indexOf('/');
   if (separator != -1)
   {
     id = path.left(separator);
     rest = path.mid(separator + 1);
   }
   else
   {
     return ContributionManager::Find(path);
   }
 
   IContributionItem::Pointer item(ContributionManager::Find(id));
   if (IMenuManager::Pointer manager = item.Cast<IMenuManager>())
   {
     return manager->FindUsingPath(rest);
   }
   return IContributionItem::Pointer(nullptr);
 }
 
 QString MenuManager::GetId() const
 {
   return id;
 }
 
 QMenu* MenuManager::GetMenu() const
 {
   return menu->menu;
 }
 
 QString MenuManager::GetMenuText() const
 {
   if (definitionId == "")
   {
     return menuText;
   }
 //  ExternalActionManager::ICallback callback = ExternalActionManager
 //  .getInstance().getCallback();
 //  if (callback != null)
 //  {
 //    String shortCut = callback.getAcceleratorText(definitionId);
 //    if (shortCut == null)
 //    {
 //      return menuText;
 //    }
 //    return menuText + "\t" + shortCut; //$NON-NLS-1$
 //  }
   return menuText;
 }
 
 QIcon MenuManager::GetImage() const
 {
   return image;
 }
 
 SmartPointer<IContributionManagerOverrides> MenuManager::GetOverrides()
 {
   if (!overrides)
   {
     if (!parent)
     {
       overrides = new NullOverrides();
     }
     else
     {
       overrides = parent->GetOverrides();
     }
     ContributionManager::SetOverrides(overrides);
   }
   return overrides;
 }
 
 IContributionManager* MenuManager::GetParent() const
 {
   return parent;
 }
 
 bool MenuManager::GetRemoveAllWhenShown() const
 {
   return removeAllWhenShown;
 }
 
 bool MenuManager::IsDynamic() const
 {
   return false;
 }
 
 bool MenuManager::IsEnabled() const
 {
   return true;
 }
 
 bool MenuManager::IsGroupMarker() const
 {
   return false;
 }
 
 bool MenuManager::IsSeparator() const
 {
   return false;
 }
 
 bool MenuManager::IsVisible() const
 {
   if (!visible)
   {
     return false; // short circuit calculations in this case
   }
 
   if (removeAllWhenShown)
   {
     // we have no way of knowing if the menu has children
     return true;
   }
 
   // menus aren't visible if all of its children are invisible (or only contains visible separators).
   bool visibleChildren = false;
   foreach(IContributionItem::Pointer item, this->GetItems())
   {
     if (item->IsVisible() && !item->IsSeparator())
     {
       visibleChildren = true;
       break;
     }
   }
 
   return visibleChildren;
 }
 
 void MenuManager::MarkDirty()
 {
   ContributionManager::MarkDirty();
   // Can't optimize by short-circuiting when the first dirty manager is encountered,
   // since non-visible children are not even processed.
   // That is, it's possible to have a dirty sub-menu under a non-dirty parent menu
   // even after the parent menu has been updated.
   // If items are added/removed in the sub-menu, we still need to propagate the dirty flag up,
   // even if the sub-menu is already dirty, since the result of isVisible() may change
   // due to the added/removed items.
   IContributionManager* p = this->GetParent();
   if (p)
   {
     p->MarkDirty();
   }
 }
 
 void MenuManager::SaveWidgetState()
 {
 }
 
 void MenuManager::SetOverrides(SmartPointer<IContributionManagerOverrides> newOverrides)
 {
   overrides = newOverrides;
   ContributionManager::SetOverrides(overrides);
 }
 
 void MenuManager::SetParent(IContributionManager* manager)
 {
   parent = manager;
 }
 
 void MenuManager::SetRemoveAllWhenShown(bool removeAll)
 {
   this->removeAllWhenShown = removeAll;
 }
 
 void MenuManager::SetVisible(bool visible)
 {
   this->visible = visible;
 }
 
 void MenuManager::SetCommandId(const QString& definitionId)
 {
   this->definitionId = definitionId;
 }
 
 void MenuManager::Update()
 {
   this->UpdateMenuItem();
 }
 
 void MenuManager::Update(const QString& property)
 {
   QList<IContributionItem::Pointer> items = GetItems();
 
   for (int i = 0; i < items.size(); i++)
   {
     items[i]->Update(property);
   }
 
   if (menu != nullptr && menu->getParentItem() != nullptr)
   {
     if (QActionProperties::TEXT == property)
     {
       QString text = GetMenuText();
       if (!text.isNull())
       {
         menu->getParentItem()->setText(text);
       }
     }
     else if (QActionProperties::IMAGE == property && !image.isNull())
     {
       menu->getParentItem()->setIcon(image);
     }
   }
 }
 
 void MenuManager::Update(bool force)
 {
   this->Update(force, false);
 }
 
 void MenuManager::UpdateAll(bool force)
 {
   this->Update(force, true);
 }
 
 void MenuManager::InitializeMenu()
 {
   menu->setTitle(GetMenuText());
   menu->setIcon(GetImage());
 
   if (!menu->isMenuBar())
   {
     this->connect(menu->menu, SIGNAL(aboutToShow()), SLOT(HandleAboutToShow()));
     this->connect(menu->menu, SIGNAL(aboutToHide()), SLOT(HandleAboutToHide()));
   }
 
   // Don't do an update(true) here, in case menu is never opened.
   // Always do it lazily in handleAboutToShow().
 }
 
 void MenuManager::UpdateMenuItem()
 {
   if (menuItem && menu)
   {
     bool enabled = removeAllWhenShown || menu->actions().size() > 0;
     if (menu->isEnabled() != enabled)
     {
       menuItem->setEnabled(enabled);
     }
   }
 }
 
 void MenuManager::DoItemFill(IContributionItem::Pointer ci, QAction* before)
 {
   if (menu->isMenuBar())
   {
     ci->Fill(menu->menuBar, before);
   }
   else
   {
     ci->Fill(menu->menu, before);
   }
 }
 
 void MenuManager::Update(bool force, bool recursive)
 {
   if (ContributionManager::IsDirty() || force)
   {
     if (menu)
     {
       // clean contains all active items without double separators
       QList<IContributionItem::Pointer> items = this->GetItems();
       QList<IContributionItem::Pointer> clean;
       IContributionItem::Pointer separator;
       foreach (IContributionItem::Pointer ci, items)
       {
         if (!ci->IsVisible())
         {
           continue;
         }
         if (ci->IsSeparator())
         {
           // delay creation until necessary
           // (handles both adjacent separators, and separator at end)
           separator = ci;
         }
         else
         {
           if (separator)
           {
             if (clean.size() > 0)
             {
               clean.push_back(separator);
             }
             separator = nullptr;
           }
           clean.push_back(ci);
         }
       }
 
       // remove obsolete (removed or non active)
       QList<QAction*> mi = menu->actions();
 
       for (int i = 0; i < mi.size(); i++)
       {
         Object::Pointer data = mi[i]->data().value<Object::Pointer>();
 
         if (!data || !clean.contains(data.Cast<IContributionItem>()))
         {
           menu->removeAction(mi[i]);
         }
         else if (IContributionItem::Pointer ci = data.Cast<IContributionItem>())
         {
           if(ci->IsDynamic() && ci->IsDirty())
           {
             menu->removeAction(mi[i]);
             delete mi[i];
           }
         }
       }
 
       // add new
       mi = menu->actions();
       int srcIx = 0;
       int destIx = 0;
 
       for (QList<IContributionItem::Pointer>::Iterator e = clean.begin();
            e != clean.end(); ++e)
       {
         IContributionItem::Pointer src(*e);
         IContributionItem::Pointer dest;
 
         // get corresponding item in widget
         if (srcIx < mi.size())
         {
           dest = mi[srcIx]->data().value<Object::Pointer>().Cast<IContributionItem>();
         }
         else
         {
           dest = nullptr;
         }
 
         if (dest && src == dest)
         {
           srcIx++;
           destIx++;
         }
         else if (dest && dest->IsSeparator() && src->IsSeparator())
         {
           mi[srcIx]->setData(QVariant::fromValue<Object::Pointer>(src));
           srcIx++;
           destIx++;
         }
         else
         {
           int start = menu->actions().size();
           //qDebug() << "***** Filling item destIx = " << destIx << " (size: " << start << ")";
           this->DoItemFill(src, destIx >= start ? nullptr : menu->actions().at(destIx));
           int newItems = menu->actions().size() - start;
           //qDebug() << "***** New items: " << newItems;
           for (int i = 0; i < newItems; ++i)
           {
             menu->actions().at(destIx++)->setData(QVariant::fromValue<Object::Pointer>(src));
           }
         }
 
         // May be we can optimize this call. If the menu has just
         // been created via the call src.fill(fMenuBar, destIx) then
         // the menu has already been updated with update(true)
         // (see MenuManager). So if force is true we do it again. But
         // we can't set force to false since then information for the
         // sub sub menus is lost.
         if (recursive)
         {
           IContributionItem::Pointer item(src);
           if (SubContributionItem::Pointer subItem = item.Cast<SubContributionItem>())
           {
             item = subItem->GetInnerItem();
           }
           if (IMenuManager::Pointer mm = item.Cast<IMenuManager>())
           {
             mm->UpdateAll(force);
           }
         }
 
       }
 
       // remove any old menu items not accounted for
       for (; srcIx < mi.size(); srcIx++)
       {
         menu->removeAction(mi[srcIx]);
         delete mi[srcIx];
       }
 
       this->SetDirty(false);
     }
   }
   else
   {
-    // I am not dirty. Check if I must recursivly walk down the hierarchy.
+    // I am not dirty. Check if I must recursively walk down the hierarchy.
     if (recursive)
     {
       foreach (IContributionItem::Pointer ci, this->GetItems())
       {
         if (IMenuManager::Pointer mm = ci.Cast<IMenuManager>())
         {
           if (mm->IsVisible())
           {
             mm->UpdateAll(force);
           }
         }
       }
     }
   }
   this->UpdateMenuItem();
 }
 
 void MenuManager::DumpActionInfo(QMenuProxy* menu)
 {
   if (menu->isMenuBar())
   {
     //qDebug() << "QMenuBar [" << menu->menuBar << "]";
     DumpActionInfo(menu->menuBar, 1);
   }
   else
   {
     //qDebug() << "QMenu [" << menu->menu << "]" << menu->menu;
     DumpActionInfo(menu->menu, 1);
   }
 }
 
 void MenuManager::DumpActionInfo(QWidget* widget, int level)
 {
   QString indent = " |";
   for (int i = 0; i < level; ++i) indent += "--";
   foreach(QAction* action, widget->actions())
   {
     qDebug() << qPrintable(indent) << action->text() << "[" << action << "]";
     if (action->menu())
     {
       DumpActionInfo(action->menu(), level+1);
     }
   }
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryMenuManager.h
index 21b4b66e54..4e84952186 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);
 
 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.
+   * Returns the parent contribution manager of this manager.
    *
    * @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 before
    *            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/application/berryWorkbenchWindowAdvisor.h b/Plugins/org.blueberry.ui.qt/src/application/berryWorkbenchWindowAdvisor.h
index 18f15f4ddb..7135b29cf2 100644
--- a/Plugins/org.blueberry.ui.qt/src/application/berryWorkbenchWindowAdvisor.h
+++ b/Plugins/org.blueberry.ui.qt/src/application/berryWorkbenchWindowAdvisor.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 BERRYWORKBENCHWINDOWADVISOR_H_
 #define BERRYWORKBENCHWINDOWADVISOR_H_
 
 #include <berrySmartPointer.h>
 
 #include <org_blueberry_ui_qt_Export.h>
 
 namespace berry
 {
 
 struct IActionBarConfigurer;
 struct IMemento;
 struct IWorkbenchWindowConfigurer;
 
 class ActionBarAdvisor;
 class Shell;
 
 /**
  * Public base class for configuring a workbench window.
  * <p>
  * The workbench window advisor object is created in response to a workbench
  * window being created (one per window), and is used to configure the window.
  * </p>
  * <p>
  * An application should declare a subclass of <code>WorkbenchWindowAdvisor</code>
  * and override methods to configure workbench windows to suit the needs of the
  * particular application.
  * </p>
  * <p>
  * The following advisor methods are called at strategic points in the
  * workbench window's lifecycle (as with the workbench advisor, all occur
  * within the dynamic scope of the call to
  * <code>PlatformUI#CreateAndRunWorkbench()</code>):
  * <ul>
  * <li>PreWindowOpen() - called as the window is being opened;
  *  use to configure aspects of the window other than actions bars</li>
  * <li>PostWindowRestore() - called after the window has been
  * recreated from a previously saved state; use to adjust the restored
  * window</li>
  * <li>PostWindowCreate() -  called after the window has been created,
  * either from an initial state or from a restored state;  used to adjust the
  * window</li>
  * <li>OpenIntro() - called immediately before the window is opened in
  * order to create the introduction component, if any.</li>
  * <li>PostWindowOpen() - called after the window has been
  * opened; use to hook window listeners, etc.</li>
  * <li>PreWindowShellClose() - called when the window's shell
  * is closed by the user; use to pre-screen window closings</li>
  * </ul>
  * </p>
  *
  */
 class BERRY_UI_QT WorkbenchWindowAdvisor
 {
 
 private:
 
   SmartPointer<IWorkbenchWindowConfigurer> windowConfigurer;
 
 protected:
 
   /**
    * Returns the workbench window configurer.
    *
    * @return the workbench window configurer
    */
   SmartPointer<IWorkbenchWindowConfigurer> GetWindowConfigurer();
 
 public:
 
   /**
    * Creates a new workbench window advisor for configuring a workbench
    * window via the given workbench window configurer.
    *
    * @param configurer an object for configuring the workbench window
    */
   WorkbenchWindowAdvisor(const SmartPointer<IWorkbenchWindowConfigurer>& configurer);
   virtual ~WorkbenchWindowAdvisor();
 
   /**
    * Performs arbitrary actions before the window is opened.
    * <p>
    * This method is called before the window's controls have been created.
    * Clients must not call this method directly (although super calls are okay).
    * The default implementation does nothing. Subclasses may override.
    * Typical clients will use the window configurer to tweak the
    * workbench window in an application-specific way; however, filling the
    * window's menu bar, tool bar, and status line must be done in
    * <code>ActionBarAdvisor#FillActionBars()</code>, which is called immediately
    * after this method is called.
    * </p>
    */
   virtual void PreWindowOpen();
 
   /**
    * Creates a new action bar advisor to configure the action bars of the window
    * via the given action bar configurer.
    * The default implementation returns a new instance of <code>ActionBarAdvisor</code>.
    *
    * @param configurer the action bar configurer for the window
    * @return the action bar advisor for the window
    */
   virtual SmartPointer<ActionBarAdvisor> CreateActionBarAdvisor(
       SmartPointer<IActionBarConfigurer> configurer);
 
   /**
    * Performs arbitrary actions after the window has been restored,
    * but before it is opened.
    * <p>
    * This method is called after a previously-saved window has been
    * recreated. This method is not called when a new window is created from
    * scratch. This method is never called when a workbench is started for the
    * very first time, or when workbench state is not saved or restored.
    * Clients must not call this method directly (although super calls are okay).
    * The default implementation does nothing. Subclasses may override.
    * It is okay to call <code>IWorkbench#Close()</code> from this method.
    * </p>
    *
    * @exception WorkbenchException thrown if there are any errors to report
    *   from post-restoration of the window
    */
   virtual void PostWindowRestore();
 
   /**
-   * Opens the introduction componenet.
+   * Opens the introduction component.
    * <p>
    * Clients must not call this method directly (although super calls are okay).
    * The default implementation opens the intro in the first window provided
    * if the preference <code>WorkbenchPreferenceConstants#SHOW_INTRO</code> is <code>true</code>.  If
    * an intro is shown then this preference will be set to <code>false</code>.
    * Subsequently, and intro will be shown only if
    * <code>WorkbenchConfigurer#GetSaveAndRestore()</code> returns
    * <code>true</code> and the introduction was visible on last shutdown.
    * Subclasses may override.
    * </p>
    */
   virtual void OpenIntro();
 
   /**
    * Performs arbitrary actions after the window has been created (possibly
    * after being restored), but has not yet been opened.
    * <p>
    * This method is called after the window has been created from scratch,
    * or when it has been restored from a previously-saved window.  In the latter case,
    * this method is called after <code>PostWindowRestore()</code>.
    * Clients must not call this method directly (although super calls are okay).
    * The default implementation does nothing. Subclasses may override.
    * </p>
    */
   virtual void PostWindowCreate();
 
   /**
    * Performs arbitrary actions after the window has been opened (possibly
    * after being restored).
    * <p>
    * This method is called after the window has been opened. This method is
    * called after the window has been created from scratch, or when
    * it has been restored from a previously-saved window.
    * Clients must not call this method directly (although super calls are okay).
    * The default implementation does nothing. Subclasses may override.
    * </p>
    */
   virtual void PostWindowOpen();
 
   /**
    * Performs arbitrary actions as the window's shell is being closed
    * directly, and possibly veto the close.
    * <p>
    * This method is called from a <code>IShellListener</code> associated with the window,
    * for example when the user clicks the window's close button. It is not
    * called when the window is being closed for other reasons, such as if the
    * user exits the workbench via the <code>ActionFactory#QUIT</code> action.
    * Clients must not call this method directly (although super calls are
    * okay). If this method returns <code>false</code>, then the user's
    * request to close the shell is ignored. This gives the workbench advisor
    * an opportunity to query the user and/or veto the closing of a window
    * under some circumstances.
    * </p>
    *
    * @return <code>true</code> to allow the window to close, and
    *         <code>false</code> to prevent the window from closing
    * @see IWorkbenchWindow#Close()
    * @see WorkbenchAdvisor#PreShutdown()
    */
   virtual bool PreWindowShellClose();
 
   /**
    * Performs arbitrary actions after the window is closed.
    * <p>
    * This method is called after the window's controls have been disposed.
    * Clients must not call this method directly (although super calls are
    * okay). The default implementation does nothing. Subclasses may override.
    * </p>
    */
   virtual void PostWindowClose();
 
   /**
    * Creates the contents of the window.
    * <p>
    * The default implementation adds a menu bar, a cool bar, a status line,
    * a perspective bar, and a fast view bar.  The visibility of these controls
    * can be configured using the <code>SetShow*</code> methods on
    * IWorkbenchWindowConfigurer.
    * </p>
    * <p>
    * Subclasses may override to define custom window contents and layout,
    * but must call <code>IWorkbenchWindowConfigurer#CreatePageComposite()</code>.
    * </p>
    *
    * @param shell the window's shell
    * @see IWorkbenchWindowConfigurer#CreateMenuBar()
    * @see IWorkbenchWindowConfigurer#CreateCoolBarControl()
    * @see IWorkbenchWindowConfigurer#CreateStatusLineControl()
    * @see IWorkbenchWindowConfigurer#CreatePageComposite()
    */
   virtual void CreateWindowContents(SmartPointer<Shell> shell);
 
   /**
    * Creates and returns the control to be shown when the window has no open pages.
    * If <code>null</code> is returned, the default window background is shown.
    * <p>
    * The default implementation returns <code>null</code>.
    * Subclasses may override.
    * </p>
    *
    * @param parent the parent composite
    * @return the control or <code>null</code>
    */
   virtual QWidget* CreateEmptyWindowContents(QWidget* parent);
 
   /**
    * Saves arbitrary application specific state information.
    *
    * @param memento the storage area for object's state
    * @return a status object indicating whether the save was successful
    */
   virtual bool SaveState(SmartPointer<IMemento> memento);
 
   /**
    * Restores arbitrary application specific state information.
    *
    * @param memento the storage area for object's state
    * @return a status object indicating whether the restore was successful
    */
   virtual bool RestoreState(SmartPointer<IMemento> memento);
 };
 
 }
 
 #endif /*BERRYWORKBENCHWINDOWADVISOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h b/Plugins/org.blueberry.ui.qt/src/berryIContributionRoot.h
index 5b3074227d..91a1a898d2 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);
 
   /**
    * 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
    * berry::AbstractContributionFactory::CreateContributionItems().
    *
    * @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
+   * Registers visibility 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 AddContributionItem().
    *
    * @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/berryIEditorReference.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorReference.h
index aa6908b2c8..8dba8713c0 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 IEditorPart will not be instantiated 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);
 
   ~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/berryIEditorRegistry.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorRegistry.h
index ac26a03df3..c1e1006973 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorRegistry.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorRegistry.h
@@ -1,275 +1,275 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef MITKIEDITORREGISTRY_H_
 #define MITKIEDITORREGISTRY_H_
 
 
 #include "berryIEditorDescriptor.h"
 #include "berryIFileEditorMapping.h"
 
 namespace berry {
 
 /**
  * \ingroup org_blueberry_ui_qt
  *
  * Registry of editors known to the workbench.
  * <p>
  * An editor can be created in one of two ways:
  * <ul>
  *   <li>An editor can be defined by an extension to the workbench.</li>
  *   <li>The user manually associates an editor with a given resource extension
  *      type. This will override any default workbench or platform association.
  *      </li>
  * </ul>
  * </p>
  * <p>
  * The registry does not keep track of editors that are "implicitly" determined.
  * For example a bitmap (<code>.bmp</code>) file will typically not have a
  * registered editor. Instead, when no registered editor is found, the
  * underlying OS is consulted.
  * </p>
  * <p>
  * This interface is not intended to be implemented by clients.
  * </p>
  *
  * @see org.blueberry.ui.IWorkbench#getEditorRegistry()
  */
 struct BERRY_UI_QT IEditorRegistry {
 
     /**
      * The property identifier for the contents of this registry.
      */
     static const int PROP_CONTENTS; // = 0x01;
 
     /**
      * The identifier for the system external editor descriptor. This descriptor
      * is always present in the registry on all platforms.
      * Use {@link #FindEditor} to access the editor descriptor for this identifier.
      *
      * @since 3.0
      */
     static const QString SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor";
 
     /**
      * The identifier for the system in-place editor descriptor. This descriptor
      * is only present in the registry on platforms that support in-place editing
      * (for example Win32). Use {@link #FindEditor} to access the editor
      * descriptor for this identifier.
      *
      * @since 3.0
      */
     static const QString SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor";
 
     /*
      * Adds a listener for changes to properties of this registry.
      * Has no effect if an identical listener is already registered.
      * <p>
      * The properties ids are as follows:
      * <ul>
      *   <li><code>PROP_CONTENTS</code>: Triggered when the file editor mappings in
      *       the editor registry change.</li>
      * </ul>
      * </p>
      *
      * @param listener a property listener
      */
     // virtual void AddPropertyListener(IPropertyListener listener) = 0;
 
     virtual ~IEditorRegistry();
 
     /**
      * Finds and returns the descriptor of the editor with the given editor id.
      *
      * @param editorId the editor id
      * @return the editor descriptor with the given id, or <code>null</code> if not
      *   found
      */
     virtual IEditorDescriptor::Pointer FindEditor(const QString& editorId) = 0;
 
     /**
      * Returns the default editor. The default editor always exist.
      *
      * @return the descriptor of the default editor
      * @deprecated The system external editor is the default editor.
      * Use <code>findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)</code>
      * instead.
      */
     virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
 
     /**
    * Returns the default editor for a given file name. This method assumes an
    * unknown content type for the given file.
    * <p>
    * The default editor is determined by taking the file extension for the
    * file and obtaining the default editor for that extension.
    * </p>
    *
    * @param fileName
    *            the file name in the system
    * @return the descriptor of the default editor, or <code>null</code> if
    *         not found
    */
     virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
 
     /*
      * Returns the default editor for a given file name and with the given content type.
      * <p>
      * The default editor is determined by taking the file extension for the
      * file and obtaining the default editor for that extension.
      * </p>
      *
      * @param fileName the file name in the system
      * @param contentType the content type or <code>null</code> for the unknown content type
      * @return the descriptor of the default editor, or <code>null</code> if not
      *   found
      * @since 3.1
      */
     //virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
 
   /**
    * Returns the list of file editors registered to work against the file with
    * the given file name. This method assumes an unknown content type for the
    * given file.
    * <p>
    * Note: Use <code>getDefaultEditor(String)</code> if you only the need
    * the default editor rather than all candidate editors.
    * </p>
    *
    * @param fileName
    *            the file name in the system
    * @return a list of editor descriptors
    */
   virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName) = 0;
 
   /*
    * Returns the list of file editors registered to work against the file with
    * the given file name and with the given content type.
    * <p>
    * Note: Use <code>getDefaultEditor(String)</code> if you only the need
    * the default editor rather than all candidate editors.
    * </p>
    *
    * @param fileName
    *            the file name in the system
    * @param contentType
    *            the content type or <code>null</code> for the unknown
    *            content type
    * @return a list of editor descriptors
    * @since 3.1
    */
     //virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) = 0;
 
     /**
      * Returns a list of mappings from file type to editor.  The resulting list
      * is sorted in ascending order by file extension.
      * <p>
      * Each mapping defines an extension and the set of editors that are
      * available for that type. The set of editors includes those registered
      * via plug-ins and those explicitly associated with a type by the user
      * in the workbench preference pages.
      * </p>
      *
      * @return a list of mappings sorted alphabetically by extension
      */
     virtual QList<IFileEditorMapping::Pointer> GetFileEditorMappings() = 0;
 
   /*
    * Returns the image descriptor associated with a given file. This image is
    * usually displayed next to the given file. This method assumes an unknown
    * content type for the given file.
    * <p>
    * The image is determined by taking the file extension of the file and
    * obtaining the image for the default editor associated with that
    * extension. A default image is returned if no default editor is available.
    * </p>
    *
    * @param filename
    *            the file name in the system
    * @return the descriptor of the image to display next to the file
    */
    // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0;
 
   /*
    * Returns the image descriptor associated with a given file. This image is
    * usually displayed next to the given file.
    * <p>
    * The image is determined by taking the file extension of the file and
    * obtaining the image for the default editor associated with that
    * extension. A default image is returned if no default editor is available.
    * </p>
    *
    * @param filename
    *            the file name in the system
    * @param contentType
    *            the content type of the file or <code>null</code> for the
    *            unknown content type
    * @return the descriptor of the image to display next to the file
    * @since 3.1
    */
-   // virtual ImageDescriptor* GetImageDescriptor(const std::tring& filename, IContentType contentType) = 0;
+   // virtual ImageDescriptor* GetImageDescriptor(const std::string& filename, IContentType contentType) = 0;
 
     /*
      * Removes the given property listener from this registry.
      * Has no affect if an identical listener is not registered.
      *
      * @param listener a property listener
      */
    // virtual void RemovePropertyListener(IPropertyListener listener) = 0;
 
     /**
      * Sets the default editor id for the files that match that
      * specified file name or extension. The specified editor must be
      * defined as an editor for that file name or extension.
      *
      * @param fileNameOrExtension the file name or extension pattern (e.g. "*.xml");
      * @param editorId the editor id or <code>null</code> for no default
      */
     virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
 
     /**
      * Returns whether there is an in-place editor that could handle a file
      * with the given name.
      *
      * @param filename the file name
      * @return <code>true</code> if an in-place editor is available, and
      * <code>false</code> otherwise
      * @since 3.0
      */
     virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
 
     /**
      * Returns whether the system has an editor that could handle a file
      * with the given name.
      *
      * @param filename the file name
      * @return <code>true</code> if an external editor available, and
      * <code>false</code> otherwise
      * @since 3.0
      */
     virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
 
     /*
      * Returns the image descriptor associated with the system editor that
      * would be used to edit this file externally.
      *
      * @param filename the file name
      * @return the descriptor of the external editor image, or <code>null</code>
      * if none
      * @since 3.0
      */
    // virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
 };
 
 }
 
 #endif /*MITKIEDITORREGISTRY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
index f04095c4df..5d9e33a7e4 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.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 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
+ * The workbench exposes its implementation of editor part sites via this
  * interface, which is not intended to be implemented or extended by clients.
  * </p>
  */
 struct BERRY_UI_QT IEditorSite : public virtual IWorkbenchPartSite {
 
   berryObjectMacro(berry::IEditorSite);
 
   ~IEditorSite() override;
 
     /**
      * Returns the action bar contributor for this editor.
      * <p>
-     * An action contributor is responsable for the creation of actions.
+     * An action contributor is responsible 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/berryIPersistableElement.h b/Plugins/org.blueberry.ui.qt/src/berryIPersistableElement.h
index 35989b56ab..368394fb91 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIPersistableElement.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIPersistableElement.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 BERRYIPERSISTABLEELEMENT_H
 #define BERRYIPERSISTABLEELEMENT_H
 
 #include <berryIPersistable.h>
 
 namespace berry {
 
 /**
  * Interface for asking an object to store its state in a memento.
  * <p>
  * This interface is typically included in interfaces where
- * persistance is required.
+ * persistence is required.
  * </p><p>
  * When the workbench is shutdown objects which implement this interface
  * will be persisted.  At this time the <code>GetFactoryId</code> method
  * is invoked to discover the id of the element factory that will be used
  * to re-create the object from a memento.  Then the <code>SaveState</code>
  * method is invoked to store the element data into a newly created memento.
  * The resulting mementos are collected up and written out to a single file.
  * </p>
  * <p>
  * During workbench startup these mementos are read from the file.  The
  * factory Id for each is retrieved and mapped to an <code>IElementFactory</code>
  * which has been registered in the element factory extension point.  If a
  * factory exists for the Id it will be engaged to re-create the original
  * object.
  * </p>
  *
  * @see IAdaptable
  * @see IMemento
  * @see IElementFactory
  */
 struct IPersistableElement : public IPersistable
 {
     /**
      * Returns the id of the element factory which should be used to re-create this
      * object.
      * <p>
      * Factory ids are declared in extensions to the standard extension point
      * <code>"org.eclipse.ui.elementFactories"</code>.
      * </p>
      *
      * @return the element factory id
      * @see IElementFactory
      */
   virtual QString GetFactoryId() const = 0;
 };
 
 }
 
 #endif // BERRYIPERSISTABLEELEMENT_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h b/Plugins/org.blueberry.ui.qt/src/berryIStructuredSelection.h
index 726dfa4325..4395446aab 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);
 
   /**
    * 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
+   * a linker error in dependent libraries. 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/berryIViewSite.h b/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h
index 70f052e120..ed4a144795 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIViewSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIViewSite.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 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,
+ * The workbench exposes its implementation of view part sites via this interface,
  * which is not intended to be implemented or extended by clients.
  * </p>
  */
 struct BERRY_UI_QT IViewSite : public virtual IWorkbenchPartSite
 {
 
   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 905f58a87f..2d9321e54b 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIWorkbench.h
@@ -1,421 +1,421 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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 <em>the</em> 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 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
  */
 struct BERRY_UI_QT IWorkbench : public IServiceLocator {
 
   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
+   * Returns the element factory with the given id. The caller 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/berryIWorkbenchPartReference.h b/Plugins/org.blueberry.ui.qt/src/berryIWorkbenchPartReference.h
index cc5c390f3b..d205ac78c2 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
+ * The IWorkbenchPart will not be instantiated 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);
 
   ~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/berryMenuUtil.h b/Plugins/org.blueberry.ui.qt/src/berryMenuUtil.h
index 12332c5974..ee61eb4867 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryMenuUtil.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryMenuUtil.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 BERRYMENUUTIL_H
 #define BERRYMENUUTIL_H
 
 #include <org_blueberry_ui_qt_Export.h>
 
 namespace berry {
 
 /**
  * Provides utilities and constants for use with the new menus API.
  *
  * @note This class is not intended to be subclassed by clients.
  * @note This class is not intended to be instantiated by clients.
  */
 class BERRY_UI_QT MenuUtil
 {
 
 public:
 
   /**
    *
    * Workbench Menu. On supported platforms, this menu is shown when no
    * workbench windows are active
    */
   static QString WORKBENCH_MENU; // = "menu:org.blueberry.ui.workbench.menu";
   /** Main Menu */
   static QString MAIN_MENU; // = "menu:org.blueberry.ui.main.menu";
   /** Main ToolBar */
   static QString MAIN_TOOLBAR; // = "toolbar:org.blueberry.ui.main.toolbar";
 
   /** -Any- Popup Menu */
   static QString ANY_POPUP; // = "popup:org.blueberry.ui.popup.any";
 
   /**
    * Valid query attribute. Usage <b>menu:menu.id?before=contribution.id</b>.
    */
   static QString QUERY_BEFORE; // = "before";
 
   /**
    * Valid query attribute. Usage <b>menu:menu.id?after=contribution.id</b>.
    */
   static QString QUERY_AFTER; // = "after";
 
   /**
    * Valid query attribute. Usage <b>menu:menu.id?endof=contribution.id</b>.
    * <p>
    * This menu contribution will be placed at the end of the group defined by
    * <b>contribution.id</b> (usually right in front of the next group marker
    * or separator). Further contribution processing can still place other
    * contributions after this one.
    * </p>
    */
   static QString QUERY_ENDOF; // = "endof";
 
   /**
    * Contributions of targets to this location will be included with the show
    * in menu.
    */
   static QString SHOW_IN_MENU_ID; // = "popup:org.blueberry.ui.menus.showInMenu";
 
   /**
    * @param id
    *            The menu's id
    * @return The locator URI for a menu with the given id
    */
   static QString MenuUri(const QString& id);
 
   /**
    * @param id
    *            The id of the menu
    * @param location
    *            The relative location specifier
    * @param refId
    *            The id of the menu element to be relative to
    * @return A location URI formatted with the given parameters
    */
   static QString MenuAddition(const QString& id, const QString& location,
                               const QString& refId);
 
   /**
    * Convenience method to create a standard menu addition The resulting
    * string has the format: "menu:[id]?after=additions"
    *
    * @param id
    *            The id of the root element to contribute to
    * @return The formatted string
    */
   static QString MenuAddition(const QString& id);
 
   /**
    * @param id
    *            The toolbar's id
-   * @return The lcoation URI for a toolbar with the given id
+   * @return The location URI for a toolbar with the given id
    */
   static QString ToolbarUri(const QString& id);
 
   /**
    * @param id
    *            The id of the toolbar
    * @param location
    *            The relative location specifier
    * @param refId
    *            The id of the toolbar element to be relative to
    * @return A location URI formatted with the given parameters
    */
   static QString ToolbarAddition(const QString& id, const QString& location,
                                  const QString& refId);
 
   /**
    * Convenience method to create a standard toolbar addition The resulting
    * string has the format: "toolbar:[id]?after=additions"
    *
    * @param id
    *            The id of the root element to contribute to
    * @return The formatted string
    */
   static QString ToolbarAddition(const QString& id);
 };
 
 }
 
 #endif // BERRYMENUUTIL_H
diff --git a/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h b/Plugins/org.blueberry.ui.qt/src/berryPropertyChangeEvent.h
index 740bb995cc..e54c0d7a3b 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);
 
 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
+     * The object on which the property change occurred
      */
     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/berrySameShellProvider.h b/Plugins/org.blueberry.ui.qt/src/berrySameShellProvider.h
index e94e1595cd..c14ad3970b 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);
 
   /**
    * 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
+   *        or null if GetShell() should always 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/berryWindow.h b/Plugins/org.blueberry.ui.qt/src/berryWindow.h
index beab88ed1a..56ea246b1c 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryWindow.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryWindow.h
@@ -1,675 +1,675 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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);
 
   /**
    * 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);
 
     /**
      * Handle the exception.
      *
      * @param t
-     *            The exception that occured.
+     *            The exception that occurred.
      */
     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;
 
   /**
    * 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;
 
   /**
    * 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);
 
 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
    */
   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);
 
   /**
    * 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
+   * It is common practice 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.h b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
index 69cf519f19..2427402bc7 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryWorkbenchPart.h
@@ -1,241 +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.
 
 ============================================================================*/
 
 #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
  */
 class BERRY_UI_QT WorkbenchPart : public QObject,
     public virtual IWorkbenchPart, public IExecutableExtension
 {
   Q_OBJECT
   Q_INTERFACES(berry::IExecutableExtension);
 
 public:
   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;
   }
 
   /**
    * Sets the part site.
    *
    * 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.
+   * It is considered bad practice 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.
+   * It is considered bad practice 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/handlers/berryHandlerUtil.h b/Plugins/org.blueberry.ui.qt/src/handlers/berryHandlerUtil.h
index d526f0ac1f..78e2e375d6 100644
--- a/Plugins/org.blueberry.ui.qt/src/handlers/berryHandlerUtil.h
+++ b/Plugins/org.blueberry.ui.qt/src/handlers/berryHandlerUtil.h
@@ -1,382 +1,382 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYHANDLERUTIL_H_
 #define BERRYHANDLERUTIL_H_
 
 #include <berryExecutionEvent.h>
 #include <berryObjectList.h>
 #include <berryObjectString.h>
 
 #include <org_blueberry_ui_qt_Export.h>
 #include "berryIWorkbenchPart.h"
 #include "berryIWorkbenchPartSite.h"
 #include "berryISelection.h"
 #include "berryIWorkbenchWindow.h"
 
 #include "berryISources.h"
 
 namespace berry {
 
 /**
  * \ingroup org_blueberry_ui_qt
  *
  * Some common utilities for working with handlers in Platform UI.
  * <p>
  * <b>Note</b>: this class should not be instantiated or extended by clients.
  * </p>
  *
  * @since 3.3
  */
 class BERRY_UI_QT HandlerUtil {
 
 private:
 
   static void NoVariableFound(const ExecutionEvent::ConstPointer& event, const QString& name);
 
   static void IncorrectTypeFound(const ExecutionEvent::ConstPointer& event, const QString& name,
                                  const QString& expectedType, const QString& wrongType);
 
 
 public:
 
   typedef ObjectList<ObjectString::Pointer> StringVectorType;
 
   /**
    * Extract the variable.
    *
    * @param event
    *            The execution event that contains the application context
    * @param name
    *            The variable name to extract.
    * @return The object from the application context, or <code>null</code>
    *         if it could not be found.
    */
   static Object::ConstPointer GetVariable(const ExecutionEvent::ConstPointer& event, const QString& name);
 
   /**
    * Extract the variable.
    *
    * @param event
    *            The execution event that contains the application context
    * @param name
    *            The variable name to extract.
    * @return The object from the application context. Will not return
    *         <code>null</code>.
    * @throws ExecutionException
    *             if the variable is not found.
    */
   static Object::ConstPointer GetVariableChecked(const ExecutionEvent::ConstPointer& event, const QString& name);
 
   /**
    * Extract the variable.
    *
    * @param context
    *            The IEvaluationContext or <code>null</code>
    * @param name
    *            The variable name to extract.
    * @return The object from the application context, or <code>null</code>
    *         if it could not be found.
    */
   static Object::ConstPointer GetVariable(Object::Pointer context, const QString& name);
 
   /**
    * Return the active contexts.
    *
    * @param event
    *            The execution event that contains the application context
    * @return a collection of String contextIds, or <code>null</code>.
    */
   static StringVectorType::ConstPointer GetActiveContexts(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active contexts.
    *
    * @param event
    *            The execution event that contains the application context
    * @return a collection of String contextIds. Will not return
    *         <code>null</code>.
    * @throws ExecutionException
    *             If the context variable is not found.
    */
   static StringVectorType::ConstPointer GetActiveContextsChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
      * Return the active workbench window.
      *
      * @param event
      *            The execution event that contains the application context
      * @return the active workbench window, or <code>null</code>.
      */
    static IWorkbenchWindow::Pointer GetActiveWorkbenchWindow(const ExecutionEvent::ConstPointer& event);
 
     /**
      * Return the active workbench window.
      *
      * @param event
      *            The execution event that contains the application context
      * @return the active workbench window. Will not return <code>null</code>.
      * @throws ExecutionException
      *             If the active workbench window variable is not found.
      */
     static IWorkbenchWindow::Pointer GetActiveWorkbenchWindowChecked(
         const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the part id of the active editor.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the part id of the active editor, or <code>null</code>.
    */
   static ObjectString::ConstPointer GetActiveEditorId(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the part id of the active editor.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the part id of the active editor. Will not return
    *         <code>null</code>.
    * @throws ExecutionException
    *             If the active editor id variable is not found.
    */
   static ObjectString::ConstPointer GetActiveEditorIdChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active part.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active part, or <code>null</code>.
    */
   static IWorkbenchPart::Pointer GetActivePart(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active part.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active part. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active part variable is not found.
    */
   static IWorkbenchPart::Pointer GetActivePartChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the part id of the active part.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the part id of the active part, or <code>null</code>.
    */
   static ObjectString::ConstPointer GetActivePartId(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the part id of the active part.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the part id of the active part. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active part id variable is not found.
    */
   static ObjectString::ConstPointer GetActivePartIdChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active part site.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active part site, or <code>null</code>.
    */
   static IWorkbenchPartSite::Pointer GetActiveSite(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active part site.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active part site. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active part site variable is not found.
    */
   static IWorkbenchPartSite::Pointer GetActiveSiteChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the current selection.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the current selection, or <code>null</code>.
    */
   static ISelection::ConstPointer GetCurrentSelection(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the current selection.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the current selection. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the current selection variable is not found.
    */
   static ISelection::ConstPointer GetCurrentSelectionChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the menu IDs that were applied to the registered context menu.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the menu IDs, or <code>null</code>.
    */
   static StringVectorType::ConstPointer GetActiveMenus(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the menu IDs that were applied to the registered context menu.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the menu IDs. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active menus variable is not found.
    */
   static StringVectorType::ConstPointer GetActiveMenusChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active menu selection. The active menu is a registered context
    * menu.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active menu selection, or <code>null</code>.
    */
   static ISelection::ConstPointer GetActiveMenuSelection(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active menu selection. The active menu is a registered context
    * menu.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active menu selection. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active menu selection variable is not found.
    */
   static ISelection::ConstPointer GetActiveMenuSelectionChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active menu editor input, if available. The active menu is a
    * registered context menu.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active menu editor, or <code>null</code>.
    */
   static ISelection::ConstPointer GetActiveMenuEditorInput(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the active menu editor input. The active menu is a registered
    * context menu. Some context menus do not include the editor input which
    * will throw an exception.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the active menu editor input. Will not return <code>null</code>.
    * @throws ExecutionException
    *             If the active menu editor input variable is not found.
    */
   static ISelection::ConstPointer GetActiveMenuEditorInputChecked(
       const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the ShowInContext selection.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the show in selection, or <code>null</code>.
    */
   static ISelection::ConstPointer GetShowInSelection(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the ShowInContext selection. Will not return <code>null</code>.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the show in selection, or <code>null</code>.
    * @throws ExecutionException
    *             If the show in selection variable is not found.
    */
   static ISelection::ConstPointer GetShowInSelectionChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the ShowInContext input.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the show in input, or <code>null</code>.
    */
   static Object::ConstPointer GetShowInInput(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Return the ShowInContext input. Will not return <code>null</code>.
    *
    * @param event
    *            The execution event that contains the application context
    * @return the show in input, or <code>null</code>.
    * @throws ExecutionException
    *             If the show in input variable is not found.
    */
   static Object::ConstPointer GetShowInInputChecked(const ExecutionEvent::ConstPointer& event);
 
   /**
    * Toggles the command's state.
    *
    * @param command The command whose state needs to be toggled
    * @return the original value before toggling
    *
    * @throws ExecutionException
    * When the command doesn't contain the toggle state or when the state doesn't contain a boolean value
    */
   static bool ToggleCommandState(const SmartPointer<Command>& command);
 
   /**
    * Checks whether the radio state of the command is same as the radio state
    * parameter's value
    *
    * @param event
    *            The execution event that contains the application context
-   * @return <code>true</code> whe the values are same, <code>false</code>
+   * @return <code>true</code> when the values are same, <code>false</code>
    *         otherwise
    *
    * @throws ExecutionException
    *             When the command doesn't have the radio state or the event
    *             doesn't have the radio state parameter
    */
   static bool MatchesRadioState(const SmartPointer<ExecutionEvent>& event);
 
   /**
    * Updates the radio state of the command to the given value
    *
    * @param command
    *            the command whose state should be updated
    * @param newState
    *            the new state
    *
    * @throws ExecutionException
    *             When the command doesn't have a radio state
    */
   static void UpdateRadioState(const SmartPointer<Command>& command, const QString& newState);
 };
 
 }
 #endif /*BERRYHANDLERUTIL_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandParameter.h
index 0ff245e569..84bae63608 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);
 
 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.
+   *            parameter 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/berryCommandService.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp
index f37b522b35..889118ab0a 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryCommandService.cpp
@@ -1,313 +1,313 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryCommandService.h"
 
 #include <berryCommand.h>
 #include <berryCommandManager.h>
 #include <berryCommandCategory.h>
 #include <berryParameterizedCommand.h>
 #include <berryUIElement.h>
 
 #include "berryPersistentState.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryElementReference.h"
 
 #include <berryIHandler.h>
 #include <berryIElementUpdater.h>
 #include <berryIElementReference.h>
 #include <berryISafeRunnable.h>
 #include <berrySafeRunner.h>
 #include <berryObjectString.h>
 
 #include <QStringList>
 
 namespace berry {
 
 const std::string CommandService::PREFERENCE_KEY_PREFIX = "org.blueberry.ui.commands/state";
 
 std::string CommandService::CreatePreferenceKey(const SmartPointer<Command>& command,
                                                 const QString& stateId)
 {
   return PREFERENCE_KEY_PREFIX + '/' + command->GetId().toStdString() + '/' + stateId.toStdString();
 }
 
 CommandService::CommandService( CommandManager* commandManager)
   : commandManager(commandManager)
   , commandPersistence(this)
 {
   if (commandManager == nullptr)
   {
     throw std::invalid_argument("Cannot create a command service with a null manager");
   }
 }
 
 CommandService::~CommandService()
 {
   this->Dispose();
 }
 
 void CommandService::AddExecutionListener(IExecutionListener* listener)
 {
   commandManager->AddExecutionListener(listener);
 }
 
 void CommandService::DefineUncategorizedCategory(const QString& name,
                                  const QString& description)
 {
   commandManager->DefineUncategorizedCategory(name, description);
 }
 
 SmartPointer<ParameterizedCommand> CommandService::Deserialize(const QString& serializedParameterizedCommand) const
 {
   return commandManager->Deserialize(serializedParameterizedCommand);
 }
 
 void CommandService::Dispose()
 {
   /*
-   * All state on all commands neeeds to be disposed. This is so that the
+   * All state on all commands needs to be disposed. This is so that the
    * state has a chance to persist any changes.
    */
   const QList<Command::Pointer> commands = commandManager->GetAllCommands();
   foreach (const Command::Pointer& command, commands)
   {
     const QList<QString> stateIds = command->GetStateIds();
     foreach(const QString& stateId, stateIds)
     {
       const State::Pointer state = command->GetState(stateId);
       if (PersistentState::Pointer persistentState = state.Cast<PersistentState>())
       {
         if (persistentState->ShouldPersist())
         {
           persistentState->Save(WorkbenchPlugin::GetDefault()->GetPreferences(),
                                 CreatePreferenceKey(command, stateId));
         }
       }
     }
   }
   commandCallbacks.clear();
 }
 
 SmartPointer<CommandCategory> CommandService::GetCategory(const QString& categoryId) const
 {
   return commandManager->GetCategory(categoryId);
 }
 
 SmartPointer<Command> CommandService::GetCommand(const QString& commandId) const
 {
   return commandManager->GetCommand(commandId);
 }
 
 QList<SmartPointer<CommandCategory> > CommandService::GetDefinedCategories() const
 {
   return commandManager->GetDefinedCategories();
 }
 
 QStringList CommandService::GetDefinedCategoryIds() const
 {
   return commandManager->GetDefinedCategoryIds().toList();
 }
 
 QStringList CommandService::GetDefinedCommandIds() const
 {
   return commandManager->GetDefinedCommandIds().toList();
 }
 
 QList<SmartPointer<Command> > CommandService::GetDefinedCommands() const
 {
   return commandManager->GetDefinedCommands();
 }
 
 QStringList CommandService::GetDefinedParameterTypeIds() const
 {
   return commandManager->GetDefinedParameterTypeIds().toList();
 }
 
 QList<SmartPointer<ParameterType> > CommandService::GetDefinedParameterTypes() const
 {
   return commandManager->GetDefinedParameterTypes();
 }
 
 QString CommandService::GetHelpContextId(const SmartPointer<const Command>& command) const
 {
   return commandManager->GetHelpContextId(command);
 }
 
 QString CommandService::GetHelpContextId(const QString& commandId) const
 {
   Command::Pointer command = GetCommand(commandId);
   return commandManager->GetHelpContextId(command);
 }
 
 SmartPointer<ParameterType> CommandService::GetParameterType(const QString& parameterTypeId) const
 {
   return commandManager->GetParameterType(parameterTypeId);
 }
 
 void CommandService::ReadRegistry()
 {
   commandPersistence.Read();
 }
 
 void CommandService::RemoveExecutionListener(IExecutionListener* listener)
 {
   commandManager->RemoveExecutionListener(listener);
 }
 
 void CommandService::SetHelpContextId(const SmartPointer<IHandler>& handler,
                       const QString& helpContextId)
 {
   commandManager->SetHelpContextId(handler, helpContextId);
 }
 
 void CommandService::RefreshElements(const QString& commandId,
                      const QHash<QString, Object::Pointer>&  filter)
 {
   Command::Pointer cmd = GetCommand(commandId);
 
   if (!cmd->IsDefined() || !(cmd->GetHandler().Cast<IElementUpdater>()))
   {
     return;
   }
   IElementUpdater::Pointer updater = cmd->GetHandler().Cast<IElementUpdater>();
 
   if (commandCallbacks.isEmpty())
   {
     return;
   }
 
   if(!commandCallbacks.contains(commandId))
   {
     return;
   }
 
   foreach (IElementReference::Pointer callbackRef, commandCallbacks[commandId])
   {
     struct _SafeRunnable : public ISafeRunnable
     {
       IElementUpdater* updater;
       IElementReference* callbackRef;
 
       _SafeRunnable(IElementUpdater* updater, IElementReference* callbackRef)
         : updater(updater), callbackRef(callbackRef)
       {}
 
       void HandleException(const ctkException& exc) override
       {
         WorkbenchPlugin::Log(QString("Failed to update callback: ") +
                              callbackRef->GetCommandId() + exc.what());
       }
 
       void Run() override
       {
         updater->UpdateElement(callbackRef->GetElement().GetPointer(), callbackRef->GetParameters());
       }
     };
 
     QHash<QString,Object::Pointer> parms = callbackRef->GetParameters();
 
     ISafeRunnable::Pointer run(new _SafeRunnable(updater.GetPointer(), callbackRef.GetPointer()));
     if (filter.isEmpty())
     {
       SafeRunner::Run(run);
     }
     else
     {
       bool match = true;
       QHashIterator<QString, Object::Pointer> i(filter);
       while (i.hasNext())
       {
         i.next();
         Object::Pointer value = parms[i.key()];
         if (i.value() != value)
         {
           match = false;
           break;
         }
       }
       if (match)
       {
         SafeRunner::Run(run);
       }
     }
   }
 }
 
 SmartPointer<IElementReference> CommandService::RegisterElementForCommand(
     const SmartPointer<ParameterizedCommand>& command,
     const SmartPointer<UIElement>& element)
 {
   if (!command->GetCommand()->IsDefined())
   {
     throw NotDefinedException(
         "Cannot define a callback for undefined command "
             + command->GetCommand()->GetId());
   }
   if (element.IsNull())
   {
     throw NotDefinedException("No callback defined for command "
         + command->GetCommand()->GetId());
   }
 
   QHash<QString, QString> paramMap = command->GetParameterMap();
   QHash<QString, Object::Pointer> parms;
   for (QHash<QString, QString>::const_iterator i = paramMap.begin();
        i != paramMap.end(); ++i)
   {
     Object::Pointer value(new ObjectString(i.value()));
     parms.insert(i.key(), value);
   }
   IElementReference::Pointer ref(new ElementReference(command->GetId(),
                                                       element, parms));
   RegisterElement(ref);
   return ref;
 }
 
 void CommandService::RegisterElement(const SmartPointer<IElementReference>& elementReference)
 {
   QList<IElementReference::Pointer>& parameterizedCommands = commandCallbacks[elementReference->GetCommandId()];
   parameterizedCommands.push_back(elementReference);
 
   // If the active handler wants to update the callback, it can do
   // so now
   Command::Pointer command = GetCommand(elementReference->GetCommandId());
   if (command->IsDefined())
   {
     if (IElementUpdater::Pointer updater = command->GetHandler().Cast<IElementUpdater>())
     {
       updater->UpdateElement(elementReference->GetElement().GetPointer(),
                              elementReference->GetParameters());
     }
   }
 }
 
 void CommandService::UnregisterElement(const SmartPointer<IElementReference>& elementReference)
 {
   if (commandCallbacks.contains(elementReference->GetCommandId()))
   {
     QList<IElementReference::Pointer>& parameterizedCommands = commandCallbacks[elementReference->GetCommandId()];
     parameterizedCommands.removeAll(elementReference);
     if (parameterizedCommands.isEmpty())
     {
       commandCallbacks.remove(elementReference->GetCommandId());
     }
   }
 }
 
 const CommandPersistence* CommandService::GetCommandPersistence() const
 {
   return &commandPersistence;
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryDragUtil.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryDragUtil.cpp
index 3cac5f379e..039cdb2950 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryDragUtil.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryDragUtil.cpp
@@ -1,289 +1,289 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "tweaklets/berryGuiWidgetsTweaklet.h"
 
 #include "berryDragUtil.h"
 
 #include "berryGeometry.h"
 #include "berryQtTracker.h"
 
 namespace berry
 {
 
 const QString DragUtil::DROP_TARGET_ID =
     "org.blueberry.ui.internal.dropTarget";
 
 TestDropLocation::Pointer DragUtil::forcedDropTarget(nullptr);
 
 QList<IDragOverListener*> DragUtil::defaultTargets = QList<IDragOverListener*>();
 
 
 DragUtil::TargetListType::Pointer DragUtil::GetTargetList(QWidget* control)
 {
   Object::Pointer data = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetData(
       control, DROP_TARGET_ID);
   TargetListType::Pointer list = data.Cast<TargetListType> ();
   return list;
 }
 
 IDropTarget::Pointer DragUtil::GetDropTarget(const QList<IDragOverListener*>& toSearch,
                                              QWidget* mostSpecificControl,
                                              Object::Pointer draggedObject,
                                              const QPoint& position,
                                              const QRect& dragRectangle)
 {
 
   for (QList<IDragOverListener*>::const_iterator iter =
       toSearch.begin(); iter != toSearch.end(); ++iter)
   {
     IDragOverListener* next = *iter;
 
     IDropTarget::Pointer dropTarget = next->Drag(mostSpecificControl,
         draggedObject, position, dragRectangle);
 
     if (dropTarget != 0)
     {
       return dropTarget;
     }
   }
 
   return IDropTarget::Pointer(nullptr);
 }
 
 void DragUtil::AddDragTarget(QWidget* control, IDragOverListener* target)
 {
   if (control == nullptr)
   {
     defaultTargets.push_back(target);
   }
   else
   {
     TargetListType::Pointer targetList = GetTargetList(control);
 
     if (targetList == 0)
     {
       targetList = new TargetListType();
       Tweaklets::Get(GuiWidgetsTweaklet::KEY)->SetData(control, DROP_TARGET_ID,
           targetList);
     }
     targetList->push_back(target);
   }
 }
 
 void DragUtil::RemoveDragTarget(QWidget* control, IDragOverListener* target)
 {
   if (control == nullptr)
   {
     defaultTargets.removeAll(target);
   }
   else
   {
     TargetListType::Pointer targetList = GetTargetList(control);
     if (targetList != 0)
     {
       targetList->removeAll(target);
       if (targetList->empty())
       {
         Tweaklets::Get(GuiWidgetsTweaklet::KEY)->SetData(control,
             DROP_TARGET_ID, Object::Pointer(nullptr));
       }
     }
   }
 }
 
 QRect DragUtil::GetDisplayBounds(QWidget* boundsControl)
 {
   QWidget* parent = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetParent(
       boundsControl);
   if (parent == nullptr)
   {
     return Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetBounds(boundsControl);
   }
 
   QRect rect = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetBounds(
       boundsControl);
   return Geometry::ToDisplay(parent, rect);
 }
 
 bool DragUtil::PerformDrag(Object::Pointer draggedItem,
     const QRect& sourceBounds, const QPoint& initialLocation,
     bool allowSnapping)
 {
 
   IDropTarget::Pointer target = DragToTarget(draggedItem, sourceBounds,
       initialLocation, allowSnapping);
 
   if (target == 0)
   {
     return false;
   }
 
   target->Drop();
   target->DragFinished(true);
 
   return true;
 }
 
 void DragUtil::ForceDropLocation(TestDropLocation::Pointer forcedLocation)
 {
   forcedDropTarget = forcedLocation;
 }
 
 IDropTarget::Pointer DragUtil::DragToTarget(Object::Pointer draggedItem,
     const QRect& sourceBounds, const QPoint& initialLocation,
     bool allowSnapping)
 {
   //final Display display = Display.getCurrent();
 
   // Testing...immediately 'drop' onto the test target
   if (forcedDropTarget != 0)
   {
     QPoint location = forcedDropTarget->GetLocation();
 
     QWidget* currentControl =
         Tweaklets::Get(GuiWidgetsTweaklet::KEY)->FindControl(
             forcedDropTarget->GetShells(), location);
     return GetDropTarget(currentControl, draggedItem, location, sourceBounds);
   }
 
   // Create a tracker.  This is just an XOR rect on the screen.
   // As it moves we notify the drag listeners.
   QtTracker tracker;
   //tracker.setStippled(true);
 
   QtTrackerMoveListener trackerListener(draggedItem, sourceBounds,
                                         initialLocation, allowSnapping);
 
   trackerListener.connect(&tracker, SIGNAL(Moved(QtTracker*,QPoint)), SLOT(Moved(QtTracker*,QPoint)));
 
   // Setup...when the drag starts we might already be over a valid target, check this...
   // If there is a 'global' target then skip the check
   IDropTarget::Pointer target;
   QWidget* startControl =
       Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetCursorControl();
 
   if (startControl != nullptr && allowSnapping)
   {
     target = GetDropTarget(startControl, draggedItem, initialLocation,
         sourceBounds);
   }
 
   // Set up an initial tracker rectangle
   QRect startRect = sourceBounds;
   if (target != 0)
   {
     QRect rect = target->GetSnapRectangle();
 
     if (rect.width() != 0 && rect.height() != 0)
     {
       startRect = rect;
     }
 
     tracker.SetCursor(target->GetCursor());
   }
 
   if (startRect.width() != 0 && startRect.height() != 0)
   {
     tracker.SetRectangle(startRect);
   }
 
-  // Tracking Loop...tracking is preformed on the 'SWT.Move' listener registered
+  // Tracking Loop...tracking is performed on the 'SWT.Move' listener registered
   // against the tracker.
 
   //  // HACK:
   //  // Some control needs to capture the mouse during the drag or other
   //  // controls will interfere with the cursor
   //  Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
   //  if (shell != null)
   //  {
   //    shell.setCapture(true);
   //  }
 
   // Run tracker until mouse up occurs or escape key pressed.
   bool trackingOk = tracker.Open();
 
   //  // HACK:
   //  // Release the mouse now
   //  if (shell != null)
   //  {
   //    shell.setCapture(false);
   //  }
 
   // Done tracking...
 
   // Get the current drop target
   IDropTarget::Pointer dropTarget;
   QPoint finalLocation =
       Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetCursorLocation();
   QWidget* targetControl =
       Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetCursorControl();
   dropTarget = GetDropTarget(targetControl, draggedItem, finalLocation,
       tracker.GetRectangle());
 
   // Cleanup...
   //delete tracker;
 
   // if we're going to perform a 'drop' then delay the issuing of the 'finished'
   // callback until after it's done...
   if (trackingOk)
   {
     return dropTarget;
   }
   else if (dropTarget != 0)
   {
     // If the target can handle a 'finished' notification then send one
     dropTarget->DragFinished(false);
   }
 
   return IDropTarget::Pointer(nullptr);
 }
 
 IDropTarget::Pointer DragUtil::GetDropTarget(QWidget* toSearch,
     Object::Pointer draggedObject, const QPoint& position,
     const QRect& dragRectangle)
 {
   // Search for a listener by walking the control's parent hierarchy
   for (QWidget* current = toSearch; current != nullptr; current = Tweaklets::Get(
       GuiWidgetsTweaklet::KEY)->GetParent(current))
   {
     TargetListType::Pointer targetList = GetTargetList(current);
     QList<IDragOverListener*> targets;
     if (targetList != 0)
       targets = *targetList;
 
     IDropTarget::Pointer dropTarget = GetDropTarget(targets, toSearch,
         draggedObject, position, dragRectangle);
 
     if (dropTarget != 0)
     {
       return dropTarget;
     }
 
     //          // Don't look to parent shells for drop targets
     //          if (current instanceof Shell) {
     //              break;
     //          }
   }
 
   // No controls could handle this event -- check for default targets
   return GetDropTarget(defaultTargets, toSearch, draggedObject, position,
       dragRectangle);
 }
 
 //QPoint DragUtil::GetEventLoc(GuiTk::ControlEvent::Pointer event)
 //{
 //  Control ctrl = (Control) event.widget;
 //  return ctrl.toDisplay(new QPoint(event.x, event.y));
 //}
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorDescriptor.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorDescriptor.h
index 53a6158445..f4649e1df2 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorDescriptor.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorDescriptor.h
@@ -1,388 +1,388 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYEDITORDESCRIPTOR_H_
 #define BERRYEDITORDESCRIPTOR_H_
 
 #include "berryIEditorDescriptor.h"
 #include "berryIMemento.h"
 
 #include <berryIConfigurationElement.h>
 
 #include <QIcon>
 
 namespace berry
 {
 
 struct IEditorPart;
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * @see IEditorDescriptor
  */
 class BERRY_UI_QT EditorDescriptor : public IEditorDescriptor
 { //, Serializable, IPluginContribution {
 
 public:
   berryObjectMacro(EditorDescriptor);
 
   // @issue the following constants need not be public; see bug 47600
   /**
    * Open internal constant.  Value <code>0x01</code>.
    */
   static const int OPEN_INTERNAL; // = 0x01;
 
   /**
    * Open in place constant.  Value <code>0x02</code>.
    */
   static const int OPEN_INPLACE; // = 0x02;
 
   /**
    * Open external constant.  Value <code>0x04</code>.
    */
   static const int OPEN_EXTERNAL; // = 0x04;
 
 
 private:
 
   QString editorName;
 
   QString imageFilename;
 
   mutable QIcon imageDesc;
 
   mutable bool testImage;
 
   QString className;
 
   QString launcherName;
 
   QString fileName;
 
   QString id;
 
   bool matchingStrategyChecked;
   IEditorMatchingStrategy::Pointer matchingStrategy;
 
   //Program program;
 
   //The id of the plugin which contributed this editor, null for external editors
   QString pluginIdentifier;
 
   int openMode;
 
   IConfigurationElement::Pointer configurationElement;
 
   /**
    * Create a new instance of an editor descriptor. Limited
    * to internal framework calls.
    * @param element
    * @param id2
    */
   /* package */
 public: EditorDescriptor(const QString& id2, IConfigurationElement::Pointer element);
 
   /**
    * Create a new instance of an editor descriptor. Limited
    * to internal framework calls.
    */
   /* package */
 public: EditorDescriptor();
 
   /**
    * Creates a descriptor for an external program.
    *
    * @param filename the external editor full path and filename
    * @return the editor descriptor
    */
   //public: static EditorDescriptor::Pointer CreateForProgram(const QString& filename) {
   //        if (filename == null) {
   //            throw new IllegalArgumentException();
   //        }
   //        EditorDescriptor editor = new EditorDescriptor();
   //
   //        editor.setFileName(filename);
   //        editor.setID(filename);
   //        editor.setOpenMode(OPEN_EXTERNAL);
   //
   //        //Isolate the program name (no directory or extension)
   //        int start = filename.lastIndexOf(File.separator);
   //        String name;
   //        if (start != -1) {
   //            name = filename.substring(start + 1);
   //        } else {
   //            name = filename;
   //        }
   //        int end = name.lastIndexOf('.');
   //        if (end != -1) {
   //            name = name.substring(0, end);
   //        }
   //        editor.setName(name);
   //
   //        // get the program icon without storing it in the registry
   //        ImageDescriptor imageDescriptor = new ProgramImageDescriptor(filename,
   //                0);
   //        editor.setImageDescriptor(imageDescriptor);
   //
   //        return editor;
   //    }
 
   /**
    * Return the program called programName. Return null if it is not found.
    * @return org.blueberry.swt.program.Program
    */
   //private: static Program FindProgram(const QString& programName) {
   //
   //        Program[] programs = Program.getPrograms();
   //        for (int i = 0; i < programs.length; i++) {
   //            if (programs[i].getName().equals(programName)) {
   //        return programs[i];
   //      }
   //        }
   //
   //        return null;
   //    }
 
   /**
    * Create the editor action bar contributor for editors of this type.
    *
    * @return the action bar contributor, or <code>null</code>
    */
 //public: IEditorActionBarContributor::Pointer CreateActionBarContributor();
 
   /**
    * Return the editor class name.
    *
    * @return the class name
    */
 public: QString GetEditorClassName() const;
 
   /**
    * Return the configuration element used to define this editor, or <code>null</code>.
    *
    * @return the element or null
    */
 public: IConfigurationElement::Pointer GetConfigurationElement() const;
 
   /**
    * Create an editor part based on this descriptor.
    *
    * @return the editor part
    * @throws CoreException thrown if there is an issue creating the editor
    */
 public: SmartPointer<IEditorPart> CreateEditor();
 
   /**
    * Return the file name of the command to execute for this editor.
    *
    * @return the file name to execute
    */
 public: QString GetFileName() const;
 
   /**
    * Return the id for this editor.
    *
    * @return the id
    */
 public: QString GetId() const override;
 
   /**
    * Return the image descriptor describing this editor.
    *
    * @return the image descriptor
    */
 public: QIcon GetImageDescriptor() const override;
 
   /**
    * Verifies that the image descriptor generates an image.  If not, the
    * descriptor is replaced with the default image.
    *
    * @since 3.1
    */
 private: void VerifyImage() const;
 
   /**
    * The name of the image describing this editor.
    *
    * @return the image file name
    */
 public: QString GetImageFilename() const;
 
   /**
    * Return the user printable label for this editor.
    *
    * @return the label
    */
 public: QString GetLabel() const override;
 
   /**
    * Returns the class name of the launcher.
    *
    * @return the launcher class name
    */
 public: QString GetLauncher() const;
 
   /**
    * Return the contributing plugin id.
    *
    * @return the contributing plugin id
    */
 public: QString GetPluginID() const;
 
   /**
    * Get the program for the receiver if there is one.
    * @return Program
    */
   //public: Program GetProgram() {
   //        return this.program;
   //    }
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorDescriptor#isInternal
    */
 public: bool IsInternal() const override;
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorDescriptor#isOpenInPlace
    */
 public: bool IsOpenInPlace() const override;
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorDescriptor#isOpenExternal
    */
 public: bool IsOpenExternal() const override;
 
   /**
    * Load the object properties from a memento.
    *
    * @return <code>true</code> if the values are valid, <code>false</code> otherwise
    */
 protected: bool LoadValues(IMemento::Pointer memento);
 
   /**
    * Save the object values in a IMemento
    */
 protected: void SaveValues(IMemento::Pointer memento);
 
   /**
    * Return the open mode of this editor.
    *
    * @return the open mode of this editor
    * @since 3.1
    */
 private: int GetOpenMode() const;
 
   /**
    * Set the class name of an internal editor.
    */
   /* package */public: void SetClassName(const QString& newClassName);
 
   /**
    * Set the configuration element which contributed this editor.
    */
   /* package */public: void SetConfigurationElement(
       IConfigurationElement::Pointer newConfigurationElement);
 
   /**
    * Set the filename of an external editor.
    */
   /* package */public: void SetFileName(const QString& aFileName);
 
   /**
    * Set the id of the editor.
    * For internal editors this is the id as provided in the extension point
    * For external editors it is path and filename of the editor
    */
   /* package */public: void SetID(const QString& anID);
 
   /**
-   * The Image to use to repesent this editor
+   * The Image to use to represent this editor
    */
   /* package */
   //    public : void SetImageDescriptor(ImageDescriptor desc) {
   //        imageDesc = desc;
   //        testImage = true;
   //    }
 
   /**
    * The name of the image to use for this editor.
    */
   /* package */
   //    public: void SetImageFilename(const QString& aFileName) {
   //        imageFilename = aFileName;
   //    }
 
   /**
    * Sets the new launcher class name
    *
    * @param newLauncher the new launcher
    */
   /* package */public: void SetLauncher(const QString& newLauncher);
 
   /**
    * The label to show for this editor.
    */
   /* package */public: void SetName(const QString& newName);
 
   /**
    * Sets the open mode of this editor descriptor.
    *
    * @param mode the open mode
    *
    * @issue this method is public as a temporary fix for bug 47600
    */
 public: void SetOpenMode(int mode);
 
   /**
    * The id of the plugin which contributed this editor, null for external editors.
    */
   /* package */public: void SetPluginIdentifier(const QString& anID);
 
   /**
    * Set the receivers program.
    * @param newProgram
    */
   /* package */
   //    public: void SetProgram(Program newProgram) {
   //
   //        this.program = newProgram;
   //        if (editorName == null) {
   //      setName(newProgram.getName());
   //    }
   //    }
 
   /**
    * For debugging purposes only.
    */
 public: QString ToString() const override;
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.activities.support.IPluginContribution#getLocalId()
    */
 public: QString GetLocalId() const;
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.activities.support.IPluginContribution#getPluginId()
    */
 public: QString GetPluginId() const;
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorDescriptor#getEditorManagementPolicy()
    */
 public: IEditorMatchingStrategy::Pointer GetEditorMatchingStrategy() override;
 
 };
 
 }
 
 #endif /*BERRYEDITORDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorReference.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorReference.h
index 25cf8c269c..01052cfaf2 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorReference.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorReference.h
@@ -1,232 +1,232 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYEDITORREFERENCE_H_
 #define BERRYEDITORREFERENCE_H_
 
 #include "berryWorkbenchPartReference.h"
 #include "berryIEditorReference.h"
 #include "berryIEditorInput.h"
 #include "berryIMemento.h"
 #include "berryIWorkbenchPart.h"
 #include "berryIEditorPart.h"
 
 namespace berry
 {
 
 class EditorManager;
 class EditorDescriptor;
 class PartPane;
 struct IWorkbenchPage;
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  */
 class EditorReference : public WorkbenchPartReference, public IEditorReference
 {
 
 private:
   const EditorManager* manager;
 
 private:
   IMemento::Pointer editorMemento;
 
 private:
   IMemento::Pointer editorState;
 
   /**
    * Flag that lets us detect malfunctioning editors that don't fire PROP_INPUT events.
    * It is never needed for a correctly-functioning
    */
 private:
   bool expectingInputChange;
 
   /**
    * Flag that determines whether we've already reported that this editor is malfunctioning.
    * This prevents us from spamming the event log if we repeatedly detect the same error in
    * a particular editor. If we ever detect an editor is violating its public contract in
    * a way we can recover from (such as a missing property change event), we report the error
    * once and then silently ignore errors from the same editor.
    */
 private:
   bool reportedMalfunctioningEditor;
 
   /**
    * User-readable name of the editor's input
    */
   QString name;
 
   QString factoryId;
 
   IEditorInput::Pointer restoredInput;
 
   /**
    * @param manager
    *            The editor manager for this reference
    * @param input
    *            our input
    * @param desc
    *            the descriptor from the declaration
    * @param editorState
-   *            propogate state from another editor. Can be <code>null</code>.
+   *            propagate state from another editor. Can be <code>null</code>.
    */
 public:
 
   berryObjectMacro(EditorReference);
 
   EditorReference(EditorManager* manager, IEditorInput::Pointer input,
       SmartPointer<EditorDescriptor> desc, IMemento::Pointer editorState = IMemento::Pointer(nullptr));
 
   /**
    * Constructs a new editor reference for use by editors being restored from
    * a memento.
    */
   EditorReference(EditorManager* manager, IMemento::Pointer memento);
 
 public:
   SmartPointer<EditorDescriptor> GetDescriptor();
 
   /**
    * @param id the id
    * @return the editor descriptor
    */
 private:
   SmartPointer<EditorDescriptor> GetDescriptor(const QString& id);
 
   /**
    * Initializes the necessary editor listeners and handlers
    */
 private:
   void InitListenersAndHandlers();
 
 protected:
   SmartPointer<PartPane> CreatePane() override;
 
   /**
    * This method is called when there should be a change in the editor pin
    * status (added or removed) so that it will ask its presentable part
    * to fire a PROP_TITLE event in order for the presentation to request
    * the new icon for this editor
    */
 public:
   void PinStatusUpdated();
 
 public:
   QString GetFactoryId() override;
 
 protected:
   QString ComputePartName() const override;
 
 public:
   QString GetName() override;
 
 public:
   IEditorPart::Pointer GetEditor(bool restore) override;
 
 public:
   void SetName(const QString& name);
 
 public:
   IMemento::Pointer GetMemento();
 
 public:
   SmartPointer<IWorkbenchPage> GetPage() const override;
 
 public:
   IEditorInput::Pointer GetEditorInput() override;
 
 private:
   IEditorInput::Pointer GetRestoredInput();
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IWorkbenchPartReference#getTitleImage()
    * This method will append a pin to the icon of the editor
    * if the "automatically close editors" option in the
    * preferences is enabled and the editor has been pinned.
    */
   //public: ImageDescriptor computeImageDescriptor() {
   //        ImageDescriptor descriptor = super.computeImageDescriptor();
   //        if (!isPinned()) {
   //      return descriptor;
   //    }
   //
   //        // Check if the pinned preference is set
   //        IPreferenceStore prefStore = WorkbenchPlugin.getDefault()
   //                .getPreferenceStore();
   //        boolean bUsePin = prefStore
   //        .getBoolean(IPreferenceConstants.REUSE_EDITORS_BOOLEAN)
   //        || ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).alwaysShowPinAction();
   //
   //        if (!bUsePin) {
   //      return descriptor;
   //    }
   //
   //        ImageDescriptor pinDesc = this.manager.getEditorPinImageDesc();
   //        if (pinDesc == null) {
   //      return descriptor;
   //    }
   //
   //        return new OverlayIcon(descriptor, pinDesc, new Point(16, 16));
   //    }
 
 protected:
 
   /**
    * Wrapper for restoring the editor. First, this delegates to busyRestoreEditorHelper
    * to do the real work of restoring the view. If unable to restore the editor, this
    * method tries to substitute an error part and return success.
    *
    * @return the created part
    */
   IWorkbenchPart::Pointer CreatePart() override;
 
   using WorkbenchPartReference::PropertyChanged;
   void PropertyChanged(Object::Pointer source, int propId);
 
   /**
    * Attempts to set the input of the editor to the given input. Note that the input
    * can't always be changed for an editor. Editors that don't implement IReusableEditor
    * can't have their input changed once they've been materialized.
    *
    * @param input new input
    * @return true iff the input was actually changed
    */
 public:
   bool SetInput(IEditorInput::Pointer input);
 
   /**
    * Reports a recoverable malfunction in the system log. A recoverable malfunction would be
    * something like failure to fire an expected property change. Only the first malfunction is
    *
    * @param string
    */
 private:
   void ReportMalfunction(const QString& string);
 
 private:
   IEditorPart::Pointer CreatePartHelper();
 
   /**
    * Creates and returns an empty editor (<code>ErrorEditorPart</code>).
    *
    * @param descr the editor descriptor
    * @return the empty editor part or <code>null</code> in case of an exception
    */
 public:
   IEditorPart::Pointer GetEmptyEditor(SmartPointer<EditorDescriptor> descr);
 
 };
 
 } // namespace berry
 
 #endif /*BERRYEDITORREFERENCE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.cpp
index 0f994146b2..c4c35cbdda 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.cpp
@@ -1,1295 +1,1295 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryEditorRegistry.h"
 
 #include "berryWorkbenchPlugin.h"
 #include "berryEditorRegistryReader.h"
 #include "berryWorkbenchRegistryConstants.h"
 
 namespace berry
 {
 
 const QString EditorRegistry::EMPTY_EDITOR_ID =
     "org.blueberry.ui.internal.emptyEditorTab";
 
 QHash<QString, FileEditorMapping::Pointer>
     EditorRegistry::EditorMap::defaultMap;
 
 QHash<QString, FileEditorMapping::Pointer> EditorRegistry::EditorMap::map;
 
 EditorRegistry::RelatedRegistry::RelatedRegistry(EditorRegistry* reg) :
   editorRegistry(reg)
 {
 
 }
 
 QList<IEditorDescriptor::Pointer> EditorRegistry::RelatedRegistry::GetRelatedObjects(
     const QString& fileName)
 {
   IFileEditorMapping::Pointer mapping = editorRegistry->GetMappingFor(fileName);
   if (mapping.IsNull())
   {
     return QList<IEditorDescriptor::Pointer>();
   }
 
   return mapping->GetEditors();
 }
 
 EditorRegistry::EditorRegistry() :
   relatedRegistry(this)
 {
   this->InitialIdToEditorMap(mapIDtoEditor);
   this->InitializeFromStorage();
   //IExtensionTracker tracker = PlatformUI.getWorkbench().getExtensionTracker();
   //tracker.registerHandler(this,
   //    ExtensionTracker.createExtensionPointFilter(getExtensionPointFilter()));
 }
 
 void EditorRegistry::AddEditorFromPlugin(EditorDescriptor::Pointer editor,
     const QList<QString>& extensions,
     const QList<QString>& filenames,
     const QList<QString>&  /*contentTypeVector*/, bool bDefault)
 {
 
   //PlatformUI.getWorkbench().getExtensionTracker().registerObject(editor.getConfigurationElement().getDeclaringExtension(), editor, IExtensionTracker.REF_WEAK);
   // record it in our quick reference list
   sortedEditorsFromPlugins.push_back(editor);
 
   // add it to the table of mappings
   for (QList<QString>::const_iterator itr = extensions.begin(); itr
       != extensions.end(); ++itr)
   {
     QString fileExtension = *itr;
 
     if (!fileExtension.isEmpty())
     {
       FileEditorMapping::Pointer mapping = this->GetMappingFor("*." + fileExtension);
       if (mapping.IsNull())
       { // no mapping for that extension
         mapping = new FileEditorMapping(fileExtension);
         typeEditorMappings.PutDefault(this->MappingKeyFor(mapping), mapping);
       }
       mapping->AddEditor(editor);
       if (bDefault)
       {
         mapping->SetDefaultEditor(editor);
       }
     }
   }
 
   // add it to the table of mappings
   for (QList<QString>::const_iterator itr = filenames.begin(); itr
       != filenames.end(); ++itr)
   {
     QString filename = *itr;
 
     if (!filename.isEmpty())
     {
       FileEditorMapping::Pointer mapping = this->GetMappingFor(filename);
       if (mapping.IsNull())
       { // no mapping for that extension
         QString name;
         QString extension;
         int index = filename.indexOf('.');
         if (index == -1)
         {
           name = filename;
           extension = "";
         }
         else
         {
           name = filename.left(index);
           extension = filename.mid(index + 1);
         }
         mapping = new FileEditorMapping(name, extension);
         typeEditorMappings.PutDefault(this->MappingKeyFor(mapping), mapping);
       }
       mapping->AddEditor(editor);
       if (bDefault)
       {
         mapping->SetDefaultEditor(editor);
       }
     }
   }
 
   //  for (QList<QString>::const_iterator itr = contentTypeVector.begin();
   //         itr != contentTypeVector.end(); ++itr)
   //  {
   //    QString contentTypeId = *itr;
   //    if (!contentTypeId.empty())
   //    {
   //      IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
   //      if (contentType != null)
   //      {
   //        IEditorDescriptor [] editorArray = (IEditorDescriptor[]) contentTypeToEditorMappings.get(contentType);
   //        if (editorArray == null)
   //        {
   //          editorArray = new IEditorDescriptor[]
   //          { editor};
   //          contentTypeToEditorMappings.put(contentType, editorArray);
   //        }
   //        else
   //        {
   //          IEditorDescriptor [] newArray = new IEditorDescriptor[editorArray.length + 1];
   //          if (bDefault)
   //          { // default editors go to the front of the line
   //            newArray[0] = editor;
   //            System.arraycopy(editorArray, 0, newArray, 1, editorArray.length);
   //          }
   //          else
   //          {
   //            newArray[editorArray.length] = editor;
   //            System.arraycopy(editorArray, 0, newArray, 0, editorArray.length);
   //          }
   //          contentTypeToEditorMappings.put(contentType, newArray);
   //        }
   //      }
   //    }
   //  }
 
   // Update editor map.
   mapIDtoEditor[editor->GetId()] = editor;
 }
 
 void EditorRegistry::AddExternalEditorsToEditorMap()
 {
   // Add registered editors (may include external editors).
   QList<FileEditorMapping::Pointer> maps =
       typeEditorMappings.AllMappings();
   for (int i = 0; i < maps.size(); ++i)
   {
     FileEditorMapping::Pointer map = maps[i];
     QList<IEditorDescriptor::Pointer> descArray = map->GetEditors();
     for (QList<IEditorDescriptor::Pointer>::iterator itr =
         descArray.begin(); itr != descArray.end(); ++itr)
     {
       mapIDtoEditor[(*itr)->GetId()] = itr->Cast<EditorDescriptor> ();
     }
   }
 }
 
 IEditorDescriptor::Pointer EditorRegistry::FindEditor(const QString& id)
 {
   return mapIDtoEditor[id];
 }
 
 IEditorDescriptor::Pointer EditorRegistry::GetDefaultEditor()
 {
   // the default editor will always be the system external editor
   // this should never return null
   return this->FindEditor(IEditorRegistry::SYSTEM_EXTERNAL_EDITOR_ID);
 }
 
 IEditorDescriptor::Pointer EditorRegistry::GetDefaultEditor(
     const QString& fileName)
 {
   //return this->GetDefaultEditor(filename, guessAtContentType(filename));
   return this->GetEditorForContentType(fileName /*, contentType*/);
 }
 
 IEditorDescriptor::Pointer EditorRegistry::GetEditorForContentType(
     const QString& filename
 /*IContentType contentType*/)
 {
   IEditorDescriptor::Pointer desc;
   ;
   QList<IEditorDescriptor::Pointer> contentTypeResults =
       this->FindRelatedObjects(/*contentType,*/filename, relatedRegistry);
   if (contentTypeResults.size() > 0)
   {
     desc = contentTypeResults.front();
   }
   return desc;
 }
 
 QList<IEditorDescriptor::Pointer> EditorRegistry::FindRelatedObjects(
     /*IContentType type,*/const QString& fileName,
     RelatedRegistry&  /*registry*/)
 {
   QList<IEditorDescriptor::Pointer> allRelated;
   QList<IEditorDescriptor::Pointer> nonDefaultFileEditors;
   QList<IEditorDescriptor::Pointer> related;
 
   if (!fileName.isEmpty())
   {
     FileEditorMapping::Pointer mapping = this->GetMappingFor(fileName);
     if (!mapping.IsNull())
     {
       // backwards compatibility - add editors flagged as "default"
       related = mapping->GetDeclaredDefaultEditors();
       for (QList<IEditorDescriptor::Pointer>::iterator itr =
           related.begin(); itr != related.end(); ++itr)
       {
         // we don't want to return duplicates
         if (std::find(allRelated.begin(), allRelated.end(), *itr)
             == allRelated.end())
         {
           allRelated.push_back(*itr);
         }
       }
 
       // add all filename editors to the nonDefaultList
       // we'll later try to add them all after content types are resolved
       // duplicates (ie: default editors) will be ignored
       QList<IEditorDescriptor::Pointer> tmpList = mapping->GetEditors();
       nonDefaultFileEditors.append(tmpList);
     }
 
     int index = fileName.indexOf('.');
     if (index != -1)
     {
       QString extension = "*" + fileName.mid(index);
       mapping = this->GetMappingFor(extension);
       if (!mapping.IsNull())
       {
         related = mapping->GetDeclaredDefaultEditors();
         for (QList<IEditorDescriptor::Pointer>::iterator itr =
             related.begin(); itr != related.end(); ++itr)
         {
           // we don't want to return duplicates
           if (std::find(allRelated.begin(), allRelated.end(), *itr)
               == allRelated.end())
           {
             allRelated.push_back(*itr);
           }
         }
         QList<IEditorDescriptor::Pointer> tmpList = mapping->GetEditors();
         nonDefaultFileEditors.append(tmpList);
       }
     }
   }
 
   //    if (type != null) {
   //      // now add any objects directly related to the content type
   //      related = registry.getRelatedObjects(type);
   //      for (int i = 0; i < related.length; i++) {
   //        // we don't want to return duplicates
   //        if (!allRelated.contains(related[i])) {
   //          // if it's not filtered, add it to the list
   //          if (!WorkbenchActivityHelper.filterItem(related[i])) {
   //            allRelated.add(related[i]);
   //          }
   //        }
   //      }
   //
   //    }
 
   //    if (type != null) {
   //      // now add any indirectly related objects, walking up the content type hierarchy
   //      while ((type = type.getBaseType()) != null) {
   //        related = registry.getRelatedObjects(type);
   //        for (int i = 0; i < related.length; i++) {
   //          // we don't want to return duplicates
   //          if (!allRelated.contains(related[i])) {
   //            // if it's not filtered, add it to the list
   //            if (!WorkbenchActivityHelper.filterItem(related[i])) {
   //              allRelated.add(related[i]);
   //            }
   //          }
   //        }
   //      }
   //    }
 
   // add all non-default editors to the list
   for (QList<IEditorDescriptor::Pointer>::iterator i =
       nonDefaultFileEditors.begin(); i != nonDefaultFileEditors.end(); ++i)
   {
     IEditorDescriptor::Pointer editor = *i;
     if (std::find(allRelated.begin(), allRelated.end(), editor)
         == allRelated.end())
     {
       allRelated.push_back(editor);
     }
   }
 
   return allRelated;
 }
 
 QList<IEditorDescriptor::Pointer> EditorRegistry::GetEditors(
     const QString& filename)
 {
   //return getEditors(filename, guessAtContentType(filename));
   return this->FindRelatedObjects(/*contentType,*/filename, relatedRegistry);
 }
 
 QList<IFileEditorMapping::Pointer> EditorRegistry::GetFileEditorMappings()
 {
   QList<FileEditorMapping::Pointer>
       array(typeEditorMappings.AllMappings());
   std::sort(array.begin(), array.end(), CmpFileEditorMapping());
 
   QList<IFileEditorMapping::Pointer> result;
   for (QList<FileEditorMapping::Pointer>::iterator itr = array.begin(); itr
       != array.end(); ++itr)
   {
     result.push_back(itr->Cast<IFileEditorMapping> ());
   }
   return result;
 }
 
 FileEditorMapping::Pointer EditorRegistry::GetMappingFor(const QString& ext)
 {
   QString key = this->MappingKeyFor(ext);
   return typeEditorMappings.Get(key);
 }
 
 QList<FileEditorMapping::Pointer> EditorRegistry::GetMappingForFilename(
     const QString& filename)
 {
   QList<FileEditorMapping::Pointer> mapping;
 
   // Lookup on entire filename
   mapping[0] = this->GetMappingFor(filename);
 
   // Lookup on filename's extension
   int index = filename.indexOf('.');
   if (index != -1)
   {
     QString extension = filename.mid(index);
     mapping[1] = this->GetMappingFor("*" + extension);
   }
 
   return mapping;
 }
 
 //    QList<IEditorDescriptor::Pointer> EditorRegistry::GetSortedEditorsFromOS()
 //    {
 //      List externalEditors = new ArrayList();
 //      Program[] programs = Program.getPrograms();
 //
 //      for (int i = 0; i < programs.length; i++)
 //      {
 //        //1FPLRL2: ITPUI:WINNT - NOTEPAD editor cannot be launched
 //        //Some entries start with %SystemRoot%
 //        //For such cases just use the file name as they are generally
 //        //in directories which are on the path
 //        /*
 //         * if (fileName.charAt(0) == '%') { fileName = name + ".exe"; }
 //         */
 //
 //        EditorDescriptor editor = new EditorDescriptor();
 //        editor.setOpenMode(EditorDescriptor.OPEN_EXTERNAL);
 //        editor.setProgram(programs[i]);
 //
 //        // determine the program icon this editor would need (do not let it
 //        // be cached in the workbench registry)
 //        ImageDescriptor desc = new ExternalProgramImageDescriptor(
 //            programs[i]);
 //        editor.setImageDescriptor(desc);
 //        externalEditors.add(editor);
 //      }
 //
 //      Object[] tempArray = sortEditors(externalEditors);
 //      IEditorDescriptor[] array = new IEditorDescriptor[externalEditors
 //      .size()];
 //      for (int i = 0; i < tempArray.length; i++)
 //      {
 //        array[i] = (IEditorDescriptor) tempArray[i];
 //      }
 //      return array;
 //    }
 
 QList<IEditorDescriptor::Pointer> EditorRegistry::GetSortedEditorsFromPlugins()
 {
   QList<IEditorDescriptor::Pointer> result;
   for (QList<EditorDescriptor::Pointer>::iterator itr =
       sortedEditorsFromPlugins.begin(); itr != sortedEditorsFromPlugins.end(); ++itr)
   {
     result.push_back((*itr).Cast<IEditorDescriptor> ());
   }
   return result;
 }
 
 void EditorRegistry::InitialIdToEditorMap(
     QHash<QString, EditorDescriptor::Pointer>& map)
 {
   this->AddSystemEditors(map);
 }
 
 void EditorRegistry::AddSystemEditors(
     QHash<QString, EditorDescriptor::Pointer>& map)
 {
   // there will always be a system external editor descriptor
   EditorDescriptor::Pointer editor(new EditorDescriptor());
   editor->SetID(IEditorRegistry::SYSTEM_EXTERNAL_EDITOR_ID);
   editor->SetName("System Editor");
   editor->SetOpenMode(EditorDescriptor::OPEN_EXTERNAL);
   // @issue we need a real icon for this editor?
   map[IEditorRegistry::SYSTEM_EXTERNAL_EDITOR_ID] = editor;
 
   // there may be a system in-place editor if supported by platform
   //      if (ComponentSupport.inPlaceEditorSupported())
   //      {
   //        editor = new EditorDescriptor();
   //        editor.setID(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID);
   //        editor.setName(WorkbenchMessages.SystemInPlaceDescription_name);
   //        editor.setOpenMode(EditorDescriptor.OPEN_INPLACE);
   //        // @issue we need a real icon for this editor?
   //        map.put(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID, editor);
   //      }
 
   EditorDescriptor::Pointer emptyEditorDescriptor(new EditorDescriptor());
   emptyEditorDescriptor->SetID(EMPTY_EDITOR_ID);
   emptyEditorDescriptor->SetName("(Empty)"); //$NON-NLS-1$
   //emptyEditorDescriptor.setImageDescriptor(WorkbenchImages
   //.getImageDescriptor(IWorkbenchGraphicConstants.IMG_OBJ_ELEMENT));
   map[EMPTY_EDITOR_ID] = emptyEditorDescriptor;
 }
 
 void EditorRegistry::InitializeFromStorage()
 {
 
   //Get editors from the registry
   EditorRegistryReader registryReader;
   registryReader.AddEditors(this);
   this->SortInternalEditors();
   this->RebuildInternalEditorMap();
 
   //      IPreferenceStore store = PlatformUI.getPreferenceStore();
   //      String defaultEditors = store
   //      .getString(IPreferenceConstants.DEFAULT_EDITORS);
   //      String chachedDefaultEditors = store
   //      .getString(IPreferenceConstants.DEFAULT_EDITORS_CACHE);
 
   //If defaults has changed load it afterwards so it overrides the users
   // associations.
   //if (defaultEditors == null
   //    || defaultEditors.equals(chachedDefaultEditors))
   //{
   this->SetProductDefaults("");//defaultEditors);
   this->LoadAssociations(); //get saved earlier state
   //      }
   //      else
   //      {
   //        loadAssociations(); //get saved earlier state
   //        setProductDefaults(defaultEditors);
   //        store.putValue(IPreferenceConstants.DEFAULT_EDITORS_CACHE,
   //            defaultEditors);
   //      }
   this->AddExternalEditorsToEditorMap();
 }
 
 void EditorRegistry::SetProductDefaults(const QString& defaultEditors)
 {
   if (defaultEditors.isEmpty())
   {
     return;
   }
 
   //      Poco::StringTokenizer extEditors(defaultEditors,
   //          IPreferenceConstants::SEPARATOR, Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY);
   //      while (extEditors.hasMoreTokens())
   //      {
   //        String extEditor = extEditors.nextToken().trim();
   //        int index = extEditor.indexOf(':');
   //        if (extEditor.length() < 3 || index <= 0 || index
   //            >= (extEditor.length() - 1))
   //        {
   //          //Extension and id must have at least one char.
   //          WorkbenchPlugin
   //          .log("Error setting default editor. Could not parse '" + extEditor
   //              + "'. Default editors should be specified as '*.ext1:editorId1;*.ext2:editorId2'"); //$NON-NLS-1$ //$NON-NLS-2$
   //          return;
   //        }
   //        String ext = extEditor.substring(0, index).trim();
   //        String editorId = extEditor.substring(index + 1).trim();
   //        FileEditorMapping mapping = getMappingFor(ext);
   //        if (mapping == null)
   //        {
   //          WorkbenchPlugin
   //          .log("Error setting default editor. Could not find mapping for '"
   //              + ext + "'."); //$NON-NLS-1$ //$NON-NLS-2$
   //          continue;
   //        }
   //        EditorDescriptor editor = (EditorDescriptor) findEditor(editorId);
   //        if (editor == null)
   //        {
   //          WorkbenchPlugin
   //          .log("Error setting default editor. Could not find editor: '"
   //              + editorId + "'."); //$NON-NLS-1$ //$NON-NLS-2$
   //          continue;
   //        }
   //        mapping.setDefaultEditor(editor);
   //      }
 }
 
 bool EditorRegistry::ReadEditors(
     QHash<QString, EditorDescriptor::Pointer>&  /*editorTable*/)
 {
   //Get the workbench plugin's working directory
   QString workbenchStatePath = WorkbenchPlugin::GetDefault()->GetDataLocation();
   if (workbenchStatePath.isNull())
   {
     return false;
   }
   //      IPreferenceStore store = WorkbenchPlugin.getDefault()
   //      .getPreferenceStore();
   //      Reader reader = null;
   //      try
   //      {
   //        // Get the editors defined in the preferences store
   //        String xmlString = store.getString(IPreferenceConstants.EDITORS);
   //        if (xmlString == null || xmlString.length() == 0)
   //        {
   //          FileInputStream stream = new FileInputStream(workbenchStatePath
   //              .append(IWorkbenchConstants.EDITOR_FILE_NAME)
   //              .toOSString());
   //          reader = new BufferedReader(new InputStreamReader(stream,
   //                  "utf-8")); //$NON-NLS-1$
   //        }
   //        else
   //        {
   //          reader = new StringReader(xmlString);
   //        }
   //        XMLMemento memento = XMLMemento.createReadRoot(reader);
   //        EditorDescriptor editor;
   //        IMemento[] edMementos = memento
   //        .getChildren(IWorkbenchConstants.TAG_DESCRIPTOR);
   //        // Get the editors and validate each one
   //        for (int i = 0; i < edMementos.length; i++)
   //        {
   //          editor = new EditorDescriptor();
   //          boolean valid = editor.loadValues(edMementos[i]);
   //          if (!valid)
   //          {
   //            continue;
   //          }
   //          if (editor.getPluginID() != null)
   //          {
   //            //If the editor is from a plugin we use its ID to look it
   //            // up in the mapping of editors we
   //            //have obtained from plugins. This allows us to verify that
   //            // the editor is still valid
   //            //and allows us to get the editor description from the
   //            // mapping table which has
   //            //a valid config element field.
   //            EditorDescriptor validEditorDescritor = (EditorDescriptor) mapIDtoEditor
   //            .get(editor.getId());
   //            if (validEditorDescritor != null)
   //            {
   //              editorTable.put(validEditorDescritor.getId(),
   //                  validEditorDescritor);
   //            }
   //          }
   //          else
   //          { //This is either from a program or a user defined
   //            // editor
   //            ImageDescriptor descriptor;
   //            if (editor.getProgram() == null)
   //            {
   //              descriptor = new ProgramImageDescriptor(editor
   //                  .getFileName(), 0);
   //            }
   //            else
   //            {
   //              descriptor = new ExternalProgramImageDescriptor(editor
   //                  .getProgram());
   //            }
   //            editor.setImageDescriptor(descriptor);
   //            editorTable.put(editor.getId(), editor);
   //          }
   //        }
   //      }
   //      catch (IOException e)
   //      {
   //        try
   //        {
   //          if (reader != null)
   //          {
   //            reader.close();
   //          }
   //        }
   //        catch (IOException ex)
   //        {
   //          e.printStackTrace();
   //        }
   //        //Ignore this as the workbench may not yet have saved any state
   //        return false;
   //      }
   //      catch (WorkbenchException e)
   //      {
   //        ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle,
   //            WorkbenchMessages.EditorRegistry_errorMessage,
   //            e.getStatus());
   //        return false;
   //      }
 
   return true;
 }
 
 void EditorRegistry::ReadResources(
     QHash<QString, EditorDescriptor::Pointer>& /*editorTable*/,
     std::ostream&  /*reader*/)
 {
   //      XMLMemento memento = XMLMemento.createReadRoot(reader);
   //      String versionString = memento.getString(IWorkbenchConstants.TAG_VERSION);
   //      boolean versionIs31 = "3.1".equals(versionString); //$NON-NLS-1$
   //
   //      IMemento[] extMementos = memento
   //      .getChildren(IWorkbenchConstants.TAG_INFO);
   //      for (int i = 0; i < extMementos.length; i++)
   //      {
   //        String name = extMementos[i]
   //        .getString(IWorkbenchConstants.TAG_NAME);
   //        if (name == null)
   //        {
   //          name = "*"; //$NON-NLS-1$
   //        }
   //        String extension = extMementos[i]
   //        .getString(IWorkbenchConstants.TAG_EXTENSION);
   //        IMemento[] idMementos = extMementos[i]
   //        .getChildren(IWorkbenchConstants.TAG_EDITOR);
   //        String[] editorIDs = new String[idMementos.length];
   //        for (int j = 0; j < idMementos.length; j++)
   //        {
   //          editorIDs[j] = idMementos[j]
   //          .getString(IWorkbenchConstants.TAG_ID);
   //        }
   //        idMementos = extMementos[i]
   //        .getChildren(IWorkbenchConstants.TAG_DELETED_EDITOR);
   //        String[] deletedEditorIDs = new String[idMementos.length];
   //        for (int j = 0; j < idMementos.length; j++)
   //        {
   //          deletedEditorIDs[j] = idMementos[j]
   //          .getString(IWorkbenchConstants.TAG_ID);
   //        }
   //        FileEditorMapping mapping = getMappingFor(name + "." + extension); //$NON-NLS-1$
   //        if (mapping == null)
   //        {
   //          mapping = new FileEditorMapping(name, extension);
   //        }
   //        List editors = new ArrayList();
   //        for (int j = 0; j < editorIDs.length; j++)
   //        {
   //          if (editorIDs[j] != null)
   //          {
   //            EditorDescriptor editor = (EditorDescriptor) editorTable
   //            .get(editorIDs[j]);
   //            if (editor != null)
   //            {
   //              editors.add(editor);
   //            }
   //          }
   //        }
   //        List deletedEditors = new ArrayList();
   //        for (int j = 0; j < deletedEditorIDs.length; j++)
   //        {
   //          if (deletedEditorIDs[j] != null)
   //          {
   //            EditorDescriptor editor = (EditorDescriptor) editorTable
   //            .get(deletedEditorIDs[j]);
   //            if (editor != null)
   //            {
   //              deletedEditors.add(editor);
   //            }
   //          }
   //        }
   //
   //        List defaultEditors = new ArrayList();
   //
   //        if (versionIs31)
   //        { // parse the new format
   //          idMementos = extMementos[i]
   //          .getChildren(IWorkbenchConstants.TAG_DEFAULT_EDITOR);
   //          String[] defaultEditorIds = new String[idMementos.length];
   //          for (int j = 0; j < idMementos.length; j++)
   //          {
   //            defaultEditorIds[j] = idMementos[j]
   //            .getString(IWorkbenchConstants.TAG_ID);
   //          }
   //          for (int j = 0; j < defaultEditorIds.length; j++)
   //          {
   //            if (defaultEditorIds[j] != null)
   //            {
   //              EditorDescriptor editor = (EditorDescriptor) editorTable
   //              .get(defaultEditorIds[j]);
   //              if (editor != null)
   //              {
   //                defaultEditors.add(editor);
   //              }
   //            }
   //          }
   //        }
   //        else
   //        { // guess at pre 3.1 format defaults
   //          if (!editors.isEmpty())
   //          {
   //            EditorDescriptor editor = (EditorDescriptor) editors.get(0);
   //            if (editor != null)
   //            {
   //              defaultEditors.add(editor);
   //            }
   //          }
   //          defaultEditors.addAll(Arrays.asList(mapping.getDeclaredDefaultEditors()));
   //        }
   //
   //        // Add any new editors that have already been read from the registry
   //        // which were not deleted.
   //        IEditorDescriptor[] editorsArray = mapping.getEditors();
   //        for (int j = 0; j < editorsArray.length; j++)
   //        {
   //          if (!contains(editors, editorsArray[j])
   //              && !deletedEditors.contains(editorsArray[j]))
   //          {
   //            editors.add(editorsArray[j]);
   //          }
   //        }
   //        // Map the editor(s) to the file type
   //        mapping.setEditorsList(editors);
   //        mapping.setDeletedEditorsList(deletedEditors);
   //        mapping.setDefaultEditors(defaultEditors);
   //        typeEditorMappings.put(mappingKeyFor(mapping), mapping);
   //      }
 }
 
 bool EditorRegistry::Contains(
     const QList<IEditorDescriptor::Pointer>& editorsArray,
     IEditorDescriptor::Pointer editorDescriptor)
 {
   IEditorDescriptor::Pointer currentEditorDescriptor;
   for (QList<IEditorDescriptor::Pointer>::const_iterator i =
       editorsArray.begin(); i != editorsArray.end(); ++i)
   {
     currentEditorDescriptor = *i;
     if (currentEditorDescriptor->GetId() == editorDescriptor->GetId())
     {
       return true;
     }
   }
   return false;
 
 }
 
 bool EditorRegistry::ReadResources(
     QHash<QString, EditorDescriptor::Pointer>&  /*editorTable*/)
 {
   //Get the workbench plugin's working directory
   QString workbenchStatePath = WorkbenchPlugin::GetDefault()->GetDataLocation();
   // XXX: nobody cares about this return value
   if (workbenchStatePath.isNull())
   {
     return false;
   }
   //      IPreferenceStore store = WorkbenchPlugin.getDefault()
   //      .getPreferenceStore();
   //      Reader reader = null;
   //      try
   //      {
   //        // Get the resource types
   //        String xmlString = store.getString(IPreferenceConstants.RESOURCES);
   //        if (xmlString == null || xmlString.length() == 0)
   //        {
   //          FileInputStream stream = new FileInputStream(workbenchStatePath
   //              .append(IWorkbenchConstants.RESOURCE_TYPE_FILE_NAME)
   //              .toOSString());
   //          reader = new BufferedReader(new InputStreamReader(stream,
   //                  "utf-8")); //$NON-NLS-1$
   //        }
   //        else
   //        {
   //          reader = new StringReader(xmlString);
   //        }
   //        // Read the defined resources into the table
   //        readResources(editorTable, reader);
   //      }
   //      catch (IOException e)
   //      {
   //        try
   //        {
   //          if (reader != null)
   //          {
   //            reader.close();
   //          }
   //        }
   //        catch (IOException ex)
   //        {
   //          ex.printStackTrace();
   //        }
   //        MessageDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle,
   //            WorkbenchMessages.EditorRegistry_errorMessage);
   //        return false;
   //      }
   //      catch (WorkbenchException e)
   //      {
   //        ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle,
   //            WorkbenchMessages.EditorRegistry_errorMessage,
   //            e.getStatus());
   //        return false;
   //      }
   return true;
 
 }
 
 bool EditorRegistry::LoadAssociations()
 {
   QHash<QString, EditorDescriptor::Pointer> editorTable;
   if (!this->ReadEditors(editorTable))
   {
     return false;
   }
   return this->ReadResources(editorTable);
 }
 
 QString EditorRegistry::MappingKeyFor(const QString& type)
 {
-  // keep everyting lower case for case-sensitive platforms
+  // keep everything lower case for case-sensitive platforms
   return type.toLower();
 }
 
 QString EditorRegistry::MappingKeyFor(FileEditorMapping::Pointer mapping)
 {
   return this->MappingKeyFor(mapping->GetName()
       + (mapping->GetExtension().size() == 0 ? "" : "."
           + mapping->GetExtension())); //$NON-NLS-1$ //$NON-NLS-2$
 }
 
 void EditorRegistry::RebuildEditorMap()
 {
   this->RebuildInternalEditorMap();
   this->AddExternalEditorsToEditorMap();
 }
 
 void EditorRegistry::RebuildInternalEditorMap()
 {
   EditorDescriptor::Pointer desc;
 
   // Allocate a new map.
   mapIDtoEditor.clear();
   this->InitialIdToEditorMap(mapIDtoEditor);
 
   // Add plugin editors.
   for (QList<EditorDescriptor::Pointer>::iterator itr =
       sortedEditorsFromPlugins.begin(); itr != sortedEditorsFromPlugins.end(); ++itr)
   {
     desc = *itr;
     mapIDtoEditor[desc->GetId()] = desc;
   }
 }
 
 void EditorRegistry::SaveAssociations()
 {
   //Save the resource type descriptions
   //      List editors = new ArrayList();
   //      IPreferenceStore store = WorkbenchPlugin.getDefault()
   //      .getPreferenceStore();
   //
   //      XMLMemento memento = XMLMemento
   //      .createWriteRoot(IWorkbenchConstants.TAG_EDITORS);
   //      memento.putString(IWorkbenchConstants.TAG_VERSION, "3.1"); //$NON-NLS-1$
   //      FileEditorMapping maps[] = typeEditorMappings.userMappings();
   //      for (int mapsIndex = 0; mapsIndex < maps.length; mapsIndex++)
   //      {
   //        FileEditorMapping type = maps[mapsIndex];
   //        IMemento editorMemento = memento
   //        .createChild(IWorkbenchConstants.TAG_INFO);
   //        editorMemento.putString(IWorkbenchConstants.TAG_NAME, type
   //        .getName());
   //        editorMemento.putString(IWorkbenchConstants.TAG_EXTENSION, type
   //        .getExtension());
   //        IEditorDescriptor[] editorArray = type.getEditors();
   //        for (int i = 0; i < editorArray.length; i++)
   //        {
   //          EditorDescriptor editor = (EditorDescriptor) editorArray[i];
   //          if (!editors.contains(editor))
   //          {
   //            editors.add(editor);
   //          }
   //          IMemento idMemento = editorMemento
   //          .createChild(IWorkbenchConstants.TAG_EDITOR);
   //          idMemento.putString(IWorkbenchConstants.TAG_ID, editorArray[i]
   //          .getId());
   //        }
   //        editorArray = type.getDeletedEditors();
   //        for (int i = 0; i < editorArray.length; i++)
   //        {
   //          EditorDescriptor editor = (EditorDescriptor) editorArray[i];
   //          if (!editors.contains(editor))
   //          {
   //            editors.add(editor);
   //          }
   //          IMemento idMemento = editorMemento
   //          .createChild(IWorkbenchConstants.TAG_DELETED_EDITOR);
   //          idMemento.putString(IWorkbenchConstants.TAG_ID, editorArray[i]
   //          .getId());
   //        }
   //        editorArray = type.getDeclaredDefaultEditors();
   //        for (int i = 0; i < editorArray.length; i++)
   //        {
   //          EditorDescriptor editor = (EditorDescriptor) editorArray[i];
   //          if (!editors.contains(editor))
   //          {
   //            editors.add(editor);
   //          }
   //          IMemento idMemento = editorMemento
   //          .createChild(IWorkbenchConstants.TAG_DEFAULT_EDITOR);
   //          idMemento.putString(IWorkbenchConstants.TAG_ID, editorArray[i]
   //          .getId());
   //        }
   //      }
   //      Writer writer = null;
   //      try
   //      {
   //        writer = new StringWriter();
   //        memento.save(writer);
   //        writer.close();
   //        store.setValue(IPreferenceConstants.RESOURCES, writer.toString());
   //      }
   //      catch (IOException e)
   //      {
   //        try
   //        {
   //          if (writer != null)
   //          {
   //            writer.close();
   //          }
   //        }
   //        catch (IOException ex)
   //        {
   //          ex.printStackTrace();
   //        }
   //        MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$
   //            "Unable to save resource associations."); //$NON-NLS-1$
   //        return;
   //      }
   //
   //      memento = XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_EDITORS);
   //      Iterator itr = editors.iterator();
   //      while (itr.hasNext())
   //      {
   //        EditorDescriptor editor = (EditorDescriptor) itr.next();
   //        IMemento editorMemento = memento
   //        .createChild(IWorkbenchConstants.TAG_DESCRIPTOR);
   //        editor.saveValues(editorMemento);
   //      }
   //      writer = null;
   //      try
   //      {
   //        writer = new StringWriter();
   //        memento.save(writer);
   //        writer.close();
   //        store.setValue(IPreferenceConstants.EDITORS, writer.toString());
   //      }
   //      catch (IOException e)
   //      {
   //        try
   //        {
   //          if (writer != null)
   //          {
   //            writer.close();
   //          }
   //        }
   //        catch (IOException ex)
   //        {
   //          ex.printStackTrace();
   //        }
   //        MessageDialog.openError((Shell) null,
   //            "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$
   //        return;
   //      }
 }
 
 void EditorRegistry::SetFileEditorMappings(
     const QList<FileEditorMapping::Pointer>& newResourceTypes)
 {
   typeEditorMappings.Clear();
   for (int i = 0; i < newResourceTypes.size(); i++)
   {
     FileEditorMapping::Pointer mapping = newResourceTypes[i];
     typeEditorMappings.Put(this->MappingKeyFor(mapping), mapping);
   }
   //extensionImages = new HashMap();
   this->RebuildEditorMap();
   //firePropertyChange(PROP_CONTENTS);
 }
 
 void EditorRegistry::SetDefaultEditor(const QString& fileName,
     const QString& editorId)
 {
   EditorDescriptor::Pointer desc = this->FindEditor(editorId).Cast<
       EditorDescriptor> ();
   QList<FileEditorMapping::Pointer> mapping = this->GetMappingForFilename(
       fileName);
   if (!mapping[0].IsNull())
   {
     mapping[0]->SetDefaultEditor(desc);
   }
   if (!mapping[1].IsNull())
   {
     mapping[1]->SetDefaultEditor(desc);
   }
 }
 
 QList<IEditorDescriptor::Pointer> EditorRegistry::SortEditors(
     const QList<IEditorDescriptor::Pointer>& unsortedList)
 {
   QList<IEditorDescriptor::Pointer> result(unsortedList);
   std::sort(result.begin(), result.end(), CmpIEditorDescriptor());
 
   return result;
 }
 
 void EditorRegistry::SortInternalEditors()
 {
   qSort(sortedEditorsFromPlugins.begin(), sortedEditorsFromPlugins.end(), CmpEditorDescriptor());
 }
 
 void EditorRegistry::EditorMap::PutDefault(const QString& key,
     FileEditorMapping::Pointer value)
 {
   defaultMap[key] = value;
 }
 
 void EditorRegistry::EditorMap::Put(const QString& key,
     FileEditorMapping::Pointer value)
 {
   QHash<QString, FileEditorMapping::Pointer>::iterator result =
       defaultMap.find(key);
   if (result != defaultMap.end())
   {
     map[key] = value;
   }
 }
 
 FileEditorMapping::Pointer EditorRegistry::EditorMap::Get(
     const QString& key)
 {
   QHash<QString, FileEditorMapping::Pointer>::const_iterator result =
       map.find(key);
   if (result == map.end())
   {
     return defaultMap[key];
   }
   return result.value();
 }
 
 void EditorRegistry::EditorMap::Clear()
 {
   defaultMap.clear();
   map.clear();
 }
 
 QList<FileEditorMapping::Pointer> EditorRegistry::EditorMap::AllMappings()
 {
   QSet<FileEditorMapping::Pointer> resultSet;
   QHash<QString, FileEditorMapping::Pointer>::const_iterator iter;
   for (iter = defaultMap.begin(); iter != defaultMap.end(); ++iter)
   {
     resultSet.insert(iter.value());
   }
   for (iter = map.begin(); iter != map.end(); ++iter)
   {
     resultSet.insert(iter.value());
   }
 
   return resultSet.toList();
 }
 
 QList<FileEditorMapping::Pointer> EditorRegistry::EditorMap::UserMappings()
 {
   return map.values();
 }
 
 bool EditorRegistry::IsSystemInPlaceEditorAvailable(const QString&  /*filename*/)
 {
   //return ComponentSupport.inPlaceEditorAvailable(filename);
   return false;
 }
 
 bool EditorRegistry::IsSystemExternalEditorAvailable(
     const QString&  /*filename*/)
 {
   //      QString::size_type nDot = filename.find_last_of('.');
   //      if (nDot != QString::npos)
   //      {
   //        QString strName = filename.substr(nDot);
   //        return Program.findProgram(strName) != null;
   //      }
   return false;
 }
 
 void EditorRegistry::RemoveEditorFromMapping(
     QHash<QString, FileEditorMapping::Pointer>& map,
     IEditorDescriptor::Pointer desc)
 {
   FileEditorMapping::Pointer mapping;
   for (QHash<QString, FileEditorMapping::Pointer>::iterator iter =
       map.begin(); iter != map.end(); ++iter)
   {
     mapping = iter.value();
     QList<IEditorDescriptor::Pointer> editors(mapping->GetEditors());
     QList<IEditorDescriptor::Pointer>::iterator result = std::find(
         editors.begin(), editors.end(), desc);
     if (result != editors.end())
     {
       mapping->RemoveEditor(result->Cast<EditorDescriptor> ());
       editors.erase(result);
     }
 
     if (editors.empty())
     {
       map.erase(iter);
       break;
     }
   }
 }
 
 IExtensionPoint::Pointer EditorRegistry::GetExtensionPointFilter()
 {
   return Platform::GetExtensionRegistry()->GetExtensionPoint(
         PlatformUI::PLUGIN_ID(), WorkbenchRegistryConstants::PL_EDITOR);
 }
 
 QList<IFileEditorMapping::Pointer> EditorRegistry::GetUnifiedMappings()
 {
   QList<IFileEditorMapping::Pointer>
       standardMappings(
           dynamic_cast<EditorRegistry*> (PlatformUI::GetWorkbench() ->GetEditorRegistry())->GetFileEditorMappings());
 
   QList<IFileEditorMapping::Pointer> allMappings(standardMappings);
   // mock-up content type extensions into IFileEditorMappings
   //      IContentType [] contentTypes = Platform.getContentTypeManager().getAllContentTypes();
   //      for (int i = 0; i < contentTypes.length; i++)
   //      {
   //        IContentType type = contentTypes[i];
   //        String [] extensions = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
   //        for (int j = 0; j < extensions.length; j++)
   //        {
   //          String extension = extensions[j];
   //          boolean found = false;
   //          for (Iterator k = allMappings.iterator(); k.hasNext();)
   //          {
   //            IFileEditorMapping mapping = (IFileEditorMapping) k.next();
   //            if ("*".equals(mapping.getName())
   //                && extension.equals(mapping.getExtension()))
   //            { //$NON-NLS-1$
   //              found = true;
   //              break;
   //            }
   //          }
   //          if (!found)
   //          {
   //            MockMapping mockMapping = new MockMapping(type, "*", extension); //$NON-NLS-1$
   //            allMappings.add(mockMapping);
   //          }
   //        }
   //
   //        String [] filenames = type.getFileSpecs(IContentType.FILE_NAME_SPEC);
   //        for (int j = 0; j < filenames.length; j++)
   //        {
   //          String wholename = filenames[j];
   //          int idx = wholename.indexOf('.');
   //          String name = idx == -1 ? wholename : wholename.substring(0, idx);
   //          String extension = idx == -1 ? "" : wholename.substring(idx + 1); //$NON-NLS-1$
   //
   //          boolean found = false;
   //          for (Iterator k = allMappings.iterator(); k.hasNext();)
   //          {
   //            IFileEditorMapping mapping = (IFileEditorMapping) k.next();
   //            if (name.equals(mapping.getName())
   //                && extension.equals(mapping.getExtension()))
   //            {
   //              found = true;
   //              break;
   //            }
   //          }
   //          if (!found)
   //          {
   //            MockMapping mockMapping = new MockMapping(type, name, extension);
   //            allMappings.add(mockMapping);
   //          }
   //        }
   //      }
 
   return allMappings;
 }
 
 MockMapping::MockMapping(/*IContentType type,*/const QString& name,
     const QString& ext) :
   extension(ext), filename(name)
 {
   //this.contentType = type;
 }
 
 IEditorDescriptor::Pointer MockMapping::GetDefaultEditor()
 {
   //      QList<IEditorDescriptor::Pointer> candidates = PlatformUI::GetWorkbench()->GetEditorRegistry()
   //      ->GetEditorsForContentType(contentType);
   //      if (candidates.empty())
   //      {
   //        return IEditorDescriptor::Pointer();
   //      }
   //      return candidates[0];
 
   return IEditorDescriptor::Pointer();
 }
 
 QList<IEditorDescriptor::Pointer> MockMapping::GetEditors() const
 {
   //      QList<IEditorDescriptor::Pointer> editorsForContentType = (dynamic_cast<EditorRegistry*>(PlatformUI
   //          ::GetWorkbench()->GetEditorRegistry())
   //      ->GetEditorsForContentType(contentType);
   //      return editorsForContentType;
   return QList<IEditorDescriptor::Pointer>();
 }
 
 QList<IEditorDescriptor::Pointer> MockMapping::GetDeletedEditors() const
 {
   return QList<IEditorDescriptor::Pointer>();
 }
 
 QString MockMapping::GetExtension() const
 {
   return extension;
 }
 
 QString MockMapping::GetLabel() const
 {
   return filename + '.' + extension;
 }
 
 QString MockMapping::GetName() const
 {
   return filename;
 }
 
 bool MockMapping::operator==(const Object* obj) const
 {
   if (const MockMapping* other = dynamic_cast<const MockMapping*>(obj))
   {
     if (this == other)
     {
       return true;
     }
 
     //MockMapping mapping = (MockMapping) obj;
     if (!(this->filename == other->filename))
     {
       return false;
     }
 
     if (!(this->extension == other->extension))
     {
       return false;
     }
 
     if (!(this->GetEditors() == other->GetEditors()))
     {
       return false;
     }
     return this->GetDeletedEditors() == other->GetDeletedEditors();
   }
 
   return false;
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.h
index 3ac251dbc6..6716f0b9de 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorRegistry.h
@@ -1,754 +1,754 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYEDITORREGISTRY_H_
 #define BERRYEDITORREGISTRY_H_
 
 #include <berryIExtensionPoint.h>
 
 #include "berryIEditorRegistry.h"
 #include "berryIFileEditorMapping.h"
 #include "berryEditorDescriptor.h"
 #include "berryFileEditorMapping.h"
 
 namespace berry
 {
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * Provides access to the collection of defined editors for resource types.
  */
 class EditorRegistry : public IEditorRegistry
 {
 
   class RelatedRegistry
   {
 
   public: RelatedRegistry(EditorRegistry* editorRegistry);
     /**
      * Return the objects related to the type.
      *
      * @param type
      * @return the objects related to the type
      */
     //  public: QList<IEditorDescriptor::Pointer> GetRelatedObjects(IContentType type) {
     //      IEditorDescriptor[] relatedObjects = (IEditorDescriptor[]) contentTypeToEditorMappings.get(type);
     //      if (relatedObjects == null) {
     //        return EMPTY;
     //      }
     //      return (IEditorDescriptor[]) WorkbenchActivityHelper.restrictArray(relatedObjects);
     //    }
 
     /**
      * Return the objects related to the filename
      * @param fileName
      * @return the objects related to the filename
      */
 public:
     QList<IEditorDescriptor::Pointer> GetRelatedObjects(
         const QString& fileName);
 
 private: EditorRegistry* editorRegistry;
   };
 
   friend class RelatedRegistry;
 
   /**
     * Map of FileEditorMapping (extension to FileEditorMapping) Uses two
     * java.util.HashMap: one keeps the default which are set by the plugins and
     * the other keeps the changes made by the user through the preference page.
     */
  class EditorMap
    {
      static QHash<QString, FileEditorMapping::Pointer> defaultMap;
 
      static QHash<QString, FileEditorMapping::Pointer> map;
 
  public: void Clear();
 
      /**
       * Put a default mapping into the editor map.
       *
       * @param key the key to set
       * @param value the value to associate
       */
    public: static void PutDefault(const QString& key, FileEditorMapping::Pointer value);
 
      /**
       * Put a mapping into the user editor map.
       *
       * @param key the key to set
       * @param value the value to associate
       */
    public: void Put(const QString& key, FileEditorMapping::Pointer value);
 
      /**
       * Return the mapping associated to the key. First searches user
       * map, and then falls back to the default map if there is no match. May
       * return <code>null</code>
       *
       * @param key
       *            the key to search for
       * @return the mapping associated to the key or <code>null</code>
       */
    public: FileEditorMapping::Pointer Get(const QString& key);
 
      /**
       * Return all mappings. This will return default mappings overlayed with
       * user mappings.
       *
       * @return the mappings
       */
    public: QList<FileEditorMapping::Pointer> AllMappings();
 
      /**
       * Return all user mappings.
       *
       * @return the mappings
       */
    public: QList<FileEditorMapping::Pointer> UserMappings();
    };
 
  struct CmpFileEditorMapping
  {
    bool operator()(const FileEditorMapping::Pointer& x, const FileEditorMapping::Pointer& y) const
    {
      return x->GetLabel() < y->GetLabel();
    }
  };
 
  struct CmpIEditorDescriptor
   {
     bool operator()(const IEditorDescriptor::Pointer& x, const IEditorDescriptor::Pointer& y) const
     {
       return x->GetLabel() < y->GetLabel();
     }
   };
 
  struct CmpEditorDescriptor
    {
      bool operator()(const EditorDescriptor::Pointer& x, const EditorDescriptor::Pointer& y) const
      {
        return x->GetLabel() < y->GetLabel();
      }
    };
   //private: Map contentTypeToEditorMappings = new HashMap();
 
   /*
    * Cached images - these include images from registered editors (via
    * plugins) and others hence this table is not one to one with the mappings
    * table. It is in fact a superset of the keys one would find in
    * typeEditorMappings
    */
   //private: Map extensionImages = new HashMap();
 
   /**
    * Vector of EditorDescriptor - all the editors loaded from plugin files.
    * The list is kept in order to be able to show in the editor selection
    * dialog of the resource associations page.  This list is sorted based on the
    * human readable label of the editor descriptor.
    *
    * @see #comparer
    */
 private:
   QList<EditorDescriptor::Pointer> sortedEditorsFromPlugins;
 
   // Map of EditorDescriptor - map editor id to editor.
 private:
   QHash<QString, EditorDescriptor::Pointer> mapIDtoEditor;
 
   // Map of FileEditorMapping (extension to FileEditorMapping)
 private:
   EditorMap typeEditorMappings;
 
   /*
    * Compares the labels from two IEditorDescriptor objects
    */
 //private:
 //  static final Comparator comparer = new Comparator()
 //  {
 //  private Collator collator = Collator.getInstance();
 //
 //  public int compare(Object arg0, Object arg1)
 //    {
 //      String s1 = ((IEditorDescriptor) arg0).getLabel();
 //      String s2 = ((IEditorDescriptor) arg1).getLabel();
 //      return collator.compare(s1, s2);
 //    }
 //  };
 
 private: RelatedRegistry relatedRegistry;
 
 public: static const QString EMPTY_EDITOR_ID; // = "org.blueberry.ui.internal.emptyEditorTab"
 
   /**
    * Return an instance of the receiver. Adds listeners into the extension
    * registry for dynamic UI purposes.
    */
 public: EditorRegistry();
 
   /**
    * Add an editor for the given extensions with the specified (possibly null)
    * extended type. The editor is being registered from a plugin
    *
    * @param editor
    *            The description of the editor (as obtained from the plugin
    *            file and built by the registry reader)
    * @param extensions
    *            Collection of file extensions the editor applies to
    * @param filenames
    *            Collection of filenames the editor applies to
    * @param contentTypeVector
    * @param bDefault
    *            Indicates whether the editor should be made the default editor
    *            and hence appear first inside a FileEditorMapping
    *
    * This method is not API and should not be called outside the workbench
    * code.
    */
 public: void AddEditorFromPlugin(EditorDescriptor::Pointer editor, const QList<QString>& extensions,
       const QList<QString>& filenames,
       const QList<QString>& contentTypeVector,
       bool bDefault);
 
   /**
    * Add external editors to the editor mapping.
    */
 private: void AddExternalEditorsToEditorMap();
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
   //public: void AddPropertyListener(IPropertyListener l) {
   //        addListenerObject(l);
   //    }
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
 public: IEditorDescriptor::Pointer FindEditor(const QString& id) override;
 
   /**
    * Fires a property changed event to all registered listeners.
    *
    * @param type the type of event
    * @see IEditorRegistry#PROP_CONTENTS
    */
   //    private: void FirePropertyChange(final int type) {
   //        Object[] array = getListeners();
   //        for (int nX = 0; nX < array.length; nX++) {
   //            final IPropertyListener l = (IPropertyListener) array[nX];
   //            Platform.run(new SafeRunnable() {
   //                public: void run() {
   //                    l.propertyChanged(EditorRegistry.this, type);
   //                }
   //            });
   //        }
   //    }
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    *
    * @deprecated
    */
 public: IEditorDescriptor::Pointer GetDefaultEditor() override;
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
 public: IEditorDescriptor::Pointer GetDefaultEditor(const QString& filename) override;
 
   /**
    * Return the (approximated) content type for a file with the given name.
    *
    * @param filename the filename
    * @return the content type or <code>null</code> if it could not be determined
    * @since 3.1
    */
   //  private: IContentType::Pointer GuessAtContentType(const QString& filename) {
   //    return Platform.getContentTypeManager().findContentTypeFor(filename);
   //  }
 
   /**
    * Returns the default file image descriptor.
    *
    * @return the image descriptor
    */
   //    private: ImageDescriptor GetDefaultImage() {
   //        // @issue what should be the default image?
   //        return WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
   //    }
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
 public: QList<IEditorDescriptor::Pointer> GetEditors(const QString& filename) override;
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
 public: QList<IFileEditorMapping::Pointer> GetFileEditorMappings() override;
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
   //    public: ImageDescriptor GetImageDescriptor(String filename) {
   //    return getImageDescriptor(filename, guessAtContentType(filename));
   //  }
 
   /**
    * Find the file editor mapping for the file extension. Returns
    * <code>null</code> if not found.
    *
    * @param ext
    *            the file extension
    * @return the mapping, or <code>null</code>
    */
 private: FileEditorMapping::Pointer GetMappingFor(const QString& ext);
 
   /**
    * Find the file editor mappings for the given filename.
    * <p>
    * Return an array of two FileEditorMapping items, where the first mapping
    * is for the entire filename, and the second mapping is for the filename's
    * extension only. These items can be null if no mapping exist on the
    * filename and/or filename's extension.</p>
    *
    * @param filename the filename
    * @return the mappings
    */
 private: QList<FileEditorMapping::Pointer> GetMappingForFilename(const QString& filename);
 
   /**
    * Return the editor descriptors pulled from the OS.
    * <p>
    * WARNING! The image described by each editor descriptor is *not* known by
    * the workbench's graphic registry. Therefore clients must take care to
    * ensure that if they access any of the images held by these editors that
    * they also dispose them
    * </p>
    * @return the editor descriptors
    */
 //public: QList<IEditorDescriptor::Pointer> GetSortedEditorsFromOS();
 
   /**
    * Return the editors loaded from plugins.
    *
    * @return the sorted array of editors declared in plugins
    * @see #comparer
    */
 public: QList<IEditorDescriptor::Pointer> GetSortedEditorsFromPlugins();
 
   /**
-   * Answer an intial id to editor map. This will create a new map and
+   * Answer an initial id to editor map. This will create a new map and
    * populate it with the default system editors.
    *
    * @param initialSize
    *            the initial size of the map
    * @return the new map
    */
 private: void InitialIdToEditorMap(QHash<QString, EditorDescriptor::Pointer>& map);
 
   /**
    * Add the system editors to the provided map. This will always add an
    * editor with an id of {@link #SYSTEM_EXTERNAL_EDITOR_ID} and may also add
    * an editor with id of {@link #SYSTEM_INPLACE_EDITOR_ID} if the system
    * configuration supports it.
    *
    * @param map the map to augment
    */
 private: void AddSystemEditors(QHash<QString, EditorDescriptor::Pointer>& map);
 
   /**
    * Initialize the registry state from plugin declarations and preference
    * overrides.
    */
 private: void InitializeFromStorage();
 
   /**
    * Set the default editors according to the preference store which can be
    * overwritten in the file properties.ini.  In the form:
    * <p>
    * <code>ext1:id1;ext2:id2;...</code>
    * </p>
    *
    * @param defaultEditors the default editors to set
    */
 private: void SetProductDefaults(const QString& defaultEditors);
 
   /**
    * Read the editors defined in the preferences store.
    *
    * @param editorTable
    *            Editor table to store the editor definitions.
-   * @return true if the table is built succesfully.
+   * @return true if the table is built successfully.
    */
 private: bool ReadEditors(QHash<QString, EditorDescriptor::Pointer>& editorTable);
 
   /**
    * Read the file types and associate them to their defined editor(s).
    *
    * @param editorTable
    *            The editor table containing the defined editors.
    * @param reader
    *            Reader containing the preferences content for the resources.
    *
    * @throws WorkbenchException
    */
 public: void ReadResources(QHash<QString, EditorDescriptor::Pointer>& editorTable, std::ostream& reader);
 
   /**
    * Determine if the editors list contains the editor descriptor.
    *
    * @param editorsArray
    *      The list of editors
    * @param editorDescriptor
    *      The editor descriptor
    * @return <code>true</code> if the editors list contains the editor descriptor
    */
 private: bool Contains(const QList<IEditorDescriptor::Pointer>& editorsArray,
       IEditorDescriptor::Pointer editorDescriptor);
 
   /**
    * Creates the reader for the resources preferences defined in the
    * preference store.
    *
    * @param editorTable
    *            The editor table containing the defined editors.
-   * @return true if the resources are read succesfully.
+   * @return true if the resources are read successfully.
    */
 private: bool ReadResources(QHash<QString, EditorDescriptor::Pointer>& editorTable);
 
   /**
    * Load the serialized resource associations Return true if the operation
    * was successful, false otherwise
    */
 private: bool LoadAssociations();
 
   /**
    * Return a friendly version of the given key suitable for use in the editor
    * map.
    */
 private: QString MappingKeyFor(const QString& type);
 
   /**
    * Return a key that combines the file's name and extension of the given
    * mapping
    *
    * @param mapping the mapping to generate a key for
    */
 private: QString MappingKeyFor(FileEditorMapping::Pointer mapping);
 
   /**
    * Rebuild the editor map
    */
 private: void RebuildEditorMap();
 
   /**
    * Rebuild the internal editor mapping.
    */
 private: void RebuildInternalEditorMap();
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
   //    public: void RemovePropertyListener(IPropertyListener l) {
   //        removeListenerObject(l);
   //    }
 
   /**
    * Save the registry to the filesystem by serializing the current resource
    * associations.
    */
 public: void SaveAssociations();
 
   /**
    * Set the collection of FileEditorMappings. The given collection is
    * converted into the internal hash table for faster lookup Each mapping
    * goes from an extension to the collection of editors that work on it. This
    * operation will rebuild the internal editor mappings.
    *
    * @param newResourceTypes
-   *            te new file editor mappings.
+   *            the new file editor mappings.
    */
 public: void SetFileEditorMappings(const QList<FileEditorMapping::Pointer>& newResourceTypes);
 
   /*
    * (non-Javadoc) Method declared on IEditorRegistry.
    */
 public: void SetDefaultEditor(const QString& fileName, const QString& editorId) override;
 
   /**
    * Alphabetically sort the internal editors.
    *
    * @see #comparer
    */
 private: QList<IEditorDescriptor::Pointer> SortEditors(const QList<IEditorDescriptor::Pointer>& unsortedList);
 
   /**
    * Alphabetically sort the internal editors.
    *
    * @see #comparer
    */
 private: void SortInternalEditors();
 
   /*
    * (non-Javadoc)
    *
    * @see org.blueberry.ui.IEditorRegistry#isSystemInPlaceEditorAvailable(String)
    */
 public: bool IsSystemInPlaceEditorAvailable(const QString& filename) override;
 
   /*
    * (non-Javadoc)
    *
    * @see org.blueberry.ui.IEditorRegistry#isSystemExternalEditorAvailable(String)
    */
 public: bool IsSystemExternalEditorAvailable(const QString& filename) override;
 
   /*
    * (non-Javadoc)
    *
    * @see org.blueberry.ui.IEditorRegistry#getSystemExternalEditorImageDescriptor(java.lang.String)
    */
   //    public: ImageDescriptor GetSystemExternalEditorImageDescriptor(
   //            const QString& filename) {
   //        Program externalProgram = null;
   //        int extensionIndex = filename.lastIndexOf('.');
   //        if (extensionIndex >= 0) {
   //            externalProgram = Program.findProgram(filename
   //                    .substring(extensionIndex));
   //        }
   //        if (externalProgram == null) {
   //            return null;
   //        }
   //
   //        return new ExternalProgramImageDescriptor(externalProgram);
   //    }
 
   /**
    * Removes the entry with the value of the editor descriptor from the given
    * map. If the descriptor is the last descriptor in a given
    * FileEditorMapping then the mapping is removed from the map.
    *
    * @param map
    *            the map to search
    * @param desc
    *            the descriptor value to remove
    */
 private: void RemoveEditorFromMapping(QHash<QString, FileEditorMapping::Pointer>& map, IEditorDescriptor::Pointer desc);
 
 private: IExtensionPoint::Pointer GetExtensionPointFilter();
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorRegistry#getDefaultEditor(java.lang.String, org.blueberry.core.runtime.content.IContentType)
    */
   //  public: IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) {
   //        return getEditorForContentType(fileName, contentType);
   //  }
 
   /**
    * Return the editor for a file with a given content type.
    *
    * @param filename the file name
    * @param contentType the content type
    * @return the editor for a file with a given content type
    * @since 3.1
    */
     private: IEditorDescriptor::Pointer GetEditorForContentType(const QString& filename
         /*IContentType contentType*/);
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorRegistry#getEditors(java.lang.String, org.blueberry.core.runtime.content.IContentType)
    */
   //  public: QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) {
   //    return findRelatedObjects(contentType, fileName, relatedRegistry);
   //  }
 
   /* (non-Javadoc)
    * @see org.blueberry.ui.IEditorRegistry#getImageDescriptor(java.lang.String, org.blueberry.core.runtime.content.IContentType)
    */
   //  public: ImageDescriptor GetImageDescriptor(const QString filename, IContentType contentType) {
   //        if (filename == null) {
   //      return getDefaultImage();
   //    }
   //
   //    if (contentType != null) {
   //      IEditorDescriptor desc = getEditorForContentType(filename, contentType);
   //      if (desc != null) {
   //        ImageDescriptor anImage = (ImageDescriptor) extensionImages.get(desc);
   //        if (anImage != null) {
   //          return anImage;
   //        }
   //        anImage = desc.getImageDescriptor();
   //        extensionImages.put(desc, anImage);
   //        return anImage;
   //      }
   //    }
   //        // Lookup in the cache first...
   //        String key = mappingKeyFor(filename);
   //        ImageDescriptor anImage = (ImageDescriptor) extensionImages.get(key);
   //        if (anImage != null) {
   //      return anImage;
   //    }
   //
   //        // See if we have a mapping for the filename or extension
   //        FileEditorMapping[] mapping = getMappingForFilename(filename);
   //        for (int i = 0; i < 2; i++) {
   //            if (mapping[i] != null) {
   //                // Lookup in the cache first...
   //                String mappingKey = mappingKeyFor(mapping[i]);
   //                ImageDescriptor mappingImage = (ImageDescriptor) extensionImages
   //                        .get(key);
   //                if (mappingImage != null) {
   //          return mappingImage;
   //        }
   //                // Create it and cache it
   //                IEditorDescriptor editor = mapping[i].getDefaultEditor();
   //                if (editor != null) {
   //                    mappingImage = editor.getImageDescriptor();
   //                    extensionImages.put(mappingKey, mappingImage);
   //                    return mappingImage;
   //                }
   //            }
   //        }
   //
   //        // Nothing - time to look externally for the icon
   //        anImage = getSystemExternalEditorImageDescriptor(filename);
   //        if (anImage == null) {
   //      anImage = getDefaultImage();
   //    }
   //        //  for dynamic UI - comment out the next line
   //        //extensionImages.put(key, anImage);
   //        return anImage;
   //
   //  }
 
   /**
    * Find objects related to the content type.
    *
    * This method is temporary and exists only to back us off of the
    * soon-to-be-removed IContentTypeManager.IRelatedRegistry API.
    *
    * @param type
    * @param fileName
    * @param registry
    * @return the related objects
    */
     private: QList<IEditorDescriptor::Pointer> FindRelatedObjects(/*IContentType type,*/ const QString& fileName,
         RelatedRegistry& registry);
 
   /**
    * Return the editors bound to this content type, either directly or indirectly.
    *
    * @param type the content type to check
    * @return the editors
    * @since 3.1
    *
    * TODO: this should be rolled in with the above findRelatedObjects code
    */
   //  public: QList<IEditorDescriptor> GetEditorsForContentType(IContentType type) {
   //    ArrayList allRelated = new ArrayList();
   //    if (type == null) {
   //      return new IEditorDescriptor [0];
   //    }
   //
   //    Object [] related = relatedRegistry.getRelatedObjects(type);
   //    for (int i = 0; i < related.length; i++) {
   //      // we don't want to return duplicates
   //      if (!allRelated.contains(related[i])) {
   //        // if it's not filtered, add it to the list
   //        if (!WorkbenchActivityHelper.filterItem(related[i])) {
   //          allRelated.add(related[i]);
   //        }
   //
   //      }
   //    }
   //
   //    // now add any indirectly related objects, walking up the content type hierarchy
   //    while ((type = type.getBaseType()) != null) {
   //      related = relatedRegistry.getRelatedObjects(type);
   //      for (int i = 0; i < related.length; i++) {
   //        // we don't want to return duplicates
   //        if (!allRelated.contains(related[i])) {
   //          // if it's not filtered, add it to the list
   //          if (!WorkbenchActivityHelper.filterItem(related[i])) {
   //            allRelated.add(related[i]);
   //          }
   //        }
   //      }
   //    }
   //
   //    return (IEditorDescriptor[]) allRelated.toArray(new IEditorDescriptor[allRelated.size()]);
   //  }
 
   /**
    * Get filemappings for all defined filetypes, including those defined by content type.
    *
    * @return the filetypes
    * @since 3.1
    */
 public: QList<IFileEditorMapping::Pointer> GetUnifiedMappings();
 
 };
 
 class MockMapping : public IFileEditorMapping
 {
 
   //private: IContentType contentType;
 private:
   QString extension;
 private:
   QString filename;
 
   MockMapping(/*IContentType type,*/const QString& name,
       const QString& ext);
 
 public:
   IEditorDescriptor::Pointer GetDefaultEditor() override;
 
 public:
   QList<IEditorDescriptor::Pointer> GetEditors() const override;
 
 public:
   QList<IEditorDescriptor::Pointer> GetDeletedEditors() const override;
 
 public:
   QString GetExtension() const override;
 
   //  public: ImageDescriptor GetImageDescriptor() {
   //    IEditorDescriptor editor = getDefaultEditor();
   //    if (editor == null) {
   //      return WorkbenchImages
   //          .getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
   //    }
   //
   //    return editor.getImageDescriptor();
   //  }
 
 public:
   QString GetLabel() const override;
 
 public:
   QString GetName() const override;
 
   /* (non-Javadoc)
    * @see java.lang.Object#equals(java.lang.Object)
    */
 public:
   bool operator==(const Object* obj) const override;
 };
 
 }
 
 #endif /*BERRYEDITORREGISTRY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.cpp
index ea132a48e3..419749d786 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSashContainer.cpp
@@ -1,605 +1,605 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryEditorSashContainer.h"
 
 #include "berryPresentationSerializer.h"
 #include "berryWorkbenchConstants.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryLayoutTree.h"
 
 #include "berryWorkbenchWindowConfigurer.h"
 #include "berryWorkbenchWindow.h"
 #include "berryQtDnDControlWidget.h"
 
 #include "tweaklets/berryGuiWidgetsTweaklet.h"
 
 #include <Poco/HashMap.h>
 #include <sstream>
 
 namespace berry
 {
 
 const QString EditorSashContainer::DEFAULT_WORKBOOK_ID =
     "DefaultEditorWorkbook";
 
 void EditorSashContainer::AddChild(const RelationshipInfo& info)
 {
   PartSashContainer::AddChild(info);
 
   this->UpdateStackButtons();
 }
 
 void EditorSashContainer::ChildAdded(LayoutPart::Pointer child)
 {
   PartSashContainer::ChildAdded(child);
 
   if (child.Cast<PartStack> () != 0)
   {
     editorWorkbooks.push_back(child.Cast<PartStack> ());
   }
 }
 
 void EditorSashContainer::ChildRemoved(LayoutPart::Pointer child)
 {
   PartSashContainer::ChildRemoved(child);
 
   if (child.Cast<PartStack> () != 0)
   {
     editorWorkbooks.removeAll(child.Cast<PartStack>());
     if (activeEditorWorkbook == child)
     {
       this->SetActiveWorkbook(PartStack::Pointer(nullptr), false);
     }
 
     this->UpdateStackButtons();
   }
 }
 
 PartStack::Pointer EditorSashContainer::CreateDefaultWorkbook()
 {
   PartStack::Pointer newWorkbook = this->NewEditorWorkbook();
   newWorkbook->SetID(DEFAULT_WORKBOOK_ID);
   this->Add(newWorkbook);
   return newWorkbook;
 }
 
 void EditorSashContainer::AddDropSupport()
 {
   WorkbenchWindowConfigurer::Pointer winConfigurer = page->GetWorkbenchWindow().Cast<WorkbenchWindow>()->GetWindowConfigurer();
 
   QtDnDControlWidget* dropWidget = static_cast<QtDnDControlWidget*>(GetParent());
   dropWidget->SetTransferTypes(winConfigurer->GetTransfers());
   dropWidget->AddDropListener(winConfigurer->GetDropTargetListener());
 }
 
 PartStack::Pointer EditorSashContainer::NewEditorWorkbook()
 {
   PartStack::Pointer newWorkbook(new PartStack(page, true, PresentationFactoryUtil::ROLE_EDITOR));
   QString str;
   QTextStream buf(&str);
   buf << newWorkbook->GetClassName() << newWorkbook.GetPointer();
   newWorkbook->SetID(str);
 
   return newWorkbook;
 }
 
 QWidget* EditorSashContainer::CreateParent(QWidget* parentWidget)
 {
   //return Tweaklets::Get(GuiWidgetsTweaklet::KEY)->CreateComposite(parentWidget);
   return new QtDnDControlWidget(static_cast<QWidget*>(parentWidget));
 }
 
 void EditorSashContainer::DisposeParent()
 {
   this->parent = nullptr;
 }
 
 bool EditorSashContainer::IsActiveWorkbook(PartStack::Pointer workbook)
 {
   return activeEditorWorkbook == workbook;
 }
 
 PartStack::Pointer EditorSashContainer::CreateStack()
 {
   return this->NewEditorWorkbook();
 }
 
 void EditorSashContainer::SetVisiblePart(
     ILayoutContainer::Pointer container, PartPane::Pointer visiblePart)
 {
   PartStack::Pointer stack = container.Cast<PartStack>();
   if (stack == 0) return;
 
   stack->GetContainer().Cast<EditorSashContainer>()->SetActiveWorkbook(stack, true);
 
   stack->SetSelection(visiblePart);
 }
 
 LayoutPart::Pointer EditorSashContainer::GetVisiblePart(
     ILayoutContainer::Pointer container)
 {
   PartStack::Pointer refPart = container.Cast<PartStack>();
 
   return refPart->GetSelection();
 }
 
 EditorSashContainer::EditorSashContainer(const QString& editorId,
     WorkbenchPage* page, QWidget* parent)
  : PartSashContainer(editorId, page, parent)
 {
   this->CreateDefaultWorkbook();
 }
 
 bool EditorSashContainer::AllowsAdd(LayoutPart::Pointer layoutPart)
 {
   return LayoutPart::AllowsAdd(layoutPart);
 }
 
 void EditorSashContainer::AddEditor(PartPane::Pointer pane,
     PartStack::Pointer stack)
 {
   //EditorStack workbook = getActiveWorkbook();
   stack->Add(pane);
 }
 
 void EditorSashContainer::UpdateStackButtons()
 {
   //  // This is applicable only when the new
   //  // min/max behaviour is being used
   //  Perspective persp = getPage().getActivePerspective();
   //  if (!Perspective.useNewMinMax(persp))
   //    return;
   //
   //  // Find the upper Right editor stack
   //  LayoutPart[] stacks = getChildren();
   //  EditorStack winner = getUpperRightEditorStack(stacks);
   //
   //  // Now hide the buttons for all but the upper right stack
   //  for (int i = 0; i < stacks.length; i++)
   //  {
   //    if (!(stacks[i] instanceof EditorStack)
   //      )
   //      continue;
   //      ((EditorStack) stacks[i]).showMinMax(stacks[i] == winner);
   //  }
   //
   //  // Force the stack's presentation state to match its perspective
   //  persp.refreshEditorAreaVisibility();
 }
 
 PartStack::Pointer EditorSashContainer::GetUpperRightEditorStack()
 {
   return this->GetUpperRightEditorStack(this->GetChildren());
 }
 
 PartStack::Pointer EditorSashContainer::GetUpperRightEditorStack(
     const ILayoutContainer::ChildrenType& stacks)
 {
 
   // Find the upper Right editor stack
   PartStack::Pointer winner;
   QRect winnerRect;
 
   for (ILayoutContainer::ChildrenType::const_iterator iter = stacks.begin();
        iter != stacks.end(); ++iter)
   {
     LayoutPart::Pointer part = *iter;
     if (part.Cast<PartStack>() == 0)
       continue;
 
     PartStack::Pointer stack = part.Cast<PartStack>();
     QRect bb = stack->GetBounds();
     if (iter == stacks.begin() || bb.y() < winnerRect.y() || (bb.y() == winnerRect.y() && bb.x()
         > winnerRect.x()))
     {
       winner = stack;
       winnerRect = bb;
     }
   }
 
   return winner;
 }
 
 PartStack::Pointer EditorSashContainer::GetActiveWorkbook()
 {
   if (activeEditorWorkbook == 0)
   {
     if (editorWorkbooks.size() < 1)
     {
       this->SetActiveWorkbook(this->CreateDefaultWorkbook(), false);
     }
     else
     {
       this->SetActiveWorkbook(editorWorkbooks.front(), false);
     }
   }
 
   return activeEditorWorkbook;
 }
 
 QString EditorSashContainer::GetActiveWorkbookID()
 {
   return this->GetActiveWorkbook()->GetID();
 }
 
 QList<PartStack::Pointer> EditorSashContainer::GetEditorWorkbooks()
 {
   return editorWorkbooks;
 }
 
 std::size_t EditorSashContainer::GetEditorWorkbookCount()
 {
   return editorWorkbooks.size();
 }
 
 void EditorSashContainer::FindSashes(LayoutPart::Pointer pane,
     PartPane::Sashes& sashes)
 {
   //Find the sashes around the current editor and
   //then the sashes around the editor area.
   PartSashContainer::FindSashes(pane, sashes);
 
   ILayoutContainer::Pointer container = this->GetContainer();
   if (container != 0)
   {
     container->FindSashes(LayoutPart::Pointer(this), sashes);
   }
 }
 
 void EditorSashContainer::RemoveAllEditors()
 {
   PartStack::Pointer currentWorkbook = this->GetActiveWorkbook();
 
   // Iterate over a copy so the original can be modified.
   QList<PartStack::Pointer> workbooks(editorWorkbooks);
   for (QList<PartStack::Pointer>::iterator iter = workbooks.begin();
        iter != workbooks.end(); ++iter)
   {
     PartStack::Pointer workbook = *iter;
     QList<LayoutPart::Pointer> children = workbook->GetChildren();
     for (QList<LayoutPart::Pointer>::iterator childIter = children.begin();
          childIter != children.end(); ++childIter)
     {
       workbook->Remove(*childIter);
     }
 
     if (workbook != currentWorkbook)
     {
       this->Remove(workbook);
       workbook->Dispose();
     }
   }
 }
 
 void EditorSashContainer::RemoveEditor(PartPane::Pointer pane)
 {
   PartStack::Pointer workbook = pane->GetContainer().Cast<PartStack>();
   if (workbook == 0)
   {
     return;
   }
 
   workbook->Remove(pane);
 
   // remove the editor workbook if empty
   if (workbook->GetItemCount() < 1 /* && editorWorkbooks.size() > 1*/)
   {
     //    // If the user closes the last editor and the editor area
     //    // is maximized, restore it
     //    Perspective persp = getPage().getActivePerspective();
     //    if (Perspective.useNewMinMax(persp))
     //    {
     //      if (persp.getPresentation().getMaximizedStack() instanceof EditorStack)
     //      persp.getPresentation().getMaximizedStack().
     //      setState(IStackPresentationSite.STATE_RESTORED);
     //    }
 
     this->Remove(workbook);
     workbook->Dispose();
   }
 }
 
 bool EditorSashContainer::RestoreState(IMemento::Pointer memento)
 {
   //TODO EditorSashContainer restore state
 //  MultiStatus
 //      result =
 //          new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsRestoringPerspective, 0);
   bool result = true;
 
   // Remove the default editor workbook that is
-  // initialy created with the editor area.
+  // initially created with the editor area.
 
 //    StartupThreading.runWithoutExceptions(new StartupRunnable()
 //        {
 //
 //        public void runWithException() throws Throwable
 //        {
             PartStack::Pointer defaultWorkbook;
             for (ILayoutContainer::ChildrenType::iterator i = children.begin();
                 i != children.end(); ++i)
             {
               LayoutPart::Pointer child = *i;
               if (child->GetID() == DEFAULT_WORKBOOK_ID)
               {
                 defaultWorkbook = child.Cast<PartStack>();
                 if (defaultWorkbook->GetItemCount() > 0)
                 {
                   defaultWorkbook = nullptr;
                 }
               }
             }
             if (defaultWorkbook)
             {
               Remove(defaultWorkbook);
             }
 //          }}
 //        );
 
 
 
   // Restore the relationship/layout
   QList<IMemento::Pointer> infos(memento->GetChildren(WorkbenchConstants::TAG_INFO));
   QHash<QString, LayoutPart::Pointer> mapIDtoPart;
 
   for (int i = 0; i < infos.size(); i++)
   {
     // Get the info details.
     IMemento::Pointer childMem = infos[i];
     QString partID; childMem->GetString(WorkbenchConstants::TAG_PART, partID);
     QString relativeID; childMem->GetString(WorkbenchConstants::TAG_RELATIVE, relativeID);
     int relationship = 0;
     int left = 0, right = 0;
     if (!relativeID.isEmpty())
     {
       childMem->GetInteger(WorkbenchConstants::TAG_RELATIONSHIP, relationship);
       childMem->GetInteger(WorkbenchConstants::TAG_RATIO_LEFT, left);
       childMem->GetInteger(WorkbenchConstants::TAG_RATIO_RIGHT, right);
     }
 
     PartStack::Pointer workbook;
 //    StartupThreading.runWithoutExceptions(new StartupRunnable()
 //        {
 //
 //        public void runWithException() throws Throwable
 //          {
             // Create the part.
             workbook = NewEditorWorkbook();
             workbook->SetID(partID);
             // 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
             workbook->SetContainer(ILayoutContainer::Pointer(this));
 //          }}
 //        );
 
         IMemento::Pointer workbookMemento = childMem->GetChild(
             WorkbenchConstants::TAG_FOLDER);
         if (workbookMemento)
         {
           //result.add(workbook[0].restoreState(workbookMemento));
           result &= workbook->RestoreState(workbookMemento);
         }
 
         const int myLeft = left, myRight = right, myRelationship = relationship;
 //        StartupThreading.runWithoutExceptions(new StartupRunnable()
 //            {
 //
 //            public void runWithException() throws Throwable
 //              {
                 // Add the part to the layout
                 if (relativeID.isEmpty())
                 {
                   Add(workbook);
                 }
                 else
                 {
                   LayoutPart::Pointer refPart = mapIDtoPart[relativeID];
                   if (refPart)
                   {
                     Add(workbook, myRelationship, myLeft, myRight, refPart);
                   }
                   else
                   {
                     WorkbenchPlugin::Log("Unable to find part for ID: " + relativeID);
                   }
                 }
 //              }}
 //            );
 
             mapIDtoPart[partID] = workbook;
           }
 
           return result;
 }
 
 bool EditorSashContainer::SaveState(IMemento::Pointer memento)
 {
   QList<RelationshipInfo> relationships(ComputeRelation());
 //  MultiStatus
 //      result =
 //          new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsSavingPerspective, 0);
   bool result = true;
 
   for (int i = 0; i < relationships.size(); i++)
   {
     // Save the relationship info ..
     //    private LayoutPart part;
     //    private int relationship;
     //    private float ratio;
     //    private LayoutPart relative;
     const RelationshipInfo& info = relationships[i];
     IMemento::Pointer childMem = memento->CreateChild(
         WorkbenchConstants::TAG_INFO);
     childMem->PutString(WorkbenchConstants::TAG_PART, info.part->GetID());
 
     PartStack::Pointer stack = info.part.Cast<PartStack>();
     if (stack)
     {
       IMemento::Pointer folderMem = childMem->CreateChild(
           WorkbenchConstants::TAG_FOLDER);
       //result.add(stack.saveState(folderMem));
       result &= stack->SaveState(folderMem);
     }
 
     if (info.relative != 0)
     {
       childMem->PutString(WorkbenchConstants::TAG_RELATIVE, info.relative->GetID());
       childMem->PutInteger(WorkbenchConstants::TAG_RELATIONSHIP, info.relationship);
       childMem->PutInteger(WorkbenchConstants::TAG_RATIO_LEFT, info.left);
       childMem->PutInteger(WorkbenchConstants::TAG_RATIO_RIGHT, info.right);
     }
   }
 
   return result;
 }
 
 void EditorSashContainer::SetActiveWorkbook(PartStack::Pointer newWorkbook,
     bool hasFocus)
 {
   if (newWorkbook != 0)
   {
     if (std::find(editorWorkbooks.begin(), editorWorkbooks.end(), newWorkbook) == editorWorkbooks.end())
     {
       return;
     }
   }
 
   PartStack::Pointer oldWorkbook = activeEditorWorkbook;
   activeEditorWorkbook = newWorkbook;
 
   if (oldWorkbook != 0 && oldWorkbook != newWorkbook)
   {
     oldWorkbook->SetActive(StackPresentation::AS_INACTIVE);
   }
 
   if (newWorkbook != 0)
   {
     if (hasFocus)
     {
       newWorkbook->SetActive(StackPresentation::AS_ACTIVE_FOCUS);
     }
     else
     {
       newWorkbook->SetActive(StackPresentation::AS_ACTIVE_NOFOCUS);
     }
   }
 
   this->UpdateTabList();
 }
 
 void EditorSashContainer::SetActiveWorkbookFromID(const QString& id)
 {
   for (QList<PartStack::Pointer>::iterator iter = editorWorkbooks.begin();
        iter != editorWorkbooks.end(); ++iter)
   {
     PartStack::Pointer workbook = *iter;
     if (workbook->GetID() == id)
     {
       this->SetActiveWorkbook(workbook, false);
     }
   }
 }
 
 PartStack::Pointer EditorSashContainer::GetWorkbookFromID(const QString& id)
 {
   for (QList<PartStack::Pointer>::iterator iter = editorWorkbooks.begin();
        iter != editorWorkbooks.end(); ++iter)
   {
     PartStack::Pointer workbook = *iter;
     if (workbook->GetID() == id)
     {
       return workbook;
     }
   }
 
   return PartStack::Pointer(nullptr);
 }
 
 void EditorSashContainer::UpdateTabList()
 {
   QWidget* parent = this->GetParent();
   if (parent != nullptr)
   { // parent may be 0 on startup
     PartStack::Pointer wb(this->GetActiveWorkbook());
 //TODO EditorSashContainer update tab list
 //    if (wb == 0)
 //    {
 //      parent.setTabList(new Control[0]);
 //    }
 //    else
 //    {
 //      parent.setTabList(wb.getTabList());
 //    }
   }
 }
 
 void EditorSashContainer::CreateControl(QWidget* parent)
 {
   PartSashContainer::CreateControl(parent);
 
   ///let the user drop files/editor input on the editor area
   this->AddDropSupport();
 }
 
 bool EditorSashContainer::IsCompressible()
 {
   //Added for bug 19524
   return true;
 }
 
 bool EditorSashContainer::IsStackType(ILayoutContainer::Pointer toTest)
 {
   if (toTest.Cast<PartStack>() == 0)
     return false;
 
   return (toTest.Cast<PartStack> ()->GetAppearance()
       == PresentationFactoryUtil::ROLE_EDITOR);
 }
 
 bool EditorSashContainer::IsPaneType(LayoutPart::Pointer toTest)
 {
   if (toTest.Cast<PartPane>() == 0)
     return false;
 
   return (toTest.Cast<PartPane> ()->GetPartReference().Cast<IEditorReference> ()
       != 0);
 }
 
 bool EditorSashContainer::RestorePresentationState(IMemento::Pointer  /*areaMem*/)
 {
   QList<PartStack::Pointer> workbooks = this->GetEditorWorkbooks();
   for (QList<PartStack::Pointer>::iterator iter = workbooks.begin();
        iter != workbooks.end(); ++iter)
   {
     PartStack::Pointer workbook = *iter;
     IMemento::Pointer memento = workbook->GetSavedPresentationState();
     if (memento == 0)
     {
       continue;
     }
     QList<IPresentablePart::Pointer> parts = workbook->GetPresentableParts();
     PresentationSerializer serializer(parts);
     //StartupThreading.runWithoutExceptions(new StartupRunnable()
     //    {
 
     // public void runWithException() throws Throwable
     //   {
     workbook->GetPresentation()->RestoreState(&serializer, memento);
     //   }}
     // );
 
   }
   //return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", 0); //$NON-NLS-1$
   return true;
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSite.h b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSite.h
index 917032f56b..6b6f63aa2c 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryEditorSite.h
@@ -1,150 +1,150 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYEDITORSITE_H_
 #define BERRYEDITORSITE_H_
 
 #include "berryPartSite.h"
 #include "berryEditorDescriptor.h"
 #include "berryIEditorPart.h"
 #include "berryWorkbenchPage.h"
 #include "berryIEditorSite.h"
 #include "berryIEditorReference.h"
 
 namespace berry {
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * An editor container manages the services for an editor.
  */
 class EditorSite : public PartSite, public IEditorSite {
     /* package */ //static final int PROP_REUSE_EDITOR = -0x101;
 
 private:
   EditorDescriptor::Pointer desc;
 
     //ListenerList propChangeListeners = new ListenerList(1);
 
     // SubActionBars ab = null;
 
   /**
      * Initialize the local services.
      */
 //    void InitializeDefaultServices() {
 //      // Register an implementation of the service appropriate for the
 //      // EditorSite.
 //      final IDragAndDropService editorDTService = new EditorSiteDragAndDropServiceImpl();
 //      serviceLocator.registerService(IDragAndDropService.class, editorDTService);
 //    }
 
 protected:
 
   QString GetInitialScopeId() override;
 
 public:
 
   berryObjectMacro(EditorSite);
 
     /**
      * Constructs an EditorSite for an editor.
      */
     EditorSite(IEditorReference::Pointer ref, IEditorPart::Pointer editor,
             WorkbenchPage* page, EditorDescriptor::Pointer desc);
 
 //    void SetActionBars(SubActionBars bars) {
 //        super.setActionBars(bars);
 //
 //        if (bars instanceof IActionBars2) {
 //            ab = new SubActionBars2((IActionBars2)bars, this);
 //        } else {
 //            ab = new SubActionBars(bars, this);
 //        }
 //    }
 
 //    void ActivateActionBars(bool forceVisibility) {
 //        if (ab != null) {
 //            ab.activate(forceVisibility);
 //        }
 //        super.activateActionBars(forceVisibility);
 //    }
 
 //    void DeactivateActionBars(bool forceHide) {
 //        if (ab != null) {
 //            ab.deactivate(forceHide);
 //        }
 //        super.deactivateActionBars(forceHide);
 //    }
 
     /**
      * Returns the editor action bar contributor for this editor.
      * <p>
-     * An action contributor is responsable for the creation of actions.
+     * An action contributor is responsible 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
      */
 //    IEditorActionBarContributor::Pointer GetActionBarContributor() {
 //        EditorActionBars bars = (EditorActionBars) getActionBars();
 //        if (bars != null) {
 //      return bars.getEditorContributor();
 //    }
 //
 //        return null;
 //    }
 
     /**
      * Returns the extension editor action bar contributor for this editor.
      */
 //    IEditorActionBarContributor::Pointer GetExtensionActionBarContributor() {
 //        EditorActionBars bars = (EditorActionBars) getActionBars();
 //        if (bars != null) {
 //      return bars.getExtensionContributor();
 //    }
 //
 //        return null;
 //    }
 
     /**
      * Returns the editor
      */
     IEditorPart::Pointer GetEditorPart();
 
     EditorDescriptor::Pointer GetEditorDescriptor();
 
 
 //    void registerContextMenu(final MenuManager menuManager,
 //            final ISelectionProvider selectionProvider,
 //            final boolean includeEditorInput) {
 //        registerContextMenu(getId(), menuManager, selectionProvider,
 //                includeEditorInput);
 //    }
 //
 //    void registerContextMenu(final String menuId,
 //            final MenuManager menuManager,
 //            final ISelectionProvider selectionProvider,
 //            final boolean includeEditorInput) {
 //        if (menuExtenders == null) {
 //            menuExtenders = new ArrayList(1);
 //        }
 //
 //        PartSite.registerContextMenu(menuId, menuManager, selectionProvider,
 //                includeEditorInput, getPart(), menuExtenders);
 //    }
 };
 
 }
 
 #endif /*BERRYEDITORSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.cpp
index 7c23250034..92f2e9d911 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.cpp
@@ -1,415 +1,415 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryHandlerProxy.h"
 
 #include "berryIConfigurationElement.h"
 #include "berryIEvaluationContext.h"
 #include "berryIEvaluationService.h"
 #include "berryICommandService.h"
 #include "berryIContributor.h"
 #include "berryIEvaluationReference.h"
 
 #include "berryEvaluationResult.h"
 #include "berryExpression.h"
 #include "berryCoreException.h"
 #include "berryCommandExceptions.h"
 #include "berryUtil.h"
 #include "berryShell.h"
 #include "berryObjects.h"
 #include "berryObjectString.h"
 #include "berryUIElement.h"
 #include "berryRadioState.h"
 #include "berryRegistryToggleState.h"
 #include "berryHandlerEvent.h"
 #include "berryPlatformUI.h"
 #include "berryBundleUtility.h"
 #include "berryWorkbenchRegistryConstants.h"
 #include "berryStatus.h"
 #include "berryWorkbenchPlugin.h"
 
 #include <QMessageBox>
 
 namespace berry {
 
 QHash<SmartPointer<IConfigurationElement>, HandlerProxy*> HandlerProxy::CEToProxyMap =
     QHash<IConfigurationElement::Pointer, HandlerProxy*>();
 const QString HandlerProxy::PROP_ENABLED = "enabled";
 
 
 HandlerProxy::HandlerProxy(const QString commandId,
                            const SmartPointer<IConfigurationElement>& configurationElement,
                            const QString handlerAttributeName,
                            const SmartPointer<Expression> enabledWhenExpression,
                            IEvaluationService* evaluationService)
   : configurationElement(configurationElement)
   , enabledWhenExpression(enabledWhenExpression)
   , handlerAttributeName(handlerAttributeName)
   , evaluationService(evaluationService)
   , proxyEnabled(false)
   , commandId(commandId)
   , loadException(nullptr)
 {
   this->Register();
   if (configurationElement.IsNull())
   {
     throw ctkInvalidArgumentException(
         "The configuration element backing a handler proxy cannot be null");
   }
 
   if (handlerAttributeName.isNull())
   {
     throw ctkInvalidArgumentException(
         "The attribute containing the handler class must be known");
   }
 
   if (enabledWhenExpression.IsNotNull() && evaluationService == nullptr)
   {
     throw ctkInvalidArgumentException(
         "We must have a handler service and evaluation service to support the enabledWhen expression");
   }
 
   if (enabledWhenExpression.IsNotNull())
   {
     SetProxyEnabled(false);
     RegisterEnablement();
   }
   else
   {
     SetProxyEnabled(true);
   }
 
   CEToProxyMap.insert(configurationElement, this);
   this->UnRegister(false);
 }
 
 void HandlerProxy::UpdateStaleCEs(const QList<SmartPointer<IConfigurationElement> >& replacements)
 {
   foreach (const IConfigurationElement::Pointer& ce, replacements)
   {
     QHash<IConfigurationElement::Pointer, HandlerProxy*>::const_iterator i = CEToProxyMap.find(ce);
     if (i != CEToProxyMap.end())
     {
       (*i)->configurationElement = ce;
     }
   }
 }
 
 void HandlerProxy::SetEnabled(const Object::Pointer& evaluationContext)
 {
   IEvaluationContext* const context = dynamic_cast<IEvaluationContext*>(evaluationContext.GetPointer());
   if (context == nullptr)
   {
     return;
   }
   if (enabledWhenExpression.IsNotNull())
   {
     try
     {
       SetProxyEnabled(enabledWhenExpression->Evaluate(context) == EvaluationResult::TRUE_EVAL);
     }
     catch (const CoreException& /*e*/)
     {
       // TODO should we log this exception, or just treat it as
       // a failure
     }
   }
   if (IsOkToLoad() && LoadHandler())
   {
     handler->SetEnabled(evaluationContext);
   }
 }
 
 void HandlerProxy::Dispose()
 {
   if (handler.IsNotNull())
   {
     handler->RemoveHandlerListener(GetHandlerListener());
     handler->Dispose();
     handler = nullptr;
   }
   if (evaluationService && enablementRef)
   {
     evaluationService->RemoveEvaluationListener(enablementRef);
   }
   enablementRef = nullptr;
   delete loadException;
   loadException = nullptr;
 }
 
 Object::Pointer HandlerProxy::Execute(const SmartPointer<const ExecutionEvent>& event)
 {
   if (LoadHandler())
   {
     if (!IsEnabled())
     {
       Shell::Pointer shell = Util::GetShellToParentOn();
       QWidget* parent = nullptr;
       if (shell.IsNotNull()) parent = shell->GetControl();
       QMessageBox::information(parent, "Information", "The chosen operation is not enabled.");
       return Object::Pointer(nullptr);
     }
     return handler->Execute(event);
   }
 
   if(loadException != nullptr)
-    throw ExecutionException("Exception occured when loading the handler", *loadException);
+    throw ExecutionException("Exception occurred when loading the handler", *loadException);
 
   return Object::Pointer(nullptr);
 }
 
 bool HandlerProxy::IsEnabled() const
 {
   if (enabledWhenExpression.IsNotNull())
   {
     // proxyEnabled reflects the enabledWhen clause
     if (!GetProxyEnabled())
     {
       return false;
     }
     if (IsOkToLoad() && LoadHandler())
     {
       return handler->IsEnabled();
     }
 
     return true;
   }
 
   /*
    * There is no enabled when expression, so we just need to consult the
    * handler.
    */
   if (IsOkToLoad() && LoadHandler())
   {
     return handler->IsEnabled();
   }
   return true;
 }
 
 bool HandlerProxy::IsHandled() const
 {
   if (configurationElement.IsNotNull() && handler.IsNull())
   {
     return true;
   }
 
   if (IsOkToLoad() && LoadHandler())
   {
     return handler->IsHandled();
   }
 
   return false;
 }
 
 QString HandlerProxy::ToString() const
 {
   if (handler.IsNull())
   {
     if (configurationElement.IsNotNull())
     {
       const QString configurationElementAttribute = GetConfigurationElementAttribute();
       if (!configurationElementAttribute.isEmpty())
       {
         return configurationElementAttribute;
       }
     }
     return "HandlerProxy()";
   }
 
   return handler->ToString();
 }
 
 void HandlerProxy::UpdateElement(UIElement* element, const QHash<QString, Object::Pointer>& parameters)
 {
   if (checkedState.IsNotNull())
   {
     ObjectBool::Pointer value = checkedState->GetValue().Cast<ObjectBool>();
     element->SetChecked(value->GetValue());
   }
   else if (radioState.IsNotNull())
   {
     ObjectString::Pointer value = radioState->GetValue().Cast<ObjectString>();
     Object::Pointer parameter = parameters[RadioState::PARAMETER_ID];
     element->SetChecked(value.IsNotNull() && parameter == value);
   }
   if (handler.IsNotNull())
   {
     if (IElementUpdater::Pointer updater = handler.Cast<IElementUpdater>())
     {
       updater->UpdateElement(element, parameters);
     }
   }
 }
 
 void HandlerProxy::HandleStateChange(const SmartPointer<State>& state, const Object::Pointer& oldValue)
 {
   if (state->GetId() == RegistryToggleState::STATE_ID)
   {
     checkedState = state;
     RefreshElements();
   }
   else if (state->GetId() == RadioState::STATE_ID)
   {
     radioState = state;
     RefreshElements();
   }
   if (IStateListener* stateListener = dynamic_cast<IStateListener*>(handler.GetPointer()))
   {
     stateListener->HandleStateChange(state, oldValue);
   }
 }
 
 SmartPointer<IConfigurationElement> HandlerProxy::GetConfigurationElement() const
 {
   return configurationElement;
 }
 
 QString HandlerProxy::GetAttributeName() const
 {
   return handlerAttributeName;
 }
 
 SmartPointer<IHandler> HandlerProxy::GetHandler() const
 {
   return handler;
 }
 
 void HandlerProxy::RegisterEnablement()
 {
   enablementRef = evaluationService->AddEvaluationListener(
         enabledWhenExpression, GetEnablementListener(), PROP_ENABLED);
 }
 
 void HandlerProxy::SetProxyEnabled(bool enabled)
 {
   proxyEnabled = enabled;
 }
 
 bool HandlerProxy::GetProxyEnabled() const
 {
   return proxyEnabled;
 }
 
 IPropertyChangeListener* HandlerProxy::GetEnablementListener() const
 {
   return const_cast<HandlerProxy*>(this);
 }
 
 void HandlerProxy::PropertyChange(const SmartPointer<PropertyChangeEvent>& event)
 {
   if (event->GetProperty() == PROP_ENABLED)
   {
     SetProxyEnabled(event->GetNewValue().IsNull() ?
                       false : event->GetNewValue().Cast<ObjectBool>()->GetValue());
     HandlerEvent::Pointer event(new HandlerEvent(IHandler::Pointer(this), true, false));
     FireHandlerChanged(event);
   }
 }
 
 bool HandlerProxy::LoadHandler() const
 {
   if (handler.IsNull())
   {
     HandlerProxy* self = const_cast<HandlerProxy*>(this);
     // Load the handler.
     try
     {
       if (configurationElement.IsNotNull())
       {
         handler = configurationElement->CreateExecutableExtension<IHandler>(handlerAttributeName);
         if (handler.IsNotNull())
         {
           handler->AddHandlerListener(GetHandlerListener());
           self->SetEnabled(evaluationService == nullptr ? IEvaluationContext::Pointer(nullptr) : evaluationService->GetCurrentState());
           self->RefreshElements();
           return true;
         }
         else
         {
           const QString message = "The proxied handler was the wrong class";
           IStatus::Pointer status(
                 new Status(IStatus::ERROR_TYPE, PlatformUI::PLUGIN_ID(), 0, message, BERRY_STATUS_LOC));
           WorkbenchPlugin::Log(message, status);
           configurationElement = nullptr;
           loadException = new ctkException("Class cast exception");
         }
       }
     }
     catch (const CoreException& e)
     {
       const QString message = "The proxied handler for '" + configurationElement->GetAttribute(handlerAttributeName)
           + "' could not be loaded";
       IStatus::Pointer status(
             new Status(IStatus::ERROR_TYPE, PlatformUI::PLUGIN_ID(), 0, message, e, BERRY_STATUS_LOC));
       WorkbenchPlugin::Log(message, status);
       configurationElement = nullptr;
       loadException = e.clone();
     }
     return false;
   }
 
   return true;
 }
 
 IHandlerListener* HandlerProxy::GetHandlerListener() const
 {
   return const_cast<HandlerProxy*>(this);
 }
 
 void HandlerProxy::HandlerChanged(const SmartPointer<HandlerEvent>& handlerEvent)
 {
   HandlerEvent::Pointer event(new HandlerEvent(IHandler::Pointer(this),
                                                handlerEvent->IsEnabledChanged(),
                                                handlerEvent->IsHandledChanged()));
   FireHandlerChanged(event);
 }
 
 QString HandlerProxy::GetConfigurationElementAttribute() const
 {
   const QString attribute = configurationElement->GetAttribute(handlerAttributeName);
   if (attribute.isNull())
   {
     QList<IConfigurationElement::Pointer> children = configurationElement->GetChildren(handlerAttributeName);
     foreach (const IConfigurationElement::Pointer& child, children)
     {
       const QString childAttribute = child->GetAttribute(WorkbenchRegistryConstants::ATT_CLASS);
       if (!childAttribute.isNull())
       {
         return childAttribute;
       }
     }
   }
   return attribute;
 }
 
 bool HandlerProxy::IsOkToLoad() const
 {
   if (configurationElement.IsNotNull() && handler.IsNull())
   {
     const QString bundleId = configurationElement->GetContributor()->GetName();
     return BundleUtility::IsActive(bundleId);
   }
   return true;
 }
 
 void HandlerProxy::RefreshElements()
 {
   if (commandId.isNull() || (!(handler.Cast<IElementUpdater>())
       && (checkedState.IsNull() && radioState.IsNull())))
   {
     return;
   }
   ICommandService* cs = PlatformUI::GetWorkbench()->GetService<ICommandService>();
   cs->RefreshElements(commandId, QHash<QString, Object::Pointer>());
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h b/Plugins/org.blueberry.ui.qt/src/internal/berryHandlerProxy.h
index 82deb4cc46..dc4bdc1050 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);
 
 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.
+   * Passes the dispose 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
+   * Retrieves 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/berryLayoutHelper.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutHelper.h
index b99eea53c7..21dbaa28f6 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutHelper.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutHelper.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 BERRYLAYOUTHELPER_H_
 #define BERRYLAYOUTHELPER_H_
 
 #include "berryViewFactory.h"
 #include "berryPartPane.h"
 
 namespace berry {
 
 class PageLayout;
 
 /**
  * Helper methods that the internal layout classes (<code>PageLayout</code> and
  * <code>FolderLayout</code>) utilize for activities support and view creation.
  *
  * @since 3.0
  */
 class LayoutHelper {
 
 
 private:
 
   /**
    * Not intended to be instantiated.
    */
   LayoutHelper();
 
 public:
 
     /**
      * Creates a series of listeners that will activate the provided view on the
      * provided page layout when <code>IIdentifier</code> enablement changes. The
      * rules for this activation are as follows: <p>
      * <ul>
      * <li> if the identifier becomes enabled and the perspective of the page
      * layout is the currently active perspective in its window, then activate
      * the views immediately.
      * <li> if the identifier becomes enabled and the perspective of the page
-     * layout is not the currently active perspecitve in its window, then add an
+     * layout is not the currently active perspective in its window, then add an
      * <code>IPerspectiveListener</code> to the window and activate the views
      * when the perspective becomes active.
      *
      * @param pageLayout <code>PageLayout</code>.
      * @param viewId the view id to activate upon <code>IIdentifier</code> enablement.
      */
     static void AddViewActivator(SmartPointer<PageLayout> pageLayout,
             const QString& viewId);
 
     /**
      * Create the view.  If it's already been been created in the provided
      * factory, return the shared instance.
      *
      * @param factory the <code>ViewFactory</code> to use.
      * @param viewID the view id to use.
      * @return the new <code>ViewPane</code>.
      * @throws PartInitException thrown if there is a problem creating the view.
      */
     static PartPane::Pointer CreateView(ViewFactory* factory, const QString& viewId);
 
 };
 
 }
 
 #endif /* BERRYLAYOUTHELPER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTree.h
index 9693505e10..5df984c5b9 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
+ * Implementation of a tree where the node is always a sash
+ * and it always has two children. 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);
 
   /* 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.
+   * Adds two positive integers. Treats 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)
+   * @return a bitwise combination 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.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.cpp
index d786f4e2c7..61999ca3f6 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.cpp
@@ -1,719 +1,719 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryLayoutTreeNode.h"
 
 #include "berryConstants.h"
 #include "berryIPageLayout.h"
 
 #include <sstream>
 
 namespace berry
 {
 
 LayoutTreeNode::ChildSizes::ChildSizes (int l, int r, bool resize)
 {
   left = l;
   right = r;
   resizable = resize;
 }
 
 LayoutTreeNode::LayoutTreeNode(LayoutPartSash::Pointer sash)
  : LayoutTree(sash)
 {
   children[0] = nullptr;
   children[1] = nullptr;
 }
 
 LayoutTreeNode::~LayoutTreeNode()
 {
 
 }
 
 void LayoutTreeNode::FlushChildren()
 {
   LayoutTree::FlushChildren();
 
   children[0]->FlushChildren();
   children[1]->FlushChildren();
 }
 
 LayoutPart::Pointer LayoutTreeNode::FindPart(const QPoint& toFind)
 {
   if (!children[0]->IsVisible())
   {
     if (!children[1]->IsVisible())
     {
       return LayoutPart::Pointer(nullptr);
     }
 
     return children[1]->FindPart(toFind);
   }
   else
   {
     if (!children[1]->IsVisible())
     {
       return children[0]->FindPart(toFind);
     }
   }
 
   LayoutPartSash::Pointer sash = this->GetSash();
 
   QRect bounds = sash->GetBounds();
 
   if (sash->IsVertical())
   {
     if (toFind.x() < bounds.x() + (bounds.width() / 2))
     {
       return children[0]->FindPart(toFind);
     }
     return children[1]->FindPart(toFind);
   }
   else
   {
     if (toFind.y() < bounds.y() + (bounds.height() / 2))
     {
       return children[0]->FindPart(toFind);
     }
     return children[1]->FindPart(toFind);
   }
 }
 
 LayoutPart::Pointer LayoutTreeNode::ComputeRelation(
     QList<PartSashContainer::RelationshipInfo>& relations)
 {
   PartSashContainer::RelationshipInfo r =
       PartSashContainer::RelationshipInfo();
   r.relative = children[0]->ComputeRelation(relations);
   r.part = children[1]->ComputeRelation(relations);
   r.left = this->GetSash()->GetLeft();
   r.right = this->GetSash()->GetRight();
   r.relationship = this->GetSash()->IsVertical() ? IPageLayout::RIGHT : IPageLayout::BOTTOM;
   relations.push_front(r);
   return r.relative;
 }
 
 void LayoutTreeNode::DisposeSashes()
 {
   children[0]->DisposeSashes();
   children[1]->DisposeSashes();
   this->GetSash()->Dispose();
 }
 
 LayoutTree::Pointer LayoutTreeNode::Find(LayoutPart::Pointer child)
 {
   LayoutTree::Pointer node = children[0]->Find(child);
   if (node != 0)
   {
     return node;
   }
   node = children[1]->Find(child);
   return node;
 }
 
 LayoutPart::Pointer LayoutTreeNode::FindBottomRight()
 {
   if (children[1]->IsVisible())
   {
     return children[1]->FindBottomRight();
   }
   return children[0]->FindBottomRight();
 }
 
 LayoutTreeNode* LayoutTreeNode::FindCommonParent(LayoutPart::Pointer child1,
     LayoutPart::Pointer child2, bool foundChild1,
     bool foundChild2)
 {
   if (!foundChild1)
   {
     foundChild1 = this->Find(child1) != 0;
   }
   if (!foundChild2)
   {
     foundChild2 = this->Find(child2) != 0;
   }
   if (foundChild1 && foundChild2)
   {
     return this;
   }
   if (parent == nullptr)
   {
     return nullptr;
   }
   return parent
   ->FindCommonParent(child1, child2, foundChild1, foundChild2);
 }
 
 LayoutTreeNode::Pointer LayoutTreeNode::FindSash(LayoutPartSash::Pointer sash)
 {
   if (this->GetSash() == sash)
   {
     return LayoutTreeNode::Pointer(this);
   }
   LayoutTreeNode::Pointer node = children[0]->FindSash(sash);
   if (node != 0)
   {
     return node;
   }
   node = children[1]->FindSash(sash);
   if (node != 0)
   {
     return node;
   }
   return LayoutTreeNode::Pointer(nullptr);
 }
 
 void LayoutTreeNode::FindSashes(LayoutTree::Pointer child, PartPane::Sashes sashes)
 {
   QWidget* sash = this->GetSash()->GetControl();
   bool leftOrTop = children[0] == child;
   if (sash != nullptr)
   {
     LayoutPartSash::Pointer partSash = this->GetSash();
     //If the child is in the left, the sash
-    //is in the rigth and so on.
+    //is in the right and so on.
     if (leftOrTop)
     {
       if (partSash->IsVertical())
       {
         if (sashes.right == nullptr)
         {
           sashes.right = sash;
         }
       }
       else
       {
         if (sashes.bottom == nullptr)
         {
           sashes.bottom = sash;
         }
       }
     }
     else
     {
       if (partSash->IsVertical())
       {
         if (sashes.left == nullptr)
         {
           sashes.left = sash;
         }
       }
       else
       {
         if (sashes.top == nullptr)
         {
           sashes.top = sash;
         }
       }
     }
   }
   if (this->GetParent() != nullptr)
   {
     this->GetParent()->FindSashes(LayoutTree::Pointer(this), sashes);
   }
 }
 
 LayoutPartSash::Pointer LayoutTreeNode::GetSash() const
 {
   return part.Cast<LayoutPartSash>();
 }
 
 int LayoutTreeNode::GetSashSize() const
 {
   return this->GetSash()->GetSashSize();
 }
 
 bool LayoutTreeNode::IsVisible()
 {
   return children[0]->IsVisible() || children[1]->IsVisible();
 }
 
 LayoutTree::Pointer LayoutTreeNode::Remove(LayoutTree::Pointer child)
 {
   this->GetSash()->Dispose();
   if (parent == nullptr)
   {
     //This is the root. Return the other child to be the new root.
     if (children[0] == child)
     {
       children[1]->SetParent(nullptr);
       return children[1];
     }
     children[0]->SetParent(nullptr);
     return children[0];
   }
 
   LayoutTreeNode::Pointer oldParent(parent);
   if (children[0] == child)
   {
     oldParent->ReplaceChild(LayoutTree::Pointer(this), children[1]);
   }
   else
   {
     oldParent->ReplaceChild(LayoutTree::Pointer(this), children[0]);
   }
   return oldParent;
 }
 
 void LayoutTreeNode::ReplaceChild(LayoutTree::Pointer oldChild, LayoutTree::Pointer newChild)
 {
   if (children[0] == oldChild)
   {
     children[0] = newChild;
   }
   else if (children[1] == oldChild)
   {
     children[1] = newChild;
   }
   newChild->SetParent(this);
   if (!children[0]->IsVisible() || !children[0]->IsVisible())
   {
     this->GetSash()->Dispose();
   }
 
   this->FlushCache();
 }
 
 bool LayoutTreeNode::SameDirection(bool isVertical, LayoutTreeNode::Pointer subTree)
 {
   bool treeVertical = this->GetSash()->IsVertical();
   if (treeVertical != isVertical)
   {
     return false;
   }
   while (subTree != 0)
   {
     if (this == subTree.GetPointer())
     {
       return true;
     }
     if (subTree->children[0]->IsVisible() && subTree->children[1]->IsVisible())
     {
       if (subTree->GetSash()->IsVertical() != isVertical)
       {
         return false;
       }
     }
     subTree = subTree->GetParent();
   }
   return true;
 }
 
 int LayoutTreeNode::DoComputePreferredSize(bool width, int availableParallel,
     int availablePerpendicular, int preferredParallel)
 {
   this->AssertValidSize(availablePerpendicular);
   this->AssertValidSize(availableParallel);
   this->AssertValidSize(preferredParallel);
 
   // If one child is invisible, defer to the other child
   if (!children[0]->IsVisible())
   {
     return children[1]->ComputePreferredSize(width, availableParallel,
         availablePerpendicular, preferredParallel);
   }
 
   if (!children[1]->IsVisible())
   {
     return children[0]->ComputePreferredSize(width, availableParallel,
         availablePerpendicular, preferredParallel);
   }
 
   if (availableParallel == 0)
   {
     return 0;
   }
 
   // If computing the dimension perpendicular to our sash
   if (width == this->GetSash()->IsVertical())
   {
     // Compute the child sizes
     ChildSizes sizes = this->ComputeChildSizes(availableParallel,
         availablePerpendicular,
         GetSash()->GetLeft(), GetSash()->GetRight(), preferredParallel);
 
     // Return the sum of the child sizes plus the sash size
     return this->Add(sizes.left, this->Add(sizes.right, this->GetSashSize()));
   }
   else
   {
     // Computing the dimension parallel to the sash. We will compute and return the preferred size
     // of whichever child is closest to the ideal size.
 
     // First compute the dimension of the child sizes perpendicular to the sash
     ChildSizes sizes = this->ComputeChildSizes(availablePerpendicular, availableParallel,
         GetSash()->GetLeft(), GetSash()->GetRight(), availablePerpendicular);
 
     // Use this information to compute the dimension of the child sizes parallel to the sash.
     // Return the preferred size of whichever child is largest
     int leftSize = children[0]->ComputePreferredSize(width, availableParallel,
         sizes.left, preferredParallel);
 
     // Compute the preferred size of the right child
     int rightSize = children[1]->ComputePreferredSize(width, availableParallel,
         sizes.right, preferredParallel);
 
     // Return leftSize or rightSize: whichever one is largest
     int result = rightSize;
     if (leftSize > rightSize)
     {
       result = leftSize;
     }
 
     this->AssertValidSize(result);
 
     return result;
   }
 }
 
 LayoutTreeNode::ChildSizes LayoutTreeNode::ComputeChildSizes(int width, int height, int left,
     int right, int preferredWidth)
 {
   poco_assert(children[0]->IsVisible());
   poco_assert(children[1]->IsVisible());
   this->AssertValidSize(width);
   this->AssertValidSize(height);
   this->AssertValidSize(preferredWidth);
   poco_assert(left >= 0);
   poco_assert(right >= 0);
   poco_assert(preferredWidth >= 0);
   poco_assert(preferredWidth <= width);
   bool vertical = this->GetSash()->IsVertical();
 
   if (width <= this->GetSashSize())
   {
     return ChildSizes(0,0, false);
   }
 
   if (width == INF)
   {
     if (preferredWidth == INF)
     {
       return ChildSizes(children[0]->ComputeMaximumSize(vertical, height),
           children[1]->ComputeMaximumSize(vertical, height), false);
     }
 
     if (preferredWidth == 0)
     {
       return ChildSizes(children[0]->ComputeMinimumSize(vertical, height),
           children[1]->ComputeMinimumSize(vertical, height), false);
     }
   }
 
   int total = left + right;
 
   // Use all-or-none weighting
   double wLeft = left, wRight = right;
   switch (this->GetCompressionBias())
   {
   case -1:
     wLeft = 0.0;
     break;
   case 1:
     wRight = 0.0;
     break;
   default:
     break;
   }
   double wTotal = wLeft + wRight;
 
   // Subtract the SASH_WIDTH from preferredWidth and width. From here on, we'll deal with the
   // width available to the controls and neglect the space used by the sash.
   preferredWidth = std::max<int>(0, this->Subtract(preferredWidth, this->GetSashSize()));
   width = std::max<int>(0, this->Subtract(width, this->GetSashSize()));
 
   int redistribute = this->Subtract(preferredWidth, total);
 
   // Compute the minimum and maximum sizes for each child
   int leftMinimum = children[0]->ComputeMinimumSize(vertical, height);
   int rightMinimum = children[1]->ComputeMinimumSize(vertical, height);
   int leftMaximum = children[0]->ComputeMaximumSize(vertical, height);
   int rightMaximum = children[1]->ComputeMaximumSize(vertical, height);
 
   int idealLeft = 0;
   int idealRight = 0;
   if (PartSashContainer::leftToRight)
   {
     // Keep track of the available space for each child, given the minimum size of the other child
     int leftAvailable = std::min<int>(leftMaximum, std::max<int>(0, this->Subtract(width,
         rightMinimum)));
     int rightAvailable = std::min<int>(rightMaximum, std::max<int>(0, this->Subtract(width,
         leftMinimum)));
 
     // Figure out the ideal size of the left child
     idealLeft = std::max<int>(leftMinimum, std::min<int>(preferredWidth, left
         + (int)(redistribute * wLeft / wTotal)));
 
     // If the right child can't use all its available space, let the left child fill it in
     idealLeft = std::max<int>(idealLeft, preferredWidth - rightAvailable);
     // Ensure the left child doesn't get larger than its available space
     idealLeft = std::min<int>(idealLeft, leftAvailable);
 
     // Check if the left child would prefer to be a different size
     idealLeft = children[0]->ComputePreferredSize(vertical, leftAvailable, height,
         idealLeft);
 
     // Ensure that the left child is larger than its minimum size
     idealLeft = std::max<int>(idealLeft, leftMinimum);
     idealLeft = std::min<int>(idealLeft, leftAvailable);
 
     // Compute the right child width
     idealRight = std::max<int>(rightMinimum, preferredWidth - idealLeft);
 
     rightAvailable = std::max<int>(0, std::min<int>(rightAvailable, this->Subtract(width,
         idealLeft)));
     idealRight = std::min<int>(idealRight, rightAvailable);
     idealRight = children[1]->ComputePreferredSize(vertical, rightAvailable,
         height, idealRight);
     idealRight = std::max<int>(idealRight, rightMinimum);
   }
   else
   {
     // Keep track of the available space for each child, given the minimum size of the other child
     int rightAvailable = std::min<int>(rightMaximum, std::max<int>(0, this->Subtract(width,
         leftMinimum)));
     int leftAvailable = std::min<int>(leftMaximum, std::max<int>(0, this->Subtract(width,
         rightMinimum)));
 
     // Figure out the ideal size of the right child
     idealRight = std::max<int>(rightMinimum, std::min<int>(preferredWidth, right
         + (int)(redistribute * wRight / wTotal)));
 
     // If the left child can't use all its available space, let the right child fill it in
     idealRight = std::max<int>(idealRight, preferredWidth - leftAvailable);
     // Ensure the right child doesn't get larger than its available space
     idealRight = std::min<int>(idealRight, rightAvailable);
 
     // Check if the right child would prefer to be a different size
     idealRight = children[1]->ComputePreferredSize(vertical, rightAvailable, height,
         idealRight);
 
     // Ensure that the right child is larger than its minimum size
     idealRight = std::max<int>(idealRight, rightMinimum);
     idealRight = std::min<int>(idealRight, rightAvailable);
 
     // Compute the left child width
     idealLeft = std::max<int>(leftMinimum, preferredWidth - idealRight);
 
     leftAvailable = std::max<int>(0, std::min<int>(leftAvailable, this->Subtract(width,
         idealRight)));
     idealLeft = std::min<int>(idealLeft, leftAvailable);
     idealLeft = children[0]->ComputePreferredSize(vertical, leftAvailable,
         height, idealLeft);
     idealLeft = std::max<int>(idealLeft, leftMinimum);
   }
 
   return ChildSizes(idealLeft, idealRight, leftMaximum> leftMinimum
       && rightMaximum> rightMinimum
       && leftMinimum + rightMinimum < width);
 }
 
 int LayoutTreeNode::DoGetSizeFlags(bool width)
 {
   if (!children[0]->IsVisible())
   {
     return children[1]->GetSizeFlags(width);
   }
 
   if (!children[1]->IsVisible())
   {
     return children[0]->GetSizeFlags(width);
   }
 
   int leftFlags = children[0]->GetSizeFlags(width);
   int rightFlags = children[1]->GetSizeFlags(width);
 
   return ((leftFlags | rightFlags) & ~Constants::MAX) | (leftFlags & rightFlags
       & Constants::MAX);
 }
 
 void LayoutTreeNode::DoSetBounds(const QRect& b)
 {
   if (!children[0]->IsVisible())
   {
     children[1]->SetBounds(b);
     this->GetSash()->SetVisible(false);
     return;
   }
   if (!children[1]->IsVisible())
   {
     children[0]->SetBounds(b);
     this->GetSash()->SetVisible(false);
     return;
   }
 
   QRect bounds = b;
 
   bool vertical = this->GetSash()->IsVertical();
 
   // If this is a horizontal sash, flip coordinate systems so
   // that we can eliminate special cases
   if (!vertical)
   {
     bounds = FlipRect(bounds);
   }
 
   ChildSizes childSizes = this->ComputeChildSizes(bounds.width(), bounds.height(),
       this->GetSash()->GetLeft(), this->GetSash()->GetRight(), bounds.width());
 
   this->GetSash()->SetVisible(true);
   this->GetSash()->SetEnabled(childSizes.resizable);
 
   QRect leftBounds = QRect(bounds.x(), bounds.y(), childSizes.left, bounds.height());
   QRect sashBounds = QRect(leftBounds.x() + leftBounds.width(), bounds.y(), this->GetSashSize(), bounds.height());
   QRect rightBounds = QRect(sashBounds.x() + sashBounds.width(), bounds.y(),
                             childSizes.right, bounds.height());
 
   if (!vertical)
   {
     leftBounds = FlipRect(leftBounds);
     sashBounds = FlipRect(sashBounds);
     rightBounds = FlipRect(rightBounds);
   }
 
   this->GetSash()->SetBounds(sashBounds);
   children[0]->SetBounds(leftBounds);
   children[1]->SetBounds(rightBounds);
 }
 
 void LayoutTreeNode::CreateControl(QWidget* parent)
 {
   children[0]->CreateControl(parent);
   children[1]->CreateControl(parent);
   this->GetSash()->CreateControl(parent);
 
   LayoutTree::CreateControl(parent);
 }
 
 bool LayoutTreeNode::IsCompressible()
 {
   return children[0]->IsCompressible() || children[1]->IsCompressible();
 }
 
 int LayoutTreeNode::GetCompressionBias()
 {
   bool left = children[0]->IsCompressible();
   bool right = children[1]->IsCompressible();
   if (left == right)
   {
     return 0;
   }
   if (right)
   {
     return -1;
   }
   return 1;
 }
 
 bool LayoutTreeNode::IsLeftChild(LayoutTree::ConstPointer toTest)
 {
   return children[0] == toTest;
 }
 
 LayoutTree::Pointer LayoutTreeNode::GetChild(bool left)
 {
   int index = left ? 0 : 1;
   return (children[index]);
 }
 
 void LayoutTreeNode::SetChild(bool left, LayoutPart::Pointer part)
 {
   LayoutTree::Pointer child(new LayoutTree(part));
   this->SetChild(left, child);
   this->FlushCache();
 }
 
 void LayoutTreeNode::SetChild(bool left, LayoutTree::Pointer child)
 {
   int index = left ? 0 : 1;
   children[index] = child;
   child->SetParent(this);
   this->FlushCache();
 }
 
 QString LayoutTreeNode::ToString() const
 {
   QString str;
   QTextStream s(&str);
   s << "<null>\n";
   if (part->GetControl() != nullptr)
   {
     s << "<@" << part->GetControl() << ">\n";
   }
   QString str2;
   QTextStream result(&str2);
   result << "[";
   if (children[0]->GetParent() != this)
   {
     result << str2 << "{" << children[0] << "}" << str;
   }
   else
   {
     result << str2 << children[0] << str;
   }
 
   if (children[1]->GetParent() != this)
   {
     result << str2 << "{" << children[1] << "}]";
   }
   else
   {
     result << str2 << children[1] << "]";
   }
   return str2;
 }
 
 //void LayoutTreeNode::UpdateSashes(QWidget* parent) {
 //        if (parent == 0)
 //            return;
 //        children[0]->UpdateSashes(parent);
 //        children[1]->UpdateSashes(parent);
 //        if (children[0]->IsVisible() && children[1]->IsVisible())
 //            this->GetSash()->CreateControl(parent);
 //        else
 //            this->GetSash()->Dispose();
 //    }
 
 void LayoutTreeNode::DescribeLayout(QString& buf) const
 {
   if (!(children[0]->IsVisible()))
   {
     if (!children[1]->IsVisible())
     {
       return;
     }
 
     children[1]->DescribeLayout(buf);
     return;
   }
 
   if (!children[1]->IsVisible())
   {
     children[0]->DescribeLayout(buf);
     return;
   }
 
   buf.append("("); //$NON-NLS-1$
   children[0]->DescribeLayout(buf);
 
   buf.append(this->GetSash()->IsVertical() ? "|" : "-");
 
   children[1]->DescribeLayout(buf);
   buf.append(")");
 }
 
 QRect LayoutTreeNode::FlipRect(const QRect& rect)
 {
   return QRect(rect.y(), rect.x(), rect.height(), rect.width());
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h b/Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.h
index 16e29546d0..6b4367643c 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.
+ * sash and it always has two children.
  */
 class LayoutTreeNode : public LayoutTree {
 
 public:
 
   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
+     * Left,Right,Top and Bottom 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/berryPartList.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartList.h
index 66e2ad7237..596b616943 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartList.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartList.h
@@ -1,186 +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 BERRYPARTLIST_H_
 #define BERRYPARTLIST_H_
 
 #include "berryWorkbenchPartReference.h"
 #include "berryILayoutContainer.h"
 
 #include "berryIEditorReference.h"
 #include "berryIViewReference.h"
 
 #include <deque>
 
 namespace berry
 {
 
 class PartList : public IPropertyChangeListener {
 
 private:
 
   // list of parts in the activation order (oldest last)
   //std::deque<IWorkbenchPartReference::Pointer> parts;
 
   IWorkbenchPartReference::WeakPtr activePartReference;
   IEditorReference::WeakPtr activeEditorReference;
 
 public:
 
   using IPropertyChangeListener::PropertyChange;
   void PropertyChange(const Object::Pointer& source, int propId) override;
 
   IWorkbenchPartReference::Pointer GetActivePartReference();
 
   IEditorReference::Pointer GetActiveEditorReference();
 
   IEditorPart::Pointer GetActiveEditor();
 
   IWorkbenchPart::Pointer GetActivePart();
 
   //QList<IEditorReference::Pointer> GetEditors();
 
   void AddPart(WorkbenchPartReference::Pointer ref);
 
   /**
    * Sets the active part.
    *
    * @param ref
    */
   void SetActivePart(IWorkbenchPartReference::Pointer ref);
 
   void SetActiveEditor(IEditorReference::Pointer ref);
 
   /**
    * In order to remove a part, it must first be deactivated.
    */
   void RemovePart(WorkbenchPartReference::Pointer ref);
 
   //int IndexOf(const IWorkbenchPartReference::Pointer ref) const;
 
   /*
    * Ensures that the given part appears AFTER any other part in the same
    * container.
    */
   //void BringToTop(IWorkbenchPartReference::Pointer ref);
 
   /*
    * Return a list with all parts (editors and views).
    */
   //QList<IWorkbenchPartReference::Pointer> GetParts(const QList<IViewReference::Pointer>& views);
 
 
 private:
 
   /*
    * Returns the last (most recent) index of the given container in the activation list, or returns
    * -1 if the given container does not appear in the activation list.
    */
   //std::deque<IWorkbenchPartReference::Pointer>::iterator
   //  LastIndexOfContainer(ILayoutContainer::Pointer container);
 
   void PartInputChanged(WorkbenchPartReference::Pointer ref);
 
   void PartHidden(WorkbenchPartReference::Pointer ref);
 
   void PartOpened(WorkbenchPartReference::Pointer ref);
 
   /**
    * Called when a concrete part is about to be destroyed. This is called
-   * BEFORE disposal happens, so the part should still be accessable from the
+   * BEFORE disposal happens, so the part should still be accessible from the
    * part reference.
    *
    * @param ref
    */
   void PartClosed(WorkbenchPartReference::Pointer ref);
 
   void PartVisible(WorkbenchPartReference::Pointer ref);
 
   //bool Contains(IWorkbenchPartReference::Pointer ref);
 
 protected:
 
   /**
    * Fire the event indicating that a part reference was just realized. That
    * is, the concrete IWorkbenchPart has been attached to the part reference.
    *
    * @param part
    *            the reference that was create
    */
   virtual void FirePartOpened(IWorkbenchPartReference::Pointer part) = 0;
 
   /**
    * Fire the event indicating that a part reference was just realized. That
    * is, the concrete IWorkbenchPart has been attached to the part reference.
    *
    * @param part
    *            the reference that was create
    */
   virtual void FirePartClosed(IWorkbenchPartReference::Pointer part) = 0;
 
   /**
    * Indicates that a new part reference was added to the list.
    *
    * @param part
    */
   virtual void FirePartAdded(IWorkbenchPartReference::Pointer part) = 0;
 
   /**
    * Indicates that a part reference was removed from the list
    *
    * @param part
    */
   virtual void FirePartRemoved(IWorkbenchPartReference::Pointer part) = 0;
 
   /**
    * Indicates that the active editor changed
    *
    * @param part
    *            active part reference or null if none
    */
   virtual void FireActiveEditorChanged(IWorkbenchPartReference::Pointer ref) = 0;
 
   /**
    * Indicates that the active part has changed
    *
    * @param part
    *            active part reference or null if none
    */
   virtual void FireActivePartChanged(
       IWorkbenchPartReference::Pointer oldPart, IWorkbenchPartReference::Pointer newPart) = 0;
 
   /**
    * Indicates that the part has been made visible
    *
    * @param ref
    */
   virtual void FirePartVisible(IWorkbenchPartReference::Pointer ref) = 0;
 
   /**
    * Indicates that the part has been hidden
    *
    * @param ref
    */
   virtual void FirePartHidden(IWorkbenchPartReference::Pointer ref) = 0;
 
   /**
    * Indicates that the part input has changed
    *
    * @param ref
    */
   virtual void FirePartInputChanged(IWorkbenchPartReference::Pointer ref) = 0;
 
   virtual void FirePartBroughtToTop(IWorkbenchPartReference::Pointer ref) = 0;
 };
 
 }
 
 #endif /*BERRYPARTLIST_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartPane.h
index 68f0a864ce..fcb4a01d95 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);
 
   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.
+     * Add the Left,Right,Up,Bottom 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/berryPartStack.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.h
index ff2bd3012e..8bf9a76092 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);
 
     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);
 
         /**
          * 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.
+     * Set the active appearance 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/berryPartTester.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPartTester.h
index d8c49ac75b..5d1ac02a02 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPartTester.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPartTester.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 BERRYPARTTESTER_H_
 #define BERRYPARTTESTER_H_
 
 #include "berryIEditorPart.h"
 #include "berryIEditorInput.h"
 #include "berryIViewPart.h"
 
 namespace berry {
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  */
 class PartTester {
 private:
   PartTester() { }
 
     /**
      * Sanity-check the public interface of the editor. This is called on every editor after it
-     * is fully initiallized, but before it is actually connected to the editor reference or the
+     * is fully initialized, but before it is actually connected to the editor reference or the
      * layout. Calls as much of the editor's public interface as possible to test for exceptions,
      * and tests the return values for glaring faults. This does not need to be an exhaustive conformance
      * test, as it is called every time an editor is opened and it needs to be efficient.
      * The part should be unmodified when the method exits.
      *
      * @param part
      */
 public: static void TestEditor(IEditorPart::Pointer part);
 
 public: static void TestEditorInput(IEditorInput::Pointer input);
 
     /**
-     * Sanity-checks a workbench part. Excercises the public interface and tests for any
+     * Sanity-checks a workbench part. Exercises the public interface and tests for any
      * obviously bogus return values. The part should be unmodified when the method exits.
      *
      * @param part
      * @throws Exception
      */
 private: static void TestWorkbenchPart(IWorkbenchPart::Pointer part);
 
 
     /**
      * Sanity-check the public interface of a view. This is called on every view after it
-     * is fully initiallized, but before it is actually connected to the part reference or the
+     * is fully initialized, but before it is actually connected to the part reference or the
      * layout. Calls as much of the part's public interface as possible without modifying the part
      * to test for exceptions and check the return values for glaring faults. This does not need
      * to be an exhaustive conformance test, as it is called every time an editor is opened and
      * it needs to be efficient.
      *
      * @param part
      */
 public: static void TestView(IViewPart::Pointer part);
 };
 
 }
 
 #endif /*BERRYPARTTESTER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspective.h
index f715546a5e..982d50d523 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);
 
   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
+     * Sanity-checks the LayoutParts in this perspective. Throws an Assertion 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.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.cpp
index 8db201399f..285624ee04 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveDescriptor.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "berryPerspectiveDescriptor.h"
 
 #include "berryWorkbenchRegistryConstants.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryWorkbenchConstants.h"
 #include "berryPerspectiveRegistry.h"
 #include "berryStatus.h"
 #include "berryIContributor.h"
 
 #include <QIcon>
 
 namespace berry
 {
 
 PerspectiveDescriptor::PerspectiveDescriptor(const QString& id,
     const QString& label, PerspectiveDescriptor::Pointer originalDescriptor)
  : singleton(false), fixed(false)
 {
   this->id = id;
   this->label = label;
   if (originalDescriptor != 0)
   {
     this->originalId = originalDescriptor->GetOriginalId();
     this->imageDescriptor = originalDescriptor->imageDescriptor;
 
     // This perspective is based on a perspective in some bundle -- if
     // that
     // bundle goes away then I think it makes sense to treat this
     // perspective
     // the same as any other -- so store it with the original
     // descriptor's
     // bundle's list.
     //
     // It might also make sense the other way...removing the following
     // line
     // will allow the perspective to stay around when the originating
     // bundle
     // is unloaded.
     //
     // This might also have an impact on upgrade cases -- should we
     // really be
     // destroying all user customized perspectives when the older
     // version is
     // removed?
     //
     // I'm leaving this here for now since its a good example, but
     // wouldn't be
     // surprised if we ultimately decide on the opposite.
     //
     // The reason this line is important is that this is the value used
     // to
     // put the object into the UI level registry. When that bundle goes
     // away,
     // the registry will remove the entire list of objects. So if this
     // desc
     // has been put into that list -- it will go away.
     this->pluginId = originalDescriptor->GetPluginId();
   }
 }
 
 PerspectiveDescriptor::PerspectiveDescriptor(const QString& id,
     IConfigurationElement::Pointer configElement)
  : singleton(false), fixed(false)
 {
   this->configElement = configElement;
   this->id = id;
   // Sanity check.
   if ((this->GetId() == "") || (this->GetLabel() == "")
       || (this->GetFactoryClassName() == ""))
   {
     IStatus::Pointer status(new Status(
                               IStatus::ERROR_TYPE,
                               PlatformUI::PLUGIN_ID(),
                               nullptr,
                               QString("Invalid extension (missing label, id or class name): ") + GetId()));
     throw CoreException(status);
   }
 }
 
 IPerspectiveFactory::Pointer PerspectiveDescriptor::CreateFactory()
 {
   // if there is an originalId, then use that descriptor instead
   if (originalId != "")
   {
     // Get the original descriptor to create the factory. If the
     // original is gone then nothing can be done.
     IPerspectiveDescriptor::Pointer
         target =
             dynamic_cast<PerspectiveRegistry*> (WorkbenchPlugin::GetDefault()->GetPerspectiveRegistry()) ->FindPerspectiveWithId(
                 originalId);
 
     return target == 0 ? IPerspectiveFactory::Pointer(nullptr) : target.Cast<
         PerspectiveDescriptor> ()->CreateFactory();
   }
 
   // otherwise try to create the executable extension
   if (configElement != 0)
   {
     try
     {
       IPerspectiveFactory::Pointer factory(
           configElement ->CreateExecutableExtension<IPerspectiveFactory> (
               WorkbenchRegistryConstants::ATT_CLASS));
       return factory;
     }
     catch (const CoreException& /*e*/)
     {
       // do nothing
     }
   }
 
   return IPerspectiveFactory::Pointer(nullptr);
 }
 
 void PerspectiveDescriptor::DeleteCustomDefinition()
 {
   dynamic_cast<PerspectiveRegistry*> (WorkbenchPlugin::GetDefault() ->GetPerspectiveRegistry())->DeleteCustomDefinition(
       PerspectiveDescriptor::Pointer(this));
 }
 
 QString PerspectiveDescriptor::GetDescription() const
 {
   return configElement == 0 ? description : RegistryReader::GetDescription(
       configElement);
 }
 
 void PerspectiveDescriptor::SetDescription(const QString& desc)
 {
   description = desc;
 }
 
 bool PerspectiveDescriptor::GetFixed() const
 {
   if (configElement == 0)
     return fixed;
 
   return configElement->GetAttribute(WorkbenchRegistryConstants::ATT_FIXED).compare("true", Qt::CaseInsensitive) == 0;
 }
 
 QStringList PerspectiveDescriptor::GetKeywordReferences() const
 {
   QStringList result;
   if (configElement.IsNull())
   {
     return result;
   }
 
   auto keywordRefs = configElement->GetChildren("keywordReference");
   for (auto keywordRefsIt = keywordRefs.begin();
        keywordRefsIt != keywordRefs.end(); ++keywordRefsIt) // iterate over all refs
   {
     result.push_back((*keywordRefsIt)->GetAttribute("id"));
   }
   return result;
 }
 
 QString PerspectiveDescriptor::GetId() const
 {
   return id;
 }
 
 QString PerspectiveDescriptor::GetLocalId() const
 {
   return GetId();
 }
 
 QString PerspectiveDescriptor::GetPluginId() const
 {
   return configElement == 0 ? pluginId : configElement->GetContributor()->GetName();
 }
 
 QIcon PerspectiveDescriptor::GetImageDescriptor() const
 {
   if (!imageDescriptor.isNull())
     return imageDescriptor;
 
   if (configElement)
   {
     QString icon = configElement->GetAttribute(WorkbenchRegistryConstants::ATT_ICON);
     if (!icon.isEmpty())
     {
       imageDescriptor = AbstractUICTKPlugin::ImageDescriptorFromPlugin(
             configElement->GetContributor()->GetName(), icon);
     }
 
   }
 
   if (imageDescriptor.isNull())
   {
     imageDescriptor = AbstractUICTKPlugin::GetMissingIcon();
   }
 
   return imageDescriptor;
 }
 
 QStringList PerspectiveDescriptor::GetCategoryPath() const
 {
   if(!categoryPath.empty()) return categoryPath;
 
   if (configElement.IsNotNull())
   {
     QString category = configElement->GetAttribute(WorkbenchRegistryConstants::TAG_CATEGORY);
     categoryPath = category.split('/', QString::SkipEmptyParts);
   }
   return categoryPath;
 }
 
 QString PerspectiveDescriptor::GetLabel() const
 {
   if (configElement == 0)
     return label;
 
   return configElement->GetAttribute(WorkbenchRegistryConstants::ATT_NAME);
 }
 
 QString PerspectiveDescriptor::GetOriginalId() const
 {
   if (originalId == "")
   {
     return this->GetId();
   }
   return originalId;
 }
 
 bool PerspectiveDescriptor::HasCustomDefinition() const
 {
   return dynamic_cast<PerspectiveRegistry*> (WorkbenchPlugin::GetDefault()->GetPerspectiveRegistry())->HasCustomDefinition(
       PerspectiveDescriptor::ConstPointer(this));
 }
 
 bool PerspectiveDescriptor::HasDefaultFlag() const
 {
   if (configElement == 0)
   {
     return false;
   }
 
   return configElement->GetAttribute(WorkbenchRegistryConstants::ATT_DEFAULT).compare("true", Qt::CaseInsensitive) == 0;
 }
 
 bool PerspectiveDescriptor::IsPredefined() const
 {
   return this->GetFactoryClassName() != "" && configElement != 0;
 }
 
 bool PerspectiveDescriptor::IsSingleton() const
 {
   if (configElement == 0)
     return singleton;
 
   return configElement->GetAttribute(WorkbenchRegistryConstants::ATT_SINGLETON).compare("true", Qt::CaseInsensitive) == 0;
 }
 
 bool PerspectiveDescriptor::RestoreState(IMemento::Pointer memento)
 {
   IMemento::Pointer childMem(memento->GetChild(
       WorkbenchConstants::TAG_DESCRIPTOR));
   if (childMem)
   {
     childMem->GetString(WorkbenchConstants::TAG_ID, id);
     childMem->GetString(WorkbenchConstants::TAG_DESCRIPTOR, originalId);
     childMem->GetString(WorkbenchConstants::TAG_LABEL, label);
     childMem->GetString(WorkbenchConstants::TAG_CLASS, className);
     int singletonVal;
     singleton = childMem->GetInteger(WorkbenchConstants::TAG_SINGLETON,
         singletonVal);
 
     // Find a descriptor in the registry.
     IPerspectiveDescriptor::Pointer
         descriptor =
             WorkbenchPlugin::GetDefault() ->GetPerspectiveRegistry()->FindPerspectiveWithId(
                 this->GetOriginalId());
 
     if (descriptor)
     {
-      // Copy the state from the registred descriptor.
+      // Copy the state from the registered descriptor.
       imageDescriptor = descriptor->GetImageDescriptor();
     }
   }
   //return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
   return true;
 }
 
 void PerspectiveDescriptor::RevertToPredefined()
 {
   if (this->IsPredefined())
   {
     this->DeleteCustomDefinition();
   }
 }
 
 bool PerspectiveDescriptor::SaveState(IMemento::Pointer memento)
 {
   IMemento::Pointer childMem(memento->CreateChild(
       WorkbenchConstants::TAG_DESCRIPTOR));
   childMem->PutString(WorkbenchConstants::TAG_ID, GetId());
   if (!originalId.isEmpty())
   {
     childMem->PutString(WorkbenchConstants::TAG_DESCRIPTOR, originalId);
   }
   childMem->PutString(WorkbenchConstants::TAG_LABEL, GetLabel());
   childMem->PutString(WorkbenchConstants::TAG_CLASS, GetFactoryClassName());
   if (singleton)
   {
     childMem->PutInteger(WorkbenchConstants::TAG_SINGLETON, 1);
   }
   //return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null);
   return true;
 }
 
 IConfigurationElement::Pointer PerspectiveDescriptor::GetConfigElement() const
 {
   return configElement;
 }
 
 QString PerspectiveDescriptor::GetFactoryClassName() const
 {
   return configElement == 0 ? className : RegistryReader::GetClassValue(
       configElement, WorkbenchRegistryConstants::ATT_CLASS);
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.cpp
index 4c4859d889..e35824ad1c 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.cpp
@@ -1,1515 +1,1515 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "tweaklets/berryGuiWidgetsTweaklet.h"
 
 #include "berryPerspectiveHelper.h"
 
 #include "berryLayoutTree.h"
 #include "berryEditorSashContainer.h"
 #include "berryDragUtil.h"
 #include "berryPresentationFactoryUtil.h"
 #include "berryWorkbenchConstants.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryPolicy.h"
 
 #include <berryDebugUtil.h>
 
 namespace berry
 {
 
 const int PerspectiveHelper::MIN_DETACH_WIDTH = 150;
 const int PerspectiveHelper::MIN_DETACH_HEIGHT = 250;
 
 PerspectiveHelper::DragOverListener::DragOverListener(PerspectiveHelper* perspHelper) :
   perspHelper(perspHelper)
 {
 
 }
 
 IDropTarget::Pointer PerspectiveHelper::DragOverListener::Drag(
     QWidget* /*currentControl*/, const Object::Pointer& draggedObject, const QPoint& /*position*/,
     const QRect& dragRectangle)
 {
 
   if (draggedObject.Cast<PartPane>() != 0)
   {
     PartPane::Pointer part = draggedObject.Cast<PartPane>();
     if (part->GetContainer().Cast<PartStack>()->GetAppearance() == PresentationFactoryUtil::ROLE_EDITOR)
       return IDropTarget::Pointer(nullptr);
 
     // Views that haven't been shown yet have no 'control' which causes
     // 'GetWorkbenchWindow' to return 'null' so check explicitly
     if (part->GetPage() != perspHelper->page)
       return IDropTarget::Pointer(nullptr);
     else if (part->GetWorkbenchWindow() != perspHelper->page->GetWorkbenchWindow())
       return IDropTarget::Pointer(nullptr);
 
     if (perspHelper->dropTarget == 0)
       perspHelper->dropTarget = new ActualDropTarget(perspHelper, part, dragRectangle);
     else
       perspHelper->dropTarget->SetTarget(part, dragRectangle);
   }
   else if (draggedObject.Cast<PartStack>() != 0)
   {
     PartStack::Pointer stack = draggedObject.Cast<PartStack>();
     if (stack->GetAppearance() == PresentationFactoryUtil::ROLE_EDITOR)
       return IDropTarget::Pointer(nullptr);
 
     if (stack->GetWorkbenchWindow() != perspHelper->page->GetWorkbenchWindow())
       return IDropTarget::Pointer(nullptr);
 
     if (perspHelper->dropTarget == 0)
       perspHelper->dropTarget = new ActualDropTarget(perspHelper, stack, dragRectangle);
     else
       perspHelper->dropTarget->SetTarget(stack, dragRectangle);
   }
 
   return perspHelper->dropTarget;
 }
 
 void PerspectiveHelper::ActualDropTarget::SetTarget(PartPane::Pointer part,
     const QRect& dragRectangle)
 {
   this->stack = nullptr;
   this->part = part;
   this->dragRectangle = dragRectangle;
 }
 
 void PerspectiveHelper::ActualDropTarget::SetTarget(PartStack::Pointer stack,
     const QRect& dragRectangle)
 {
   this->stack = stack;
   this->part = nullptr;
   this->dragRectangle = dragRectangle;
 }
 
 PerspectiveHelper::ActualDropTarget::ActualDropTarget(PerspectiveHelper* perspHelper, PartPane::Pointer part,
     const QRect& dragRectangle)
 : AbstractDropTarget(), perspHelper(perspHelper)
 {
   this->SetTarget(part, dragRectangle);
 }
 
 PerspectiveHelper::ActualDropTarget::ActualDropTarget(PerspectiveHelper* perspHelper, PartStack::Pointer stack,
     const QRect& dragRectangle)
 : AbstractDropTarget(), perspHelper(perspHelper)
 {
   this->SetTarget(stack, dragRectangle);
 }
 
 void PerspectiveHelper::ActualDropTarget::Drop()
 {
 
   if (part != 0)
   {
   Shell::Pointer shell = part->GetShell();
   if (shell->GetData().Cast<DetachedWindow> () != 0)
   {
     // if only one view in tab folder then do a window move
     ILayoutContainer::Pointer container = part->GetContainer();
     if (container.Cast<PartStack> () != 0)
     {
       if (container.Cast<PartStack>()->GetItemCount() == 1)
       {
         shell->SetLocation(dragRectangle.x(), dragRectangle.y());
         return;
       }
     }
   }
 
 //  // If layout is modified always zoom out.
 //  if (isZoomed())
 //  {
 //    zoomOut();
 //  }
   // do a normal part detach
   perspHelper->DetachPart(part, dragRectangle.x(), dragRectangle.y());
   }
   else if (stack != 0)
   {
     Shell::Pointer shell = stack->GetShell();
   if (shell->GetData().Cast<DetachedWindow> () != 0)
   {
     // only one tab folder in a detach window, so do window
     // move
      shell->SetLocation(dragRectangle.x(), dragRectangle.y());
       return;
   }
 
 //  // If layout is modified always zoom out.
 //  if (isZoomed())
 //  {
 //    zoomOut();
 //  }
   // do a normal part detach
   perspHelper->Detach(stack, dragRectangle.x(), dragRectangle.y());
   }
 }
 
 CursorType PerspectiveHelper::ActualDropTarget::GetCursor()
 {
   return CURSOR_OFFSCREEN;
 }
 
 PerspectiveHelper::MatchingPart::MatchingPart(const QString& pid,
     const QString& sid, LayoutPart::Pointer part)
 {
   this->pid = pid;
   this->sid = sid;
   this->part = part;
   this->len = pid.size() + sid.size();
   this->hasWildcard = (pid.indexOf(PartPlaceholder::WILD_CARD) != -1) ||
                       (sid.indexOf(PartPlaceholder::WILD_CARD) != -1);
 }
 
 bool PerspectiveHelper::CompareMatchingParts::operator()(const MatchingPart& m1, const MatchingPart& m2) const
 {
   // specific ids always outweigh ids with wildcards
   if (m1.hasWildcard && !m2.hasWildcard)
   {
     return true;
   }
   if (!m1.hasWildcard && m2.hasWildcard)
   {
     return false;
   }
   // if both are specific or both have wildcards, simply compare based on length
   return m1.len > m2.len;
 }
 
 PerspectiveHelper::PerspectiveHelper(WorkbenchPage* workbenchPage,
     ViewSashContainer::Pointer mainLayout, Perspective* persp)
 : page(workbenchPage), perspective(persp),
 mainLayout(mainLayout),
 detachable(false), active(false)
 {
 
   // Views can be detached if the feature is enabled (true by default,
   // use the plug-in customization file to disable), and if the platform
   // supports detaching.
 
   this->dragTarget.reset(new DragOverListener(this));
 
   //TODO preference store
   //  IPreferenceStore store = PlatformUI.getPreferenceStore();
   //  this.detachable = store.getBoolean(
   //      IWorkbenchPreferenceConstants.ENABLE_DETACHED_VIEWS);
   this->detachable = true;
 
   if (this->detachable)
   {
     // Check if some arbitrary Composite supports reparenting. If it
     // doesn't, views cannot be detached.
 
     QWidget* client = workbenchPage->GetClientComposite();
     if (client == nullptr)
     {
       // The workbench page is not initialized. I don't think this can happen,
       // but if it does, silently set detachable to false.
       this->detachable = false;
     }
     else
     {
       this->detachable = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->IsReparentable(client);
     }
   }
 }
 
 void PerspectiveHelper::Activate(QWidget* parent)
 {
 
   if (active)
   {
     return;
   }
 
   parentWidget = parent;
 
   // Activate main layout
   // make sure all the views have been properly parented
   QList<PartPane::Pointer> children;
   this->CollectViewPanes(children, mainLayout->GetChildren());
   for (QList<PartPane::Pointer>::iterator iter = children.begin();
       iter != children.end(); ++iter)
   {
     PartPane::Pointer part = *iter;
     part->Reparent(parent);
   }
   mainLayout->CreateControl(parent);
   mainLayout->SetActive(true);
 
   // Open the detached windows.
   for (DetachedWindowsType::iterator iter = detachedWindowList.begin();
       iter != detachedWindowList.end(); ++iter)
   {
     (*iter)->Open();
   }
 
   this->EnableAllDrag();
 
   //  // Ensure that the maximized stack's presentation state is correct
   //  if (maximizedStackId != 0)
   //  {
   //    LayoutPart part = this->FindPart(maximizedStackId);
   //    if (part.Cast<PartStack>() != 0)
   //    {
   //      maximizedStack = (PartStack) part;
   //      maximizedStackId = 0;
   //    }
   //  }
   //
   //  // NOTE: we only handle ViewStacks here; Editor Stacks are handled by the
   //  // perspective
   //  if (maximizedStack instanceof ViewStack)
   //  {
   //    maximizedStack.setPresentationState(IStackPresentationSite.STATE_MAXIMIZED);
   //  }
 
   active = true;
 }
 
 void PerspectiveHelper::AddPart(LayoutPart::Pointer part)
 {
 
   // Look for a placeholder.
   PartPlaceholder::Pointer placeholder;
   LayoutPart::Pointer testPart;
   QString primaryId = part->GetID();
   QString secondaryId;
 
   IViewReference::Pointer ref;
   if (part.Cast<PartPane> () != 0)
   {
     PartPane::Pointer pane = part.Cast<PartPane> ();
     ref = pane->GetPartReference().Cast<IViewReference> ();
     if (ref != 0)
     secondaryId = ref->GetSecondaryId();
   }
   if (secondaryId != "")
   {
     testPart = this->FindPart(primaryId, secondaryId);
   }
   else
   {
     testPart = this->FindPart(primaryId);
   }
 
   // validate the testPart
   if (testPart != 0 && testPart.Cast<PartPlaceholder>() != 0)
   {
     placeholder = testPart.Cast<PartPlaceholder> ();
   }
 
   // If there is no placeholder do a simple add. Otherwise, replace the
-  // placeholder if its not a pattern matching placholder
+  // placeholder if its not a pattern matching placeholder
   if (placeholder == 0)
   {
     part->Reparent(mainLayout->GetParent());
     LayoutPart::Pointer relative = mainLayout->FindBottomRight();
     if (relative != 0 && relative.Cast<ILayoutContainer>() != 0)
     {
       ILayoutContainer::Pointer stack =
       relative.Cast<ILayoutContainer> ();
       if (stack->AllowsAdd(part))
       {
         mainLayout->Stack(part, stack);
       }
       else
       {
         mainLayout->AddPart(part);
       }
     }
     else
     {
       mainLayout->AddPart(part);
     }
   }
   else
   {
     ILayoutContainer::Pointer container = placeholder->GetContainer();
     if (container != 0)
     {
       if (container.Cast<DetachedPlaceHolder> () != 0)
       {
         //Create a detached window add the part on it.
         DetachedPlaceHolder::Pointer holder = container.Cast<DetachedPlaceHolder>();
         detachedPlaceHolderList.removeAll(holder);
         container->Remove(testPart);
         DetachedWindow::Pointer window(new DetachedWindow(page));
         detachedWindowList.push_back(window);
         window->Create();
         part->CreateControl(window->GetShell()->GetControl());
         // Open window.
         window->GetShell()->SetBounds(holder->GetBounds());
         window->Open();
         // add part to detached window.
         PartPane::Pointer pane = part.Cast<PartPane>();
         window->Add(pane);
         QList<LayoutPart::Pointer> otherChildren = holder->GetChildren();
         for (QList<LayoutPart::Pointer>::iterator iter = otherChildren.begin();
             iter != otherChildren.end(); ++iter)
         {
           part->GetContainer()->Add(*iter);
         }
       }
       else
       {
         // show parent if necessary
         if (container.Cast<ContainerPlaceholder> () != 0)
         {
           ContainerPlaceholder::Pointer containerPlaceholder =
               container.Cast<ContainerPlaceholder>();
           ILayoutContainer::Pointer parentContainer =
               containerPlaceholder->GetContainer();
           if (parentContainer == 0)
           {
             if (Policy::DEBUG_PERSPECTIVES())
             {
               QString msg = "Previous ContainerPlaceholder for " + tmpViewId;
               if (tmpStackTrace.isNull())
               {
                 WorkbenchPlugin::Log(msg);
               }
               else
               {
                 WorkbenchPlugin::Log(msg, *tmpStackTrace.data());
               }
               tmpViewId.clear();
               tmpStackTrace.reset(new ctkException(""));
               WorkbenchPlugin::Log("Current ContainerPlaceholder with null parent for " +
                                    primaryId + ":" + secondaryId, *tmpStackTrace.data());
               tmpStackTrace.reset();
             }
             return;
           }
           if (Policy::DEBUG_PERSPECTIVES())
           {
             tmpViewId = primaryId + ":" + secondaryId;
             tmpStackTrace.reset(new ctkException(""));
           }
 
           container = containerPlaceholder->GetRealContainer().Cast<ILayoutContainer>();
           if (container.Cast<LayoutPart> () != 0)
           {
             parentContainer->Replace(containerPlaceholder,
                 container.Cast<LayoutPart>());
           }
           containerPlaceholder->SetRealContainer(ILayoutContainer::Pointer(nullptr));
         }
 
 //        // reparent part.
 //        if (container.Cast<PartStack>() == 0)
 //        {
 //          // We don't need to reparent children of PartTabFolders since they will automatically
 //          // reparent their children when they become visible. This if statement used to be
 //          // part of an else branch. Investigate if it is still necessary.
 //          part->Reparent(mainLayout->GetParent());
 //        }
 
         // see if we should replace the placeholder
         if (placeholder->HasWildCard())
         {
           if (PartSashContainer::Pointer sashContainer = container.Cast<PartSashContainer>())
           {
             sashContainer->AddChildForPlaceholder(part, placeholder);
           }
           else
           {
             container->Add(part);
           }
         }
         else
         {
           container->Replace(placeholder, part);
         }
       }
     }
   }
 }
 
 void PerspectiveHelper::AttachPart(IViewReference::Pointer ref)
 {
   PartPane::Pointer pane = ref.Cast<WorkbenchPartReference>()->GetPane();
 
   // Restore any maximized part before re-attaching.
   // Note that 'getMaximizedStack != 0' implies 'useNewMinMax'
   //  if (getMaximizedStack() != 0)
   //  {
   //    getMaximizedStack().setState(IStackPresentationSite.STATE_RESTORED);
   //  }
 
   this->DerefPart(pane);
   this->AddPart(pane);
   this->BringPartToTop(pane);
   pane->SetFocus();
 }
 
 bool PerspectiveHelper::CanDetach()
 {
   return detachable;
 }
 
 bool PerspectiveHelper::BringPartToTop(LayoutPart::Pointer part)
 {
   ILayoutContainer::Pointer container = part->GetContainer();
   if (container != 0 && container.Cast<PartStack> () != 0)
   {
     PartStack::Pointer folder = container.Cast<PartStack> ();
     if (folder->GetSelection() != part)
     {
       folder->SetSelection(part);
       return true;
     }
   }
   return false;
 }
 
 bool PerspectiveHelper::IsPartVisible(IWorkbenchPartReference::Pointer partRef)
 {
   LayoutPart::Pointer foundPart;
   if (partRef.Cast<IViewReference> () != 0)
   {
     foundPart = this->FindPart(partRef->GetId(),
         partRef.Cast<IViewReference>()->GetSecondaryId());
   }
   else
   {
     foundPart = this->FindPart(partRef->GetId());
   }
   if (foundPart == 0)
   {
     return false;
   }
   if (foundPart.Cast<PartPlaceholder> () != 0)
   {
     return false;
   }
 
   ILayoutContainer::Pointer container = foundPart->GetContainer();
 
   if (container.Cast<ContainerPlaceholder> () != 0)
   {
     return false;
   }
 
   if (container.Cast<PartStack> () != 0)
   {
     PartStack::Pointer folder = container.Cast<PartStack>();
     LayoutPart::Pointer visiblePart = folder->GetSelection();
     if (visiblePart == 0)
     {
       return false;
     }
     return partRef == visiblePart.Cast<PartPane>()->GetPartReference();
   }
   return true;
 }
 
 bool PerspectiveHelper::WillPartBeVisible(const QString& partId)
 {
   return this->WillPartBeVisible(partId, nullptr);
 }
 
 bool PerspectiveHelper::WillPartBeVisible(const QString& partId,
     const QString& secondaryId)
 {
   LayoutPart::Pointer part = this->FindPart(partId, secondaryId);
   if (part == 0)
   {
     return false;
   }
   ILayoutContainer::Pointer container = part->GetContainer();
   if (container != 0 && container.Cast<ContainerPlaceholder> () != 0)
   {
     container = container.Cast<ContainerPlaceholder>()->GetRealContainer().Cast<ILayoutContainer>();
   }
 
   if (container != 0 && container.Cast<PartStack> () != 0)
   {
     PartStack::Pointer folder = container.Cast<PartStack>();
     if (folder->GetSelection() == 0)
     {
       return false;
     }
     return part->GetID() == folder->GetSelection()->GetID();
   }
   return true;
 }
 
 QList<PartPlaceholder::Pointer> PerspectiveHelper::CollectPlaceholders()
 {
   // Scan the main window.
   QList<PartPlaceholder::Pointer> results = this->CollectPlaceholders(
       mainLayout->GetChildren());
 
   // Scan each detached window.
   if (detachable)
   {
     for (DetachedWindowsType::iterator winIter = detachedWindowList.begin();
         winIter != detachedWindowList.end(); ++winIter)
     {
       DetachedWindow::Pointer win = *winIter;
       QList<LayoutPart::Pointer> moreResults = win->GetChildren();
       if (moreResults.size()> 0)
       {
         for (QList<LayoutPart::Pointer>::iterator iter = moreResults.begin();
             iter != moreResults.end(); ++iter)
         {
           if (iter->Cast<PartPlaceholder>() != 0)
           results.push_back(iter->Cast<PartPlaceholder>());
         }
       }
     }
   }
   return results;
 }
 
 QList<PartPlaceholder::Pointer> PerspectiveHelper::CollectPlaceholders(
     const QList<LayoutPart::Pointer>& parts)
 {
   QList<PartPlaceholder::Pointer> result;
 
   for (QList<LayoutPart::Pointer>::const_iterator iter = parts.begin();
       iter != parts.end(); ++iter)
   {
     LayoutPart::Pointer part = *iter;
     if (ILayoutContainer::Pointer container = part.Cast<ILayoutContainer>())
     {
       // iterate through sub containers to find sub-parts
       QList<PartPlaceholder::Pointer> newParts = this->CollectPlaceholders(
             container->GetChildren());
       result.append(newParts);
     }
     else if (PartPlaceholder::Pointer placeholder = part.Cast<PartPlaceholder>())
     {
       result.push_back(placeholder);
     }
   }
 
   return result;
 }
 
 void PerspectiveHelper::CollectViewPanes(QList<PartPane::Pointer>& result)
 {
   // Scan the main window.
   this->CollectViewPanes(result, mainLayout->GetChildren());
 
   // Scan each detached window.
   if (detachable)
   {
     for (DetachedWindowsType::iterator winIter = detachedWindowList.begin();
         winIter != detachedWindowList.end(); ++winIter)
     {
       DetachedWindow::Pointer win = *winIter;
       CollectViewPanes(result, win->GetChildren());
     }
   }
 }
 
 void PerspectiveHelper::CollectViewPanes(QList<PartPane::Pointer>& result,
     const QList<LayoutPart::Pointer>& parts)
 {
   for (QList<LayoutPart::Pointer>::const_iterator iter = parts.begin();
       iter != parts.end(); ++iter)
   {
     LayoutPart::Pointer part = *iter;
     if (PartPane::Pointer partPane = part.Cast<PartPane>())
     {
       if(partPane->GetPartReference().Cast<IViewReference>())
       {
         result.push_back(partPane);
       }
     }
     else if (ILayoutContainer::Pointer container = part.Cast<ILayoutContainer> ())
     {
       this->CollectViewPanes(result, container->GetChildren());
     }
   }
 }
 
 void PerspectiveHelper::Deactivate()
 {
   if (!active)
   {
     return;
   }
 
   this->DisableAllDrag();
 
   // Reparent all views to the main window
   QWidget* parent = mainLayout->GetParent();
   QList<PartPane::Pointer> children;
   this->CollectViewPanes(children, mainLayout->GetChildren());
 
   for (DetachedWindowsType::iterator winIter = detachedWindowList.begin();
       winIter != detachedWindowList.end(); ++winIter)
   {
     DetachedWindow::Pointer window = *winIter;
     CollectViewPanes(children, window->GetChildren());
   }
 
   // *** Do we even need to do this if detached windows not supported?
   for (QList<PartPane::Pointer>::iterator itr = children.begin();
       itr != children.end(); ++itr)
   {
     PartPane::Pointer part = *itr;
     part->Reparent(parent);
   }
 
   // Dispose main layout.
 
   mainLayout->SetActive(false);
 
   // Dispose the detached windows
   for (DetachedWindowsType::iterator iter = detachedWindowList.begin();
       iter != detachedWindowList.end(); ++iter)
   {
     (*iter)->Close();
   }
 
   active = false;
 }
 
 PerspectiveHelper::~PerspectiveHelper()
 {
   mainLayout->Dispose();
   mainLayout->DisposeSashes();
 }
 
 void PerspectiveHelper::DescribeLayout(QString& buf) const
 {
 
   if (detachable)
   {
     if (detachedWindowList.size() != 0)
     {
       buf.append("detachedWindows ("); //$NON-NLS-1$
 
       for (DetachedWindowsType::const_iterator winIter = detachedWindowList.begin();
           winIter != detachedWindowList.end(); ++winIter)
       {
         DetachedWindow::ConstPointer window = *winIter;
         QList<LayoutPart::Pointer> children = window->GetChildren();
         int j = 0;
         if (children.size() != 0)
         {
           buf.append("dWindow ("); //$NON-NLS-1$
           for (QList<LayoutPart::Pointer>::iterator partIter = children.begin();
               partIter != children.end(); ++partIter, ++j)
           {
             if (partIter->Cast<PartPlaceholder>() != 0)
             buf.append(partIter->Cast<PartPlaceholder>()->GetPlaceHolderId());
             else if (partIter->Cast<PartPane>() != 0)
             buf.append(
                 partIter->Cast<PartPane>()->GetPartReference()->GetPartName());
 
             if (j < (children.size() - 1))
             {
               buf.append(", "); //$NON-NLS-1$
             }
           }
           buf.append(")"); //$NON-NLS-1$
         }
 
       }
       buf.append("), "); //$NON-NLS-1$
     }
   }
 
   this->GetLayout()->DescribeLayout(buf);
 }
 
 void PerspectiveHelper::DerefPart(LayoutPart::Pointer part)
 {
   //  if (part.Cast<PartPane> () != 0)
   //  {
   //    IViewReference::Pointer ref = ((ViewPane) part).getViewReference();
   //    if (perspective.isFastView(ref))
   //    {
   //      // Special check: if it's a fast view then it's actual ViewStack
   //      // may only contain placeholders and the stack is represented in
   //      // the presentation by a container placeholder...make sure the
   //      // PartPlaceHolder for 'ref' is removed from the ViewStack
   //      String id = perspective.getFastViewManager().getIdForRef(ref);
   //      LayoutPart parentPart = findPart(id, 0);
   //      if (parentPart.Cast<ContainerPlaceholder> () != 0)
   //      {
   //        ViewStack vs =
   //            (ViewStack) ((ContainerPlaceholder) parentPart).getRealContainer();
   //        QList<LayoutPart::Pointer> kids = vs.getChildren();
   //        for (int i = 0; i < kids.length; i++)
   //        {
   //          if (kids[i].Cast<PartPlaceholder> () != 0)
   //          {
   //            if (ref.getId().equals(kids[i].id))
   //              vs.remove(kids[i]);
   //          }
   //        }
   //      }
   //      perspective.getFastViewManager().removeViewReference(ref, true, true);
   //    }
   //  }
 
   // Get vital part stats before reparenting.
   ILayoutContainer::Pointer oldContainer = part->GetContainer();
   bool wasDocked = part->IsDocked();
   Shell::Pointer oldShell = part->GetShell();
 
   // Reparent the part back to the main window
   part->Reparent(mainLayout->GetParent());
 
   // Update container.
   if (oldContainer == 0)
   {
     return;
   }
 
   oldContainer->Remove(part);
 
   ILayoutContainer::ChildrenType children = oldContainer->GetChildren();
   if (wasDocked)
   {
     bool hasChildren = (children.size()> 0);
     if (hasChildren)
     {
       // make sure one is at least visible
       int childVisible = 0;
       for (ILayoutContainer::ChildrenType::iterator iter = children.begin();
           iter != children.end(); ++iter)
       {
         if ((*iter)->GetControl() != nullptr)
         {
           childVisible++;
         }
       }
 
       // none visible, then reprarent and remove container
       if (oldContainer.Cast<PartStack> () != 0)
       {
         PartStack::Pointer folder = oldContainer.Cast<PartStack>();
 
         // Is the part in the trim?
         bool inTrim = false;
         //        // Safety check...there may be no FastViewManager
         //        if (perspective.getFastViewManager() != 0)
         //          inTrim
         //              = perspective.getFastViewManager().getFastViews(folder.getID()).size()
         //                  > 0;
 
         if (childVisible == 0 && !inTrim)
         {
           ILayoutContainer::Pointer parentContainer = folder->GetContainer();
           hasChildren = folder->GetChildren().size()> 0;
 
           // We maintain the stack as a place-holder if it has children
           // (which at this point would represent view place-holders)
           if (hasChildren)
           {
             folder->Dispose();
 
             // replace the real container with a ContainerPlaceholder
             ContainerPlaceholder::Pointer placeholder(
             new ContainerPlaceholder(folder->GetID()));
             placeholder->SetRealContainer(folder);
             parentContainer->Replace(folder, placeholder);
           }
         }
         else if (childVisible == 1)
         {
           LayoutTree::Pointer layout = mainLayout->GetLayoutTree();
           layout = layout->Find(folder);
           layout->SetBounds(layout->GetBounds());
         }
       }
     }
 
     if (!hasChildren)
     {
       // There are no more children in this container, so get rid of
       // it
       if (oldContainer.Cast<LayoutPart> () != 0)
       {
         //BERRY_INFO << "No children left, removing container\n";
 
         LayoutPart::Pointer parent = oldContainer.Cast<LayoutPart>();
         ILayoutContainer::Pointer parentContainer = parent->GetContainer();
         if (parentContainer != 0)
         {
           parentContainer->Remove(parent);
           parent->Print(qDebug());
           parent->Dispose();
         }
       }
     }
   }
   else if (!wasDocked)
   {
     if (children.empty())
     {
       // There are no more children in this container, so get rid of
       // it
       // Turn on redraw again just in case it was off.
       //oldShell.setRedraw(true);
       DetachedWindow::Pointer w = oldShell->GetData().Cast<DetachedWindow>();
       oldShell->Close();
       detachedWindowList.removeAll(w);
     }
     else
     {
       // There are children. If none are visible hide detached
       // window.
       bool allInvisible = true;
       for (ILayoutContainer::ChildrenType::iterator iter = children.begin();
           iter != children.end(); ++iter)
       {
         if (iter->Cast<PartPlaceholder> () == 0)
         {
           allInvisible = false;
           break;
         }
       }
       if (allInvisible)
       {
         DetachedPlaceHolder::Pointer placeholder(new DetachedPlaceHolder("",
             oldShell->GetBounds()));
         for (ILayoutContainer::ChildrenType::iterator iter = children.begin();
             iter != children.end(); ++iter)
         {
           oldContainer->Remove(*iter);
           (*iter)->SetContainer(placeholder);
           placeholder->Add(*iter);
         }
         detachedPlaceHolderList.push_back(placeholder);
         DetachedWindow::Pointer w = oldShell->GetData().Cast<DetachedWindow>();
         oldShell->Close();
         detachedWindowList.removeAll(w);
       }
     }
   }
 
 }
 
 void PerspectiveHelper::Detach(LayoutPart::Pointer part, int x, int y)
 {
 
   // Detaching is disabled on some platforms ..
   if (!detachable)
   {
     return;
   }
 
   // Calculate detached window size.
   QSize size = part->GetSize();
   if (size.width() == 0 || size.height() == 0)
   {
     ILayoutContainer::Pointer container = part->GetContainer();
     if (container.Cast<LayoutPart> () != 0)
     {
       size = container.Cast<LayoutPart>()->GetSize();
     }
   }
   int width = std::max<int>(size.width(), MIN_DETACH_WIDTH);
   int height = std::max<int>(size.height(), MIN_DETACH_HEIGHT);
 
   // Create detached window.
   DetachedWindow::Pointer window(new DetachedWindow(page));
   detachedWindowList.push_back(window);
 
   // Open window.
   window->Create();
   window->GetShell()->SetBounds(x, y, width, height);
   window->Open();
 
   if (part.Cast<PartStack> () != 0)
   {
     //window.getShell().setRedraw(false);
     //parentWidget.setRedraw(false);
     PartStack::Pointer stack = part.Cast<PartStack>();
     LayoutPart::Pointer visiblePart = stack->GetSelection();
     ILayoutContainer::ChildrenType children = stack->GetChildren();
     for (ILayoutContainer::ChildrenType::iterator iter = children.begin();
         iter != children.end(); ++iter)
     {
       if (PartPane::Pointer partPane = iter->Cast<PartPane>()
           // && check it is a view?
           )
       {
         // remove the part from its current container
         this->DerefPart(*iter);
         // add part to detached window.
         window->Add(*iter);
       }
     }
     if (visiblePart != 0)
     {
       this->BringPartToTop(visiblePart);
       visiblePart->SetFocus();
     }
     //window.getShell().setRedraw(true);
     //parentWidget.setRedraw(true);
   }
 
 }
 
 void PerspectiveHelper::DetachPart(LayoutPart::Pointer part, int x, int y)
 {
 
   // Detaching is disabled on some platforms ..
   if (!detachable)
   {
     return;
   }
 
   // Calculate detached window size.
   QSize size = part->GetSize();
   if (size.width() == 0 || size.height() == 0)
   {
     ILayoutContainer::Pointer container = part->GetContainer();
     if (container.Cast<LayoutPart> () != 0)
     {
       size = container.Cast<LayoutPart>()->GetSize();
     }
   }
   int width = std::max<int>(size.width(), MIN_DETACH_WIDTH);
   int height = std::max<int>(size.height(), MIN_DETACH_HEIGHT);
 
   // Create detached window.
   DetachedWindow::Pointer window(new DetachedWindow(page));
   detachedWindowList.push_back(window);
 
   // Open window.
   window->Create();
   window->GetShell()->SetBounds(x, y, width, height);
   window->Open();
 
   // remove the part from its current container
   this->DerefPart(part);
   // add part to detached window.
   window->Add(part);
   part->SetFocus();
 
 }
 
 void PerspectiveHelper::DetachPart(IViewReference::Pointer ref)
 {
   PartPane::Pointer pane = ref.Cast<WorkbenchPartReference>()->GetPane();
   if (this->CanDetach() && pane != 0)
   {
     //    if (getMaximizedStack() != 0)
     //      getMaximizedStack().setState(IStackPresentationSite.STATE_RESTORED);
 
     QRect bounds = pane->GetParentBounds();
     this->DetachPart(pane, bounds.x(), bounds.y());
   }
 }
 
 void PerspectiveHelper::AddDetachedPart(LayoutPart::Pointer part)
 {
   // Calculate detached window size.
   QRect bounds = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetShell(parentWidget)->GetBounds();
   bounds.setX(bounds.x() + (bounds.width() - 300) / 2);
   bounds.setY(bounds.y() + (bounds.height() - 300) / 2);
 
   this->AddDetachedPart(part, bounds);
 }
 
 void PerspectiveHelper::AddDetachedPart(LayoutPart::Pointer part,
     const QRect& bounds)
 {
   // Detaching is disabled on some platforms ..
   if (!detachable)
   {
     this->AddPart(part);
     return;
   }
 
   // Create detached window.
   DetachedWindow::Pointer window(new DetachedWindow(page));
   detachedWindowList.push_back(window);
   window->Create();
 
   // add part to detached window.
   part->CreateControl(window->GetShell()->GetControl());
   window->Add(part);
 
   // Open window.
   window->GetShell()->SetBounds(bounds.x(), bounds.y(), bounds.width(), bounds.height());
   window->Open();
 
   part->SetFocus();
 
 }
 
 void PerspectiveHelper::DisableAllDrag()
 {
   DragUtil::RemoveDragTarget(nullptr, dragTarget.data());
 }
 
 void PerspectiveHelper::EnableAllDrag()
 {
   DragUtil::AddDragTarget(nullptr, dragTarget.data());
 }
 
 LayoutPart::Pointer PerspectiveHelper::FindPart(const QString& id)
 {
   return this->FindPart(id, "");
 }
 
 LayoutPart::Pointer PerspectiveHelper::FindPart(const QString& primaryId,
     const QString& secondaryId)
 {
 
   //BERRY_INFO << "Looking for part: " << primaryId << ":" << secondaryId << std::endl;
 
   // check main window.
   QList<MatchingPart> matchingParts;
   LayoutPart::Pointer part = (secondaryId != "") ? this->FindPart(primaryId, secondaryId,
       mainLayout->GetChildren(), matchingParts) : this->FindPart(primaryId,
       mainLayout->GetChildren(), matchingParts);
   if (part != 0)
   {
     return part;
   }
 
   // check each detached windows.
   for (DetachedWindowsType::iterator iter = detachedWindowList.begin();
       iter != detachedWindowList.end(); ++iter)
   {
     DetachedWindow::Pointer window = *iter;
     part = (secondaryId != "") ? this->FindPart(primaryId, secondaryId,
         window->GetChildren(), matchingParts) : this->FindPart(primaryId,
         window->GetChildren(), matchingParts);
     if (part != 0)
     {
       return part;
     }
   }
 
   for (DetachedPlaceHoldersType::iterator iter = detachedPlaceHolderList.begin();
       iter != detachedPlaceHolderList.end(); ++iter)
   {
     DetachedPlaceHolder::Pointer holder = *iter;
     part = (secondaryId != "") ? this->FindPart(primaryId, secondaryId,
         holder->GetChildren(), matchingParts) : this->FindPart(primaryId,
         holder->GetChildren(), matchingParts);
     if (part != 0)
     {
       return part;
     }
   }
 
   //BERRY_INFO << "Looking through the matched parts (count: " << matchingParts.size() << ")\n";
 
   // sort the matching parts
   if (matchingParts.size()> 0)
   {
     std::partial_sort(matchingParts.begin(), (matchingParts.begin()), matchingParts.end(), CompareMatchingParts());
     const MatchingPart& mostSignificantPart = matchingParts.front();
     return mostSignificantPart.part;
   }
 
   // Not found.
   return LayoutPart::Pointer(nullptr);
 }
 
 LayoutPart::Pointer PerspectiveHelper::FindPart(const QString& id,
     const QList<LayoutPart::Pointer>& parts,
     QList<MatchingPart>& matchingParts)
 {
   for (QList<LayoutPart::Pointer>::const_iterator iter = parts.begin();
       iter != parts.end(); ++iter)
   {
     LayoutPart::Pointer part = *iter;
     // check for part equality, parts with secondary ids fail
     if (part->GetID() == id)
     {
       if (part.Cast<PartPane> () != 0)
       {
         PartPane::Pointer pane = part.Cast<PartPane>();
         IViewReference::Pointer ref = pane->GetPartReference().Cast<IViewReference>();
         if (ref->GetSecondaryId() != "")
         {
           continue;
         }
       }
       return part;
     }
     // check pattern matching placeholders
 
     else if (part->IsPlaceHolder()
              && part.Cast<PartPlaceholder>()->HasWildCard())
     {
       QRegExp re(id, Qt::CaseInsensitive);
       if (re.exactMatch(part->GetID()))
       {
         matchingParts.push_back(MatchingPart(part->GetID(), "", part));
       }
       //      StringMatcher sm = new StringMatcher(part.getID(), true, false);
       //      if (sm.match(id))
       //      {
       //        matchingParts .add(new MatchingPart(part.getID(), 0, part));
       //      }
     }
     else if (ILayoutContainer::Pointer layoutContainer = part.Cast<ILayoutContainer>())
     {
       part = FindPart(id, layoutContainer->GetChildren(),
                       matchingParts);
       if (part)
       {
         return part;
       }
     }
   }
 
   //BERRY_INFO << "Returning 0\n";
   return LayoutPart::Pointer(nullptr);
 }
 
 LayoutPart::Pointer PerspectiveHelper::FindPart(const QString& primaryId,
     const QString& secondaryId,
     const QList<LayoutPart::Pointer>& parts,
     QList<MatchingPart>& matchingParts)
 {
   for (QList<LayoutPart::Pointer>::const_iterator iter = parts.begin();
       iter != parts.end(); ++iter)
   {
     LayoutPart::Pointer part = *iter;
     // check containers first
     if (ILayoutContainer::Pointer layoutContainer = part.Cast<ILayoutContainer>())
     {
       LayoutPart::Pointer testPart = FindPart(primaryId, secondaryId,
                                               layoutContainer->GetChildren(), matchingParts);
       if (testPart)
       {
         return testPart;
       }
     }
     // check for view part equality
     if (part.Cast<PartPane> () != 0)
     {
       PartPane::Pointer pane = part.Cast<PartPane>();
       IViewReference::Pointer ref = pane->GetPartReference().Cast<IViewReference>();
       if (ref->GetId() == primaryId && ref->GetSecondaryId() == secondaryId)
       {
         return part;
       }
     }
     // check placeholders
 
     else if (part.Cast<PartPlaceholder> () != 0)
     {
       QString id = part->GetID();
 
       // optimization: don't bother parsing id if it has no separator -- it can't match
       QString phSecondaryId = ViewFactory::ExtractSecondaryId(id);
       if (phSecondaryId == "")
       {
         // but still need to check for wildcard case
         if (id == PartPlaceholder::WILD_CARD)
         {
           matchingParts.push_back(MatchingPart(id, "", part));
         }
         continue;
       }
 
       QString phPrimaryId = ViewFactory::ExtractPrimaryId(id);
       // perfect matching pair
       if (phPrimaryId == primaryId && phSecondaryId == secondaryId)
       {
         return part;
       }
       // check for partial matching pair
       QRegExp pre(phPrimaryId, Qt::CaseInsensitive);
       if (pre.exactMatch(primaryId))
       {
         QRegExp sre(phSecondaryId, Qt::CaseInsensitive);
         if (sre.exactMatch(secondaryId))
         {
           matchingParts.push_back(MatchingPart(phPrimaryId, phSecondaryId, part));
         }
       }
     }
   }
   return LayoutPart::Pointer(nullptr);
 }
 
 bool PerspectiveHelper::HasPlaceholder(const QString& id)
 {
   return this->HasPlaceholder(id, nullptr);
 }
 
 bool PerspectiveHelper::HasPlaceholder(const QString& primaryId,
     const QString& secondaryId)
 {
   LayoutPart::Pointer testPart;
   if (secondaryId == "")
   {
     testPart = this->FindPart(primaryId);
   }
   else
   {
     testPart = this->FindPart(primaryId, secondaryId);
   }
   return (testPart != 0 && testPart.Cast<PartPlaceholder> () != 0);
 }
 
 PartSashContainer::Pointer PerspectiveHelper::GetLayout() const
 {
   return mainLayout;
 }
 
 bool PerspectiveHelper::IsActive()
 {
   return active;
 }
 
 float PerspectiveHelper::GetDockingRatio(LayoutPart::Pointer source,
     LayoutPart::Pointer target)
 {
   if ((source.Cast<PartPane> () != 0 || source.Cast<PartStack> () != 0)
       && target.Cast<EditorSashContainer> () != 0)
   {
     return 0.25f;
   }
   return 0.5f;
 }
 
 void PerspectiveHelper::RemovePart(LayoutPart::Pointer part)
 {
 
   // Reparent the part back to the main window
   QWidget* parent = mainLayout->GetParent();
   part->Reparent(parent);
 
   // Replace part with a placeholder
   ILayoutContainer::Pointer container = part->GetContainer();
   if (container != 0)
   {
     QString placeHolderId = part->GetPlaceHolderId();
     container->Replace(part, LayoutPart::Pointer(new PartPlaceholder(placeHolderId)));
 
 //    // If the parent is root we're done. Do not try to replace
 //    // it with placeholder.
 //    if (container == mainLayout)
 //    {
 //      return;
 //    }
 
     // If the parent is empty replace it with a placeholder.
     QList<LayoutPart::Pointer> children = container->GetChildren();
 
     bool allInvisible = true;
     for (QList<LayoutPart::Pointer>::iterator childIter = children.begin();
         childIter != children.end(); ++childIter)
     {
       if (childIter->Cast<PartPlaceholder> () == 0)
       {
         allInvisible = false;
         break;
       }
     }
     if (allInvisible && (container.Cast<LayoutPart> () != 0))
     {
       // what type of window are we in?
       LayoutPart::Pointer cPart = container.Cast<LayoutPart>();
       //Window oldWindow = cPart.getWindow();
       bool wasDocked = cPart->IsDocked();
       Shell::Pointer oldShell = cPart->GetShell();
       if (wasDocked)
       {
 
         // PR 1GDFVBY: ViewStack not disposed when page
         // closed.
         if (container.Cast<PartStack> () != 0)
         {
           container.Cast<PartStack>()->Dispose();
         }
 
         // replace the real container with a
         // ContainerPlaceholder
         ILayoutContainer::Pointer parentContainer = cPart->GetContainer();
         ContainerPlaceholder::Pointer placeholder(
         new ContainerPlaceholder(cPart->GetID()));
         placeholder->SetRealContainer(container);
         parentContainer->Replace(cPart, placeholder);
 
       }
       else
       {
         DetachedPlaceHolder::Pointer placeholder(
         new DetachedPlaceHolder("", oldShell->GetBounds())); //$NON-NLS-1$
         for (QList<LayoutPart::Pointer>::iterator childIter2 = children.begin();
             childIter2 != children.end(); ++childIter2)
         {
           (*childIter2)->GetContainer()->Remove(*childIter2);
           (*childIter2)->SetContainer(placeholder);
           placeholder->Add(*childIter2);
         }
         detachedPlaceHolderList.push_back(placeholder);
         DetachedWindow::Pointer w = oldShell->GetData().Cast<DetachedWindow>();
         oldShell->Close();
         detachedWindowList.removeAll(w);
       }
 
     }
   }
 }
 
 void PerspectiveHelper::ReplacePlaceholderWithPart(LayoutPart::Pointer part)
 {
 
   // Look for a PartPlaceholder that will tell us how to position this
   // object
   QList<PartPlaceholder::Pointer> placeholders = this->CollectPlaceholders();
   for (int i = 0; i < placeholders.size(); i++)
   {
     if (placeholders[i]->GetID() == part->GetID())
     {
       // found a matching placeholder which we can replace with the
       // new View
       ILayoutContainer::Pointer container = placeholders[i]->GetContainer();
       if (container != 0)
       {
         if (ContainerPlaceholder::Pointer containerPlaceholder = container.Cast<ContainerPlaceholder> ())
         {
           // One of the children is now visible so replace the
           // ContainerPlaceholder with the real container
           ILayoutContainer::Pointer parentContainer =
               containerPlaceholder->GetContainer();
           container = containerPlaceholder->GetRealContainer().Cast<ILayoutContainer>();
           if (LayoutPart::Pointer layoutPart = container.Cast<LayoutPart> ())
           {
             parentContainer->Replace(containerPlaceholder, layoutPart);
           }
           containerPlaceholder->SetRealContainer(ILayoutContainer::Pointer(nullptr));
         }
         container->Replace(placeholders[i], part);
         return;
       }
     }
   }
 }
 
 bool PerspectiveHelper::RestoreState(IMemento::Pointer memento)
 {
   // Restore main window.
   IMemento::Pointer childMem = memento->GetChild(WorkbenchConstants::TAG_MAIN_WINDOW);
   //IStatus r = mainLayout->RestoreState(childMem);
   bool r = mainLayout->RestoreState(childMem);
 
   // Restore each floating window.
   if (detachable)
   {
     QList<IMemento::Pointer> detachedWindows(memento->GetChildren(
         WorkbenchConstants::TAG_DETACHED_WINDOW));
     for (QList<IMemento::Pointer>::iterator iter = detachedWindows.begin();
         iter != detachedWindows.end(); ++iter)
     {
       DetachedWindow::Pointer win(new DetachedWindow(page));
       detachedWindowList.push_back(win);
       win->RestoreState(*iter);
     }
 
     QList<IMemento::Pointer> childrenMem(memento->GetChildren(
         WorkbenchConstants::TAG_HIDDEN_WINDOW));
     for (QList<IMemento::Pointer>::iterator iter = childrenMem.begin();
         iter != childrenMem.end(); ++iter)
     {
       DetachedPlaceHolder::Pointer holder(
           new DetachedPlaceHolder("", QRect(0, 0, 0, 0)));
       holder->RestoreState(*iter);
       detachedPlaceHolderList.push_back(holder);
     }
   }
 
   // Get the cached id of the currently maximized stack
   //maximizedStackId = childMem.getString(IWorkbenchConstants.TAG_MAXIMIZED);
 
   return r;
 }
 
 bool PerspectiveHelper::SaveState(IMemento::Pointer memento)
 {
   // Persist main window.
   IMemento::Pointer childMem = memento->CreateChild(WorkbenchConstants::TAG_MAIN_WINDOW);
   //IStatus r = mainLayout->SaveState(childMem);
   bool r = mainLayout->SaveState(childMem);
 
   if (detachable)
   {
     // Persist each detached window.
     for (DetachedWindowsType::iterator iter = detachedWindowList.begin();
         iter != detachedWindowList.end(); ++iter)
     {
       childMem = memento->CreateChild(WorkbenchConstants::TAG_DETACHED_WINDOW);
       (*iter)->SaveState(childMem);
     }
     for (DetachedPlaceHoldersType::iterator iter = detachedPlaceHolderList.begin();
         iter != detachedPlaceHolderList.end(); ++iter)
     {
       childMem = memento->CreateChild(WorkbenchConstants::TAG_HIDDEN_WINDOW);
       (*iter)->SaveState(childMem);
     }
   }
 
   // Write out the id of the maximized (View) stack (if any)
   // NOTE: we only write this out if it's a ViewStack since the
   // Editor Area is handled by the perspective
 //  if (maximizedStack.Cast<PartStack> () != 0)
 //  {
 //    childMem.putString(IWorkbenchConstants.TAG_MAXIMIZED,
 //        maximizedStack.getID());
 //  }
 //  else if (maximizedStackId != 0)
 //  {
 //    // Maintain the cache if the perspective has never been activated
 //    childMem.putString(IWorkbenchConstants.TAG_MAXIMIZED, maximizedStackId);
 //  }
 
   return r;
 }
 
 void PerspectiveHelper::UpdateBoundsMap()
 {
   boundsMap.clear();
 
   // Walk the layout gathering the current bounds of each stack
   // and the editor area
   QList<LayoutPart::Pointer> kids = mainLayout->GetChildren();
   for (QList<LayoutPart::Pointer>::iterator iter = kids.begin();
       iter != kids.end(); ++iter)
   {
     if (iter->Cast<PartStack> () != 0)
     {
       PartStack::Pointer vs = iter->Cast<PartStack>();
       boundsMap.insert(vs->GetID(), vs->GetBounds());
     }
     else if (iter->Cast<EditorSashContainer> () != 0)
     {
       EditorSashContainer::Pointer esc = iter->Cast<EditorSashContainer>();
       boundsMap.insert(esc->GetID(), esc->GetBounds());
     }
   }
 }
 
 void PerspectiveHelper::ResetBoundsMap()
 {
   boundsMap.clear();
 }
 
 QRect PerspectiveHelper::GetCachedBoundsFor(const QString& id)
 {
   return boundsMap[id];
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.h
index c1c9cf1bcd..b90e7388ea 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveHelper.h
@@ -1,552 +1,552 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYPERSPECTIVEHELPER_H_
 #define BERRYPERSPECTIVEHELPER_H_
 
 #include "berryWorkbenchPage.h"
 #include "berryPartPlaceholder.h"
 #include "berryPerspective.h"
 #include "berryViewSashContainer.h"
 #include "berryPartPlaceholder.h"
 #include "berryDetachedWindow.h"
 #include "berryDetachedPlaceHolder.h"
 #include "berryIDragOverListener.h"
 #include "berryAbstractDropTarget.h"
 #include "berryPartPane.h"
 
 namespace berry
 {
 
 class WorkbenchPage;
 
 /**
  * A perspective presentation is a collection of parts with a layout. Each part
  * is parented to a main window, so you can create more than one presentation
  * on a set of parts and change the layout just by activating / deactivating a
  * presentation.
  *
  * In addition, the user can change the position of any part by mouse
  * manipulation (drag & drop). If a part is removed, we leave a placeholder
  * behind to indicate where it goes should the part be added back.
  */
 class PerspectiveHelper
 {
 
   friend class PartStack;
   friend class ViewSashContainer;
 
 private:
   QScopedPointer<ctkException> tmpStackTrace;
   QString tmpViewId;
 
   WorkbenchPage* page;
 
 protected:
   Perspective* perspective;
   QWidget* parentWidget;
 
 private:
   ViewSashContainer::Pointer mainLayout;
 
   //private: PartStack maximizedStack;
 
   /**
    * If there is a ViewStack maximized on shutdown the id is
    * cached and restored into this field on 'restoreState'.
    * This is then used to bash the ViewStack's presentation state
    * into the correct value on activation (the startup life-cycle
    * is such that we have to use this 'latch' because the window
    * state isn't valid until the activate happens.
    */
   //private: String maximizedStackId;
 
 private:
   typedef QList<DetachedWindow::Pointer> DetachedWindowsType;
   DetachedWindowsType detachedWindowList;
 
   typedef QList<DetachedPlaceHolder::Pointer> DetachedPlaceHoldersType;
   DetachedPlaceHoldersType detachedPlaceHolderList;
 
   /**
    * Maps a stack's id to its current bounds
    * this is used to capture the current bounds of all
    * stacks -before- starting a maximize (since the
-   * iterative 'minimize' calls cause the intial stack's
+   * iterative 'minimize' calls cause the initial stack's
    * bounds to change.
    */
   QHash<QString, QRect> boundsMap;
 
   bool detachable;
 
 protected:
   bool active;
 
   // key is the LayoutPart object, value is the PartDragDrop object
   //private: IPartDropListener partDropListener;
 
 private:
   static const int MIN_DETACH_WIDTH;
   static const int MIN_DETACH_HEIGHT;
 
   struct DragOverListener: public IDragOverListener
   {
 
     DragOverListener(PerspectiveHelper* perspHelper);
 
     IDropTarget::Pointer Drag(QWidget* currentControl,
         const Object::Pointer& draggedObject, const QPoint& position,
         const QRect& dragRectangle) override;
 
   private:
     PerspectiveHelper* perspHelper;
 
   };
 
   QScopedPointer<IDragOverListener> dragTarget;
 
   struct ActualDropTarget: public AbstractDropTarget
   {
 
     berryObjectMacro(ActualDropTarget);
 
     /**
      * @param part
      * @param dragRectangle
      * @since 3.1
      */
     void SetTarget(PartPane::Pointer part, const QRect& dragRectangle);
 
     /**
      * @param part
      * @param dragRectangle
      * @since 3.1
      */
     void SetTarget(PartStack::Pointer part, const QRect& dragRectangle);
 
     ActualDropTarget(PerspectiveHelper* perspHelper, PartPane::Pointer part, const QRect& dragRectangle);
 
     ActualDropTarget(PerspectiveHelper* perspHelper, PartStack::Pointer part, const QRect& dragRectangle);
 
     void Drop() override;
 
     CursorType GetCursor() override;
 
   private:
 
     PartPane::Pointer part;
     PartStack::Pointer stack;
 
     QRect dragRectangle;
 
     PerspectiveHelper* perspHelper;
   };
 
   ActualDropTarget::Pointer dropTarget;
 
 private:
   struct MatchingPart
   {
 
     QString pid;
     QString sid;
     LayoutPart::Pointer part;
     bool hasWildcard;
     int len;
 
     MatchingPart(const QString& pid, const QString& sid,
         LayoutPart::Pointer part);
 
   };
 
   struct CompareMatchingParts
   {
     bool operator()(const MatchingPart& m1, const MatchingPart& m2) const;
   };
 
 public:
 
   /**
    * Constructs a new object.
    */
   PerspectiveHelper(WorkbenchPage* workbenchPage,
       ViewSashContainer::Pointer mainLayout, Perspective* perspective);
 
   /**
    * Show the presentation.
    */
   void Activate(QWidget* parent);
 
   /**
    * Adds a part to the presentation. If a placeholder exists for the part
    * then swap the part in. Otherwise, add the part in the bottom right
    * corner of the presentation.
    */
   void AddPart(LayoutPart::Pointer part);
 
   /**
    * Attaches a part that was previously detached to the mainLayout.
    *
    * @param ref
    */
   void AttachPart(IViewReference::Pointer ref);
 
   /**
    * Return whether detachable parts can be supported.
    */
   bool CanDetach();
 
   /**
    * Bring a part forward so it is visible.
    *
    * @return true if the part was brought to top, false if not.
    */
   bool BringPartToTop(LayoutPart::Pointer part);
 
   /**
    * Returns true if the given part is visible.
    * A part is visible if it's top-level (not in a tab folder) or if it is the top one
    * in a tab folder.
    */
   bool IsPartVisible(IWorkbenchPartReference::Pointer partRef);
 
   /**
    * Returns true is not in a tab folder or if it is the top one in a tab
    * folder.
    */
   bool WillPartBeVisible(const QString& partId);
 
   bool WillPartBeVisible(const QString& partId,
       const QString& secondaryId);
 
   /**
    * Answer a list of the view panes.
    */
   void CollectViewPanes(QList<PartPane::Pointer>& result);
 
   /**
    * Hide the presentation.
    */
   void Deactivate();
 
   ~PerspectiveHelper();
 
   /**
    * 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
    */
   void DescribeLayout(QString& buf) const;
 
 private:
 
   /**
    * Answer a list of the PartPlaceholder objects.
    */
   QList<PartPlaceholder::Pointer> CollectPlaceholders();
 
   /**
    * Answer a list of the PartPlaceholder objects.
    */
   QList<PartPlaceholder::Pointer> CollectPlaceholders(
       const QList<LayoutPart::Pointer>& parts);
 
   /**
    * Answer a list of the view panes.
    */
   void CollectViewPanes(QList<PartPane::Pointer>& result,
       const QList<LayoutPart::Pointer>& parts);
 
   /**
    * Create a detached window containing a part.
    */
   void DetachPart(LayoutPart::Pointer source, int x, int y);
 
   void Detach(LayoutPart::Pointer source, int x, int y);
 
 protected:
 
   /**
    * Deref a given part. Deconstruct its container as required. Do not remove
    * drag listeners.
    */
   void DerefPart(LayoutPart::Pointer part);
 
   /**
    * Detached a part from the mainLayout. Presently this does not use placeholders
    * since the current implementation is not robust enough to remember a view's position
    * in more than one root container. For now the view is simply derefed and will dock
    * in the default position when attachPart is called.
    *
    * By default parts detached this way are set to float on top of the workbench
    * without docking. It is assumed that people that want to drag a part back onto
    * the WorkbenchWindow will detach it via drag and drop.
    *
    * @param ref
    */
 public:
   void DetachPart(IViewReference::Pointer ref);
 
   /**
    * Create a detached window containing a part.
    */
 public:
   void AddDetachedPart(LayoutPart::Pointer part);
 
 public:
   void AddDetachedPart(LayoutPart::Pointer part, const QRect& bounds);
 
   /**
    * disableDragging.
    */
 private:
   void DisableAllDrag();
 
   /**
    * enableDragging.
    */
 private:
   void EnableAllDrag();
 
   /**
    * Find the first part with a given ID in the presentation.
    * Wild cards now supported.
    */
 private:
   LayoutPart::Pointer FindPart(const QString& id);
 
   /**
    * Find the first part that matches the specified
    * primary and secondary id pair.  Wild cards
    * are supported.
    */
 public:
   LayoutPart::Pointer FindPart(const QString& primaryId,
       const QString& secondaryId);
 
   /**
    * Find the first part with a given ID in the presentation.
    */
 private:
   LayoutPart::Pointer FindPart(const QString& id,
       const QList<LayoutPart::Pointer>& parts,
       QList<MatchingPart>& matchingParts);
 
   /**
    * Find the first part that matches the specified
    * primary and secondary id pair.  Wild cards
    * are supported.
    */
 private:
   LayoutPart::Pointer FindPart(const QString& primaryId,
       const QString& secondaryId,
       const QList<LayoutPart::Pointer>& parts,
       QList<MatchingPart>& matchingParts);
 
   /**
    * Returns true if a placeholder exists for a given ID.
    */
 public:
   bool HasPlaceholder(const QString& id);
 
   /**
    * Returns true if a placeholder exists for a given ID.
    * @since 3.0
    */
 public:
   bool HasPlaceholder(const QString& primaryId,
       const QString& secondaryId);
 
   /**
    * Returns the layout container.
    */
 public:
   PartSashContainer::Pointer GetLayout() const;
 
   /**
    * Gets the active state.
    */
 public:
   bool IsActive();
 
   /**
    * Returns whether the presentation is zoomed.
    *
    * <strong>NOTE:</strong> As of 3.3 this method should always return 'false'
    * when using the new min/max behavior. It is only used for
    * legacy 'zoom' handling.
    */
   //    public: bool IsZoomed() {
   //        return mainLayout.getZoomedPart() != null;
   //    }
 
   /**
    * @return The currently maxmized stack (if any)
    */
   //  public: PartStack::Pointer GetMaximizedStack() {
   //    return maximizedStack;
   //  }
 
   /**
    * Sets the currently maximized stack. Used for query
    * and 'unZoom' purposes in the 3.3 presentation.
    *
    * @param stack The newly maximized stack
    */
   //  public: void SetMaximizedStack(PartStack::Pointer stack) {
   //    if (stack == maximizedStack)
   //      return;
   //
   //    maximizedStack = stack;
   //  }
 
   /**
    * Returns the ratio that should be used when docking the given source
    * part onto the given target
    *
    * @param source newly added part
    * @param target existing part being dragged over
    * @return the final size of the source part (wrt the current size of target)
    * after it is docked
    */
 public:
   static float GetDockingRatio(LayoutPart::Pointer source,
       LayoutPart::Pointer target);
 
   /**
    * Returns whether changes to a part will affect zoom. There are a few
    * conditions for this .. - we are zoomed. - the part is contained in the
    * main window. - the part is not the zoom part - the part is not a fast
    * view - the part and the zoom part are not in the same editor workbook
    * - the part and the zoom part are not in the same view stack.
    */
   //    public: bool PartChangeAffectsZoom(LayoutPart::Pointer pane) {
   //        return pane.isObscuredByZoom();
   //    }
 
   /**
    * Remove all references to a part.
    */
 public:
   void RemovePart(LayoutPart::Pointer part);
 
   /**
    * Add a part to the presentation.
    *
    * Note: unlike all other LayoutParts, PartPlaceholders will still point to
    * their parent container even when it is inactive. This method relies on this
    * fact to locate the parent.
    */
 public:
   void ReplacePlaceholderWithPart(LayoutPart::Pointer part);
 
   /**
    * @see org.blueberry.ui.IPersistable
    */
 public:
   bool RestoreState(IMemento::Pointer memento);
 
   /**
    * @see org.blueberry.ui.IPersistable
    */
 public:
   bool SaveState(IMemento::Pointer memento);
 
   /**
    * Zoom in on a particular layout part.
    */
   //    public: void zoomIn(IWorkbenchPartReference ref) {
   //        PartPane pane = ((WorkbenchPartReference) ref).getPane();
   //
   //
   //        parentWidget.setRedraw(false);
   //        try {
   //            pane.requestZoomIn();
   //        } finally {
   //            parentWidget.setRedraw(true);
   //        }
   //    }
 
   /**
    * Zoom out.
    */
   //    public: void zoomOut() {
   //      // New 3.3 behavior
   //    if (Perspective.useNewMinMax(perspective)) {
   //       if (maximizedStack != null)
   //         maximizedStack.setState(IStackPresentationSite.STATE_RESTORED);
   //       return;
   //    }
   //
   //        LayoutPart zoomPart = mainLayout.getZoomedPart();
   //        if (zoomPart != null) {
   //            zoomPart.requestZoomOut();
   //        }
   //    }
 
   /**
    * Forces the perspective to have no zoomed or minimized parts.
    * This is used when switching to the 3.3 presentation...
    */
   //    public: void forceNoZoom() {
   //      // Ensure that nobody's zoomed
   //      zoomOut();
   //
   //      // Now, walk the layout ensuring that nothing is minimized
   //      LayoutPart[] kids = mainLayout.getChildren();
   //      for (int i = 0; i < kids.length; i++) {
   //      if (kids[i] instanceof ViewStack) {
   //        ((ViewStack)kids[i]).setMinimized(false);
   //      }
   //      else if (kids[i] instanceof EditorSashContainer) {
   //        LayoutPart[] editorStacks = ((EditorSashContainer)kids[i]).getChildren();
   //        for (int j = 0; j < editorStacks.length; j++) {
   //          if (editorStacks[j] instanceof EditorStack) {
   //            ((EditorStack)editorStacks[j]).setMinimized(false);
   //          }
   //        }
   //      }
   //    }
   //    }
 
   /**
    * Captures the current bounds of all ViewStacks and the editor
    * area and puts them into an ID -> QRect map. This info is
    * used to cache the bounds so that we can correctly place minimized
    * stacks during a 'maximized' operation (where the iterative min's
    * affect the current layout while being performed.
    */
 public:
   void UpdateBoundsMap();
 
   /**
    * Resets the bounds map so that it won't interfere with normal minimize
    * operations
    */
 public:
   void ResetBoundsMap();
 
 public:
   QRect GetCachedBoundsFor(const QString& id);
 };
 
 }
 
 #endif /* BERRYPERSPECTIVEHELPER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveRegistry.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveRegistry.cpp
index 751fefc86b..4d7f9003d4 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveRegistry.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPerspectiveRegistry.cpp
@@ -1,624 +1,624 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryPerspectiveRegistry.h"
 
 #include "berryWorkbench.h"
 #include "berryWorkbenchPage.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryPreferenceConstants.h"
 #include "berryPerspective.h"
 #include "berryPerspectiveRegistryReader.h"
 #include "berryPlatformUI.h"
 #include "handlers/berryClosePerspectiveHandler.h"
 #include "berryIExtension.h"
 #include "berryIExtensionTracker.h"
 
 #include <mitkIPreferences.h>
 
 namespace berry
 {
 
 const QString PerspectiveRegistry::EXT = "_persp.xml";
 const QString PerspectiveRegistry::ID_DEF_PERSP = "PerspectiveRegistry.DEFAULT_PERSP";
 const QString PerspectiveRegistry::PERSP = "_persp";
 const char PerspectiveRegistry::SPACE_DELIMITER = ' ';
 
 class PerspectiveRegistry::PreferenceChangeListener
 {
 
   PerspectiveRegistry* m_Registry;
 
 public:
 
   PreferenceChangeListener(PerspectiveRegistry* registry)
     : m_Registry(registry)
   {}
 
   void PropertyChange(const mitk::IPreferences::ChangeEvent& event)
   {
     /*
      * To ensure that no custom perspective definitions are
      * deleted when preferences are imported, merge old and new
      * values
      */
     if (QString::fromStdString(event.GetProperty()).endsWith(PERSP))
     {
       /* A Perspective is being changed, merge */
       this->MergePerspectives(event);
     }
     else if (event.GetProperty() == PreferenceConstants::PERSPECTIVES)
     {
-      /* The list of perpsectives is being changed, merge */
+      /* The list of perspectives is being changed, merge */
       UpdatePreferenceList(event.GetSource());
     }
   }
 
   void MergePerspectives(const mitk::IPreferences::ChangeEvent& event)
   {
     auto* store = event.GetSource();
     if (event.GetNewValue().empty())
     {
       /*
-       * Perpsective is being removed; if the user has deleted or
+       * Perspective is being removed; if the user has deleted or
        * reverted a custom perspective, let the change pass
        * through. Otherwise, restore the custom perspective entry
        */
 
       // Find the matching descriptor in the registry
       QList<IPerspectiveDescriptor::Pointer> perspectiveList = m_Registry->GetPerspectives();
       for (int i = 0; i < perspectiveList.size(); i++)
       {
         QString id = perspectiveList[i]->GetId();
         const auto property = QString::fromStdString(event.GetProperty());
         if (property == id + PERSP)
         { // found
           // descriptor
           // see if the perspective has been flagged for
           // reverting or deleting
           if (!m_Registry->perspToRemove.contains(id))
           { // restore
             store->Put((id + PERSP).toStdString(), event.GetOldValue());
           }
           else
           { // remove element from the list
             m_Registry->perspToRemove.removeAll(id);
           }
         }
       }
     }
     else if (event.GetOldValue().empty())
     {
 
       /*
        * New perspective is being added, update the
        * perspectiveRegistry to contain the new custom perspective
        */
       auto property = QString::fromStdString(event.GetProperty());
       QString id = property.left(property.lastIndexOf(PERSP));
       if (m_Registry->FindPerspectiveWithId(id).IsNull())
       {
         // perspective does not already exist in registry, add
         // it
         PerspectiveDescriptor::Pointer desc(new PerspectiveDescriptor(
                                               QString::null, QString::null, PerspectiveDescriptor::Pointer()));
         std::stringstream reader;
         std::string xmlStr = event.GetNewValue();
         reader.str(xmlStr);
         try
         {
           XMLMemento::Pointer memento = XMLMemento::CreateReadRoot(reader);
           desc->RestoreState(memento);
           m_Registry->AddPerspective(desc);
         }
         catch (const WorkbenchException& e)
         {
           //m_Registry->UnableToLoadPerspective(e.getStatus());
           m_Registry->UnableToLoadPerspective(e.what());
         }
       }
     }
     /* If necessary, add to the list of perspectives */
     this->UpdatePreferenceList(store);
   }
 
   void UpdatePreferenceList(mitk::IPreferences* store)
   {
     QList<IPerspectiveDescriptor::Pointer> perspectiveList = m_Registry->GetPerspectives();
     QStringList perspBuffer;
     for (int i = 0; i < perspectiveList.size(); i++)
     {
       PerspectiveDescriptor::Pointer desc = perspectiveList[i].Cast<PerspectiveDescriptor>();
       if (m_Registry->HasCustomDefinition(desc))
       {
         perspBuffer.push_back(desc->GetId());
       }
     }
     store->Put(PreferenceConstants::PERSPECTIVES, perspBuffer.join(QString(SPACE_DELIMITER)).toStdString());
   }
 };
 
 PerspectiveRegistry::PerspectiveRegistry()
   : preferenceListener(new PreferenceChangeListener(this))
 {
   IExtensionTracker* tracker = PlatformUI::GetWorkbench()->GetExtensionTracker();
   tracker->RegisterHandler(this, QString("org.blueberry.ui.perspectives"));
 
   mitk::IPreferences* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
   prefs->OnPropertyChanged +=
       mitk::MessageDelegate1<PreferenceChangeListener, const mitk::IPreferences::ChangeEvent&>(
         preferenceListener.data(), &PreferenceChangeListener::PropertyChange);
 }
 
 void PerspectiveRegistry::AddPerspective(PerspectiveDescriptor::Pointer desc)
 {
   if (desc == 0)
   {
     return;
   }
   this->Add(desc);
 }
 
 void PerspectiveRegistry::RevertPerspectives(
     const QList<PerspectiveDescriptor::Pointer>& perspToRevert)
 {
   // indicate that the user is removing these perspectives
   for (QList<PerspectiveDescriptor::Pointer>::const_iterator iter = perspToRevert.begin();
        iter != perspToRevert.end(); ++iter)
   {
     PerspectiveDescriptor::Pointer desc = *iter;
     perspToRemove.push_back(desc->GetId());
     desc->RevertToPredefined();
   }
 }
 
 void PerspectiveRegistry::DeletePerspectives(
     const QList<PerspectiveDescriptor::Pointer>& perspToDelete)
 {
   for (QList<PerspectiveDescriptor::Pointer>::const_iterator iter = perspToDelete.begin();
        iter != perspToDelete.end(); ++iter)
   {
     this->DeletePerspective(*iter);
   }
 }
 
 void PerspectiveRegistry::DeletePerspective(IPerspectiveDescriptor::Pointer in)
 {
   PerspectiveDescriptor::Pointer desc = in.Cast<PerspectiveDescriptor>();
   // Don't delete predefined perspectives
   if (!desc->IsPredefined())
   {
     perspToRemove.push_back(desc->GetId());
     perspectives.removeAll(desc);
     desc->DeleteCustomDefinition();
     this->VerifyDefaultPerspective();
   }
 }
 
 void PerspectiveRegistry::Load()
 {
   // Load the registries.
   this->LoadPredefined();
   this->LoadCustom();
 
   // Get default perspective.
   // Get it from the R1.0 dialog settings first. Fixes bug 17039
 //  IDialogSettings dialogSettings =
 //      WorkbenchPlugin.getDefault() .getDialogSettings();
 //  QString str = dialogSettings.get(ID_DEF_PERSP);
 //  if (str != null && str.length() > 0)
 //  {
 //    this->SetDefaultPerspective(str);
 //    dialogSettings.put(ID_DEF_PERSP, ""); //$NON-NLS-1$
 //  }
 
   this->VerifyDefaultPerspective();
 }
 
 void PerspectiveRegistry::SaveCustomPersp(PerspectiveDescriptor::Pointer desc,
                                           XMLMemento* memento)
 {
   auto* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
 
   // Save it to the preference store.
   std::stringstream ss;
   memento->Save(ss);
   prefs->Put((desc->GetId() + PERSP).toStdString(), ss.str());
 }
 
 IMemento::Pointer PerspectiveRegistry::GetCustomPersp(const QString&  id)
 {
   std::stringstream ss;
 
   auto* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
   const auto xmlString = prefs->Get((id + PERSP).toStdString(), "");
   if (!xmlString.empty())
   { // defined in store
     ss.str(xmlString);
   }
   XMLMemento::Pointer memento = XMLMemento::CreateReadRoot(ss);
   return memento;
 }
 
 bool PerspectiveRegistry::ValidateLabel(const QString& label)
 {
   return !label.trimmed().isEmpty();
 }
 
 IPerspectiveDescriptor::Pointer PerspectiveRegistry::FindPerspectiveWithId(const QString& id)
 {
   for (QList<PerspectiveDescriptor::Pointer>::iterator iter = perspectives.begin();
     iter != perspectives.end(); ++iter)
   {
     PerspectiveDescriptor::Pointer desc = *iter;
     if (desc->GetId() == id)
     {
       //      if (WorkbenchActivityHelper.restrictUseOf(desc))
       //      {
       //        return null;
       //      }
       return desc;
     }
   }
 
   return IPerspectiveDescriptor::Pointer(nullptr);
 }
 
 IPerspectiveDescriptor::Pointer PerspectiveRegistry::FindPerspectiveWithLabel(
   const QString& label)
 {
   for (QList<PerspectiveDescriptor::Pointer>::iterator iter = perspectives.begin();
     iter != perspectives.end(); ++iter)
   {
     PerspectiveDescriptor::Pointer desc = *iter;
     if (desc->GetLabel() == label)
     {
       //      if (WorkbenchActivityHelper.restrictUseOf(desc))
       //      {
       //        return 0;
       //      }
       return desc;
     }
   }
   return IPerspectiveDescriptor::Pointer(nullptr);
 }
 
 QString PerspectiveRegistry::GetDefaultPerspective()
 {
   return defaultPerspID;
 }
 
 QList<IPerspectiveDescriptor::Pointer> PerspectiveRegistry::GetPerspectives()
 {
   //  Collection descs = WorkbenchActivityHelper.restrictCollection(perspectives,
   //      new ArrayList());
   //  return (IPerspectiveDescriptor[]) descs.toArray(
   //      new IPerspectiveDescriptor[descs.size()]);
 
   QList<IPerspectiveDescriptor::Pointer> result;
   for (QList<PerspectiveDescriptor::Pointer>::iterator iter = perspectives.begin();
     iter != perspectives.end(); ++iter)
   {
     result.push_back(iter->Cast<IPerspectiveDescriptor>());
   }
   return result;
 }
 
 void PerspectiveRegistry::SetDefaultPerspective(const QString& id)
 {
   IPerspectiveDescriptor::Pointer desc = this->FindPerspectiveWithId(id);
   if (desc != 0)
   {
     defaultPerspID = id;
     //TODO Preferences
 //    PrefUtil.getAPIPreferenceStore().setValue(
 //        IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID, id);
   }
 }
 
 IPerspectiveDescriptor::Pointer PerspectiveRegistry::CreatePerspective(const QString& label,
   IPerspectiveDescriptor::Pointer originalDescriptor)
 {
   // Sanity check to avoid invalid or duplicate labels.
   if (!this->ValidateLabel(label))
   {
     return IPerspectiveDescriptor::Pointer(nullptr);
   }
   if (this->FindPerspectiveWithLabel(label) != 0)
   {
     return IPerspectiveDescriptor::Pointer(nullptr);
   }
 
   // Calculate ID.
   QString id(label);
   id = id.replace(' ', '_').trimmed();
 
   // Create descriptor.
   PerspectiveDescriptor::Pointer desc(
     new PerspectiveDescriptor(id, label, originalDescriptor.Cast<PerspectiveDescriptor>()));
   this->Add(desc);
   return IPerspectiveDescriptor::Pointer(static_cast<IPerspectiveDescriptor*>(desc.GetPointer()));
 }
 
 IPerspectiveDescriptor::Pointer PerspectiveRegistry::ClonePerspective(const QString& id,
     const QString& label,
     IPerspectiveDescriptor::Pointer originalDescriptor)
 {
 
   // Check for invalid labels
   if (label == "" || label.trimmed().isEmpty())
   {
     throw Poco::InvalidArgumentException();
   }
 
   // Check for duplicates
   IPerspectiveDescriptor::Pointer desc = this->FindPerspectiveWithId(id);
   if (desc != 0)
   {
     throw Poco::InvalidArgumentException();
   }
 
   // Create descriptor.
   desc
       = new PerspectiveDescriptor(id, label, originalDescriptor.Cast<PerspectiveDescriptor>());
   this->Add(desc.Cast<PerspectiveDescriptor>());
   return desc;
 }
 
 void PerspectiveRegistry::RevertPerspective(IPerspectiveDescriptor::Pointer perspToRevert)
 {
   PerspectiveDescriptor::Pointer desc = perspToRevert.Cast<PerspectiveDescriptor>();
   perspToRemove.push_back(desc->GetId());
   desc->RevertToPredefined();
 }
 
 PerspectiveRegistry::~PerspectiveRegistry()
 {
 //  PlatformUI::GetWorkbench()->GetExtensionTracker()->UnregisterHandler(this);
 //  WorkbenchPlugin::GetDefault()->GetPreferences()->RemovePropertyChangeListener(preferenceListener);
 }
 
 void PerspectiveRegistry::DeleteCustomDefinition(PerspectiveDescriptor::Pointer  desc)
 {
   // remove the entry from the preference store.
   auto* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
   prefs->Remove((desc->GetId() + PERSP).toStdString());
 }
 
 bool PerspectiveRegistry::HasCustomDefinition(PerspectiveDescriptor::ConstPointer desc) const
 {
   auto* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
   const auto keys = prefs->Keys();
   return std::find(keys.begin(), keys.end(), (desc->GetId() + PERSP).toStdString()) != keys.end();
 }
 
 void PerspectiveRegistry::Add(PerspectiveDescriptor::Pointer desc)
 {
   perspectives.push_back(desc);
   IConfigurationElement::Pointer element = desc->GetConfigElement();
   if (element.IsNotNull())
   {
     PlatformUI::GetWorkbench()->GetExtensionTracker()->RegisterObject(
           element->GetDeclaringExtension(), desc, IExtensionTracker::REF_WEAK);
   }
 }
 
 void PerspectiveRegistry::InternalDeletePerspective(PerspectiveDescriptor::Pointer desc)
 {
   perspToRemove.push_back(desc->GetId());
   perspectives.removeAll(desc);
   desc->DeleteCustomDefinition();
   this->VerifyDefaultPerspective();
 }
 
 void PerspectiveRegistry::LoadCustom()
 {
   QScopedPointer<std::istream> reader;
 
   /* Get the entries from the Preference store */
   auto* prefs = WorkbenchPlugin::GetDefault()->GetPreferences();
 
   /* Get the space-delimited list of custom perspective ids */
   QString customPerspectives = QString::fromStdString(prefs->Get(PreferenceConstants::PERSPECTIVES, ""));
   QStringList perspectivesList = customPerspectives.split(' ', QString::SkipEmptyParts);
 
   for (int i = 0; i < perspectivesList.size(); i++)
   {
     try
     {
       const auto xmlString = prefs->Get((perspectivesList[i] + PERSP).toStdString(), "");
       if (!xmlString.empty())
       {
         reader.reset(new std::stringstream(xmlString));
         //reader->exceptions(std::ios_base::failbit);
       }
       else
       {
         throw WorkbenchException(QString("Description of '%1' perspective could not be found.").arg(perspectivesList[i]));
       }
 
       // Restore the layout state.
       XMLMemento::Pointer memento = XMLMemento::CreateReadRoot(*reader);
       PerspectiveDescriptor::Pointer newPersp(new PerspectiveDescriptor(
                                                 QString::null, QString::null,
                                                 PerspectiveDescriptor::Pointer(nullptr)));
       newPersp->RestoreState(memento);
       QString id = newPersp->GetId();
       IPerspectiveDescriptor::Pointer oldPersp = FindPerspectiveWithId(id);
       if (oldPersp.IsNull())
       {
         Add(newPersp);
       }
     }
     catch (const std::ios_base::failure&)
     {
       UnableToLoadPerspective(QString::null);
     }
     catch (const WorkbenchException& e)
     {
       UnableToLoadPerspective(e.message());
     }
   }
 
 //  // Get the entries from files, if any
 //  // if -data @noDefault specified the state location may not be
 //  // initialized
 //  IPath path = WorkbenchPlugin.getDefault().getDataLocation();
 //  if (path == null)
 //  {
 //    return;
 //  }
 
 //  File folder = path.toFile();
 
 //  if (folder.isDirectory())
 //  {
 //    File[] fileList = folder.listFiles();
 //    int nSize = fileList.length;
 //    for (int nX = 0; nX < nSize; nX++)
 //    {
 //      File file = fileList[nX];
 //      if (file.getName().endsWith(EXT))
 //      {
 //        // get the memento
 //        InputStream stream = null;
 //        try
 //        {
 //          stream = new FileInputStream(file);
 //          reader = new BufferedReader(new InputStreamReader(stream, "utf-8")); //$NON-NLS-1$
 
 //          // Restore the layout state.
 //          XMLMemento memento = XMLMemento.createReadRoot(reader);
 //          PerspectiveDescriptor newPersp =
 //              new PerspectiveDescriptor(null, null, null);
 //          newPersp.restoreState(memento);
 //          IPerspectiveDescriptor oldPersp = findPerspectiveWithId(
 //              newPersp .getId());
 //          if (oldPersp == null)
 //          {
 //            add(newPersp);
 //          }
 
 //          // save to the preference store
 //          saveCustomPersp(newPersp, memento);
 
 //          // delete the file
 //          file.delete();
 
 //          reader.close();
 //          stream.close();
 //        } catch (IOException e)
 //        {
 //          unableToLoadPerspective(null);
 //        } catch (WorkbenchException e)
 //        {
 //          unableToLoadPerspective(e.getStatus());
 //        }
 //      }
 //    }
 //  }
 }
 
 void PerspectiveRegistry::UnableToLoadPerspective(const QString& status)
 {
   QString msg = "Unable to load perspective";
   if (status == "")
   {
     WorkbenchPlugin::Log(msg);
     //IStatus errStatus =
     //    new Status(IStatus.ERR, WorkbenchPlugin.PI_WORKBENCH, msg);
     //StatusManager.getManager().handle(errStatus, StatusManager.SHOW);
   }
   else
   {
     WorkbenchPlugin::Log(status + ": " + msg);
     //IStatus errStatus = StatusUtil.newStatus(status, msg);
     //StatusManager.getManager().handle(errStatus, StatusManager.SHOW);
   }
 }
 
 void PerspectiveRegistry::LoadPredefined()
 {
   PerspectiveRegistryReader reader(this);
   reader.ReadPerspectives(Platform::GetExtensionRegistry());
 }
 
 void PerspectiveRegistry::VerifyDefaultPerspective()
 {
   // Step 1: Try current defPerspId value.
   IPerspectiveDescriptor::Pointer desc;
   if (defaultPerspID != "")
   {
     desc = this->FindPerspectiveWithId(defaultPerspID);
   }
   if (desc != 0)
   {
     return;
   }
 
   // Step 2. Read default value.
   //TODO Preferences
 //  QString str = PrefUtil.getAPIPreferenceStore().getString(
 //      IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID);
 //  if (str != null && str.length() > 0)
 //  {
 //    desc = this->FindPerspectiveWithId(str);
 //  }
 //  if (desc != 0)
 //  {
 //    defaultPerspID = str;
 //    return;
 //  }
 
   // Step 3. Use application-specific default
   defaultPerspID = Workbench::GetInstance()->GetDefaultPerspectiveId();
 }
 
 void PerspectiveRegistry::RemoveExtension(const IExtension::Pointer& /*source*/,
                                           const QList<Object::Pointer>& objects)
 {
   for (int i = 0; i < objects.size(); i++)
   {
     if (PerspectiveDescriptor::Pointer desc = objects[i].Cast<PerspectiveDescriptor>())
     {
       // close the perspective in all windows
       QList<IWorkbenchWindow::Pointer> windows = PlatformUI::GetWorkbench()->GetWorkbenchWindows();
       for (int w = 0; w < windows.size(); ++w)
       {
         IWorkbenchWindow::Pointer window = windows[w];
         QList<IWorkbenchPage::Pointer> pages = window->GetPages();
         for (int p = 0; p < pages.size(); ++p)
         {
           WorkbenchPage::Pointer page = pages[p].Cast<WorkbenchPage>();
           ClosePerspectiveHandler::ClosePerspective(page, page->FindPerspective(desc));
         }
       }
 
       // ((Workbench)PlatformUI.getWorkbench()).getPerspectiveHistory().removeItem(desc);
 
       this->InternalDeletePerspective(desc);
     }
   }
 }
 
 void PerspectiveRegistry::AddExtension(IExtensionTracker* /*tracker*/,
                                        const IExtension::Pointer& addedExtension)
 {
   QList<IConfigurationElement::Pointer> addedElements = addedExtension->GetConfigurationElements();
     for (int i = 0; i < addedElements.size(); i++)
     {
       PerspectiveRegistryReader reader(this);
       reader.ReadElement(addedElements[i]);
     }
   }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryPreferenceConstants.h b/Plugins/org.blueberry.ui.qt/src/internal/berryPreferenceConstants.h
index 567a50bfa1..8f522fcdf3 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryPreferenceConstants.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryPreferenceConstants.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 BERRYPREFERENCECONSTANTS_H_
 #define BERRYPREFERENCECONSTANTS_H_
 
 #include <string>
 
 namespace berry {
 
 /**
  * The PreferenceConstants are the internal constants used by the Workbench.
  */
 struct PreferenceConstants
 {
 
 public:
 
   //Boolean: true; // = single click opens editor; false; // = double click opens it.
   static const std::string OPEN_ON_SINGLE_CLICK; // = "OPEN_ON_SINGLE_CLICK";
 
   //Boolean: true; // = select on hover;
   static const std::string SELECT_ON_HOVER; // = "SELECT_ON_HOVER";
 
   //Boolean: true; // = open after delay
   static const std::string OPEN_AFTER_DELAY; // = "OPEN_AFTER_DELAY";
 
   //Do we show color icons in toolbars?
   static const std::string COLOR_ICONS; // = "COLOR_ICONS";
 
   //mappings for type/extension to an editor
   const static std::string EDITORS; // = "editors";
 
   const static std::string RESOURCES; // = "resourcetypes";
 
   //saving perspective layouts
   const static std::string PERSPECTIVES; // = "perspectives";
 
   // (int) If > 0, an editor will be reused once 'N' editors are opened.
   static const std::string REUSE_EDITORS; // = "REUSE_OPEN_EDITORS";
 
   //Boolean: true; // = replace dirty editor if no other editors to reuse
   // (prompt for save);
-  //      false; // = open a new editor if no other editors to resuse
+  //      false; // = open a new editor if no other editors to reuse
   static const std::string REUSE_DIRTY_EDITORS; // = "REUSE_DIRTY_EDITORS";
 
   //On/Off option for the two preceding options.
   static const std::string REUSE_EDITORS_BOOLEAN; // = "REUSE_OPEN_EDITORS_BOOLEAN";
 
   // (int) N recently viewed files will be listed in the File->Open Recent
   // menu.
   static const std::string RECENT_FILES; // = "RECENT_FILES";
 
   // (integer) Mode for opening a view.
   static const std::string OPEN_VIEW_MODE; // = "OPEN_VIEW_MODE";
 
   static const int OVM_EMBED; // = 0;
 
   static const int OVM_FAST; // = 1;
 
   static const int OVM_FLOAT; // = 2;
 
   // (int) Mode for opening a new perspective
   static const std::string OPEN_PERSP_MODE; // = "OPEN_PERSPECTIVE_MODE";
 
   static const int OPM_ACTIVE_PAGE; // = 0;
 
   // static const int OPM_NEW_PAGE; // = 1;
   static const int OPM_NEW_WINDOW; // = 2;
 
   //Identifier for enabled decorators
   static const std::string ENABLED_DECORATORS; // = "ENABLED_DECORATORS";
 
   //Boolean: true; // = keep cycle part dialog open when keys released
   static const std::string STICKY_CYCLE; // = "STICKY_CYCLE";
 
   //List of plugins but that extends "startup" extension point but are
-  // overriden by the user.
+  // overridden by the user.
   //std::string of plugin unique ids separated by ";"
   static const std::string PLUGINS_NOT_ACTIVATED_ON_STARTUP; // = "PLUGINS_NOT_ACTIVATED_ON_STARTUP";
 
   //Separator for PLUGINS_NOT_ACTIVATED_ON_STARTUP
   static const char SEPARATOR; // = ';';
 
   //Preference key for default editors
   const static std::string DEFAULT_EDITORS; // = "defaultEditors";
 
   //Preference key for default editors
   const static std::string DEFAULT_EDITORS_CACHE; // = "defaultEditorsCache";
 
   //Tab width; // = tab height * scalar value
   const static std::string EDITOR_TAB_WIDTH; // = "EDITOR_TAB_WIDTH";
 
   //Boolean: true; // = show Editors drop down button on CTabFolder
   static const std::string EDITORLIST_PULLDOWN_ACTIVE; // = "EDITORLIST_PULLDOWN_ACTIVE";
 
   // Selection scope for EditorList
   static const std::string EDITORLIST_SELECTION_SCOPE; // = "EDITORLIST_SELECTION_SCOPE";
 
   static const int EDITORLIST_SET_WINDOW_SCOPE; // = 0;
 
   static const int EDITORLIST_SET_PAGE_SCOPE; // = 1;
 
   static const int EDITORLIST_SET_TAB_GROUP_SCOPE; // = 2;
 
   // Sort criteria for EditorList
   static const std::string EDITORLIST_SORT_CRITERIA; // = "EDITORLIST_SORT_CRITERIA";
 
   static const int EDITORLIST_NAME_SORT; // = 0;
 
   static const int EDITORLIST_MRU_SORT; // = 1;
 
   /**
    * Boolean; true; // = EditorList displays full path
    */
   static const std::string EDITORLIST_DISPLAY_FULL_NAME; // = "EDITORLIST_DISPLAY_FULL_NAME";
 
 
   /**
    * Workbench preference id for determining whether the user has chosen to
    * override some of the settings in the current presentation.
    * <p>
    * The default value for this preference is: <code>false</code> (prompt)
    * </p>
    *
    */
   static const std::string OVERRIDE_PRESENTATION; // = "overridepresentation"; //$
 
   /**
    * <p>
    * The key for the preference indicating which tab is selected in the keys
    * preference page when last okay was pressed. This value should never
    * really be directly edited by a user.
    * </p>
    * <p>
    * This preference is an <code>int</code> value. The default value is
    * <code>0</code>.
    * </p>
    *
    */
   static const std::string KEYS_PREFERENCE_SELECTED_TAB; // = "KEYS_PREFERENCE_SELECTED_TAB";
 
   /**
    * <p>
    * The key for the preference indicating whether multi-stroke key sequences
    * should provide assistance to the user. This means that if the user pauses
    * after pressing the first key, a window will open showing the possible
    * completions.
    * </p>
    * <p>
    * This preference is a <code>boolean</code> value. The default value is
    * <code>false</code>.
    * </p>
    *
    */
   static const std::string MULTI_KEY_ASSIST; // = "MULTI_KEY_ASSIST";
 
   /**
    * <p>
    * The key for the preference indicating how long the assist window should
    * wait before opening. This is a value in milliseconds -- from the time the
    * first key in a multi-key is received by the system, to the time the
    * assist window should appear.
    * </p>
    * <p>
    * This preference is an <code>int</code> value. The default value is
    * <code>1000</code>.
    * </p>
    */
   static const std::string MULTI_KEY_ASSIST_TIME; // = "MULTI_KEY_ASSIST_TIME";
 
   /**
    * Workbench preference to use the new IPersistableEditor interface
    * throughout the workbench new editor/open editor calls.
    */
   static const std::string USE_IPERSISTABLE_EDITORS; // = "USE_IPERSISTABLE_EDITORS";
 
   /**
    * Preference to show user jobs in a dialog.
    */
   static const std::string RUN_IN_BACKGROUND; // = "RUN_IN_BACKGROUND";
 
   /**
    * Workbench preference id for determining whether the user will be prompted
    * for activity enablement. If this is false then activities are enabled
    * automatically. If it is true, then the user is only prompted for
    * activities that they have not already declared a disinterest in via the
    * prompt dialog.
    * <p>
    * The default value for this preference is: <code>true</code> (prompt)
    * </p>
    */
   static const std::string SHOULD_PROMPT_FOR_ENABLEMENT; // = "shouldPromptForEnablement";
 
 };
 
 }
 
 #endif /* BERRYPREFERENCECONSTANTS_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
index 795a3bfa6b..7b9717654b 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryQtWorkbenchPageTweaklet.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "berryQtWorkbenchPageTweaklet.h"
 
 #include <internal/berryQtControlWidget.h>
 
 #include <ui_berryQtStatusPart.h>
 
 #include <QWidget>
 #include <QHBoxLayout>
 
 namespace berry
 {
 
 QtWorkbenchPageTweaklet::QtWorkbenchPageTweaklet()
 {
 
 }
 
 QWidget* QtWorkbenchPageTweaklet::CreateClientComposite(QWidget* pageControl)
 {
   QWidget* parent = static_cast<QWidget*>(pageControl);
   auto   client = new QtControlWidget(parent, nullptr);
   client->setObjectName("ClientComposite");
   parent->layout()->addWidget(client);
 
   // we have to enable visibility to get a proper layout (see bug #1654)
   client->setVisible(true);
 
   return client;
 }
 
 QWidget* QtWorkbenchPageTweaklet::CreatePaneControl(QWidget* parent)
 {
   QWidget* qParent = static_cast<QWidget*>(parent);
   auto   control = new QtControlWidget(qParent, nullptr);
   // the object name is used in the global event filter to find
-  // the pane control over which a mouse pressed event occured
+  // the pane control over which a mouse pressed event occurred
   // --> do not change the object name
   control->setObjectName("PartPaneControl");
 
   return control;
 }
 
 Object::Pointer QtWorkbenchPageTweaklet::CreateStatusPart(QWidget* parent, const QString& title, const QString& msg)
 {
   Ui::QtStatusPart statusPart;
   statusPart.setupUi(static_cast<QWidget*>(parent));
   statusPart.m_TitleLabel->setText(title);
   statusPart.m_DetailsLabel->setText(msg);
 
   return Object::Pointer(nullptr);
 }
 
 IEditorPart::Pointer QtWorkbenchPageTweaklet::CreateErrorEditorPart(const QString&  /*partName*/, const QString&  /*msg*/)
 {
   return IEditorPart::Pointer(nullptr);
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryRegistryReader.h b/Plugins/org.blueberry.ui.qt/src/internal/berryRegistryReader.h
index 1a966dd9d5..205579322d 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryRegistryReader.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryRegistryReader.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 BERRYREGISTRYREADER_H_
 #define BERRYREGISTRYREADER_H_
 
 #include <berrySmartPointer.h>
 
 #include <QList>
 
 namespace berry {
 
 struct IExtension;
 struct IExtensionRegistry;
 struct IConfigurationElement;
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * Template implementation of a registry reader that creates objects
  * representing registry contents. Typically, an extension
  * contains one element, but this reader handles multiple
  * elements per extension.
  *
  * To start reading the extensions from the registry for an
  * extension point, call the method <code>readRegistry</code>.
  *
  * To read children of an IConfigurationElement, call the
  * method <code>readElementChildren</code> from your implementation
  * of the method <code>readElement</code>, as it will not be
  * done by default.
  */
 class RegistryReader {
 
     // for dynamic UI - remove this cache to avoid inconsistency
     //protected static Hashtable extensionPoints = new Hashtable();
     /**
      * The constructor.
      */
 protected:
 
   RegistryReader();
   virtual ~RegistryReader();
 
     /**
      * Logs the error in the workbench log using the provided
      * text and the information in the configuration element.
      */
    static void LogError(const SmartPointer<IConfigurationElement>& element,
                         const QString& text);
 
     /**
      * Logs a very common registry error when a required attribute is missing.
      */
     static void LogMissingAttribute(const SmartPointer<IConfigurationElement>& element,
                                     const QString& attributeName);
 
     /**
      * Logs a very common registry error when a required child is missing.
      */
     static void LogMissingElement(const SmartPointer<IConfigurationElement>& element,
                                   const QString& elementName);
 
     /**
      * Logs a registry error when the configuration element is unknown.
      */
     static void LogUnknownElement(const SmartPointer<IConfigurationElement>& element);
 
 
 public:
 
     /**
-     * Apply a reproducable order to the list of extensions
+     * Apply a reproducible order to the list of extensions
      * provided, such that the order will not change as
      * extensions are added or removed.
      * @param extensions the extensions to order
      * @return ordered extensions
      */
     static QList<SmartPointer<IExtension> > OrderExtensions(const QList<SmartPointer<IExtension> >& extensions);
 
 
 protected:
 
     /**
      * Implement this method to read element's attributes.
      * If children should also be read, then implementor
      * is responsible for calling <code>readElementChildren</code>.
      * Implementor is also responsible for logging missing
      * attributes.
      *
      * @return true if element was recognized, false if not.
      */
     virtual bool ReadElement(const SmartPointer<IConfigurationElement>& element) = 0;
 
     /**
      * Read the element's children. This is called by
      * the subclass' readElement method when it wants
      * to read the children of the element.
      */
     virtual void ReadElementChildren(const SmartPointer<IConfigurationElement>& element);
 
     /**
      * Read each element one at a time by calling the
      * subclass implementation of <code>readElement</code>.
      *
      * Logs an error if the element was not recognized.
      */
     virtual void ReadElements(const QList<SmartPointer<IConfigurationElement> >& elements);
 
     /**
      * Read one extension by looping through its
      * configuration elements.
      */
     virtual void ReadExtension(const SmartPointer<IExtension>& extension);
 
 
 public:
 
     /**
      *  Start the registry reading process using the
      * supplied plugin ID and extension point.
      *
      * @param registry the registry to read from
      * @param pluginId the plugin id of the extenion point
      * @param extensionPoint the extension point id
      */
     virtual void ReadRegistry(IExtensionRegistry* registry,
                               const QString& pluginId,
                               const QString& extensionPoint);
 
     /**
      * Utility for extracting the description child of an element.
      *
      * @param configElement the element
      * @return the description
      */
     static QString GetDescription(const SmartPointer<IConfigurationElement>& configElement);
 
     /**
    * Utility for extracting the value of a class attribute or a nested class
    * element that follows the pattern set forth by
    * {@link org.blueberry.core.runtime.IExecutableExtension}.
    *
    * @param configElement
    *            the element
    * @param classAttributeName
    *            the name of the class attribute to check
    * @return the value of the attribute or nested class element
    */
     static QString GetClassValue(const SmartPointer<IConfigurationElement>& configElement,
                                  const QString& classAttributeName);
 };
 
 }
 
 #endif /*BERRYREGISTRYREADER_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berrySlaveMenuService.h b/Plugins/org.blueberry.ui.qt/src/internal/berrySlaveMenuService.h
index 1abd246caa..eaad74c7ec 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berrySlaveMenuService.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berrySlaveMenuService.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 BERRYSLAVEMENUSERVICE_H
 #define BERRYSLAVEMENUSERVICE_H
 
 #include "berryInternalMenuService.h"
 
 namespace berry {
 
 /**
  * <p>
  * Provides services related to contributing menu elements to a workbench
  * window. Visibility and showing are tracked at the workbench window level.
  * </p>
  * <p>
  * This class is only intended for internal use within the
  * <code>org.eclipse.ui.workbench</code> plug-in.
  * </p>
  */
 class SlaveMenuService : public InternalMenuService
 {
 
 private:
 
   QList<SmartPointer<ISourceProvider> > providers;
   QList<SmartPointer<AbstractContributionFactory> > factories;
 
   /**
    * The parent menu service for this window. This parent must track menu
    * definitions and the registry. Must not be <code>null</code>
    */
   InternalMenuService* const parent;
   IServiceLocator* const serviceLocator;
   QSet<SmartPointer<IEvaluationReference> > restrictionExpression;
 
 public:
 
   /**
    * Constructs a new instance of <code>MenuService</code> using a menu
    * manager.
    *
    * @param parent
    *     The parent menu service for this window. This parent must track menu
-   *     definitions and the regsitry. Must not be <code>null</code>
+   *     definitions and the registry. Must not be <code>null</code>
    */
   SlaveMenuService(InternalMenuService* parent,
                    IServiceLocator* serviceLocator,
                    const QSet<SmartPointer<IEvaluationReference> >& restrictions);
 
   void PopulateContributionManager(ContributionManager* mgr, const QString& uri) override;
 
   void PopulateContributionManager(ContributionManager* mgr,
                                    const QString& uri, bool recurse) override;
 
   SmartPointer<IEvaluationContext> GetCurrentState() const override;
 
   void AddContributionFactory(const SmartPointer<AbstractContributionFactory>& cache) override;
 
   void ReleaseContributions(ContributionManager* mgr) override;
 
   void RemoveContributionFactory(const SmartPointer<AbstractContributionFactory>& factory) override;
 
   void Dispose() override;
 
   void AddSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
 
   void RemoveSourceProvider(const SmartPointer<ISourceProvider>& provider) override;
 
   QList<SmartPointer<AbstractContributionFactory> > GetAdditionsForURI(const QUrl& uri) override;
 
   void RegisterVisibleWhen(const SmartPointer<IContributionItem>& item,
                            const SmartPointer<Expression>& visibleWhen,
                            QSet<SmartPointer<IEvaluationReference> >& restriction,
                            const QString& identifierID) override;
 
   void UnregisterVisibleWhen(const SmartPointer<IContributionItem>& item,
                              QSet<SmartPointer<IEvaluationReference> >& restriction) override;
 
   void PopulateContributionManager(
       IServiceLocator* serviceLocatorToUse, const QSet<SmartPointer<IEvaluationReference> >& restriction,
       ContributionManager* mgr, const QString& uri, bool recurse) override;
 };
 
 }
 
 #endif // BERRYSLAVEMENUSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryViewFactory.h b/Plugins/org.blueberry.ui.qt/src/internal/berryViewFactory.h
index d41da54392..becce95f1d 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryViewFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryViewFactory.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 BERRYVIEWFACTORY_H_
 #define BERRYVIEWFACTORY_H_
 
 #include <berrySmartPointer.h>
 
 #include "berryIMemento.h"
 #include "berryIViewReference.h"
 
 #include "berryReferenceCounter.h"
 
 
 namespace berry {
 
 class WorkbenchPage;
 struct IViewRegistry;
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * The ViewFactory is used to control the creation and disposal of views.
  * It implements a reference counting strategy so that one view can be shared
  * by more than one client.
  */
 class ViewFactory { // implements IExtensionChangeHandler {
 
 private:
 
    QHash<QString, IMemento::Pointer> mementoTable;
    ReferenceCounter<QString, IViewReference::Pointer> counter;
 
     WorkbenchPage* page;
 
     IViewRegistry* viewReg;
 
 public:
 
     /**
      * Separates a view's primary id from its secondary id in view key strings.
      */
     static const QString ID_SEP; // = ":"
 
     /**
      * Returns a string representing a view with the given id and (optional) secondary id,
      * suitable for use as a key in a map.
      *
      * @param id primary id of the view
      * @param secondaryId secondary id of the view or <code>null</code>
      * @return the key
      */
     static QString GetKey(const QString& id, const QString& secondaryId);
 
     /**
      * Returns a string representing the given view reference, suitable for use as a key in a map.
      *
      * @param viewRef the view reference
      * @return the key
      */
     static QString GetKey(IViewReference::Pointer viewRef);
 
     /**
-     * Extracts ths primary id portion of a compound id.
+     * Extracts the primary id portion of a compound id.
      * @param compoundId a compound id of the form: primaryId [':' secondaryId]
      * @return the primary id
      */
     static QString ExtractPrimaryId(const QString& compoundId);
 
     /**
-     * Extracts ths secondary id portion of a compound id.
+     * Extracts the secondary id portion of a compound id.
      * @param compoundId a compound id of the form: primaryId [':' secondaryId]
      * @return the secondary id, or <code>null</code> if none
      */
     static QString ExtractSecondaryId(const QString& compoundId);
 
     /**
      * Returns whether the given view id contains a wildcard. Wildcards cannot
      * be used in regular view ids, only placeholders.
      *
      * @param viewId the view id
      * @return <code>true</code> if the given view id contains a wildcard,
      *         <code>false</code> otherwise
      *
      * @since 3.1
      */
     static bool HasWildcard(const QString& viewId);
 
 
     /**
      * Constructs a new view factory.
      */
     ViewFactory(WorkbenchPage* page, IViewRegistry* reg);
 
 
     /**
      * Creates an instance of a view defined by id and secondary id.
      *
      * This factory implements reference counting.  The first call to this
      * method will return a new view.  Subsequent calls will return the
      * first view with an additional reference count.  The view is
      * disposed when releaseView is called an equal number of times
      * to createView.
      */
     IViewReference::Pointer CreateView(const QString& id, const QString& secondaryId = "");
 
     /**
      * Returns the set of views being managed by this factory
      *
      * @return the set of views being managed by this factory
      */
     QList<IViewReference::Pointer> GetViewReferences();
 
     /**
      * Returns the view with the given id, or <code>null</code> if not found.
      */
     IViewReference::Pointer GetView(const QString& id);
 
     /**
      * Returns the view with the given id and secondary id, or <code>null</code> if not found.
      */
     IViewReference::Pointer GetView(const QString& id, const QString& secondaryId);
 
     /**
      * @return the <code>IViewRegistry</code> used by this factory.
      * @since 3.0
      */
     const IViewRegistry* GetViewRegistry() const;
 
     /**
      * Returns a list of views which are open.
      */
     QList<IViewReference::Pointer> GetViews();
 
     /**
      * @return the <code>WorkbenchPage</code> used by this factory.
      * @since 3.0
      */
     WorkbenchPage* GetWorkbenchPage() const;
 
     int GetReferenceCount(IViewReference::Pointer viewRef);
 
     /**
      * Releases an instance of a view.
      *
      * This factory does reference counting.  For more info see
      * getView.
      */
     void ReleaseView(IViewReference::Pointer viewRef);
 
     /**
      * Restore view states.
      *
      * @param memento the <code>IMemento</code> to restore from.
      * @return <code>IStatus</code>
      */
     /*IStatus*/bool RestoreState(IMemento::Pointer memento);
 
     /**
      * Save view states.
      *
      * @param memento the <code>IMemento</code> to save to.
      * @return <code>IStatus</code>
      */
     /*IStatus*/bool SaveState(IMemento::Pointer memento);
 
     //  for dynamic UI
     IMemento::Pointer SaveViewState(IMemento::Pointer memento, IViewReference::Pointer ref, bool& res);
 
     // for dynamic UI
     void RestoreViewState(IMemento::Pointer memento);
 
     IMemento::Pointer GetViewState(const QString& key);
 
 };
 
 }
 
 #endif /*BERRYVIEWFACTORY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWindowManager.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWindowManager.h
index 02d6e57ede..fdfbced52b 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWindowManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWindowManager.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 BERRYWINDOWMANAGER_H_
 #define BERRYWINDOWMANAGER_H_
 
 #include <vector>
 
 #include <berrySmartPointer.h>
 #include <list>
 
 namespace berry
 {
 
 class Window;
 
 /**
  * A manager for a group of windows. Window managers are an optional JFace
  * feature used in applications which create many different windows (dialogs,
  * wizards, etc.) in addition to a main window. A window manager can be used to
  * remember all the windows that an application has created (independent of
  * whether they are presently open or closed). There can be several window
  * managers, and they can be arranged into a tree. This kind of organization
  * makes it simple to close whole subgroupings of windows.
  * <p>
  * Creating a window manager is as simple as creating an instance of
  * <code>WindowManager</code>. Associating a window with a window manager is
  * done with <code>WindowManager.add(Window)</code>. A window is automatically
  * removed from its window manager as a side effect of closing the window.
  * </p>
  *
  * @see Window
  */
 class WindowManager {
 
 private:
 
     /**
      * List of windows managed by this window manager
      * (element type: <code>Window</code>).
      */
     QList<SmartPointer<Window> > windows;
 
     /**
      * List of window managers who have this window manager
      * as their parent (element type: <code>WindowManager</code>).
      */
     QList<WindowManager*> subManagers;
 
     /**
      * Adds the given window manager to the list of
      * window managers that have this one as a parent.
      * </p>
      * @param wm the child window manager
      */
     void AddWindowManager(WindowManager* wm);
 
 
 public:
 
     /**
      * Creates an empty window manager without a parent window
      * manager (that is, a root window manager).
      */
     WindowManager();
 
     /**
      * Creates an empty window manager with the given
      * window manager as parent.
      *
      * @param parent the parent window manager
      */
     WindowManager(WindowManager* parent);
 
     /**
      * Adds the given window to the set of windows managed by
      * this window manager. Does nothing is this window is
      * already managed by this window manager.
      *
      * @param window the window
      */
     void Add(SmartPointer<Window> window);
 
     /**
      * Attempts to close all windows managed by this window manager,
      * as well as windows managed by any descendent window managers.
      *
-     * @return <code>true</code> if all windows were sucessfully closed,
+     * @return <code>true</code> if all windows were successfully closed,
      * and <code>false</code> if any window refused to close
      */
     bool Close();
 
     /**
      * Returns this window manager's number of windows
      *
      * @return the number of windows
      * @since 3.0
      */
     std::size_t GetWindowCount() const;
 
     /**
      * Returns this window manager's set of windows.
      *
      * @return a possibly empty list of window
      */
     QList<SmartPointer<Window> > GetWindows() const;
 
     /**
      * Removes the given window from the set of windows managed by
      * this window manager. Does nothing is this window is
      * not managed by this window manager.
      *
      * @param window the window
      */
     void Remove(SmartPointer<Window> window);
 };
 
 }
 
 #endif /* BERRYWINDOWMANAGER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.cpp
index 16eb4a8a52..73c2ddcf90 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.cpp
@@ -1,345 +1,345 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "berryWorkbenchConstants.h"
 
 #include "berryPlatformUI.h"
 
 namespace berry
 {
 
 const QString WorkbenchConstants::DEFAULT_PRESENTATION_ID =
     "org.blueberry.ui.presentations.default";
 
 const QString WorkbenchConstants::RESOURCE_TYPE_FILE_NAME =
     "resourcetypes.xml";
 
 // Filename containing the workbench's preferences
 const QString WorkbenchConstants::PREFERENCE_BUNDLE_FILE_NAME =
     "workbench.ini";
 
 // Identifier for visible view parts.
 const QString WorkbenchConstants::WORKBENCH_VISIBLE_VIEW_ID =
     "Workbench.visibleViewID";
 
 // Identifier of workbench info properties page
 //const QString WorkbenchConstants::WORKBENCH_PROPERTIES_PAGE_INFO =
 //    PlatformUI::PLUGIN_ID + ".propertypages.info.file";
 
 // Various editor.
 //const QString WorkbenchConstants::OLE_EDITOR_ID = PlatformUI::PLUGIN_ID
 //    + ".OleEditor";
 
 // Default view category.
 const QString WorkbenchConstants::DEFAULT_CATEGORY_ID = "org.blueberry.ui";
     //PlatformUI::PLUGIN_ID;
 
-// Persistance tags.
+// Persistence tags.
 const QString WorkbenchConstants::TRUE_VAL = "true";
 
 const QString WorkbenchConstants::FALSE_VAL = "false";
 
 const QString WorkbenchConstants::TAG_WORKBENCH_ADVISOR =
     "workbenchAdvisor";
 
 const QString WorkbenchConstants::TAG_WORKBENCH_WINDOW_ADVISOR =
     "workbenchWindowAdvisor";
 
 const QString WorkbenchConstants::TAG_ACTION_BAR_ADVISOR =
     "actionBarAdvisor";
 
 const QString WorkbenchConstants::TAG_ID = "id";
 
 const QString WorkbenchConstants::TAG_FOCUS = "focus";
 
 const QString WorkbenchConstants::TAG_EDITOR = "editor";
 
 const QString WorkbenchConstants::TAG_DEFAULT_EDITOR = "defaultEditor";
 
 const QString WorkbenchConstants::TAG_DELETED_EDITOR = "deletedEditor";
 
 const QString WorkbenchConstants::TAG_EDITORS = "editors";
 
 const QString WorkbenchConstants::TAG_WORKBOOK = "workbook";
 
 const QString WorkbenchConstants::TAG_ACTIVE_WORKBOOK = "activeWorkbook";
 
 const QString WorkbenchConstants::TAG_AREA = "editorArea";
 
 const QString WorkbenchConstants::TAG_AREA_VISIBLE = "editorAreaVisible";
 
 const QString WorkbenchConstants::TAG_AREA_HIDDEN = "editorAreaHidden";
 
 const QString WorkbenchConstants::TAG_AREA_TRIM_STATE =
     "editorAreaTrimState";
 
 const QString WorkbenchConstants::TAG_INPUT = "input";
 
 const QString WorkbenchConstants::TAG_FACTORY_ID = "factoryID";
 
 const QString WorkbenchConstants::TAG_EDITOR_STATE = "editorState";
 
 const QString WorkbenchConstants::TAG_TITLE = "title";
 
 const QString WorkbenchConstants::TAG_X = "x";
 
 const QString WorkbenchConstants::TAG_Y = "y";
 
 const QString WorkbenchConstants::TAG_FLOAT = "float";
 
 const QString WorkbenchConstants::TAG_ITEM_WRAP_INDEX = "wrapIndex";
 
 const QString WorkbenchConstants::TAG_TOOLBAR_LAYOUT = "toolbarLayout";
 
 const QString WorkbenchConstants::TAG_WIDTH = "width";
 
 const QString WorkbenchConstants::TAG_HEIGHT = "height";
 
 const QString WorkbenchConstants::TAG_MINIMIZED = "minimized";
 
 const QString WorkbenchConstants::TAG_MAXIMIZED = "maximized";
 
 const QString WorkbenchConstants::TAG_FOLDER = "folder";
 
 const QString WorkbenchConstants::TAG_INFO = "info";
 
 const QString WorkbenchConstants::TAG_PART = "part";
 
 const QString WorkbenchConstants::TAG_PART_NAME = "partName";
 
 const QString WorkbenchConstants::TAG_PROPERTIES = "properties";
 
 const QString WorkbenchConstants::TAG_PROPERTY = "property";
 
 const QString WorkbenchConstants::TAG_RELATIVE = "relative";
 
 const QString WorkbenchConstants::TAG_RELATIONSHIP = "relationship";
 
 const QString WorkbenchConstants::TAG_RATIO = "ratio";
 
 const QString WorkbenchConstants::TAG_RATIO_LEFT = "ratioLeft";
 
 const QString WorkbenchConstants::TAG_RATIO_RIGHT = "ratioRight";
 
 const QString WorkbenchConstants::TAG_ACTIVE_PAGE_ID = "activePageID";
 
 const QString WorkbenchConstants::TAG_EXPANDED = "expanded";
 
 const QString WorkbenchConstants::TAG_PAGE = "page";
 
 const QString WorkbenchConstants::TAG_INTRO = "intro";
 
 const QString WorkbenchConstants::TAG_STANDBY = "standby";
 
 const QString WorkbenchConstants::TAG_LABEL = "label";
 
 const QString WorkbenchConstants::TAG_CONTENT = "content";
 
 const QString WorkbenchConstants::TAG_CLASS = "class";
 
 const QString WorkbenchConstants::TAG_FILE = "file";
 
 const QString WorkbenchConstants::TAG_DESCRIPTOR = "descriptor";
 
 const QString WorkbenchConstants::TAG_MAIN_WINDOW = "mainWindow";
 
 const QString WorkbenchConstants::TAG_DETACHED_WINDOW = "detachedWindow";
 
 const QString WorkbenchConstants::TAG_HIDDEN_WINDOW = "hiddenWindow";
 
 const QString WorkbenchConstants::TAG_WORKBENCH = "workbench";
 
 const QString WorkbenchConstants::TAG_WINDOW = "window";
 
 const QString WorkbenchConstants::TAG_VERSION = "version";
 
 const QString WorkbenchConstants::TAG_PROGRESS_COUNT = "progressCount";
 
 const QString WorkbenchConstants::TAG_PERSPECTIVES = "perspectives";
 
 const QString WorkbenchConstants::TAG_PERSPECTIVE = "perspective";
 
 const QString WorkbenchConstants::TAG_ACTIVE_PERSPECTIVE =
     "activePerspective";
 
 const QString WorkbenchConstants::TAG_ACTIVE_PART = "activePart";
 
 const QString WorkbenchConstants::TAG_ACTION_SET = "actionSet";
 
 const QString WorkbenchConstants::TAG_ALWAYS_ON_ACTION_SET =
     "alwaysOnActionSet";
 
 const QString WorkbenchConstants::TAG_ALWAYS_OFF_ACTION_SET =
     "alwaysOffActionSet";
 
 const QString WorkbenchConstants::TAG_SHOW_VIEW_ACTION = "show_view_action";
 
 const QString WorkbenchConstants::TAG_SHOW_IN_TIME = "show_in_time";
 
 const QString WorkbenchConstants::TAG_TIME = "time";
 
 const QString WorkbenchConstants::TAG_NEW_WIZARD_ACTION =
     "new_wizard_action";
 
 const QString WorkbenchConstants::TAG_PERSPECTIVE_ACTION =
     "perspective_action";
 
 const QString WorkbenchConstants::TAG_VIEW = "view";
 
 const QString WorkbenchConstants::TAG_LAYOUT = "layout";
 
 const QString WorkbenchConstants::TAG_EXTENSION = "extension";
 
 const QString WorkbenchConstants::TAG_NAME = "name";
 
 const QString WorkbenchConstants::TAG_IMAGE = "image";
 
 const QString WorkbenchConstants::TAG_LAUNCHER = "launcher";
 
 const QString WorkbenchConstants::TAG_PLUGIN = "plugin";
 
 /** deprecated - use TAG_OPEN_MODE */
 const QString WorkbenchConstants::TAG_INTERNAL = "internal";
 
 /** deprecated - use TAG_OPEN_MODE */
 const QString WorkbenchConstants::TAG_OPEN_IN_PLACE = "open_in_place";
 
 const QString WorkbenchConstants::TAG_PROGRAM_NAME = "program_name";
 
 const QString WorkbenchConstants::TAG_FAST_VIEWS = "fastViews";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_BAR = "fastViewBar";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_BARS = "fastViewBars";
 
 const QString WorkbenchConstants::TAG_GLOBAL_FAST_VIEWS = "globalFastViews";
 
 const QString WorkbenchConstants::TAG_FAST_GROUPS = "fastGroups";
 
 const QString WorkbenchConstants::TAG_FIXED = "fixed";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_CLOSEABLE = "closeable";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_MOVEABLE = "moveable";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_APPEARANCE = "appearance";
 
 const QString WorkbenchConstants::TAG_PRESENTATION = "presentation";
 
 const QString WorkbenchConstants::TAG_STANDALONE = "standalone";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_SHOW_TITLE = "showTitle";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_VIEW_STATE = "viewState";
 
 const QString WorkbenchConstants::TAG_SINGLETON = "singleton";
 
 const QString WorkbenchConstants::TAG_EDITOR_REUSE_THRESHOLD =
     "editorReuseThreshold";
 
 const QString WorkbenchConstants::TAG_PERSISTABLE = "persistable";
 
 const QString WorkbenchConstants::TAG_MRU_LIST = "mruList";
 
 const QString WorkbenchConstants::TAG_PERSPECTIVE_HISTORY = "perspHistory";
 
 const QString WorkbenchConstants::TAG_WORKING_SET_MANAGER =
     "workingSetManager";
 
 const QString WorkbenchConstants::TAG_WORKING_SETS = "workingSets";
 
 const QString WorkbenchConstants::TAG_WORKING_SET = "workingSet";
 
 const QString WorkbenchConstants::TAG_ITEM = "item";
 
 const QString WorkbenchConstants::TAG_EDIT_PAGE_ID = "editPageId";
 
 const QString WorkbenchConstants::TAG_COOLBAR_LAYOUT = "coolbarLayout";
 
 const QString WorkbenchConstants::TAG_ITEM_SIZE = "itemSize";
 
 const QString WorkbenchConstants::TAG_ITEM_X = "x";
 
 const QString WorkbenchConstants::TAG_ITEM_Y = "y";
 
 const QString WorkbenchConstants::TAG_ITEM_TYPE = "itemType";
 
 const QString WorkbenchConstants::TAG_TYPE_SEPARATOR = "typeSeparator";
 
 const QString WorkbenchConstants::TAG_TYPE_GROUPMARKER = "typeGroupMarker";
 
 const QString WorkbenchConstants::TAG_TYPE_TOOLBARCONTRIBUTION =
     "typeToolBarContribution";
 
 const QString WorkbenchConstants::TAG_TYPE_PLACEHOLDER = "typePlaceholder";
 
 const QString WorkbenchConstants::TAG_COOLITEM = "coolItem";
 
 const QString WorkbenchConstants::TAG_INDEX = "index";
 
 const QString WorkbenchConstants::TAG_PINNED = "pinned";
 
 const QString WorkbenchConstants::TAG_PATH = "path";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_TOOLTIP = "tooltip";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_VIEWS = "views";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_POSITION = "position";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_NAVIGATION_HISTORY =
     "navigationHistory";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_STICKY_STATE = "stickyState";
 
 const QString WorkbenchConstants::TAG_ACTIVE = "active";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_REMOVED = "removed";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_HISTORY_LABEL = "historyLabel";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_LOCKED = "locked";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_OPEN_MODE = "openMode";
 
 const QString WorkbenchConstants::TAG_STARTUP = "startup";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_SIDE = "fastViewLocation";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_DATA = "fastViewData";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_ORIENTATION = "orientation";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_SEL_ID = "selectedTabId";
 
 const QString WorkbenchConstants::TAG_FAST_VIEW_STYLE = "style";
 
 const QString WorkbenchConstants::TAG_THEME = "theme";//$NON-NLS-1$
 
 const QString WorkbenchConstants::TAG_VIEW_LAYOUT_REC = "viewLayoutRec";
 
 const QString WorkbenchConstants::TAG_PERSPECTIVE_BAR = "perspectiveBar";
 
 const QString WorkbenchConstants::TAG_TRIM = "trimLayout";
 
 const QString WorkbenchConstants::TAG_TRIM_AREA = "trimArea";
 
 const QString WorkbenchConstants::TAG_TRIM_ITEM = "trimItem";
 
 //Fonts
 const QString WorkbenchConstants::SMALL_FONT = "org.blueberry.ui.smallFont";
 
 //Colors
 const QString WorkbenchConstants::COLOR_HIGHLIGHT_ =
     "org.blueberry.ui.highlight";
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.h
index 3609cc3b8a..acd613a529 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchConstants.h
@@ -1,337 +1,337 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef BERRYWORKBENCHCONSTANTS_H_
 #define BERRYWORKBENCHCONSTANTS_H_
 
 #include <QString>
 
 #include <org_blueberry_ui_qt_Export.h>
 
 namespace berry
 {
 
 /**
  * General constants used by the workbench.
  */
 struct BERRY_UI_QT WorkbenchConstants
 {
 
   static const QString DEFAULT_PRESENTATION_ID; // = "org.blueberry.ui.presentations.default";
 
   static const QString RESOURCE_TYPE_FILE_NAME; // = "resourcetypes.xml";
 
   // Filename containing the workbench's preferences
   static const QString PREFERENCE_BUNDLE_FILE_NAME; // = "workbench.ini";
 
   // Identifier for visible view parts.
   static const QString WORKBENCH_VISIBLE_VIEW_ID; // = "Workbench.visibleViewID";
 
   // Identifier of workbench info properties page
   static const QString WORKBENCH_PROPERTIES_PAGE_INFO; // = PlatformUI.PLUGIN_ID + ".propertypages.info.file";
 
   // Various editor.
   static const QString OLE_EDITOR_ID; // = PlatformUI.PLUGIN_ID + ".OleEditor";
 
   // Default view category.
   static const QString DEFAULT_CATEGORY_ID; // = PlatformUI.PLUGIN_ID;
 
-  // Persistance tags.
+  // Persistence tags.
   static const QString TRUE_VAL; // = "true";
 
   static const QString FALSE_VAL; // = "false";
 
   static const QString TAG_WORKBENCH_ADVISOR; // = "workbenchAdvisor";
 
   static const QString TAG_WORKBENCH_WINDOW_ADVISOR; // = "workbenchWindowAdvisor";
 
   static const QString TAG_ACTION_BAR_ADVISOR; // = "actionBarAdvisor";
 
   static const QString TAG_ID; // = "id";
 
   static const QString TAG_FOCUS; // = "focus";
 
   static const QString TAG_EDITOR; // = "editor";
 
   static const QString TAG_DEFAULT_EDITOR; // = "defaultEditor";
 
   static const QString TAG_DELETED_EDITOR; // = "deletedEditor";
 
   static const QString TAG_EDITORS; // = "editors";
 
   static const QString TAG_WORKBOOK; // = "workbook";
 
   static const QString TAG_ACTIVE_WORKBOOK; // = "activeWorkbook";
 
   static const QString TAG_AREA; // = "editorArea";
 
   static const QString TAG_AREA_VISIBLE; // = "editorAreaVisible";
 
   static const QString TAG_AREA_HIDDEN; // = "editorAreaHidden";
 
   static const QString TAG_AREA_TRIM_STATE; // = "editorAreaTrimState";
 
   static const QString TAG_INPUT; // = "input";
 
   static const QString TAG_FACTORY_ID; // = "factoryID";
 
   static const QString TAG_EDITOR_STATE; // = "editorState";
 
   static const QString TAG_TITLE; // = "title";
 
   static const QString TAG_X; // = "x";
 
   static const QString TAG_Y; // = "y";
 
   static const QString TAG_FLOAT; // = "float";
 
   static const QString TAG_ITEM_WRAP_INDEX; // = "wrapIndex";
 
   static const QString TAG_TOOLBAR_LAYOUT; // = "toolbarLayout";
 
   static const QString TAG_WIDTH; // = "width";
 
   static const QString TAG_HEIGHT; // = "height";
 
   static const QString TAG_MINIMIZED; // = "minimized";
 
   static const QString TAG_MAXIMIZED; // = "maximized";
 
   static const QString TAG_FOLDER; // = "folder";
 
   static const QString TAG_INFO; // = "info";
 
   static const QString TAG_PART; // = "part";
 
   static const QString TAG_PART_NAME; // = "partName";
 
   static const QString TAG_PROPERTIES; // = "properties";
 
   static const QString TAG_PROPERTY; // = "property";
 
   static const QString TAG_RELATIVE; // = "relative";
 
   static const QString TAG_RELATIONSHIP; // = "relationship";
 
   static const QString TAG_RATIO; // = "ratio";
 
   static const QString TAG_RATIO_LEFT; // = "ratioLeft";
 
   static const QString TAG_RATIO_RIGHT; // = "ratioRight";
 
   static const QString TAG_ACTIVE_PAGE_ID; // = "activePageID";
 
   static const QString TAG_EXPANDED; // = "expanded";
 
   static const QString TAG_PAGE; // = "page";
 
   static const QString TAG_INTRO; // = "intro";
 
   static const QString TAG_STANDBY; // = "standby";
 
   static const QString TAG_LABEL; // = "label";
 
   static const QString TAG_CONTENT; // = "content";
 
   static const QString TAG_CLASS; // = "class";
 
   static const QString TAG_FILE; // = "file";
 
   static const QString TAG_DESCRIPTOR; // = "descriptor";
 
   static const QString TAG_MAIN_WINDOW; // = "mainWindow";
 
   static const QString TAG_DETACHED_WINDOW; // = "detachedWindow";
 
   static const QString TAG_HIDDEN_WINDOW; // = "hiddenWindow";
 
   static const QString TAG_WORKBENCH; // = "workbench";
 
   static const QString TAG_WINDOW; // = "window";
 
   static const QString TAG_VERSION; // = "version";
 
   static const QString TAG_PROGRESS_COUNT; // = "progressCount";
 
   static const QString TAG_PERSPECTIVES; // = "perspectives";
 
   static const QString TAG_PERSPECTIVE; // = "perspective";
 
   static const QString TAG_ACTIVE_PERSPECTIVE; // = "activePerspective";
 
   static const QString TAG_ACTIVE_PART; // = "activePart";
 
   static const QString TAG_ACTION_SET; // = "actionSet";
 
   static const QString TAG_ALWAYS_ON_ACTION_SET; // = "alwaysOnActionSet";
 
   static const QString TAG_ALWAYS_OFF_ACTION_SET; // = "alwaysOffActionSet";
 
   static const QString TAG_SHOW_VIEW_ACTION; // = "show_view_action";
 
   static const QString TAG_SHOW_IN_TIME; // = "show_in_time";
 
   static const QString TAG_TIME; // = "time";
 
   static const QString TAG_NEW_WIZARD_ACTION; // = "new_wizard_action";
 
   static const QString TAG_PERSPECTIVE_ACTION; // = "perspective_action";
 
   static const QString TAG_VIEW; // = "view";
 
   static const QString TAG_LAYOUT; // = "layout";
 
   static const QString TAG_EXTENSION; // = "extension";
 
   static const QString TAG_NAME; // = "name";
 
   static const QString TAG_IMAGE; // = "image";
 
   static const QString TAG_LAUNCHER; // = "launcher";
 
   static const QString TAG_PLUGIN; // = "plugin";
 
   /** deprecated - use TAG_OPEN_MODE */
   static const QString TAG_INTERNAL; // = "internal";
 
   /** deprecated - use TAG_OPEN_MODE */
   static const QString TAG_OPEN_IN_PLACE; // = "open_in_place";
 
   static const QString TAG_PROGRAM_NAME; // = "program_name";
 
   static const QString TAG_FAST_VIEWS; // = "fastViews";
 
   static const QString TAG_FAST_VIEW_BAR; // = "fastViewBar";
 
   static const QString TAG_FAST_VIEW_BARS; // = "fastViewBars";
 
   static const QString TAG_GLOBAL_FAST_VIEWS; // = "globalFastViews";
 
   static const QString TAG_FAST_GROUPS; // = "fastGroups";
 
   static const QString TAG_FIXED; // = "fixed";//$NON-NLS-1$
 
   static const QString TAG_CLOSEABLE; // = "closeable";//$NON-NLS-1$
 
   static const QString TAG_MOVEABLE; // = "moveable";//$NON-NLS-1$
 
   static const QString TAG_APPEARANCE; // = "appearance";
 
   static const QString TAG_PRESENTATION; // = "presentation";
 
   static const QString TAG_STANDALONE; // = "standalone";//$NON-NLS-1$
 
   static const QString TAG_SHOW_TITLE; // = "showTitle";//$NON-NLS-1$
 
   static const QString TAG_VIEW_STATE; // = "viewState";
 
   static const QString TAG_SINGLETON; // = "singleton";
 
   static const QString TAG_EDITOR_REUSE_THRESHOLD; // = "editorReuseThreshold";
 
   static const QString TAG_PERSISTABLE; // = "persistable";
 
   static const QString TAG_MRU_LIST; // = "mruList";
 
   static const QString TAG_PERSPECTIVE_HISTORY; // = "perspHistory";
 
   static const QString TAG_WORKING_SET_MANAGER; // = "workingSetManager";
 
   static const QString TAG_WORKING_SETS; // = "workingSets";
 
   static const QString TAG_WORKING_SET; // = "workingSet";
 
   static const QString TAG_ITEM; // = "item";
 
   static const QString TAG_EDIT_PAGE_ID; // = "editPageId";
 
   static const QString TAG_COOLBAR_LAYOUT; // = "coolbarLayout";
 
   static const QString TAG_ITEM_SIZE; // = "itemSize";
 
   static const QString TAG_ITEM_X; // = "x";
 
   static const QString TAG_ITEM_Y; // = "y";
 
   static const QString TAG_ITEM_TYPE; // = "itemType";
 
   static const QString TAG_TYPE_SEPARATOR; // = "typeSeparator";
 
   static const QString TAG_TYPE_GROUPMARKER; // = "typeGroupMarker";
 
   static const QString TAG_TYPE_TOOLBARCONTRIBUTION; // = "typeToolBarContribution";
 
   static const QString TAG_TYPE_PLACEHOLDER; // = "typePlaceholder";
 
   static const QString TAG_COOLITEM; // = "coolItem";
 
   static const QString TAG_INDEX; // = "index";
 
   static const QString TAG_PINNED; // = "pinned";
 
   static const QString TAG_PATH; // = "path";//$NON-NLS-1$
 
   static const QString TAG_TOOLTIP; // = "tooltip";//$NON-NLS-1$
 
   static const QString TAG_VIEWS; // = "views";//$NON-NLS-1$
 
   static const QString TAG_POSITION; // = "position";//$NON-NLS-1$
 
   static const QString TAG_NAVIGATION_HISTORY; // = "navigationHistory";//$NON-NLS-1$
 
   static const QString TAG_STICKY_STATE; // = "stickyState";
 
   static const QString TAG_ACTIVE; // = "active";//$NON-NLS-1$
 
   static const QString TAG_REMOVED; // = "removed";//$NON-NLS-1$
 
   static const QString TAG_HISTORY_LABEL; // = "historyLabel";//$NON-NLS-1$
 
   static const QString TAG_LOCKED; // = "locked";//$NON-NLS-1$
 
   static const QString TAG_OPEN_MODE; // = "openMode";
 
   static const QString TAG_STARTUP; // = "startup";
 
   static const QString TAG_FAST_VIEW_SIDE; // = "fastViewLocation";
 
   static const QString TAG_FAST_VIEW_DATA; // = "fastViewData";
 
   static const QString TAG_FAST_VIEW_ORIENTATION; // = "orientation";
 
   static const QString TAG_FAST_VIEW_SEL_ID; // = "selectedTabId";
 
   static const QString TAG_FAST_VIEW_STYLE; // = "style";
 
   static const QString TAG_THEME; // = "theme";//$NON-NLS-1$
 
   static const QString TAG_VIEW_LAYOUT_REC; // = "viewLayoutRec";
 
   static const QString TAG_PERSPECTIVE_BAR; // = "perspectiveBar";
 
   static const QString TAG_TRIM; // = "trimLayout";
 
   static const QString TAG_TRIM_AREA; // = "trimArea";
 
   static const QString TAG_TRIM_ITEM; // = "trimItem";
 
   //Fonts
   static const QString SMALL_FONT; // = "org.blueberry.ui.smallFont";
 
   //Colors
   static const QString COLOR_HIGHLIGHT_; // = "org.blueberry.ui.highlight";
 
 };
 
 }
 
 #endif /* BERRYWORKBENCHCONSTANTS_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
index fe4c59e7ac..85d05670da 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchPage.h
@@ -1,1428 +1,1428 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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);
 
 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
+     * Returns 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.
+   * called to restore this page from data stored in a persistence 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.
+   * Activates a part. The part is given focus, the pane is highlighted.
    */
   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.
+   * Deactivates a part. The pane is unhighlighted.
    */
   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.
+   * propagate 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
+   * for the specified 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
+   * Sanity-checks the objects in this page. Throws an Assertion 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
   {
     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/berryWorkbenchRegistryConstants.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchRegistryConstants.h
index 3f79b5fe2d..18201ee809 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchRegistryConstants.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchRegistryConstants.h
@@ -1,1318 +1,1318 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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_REGISTRY_CONSTANTS__
 #define __BERRY_WORKBENCH_REGISTRY_CONSTANTS__
 
 #include <QString>
 
 namespace berry {
 
 /**
  * \ingroup org_blueberry_ui_internal
  *
  * Interface containing various registry constants (tag and attribute names).
  *
  */
 struct WorkbenchRegistryConstants {
 
   /**
    * Accelerator attribute. Value <code>accelerator</code>.
    */
   static const QString ATT_ACCELERATOR; // "accelerator";
 
   /**
    * Adaptable attribute. Value <code>adaptable</code>.
    */
   static const QString ATT_ADAPTABLE; // "adaptable";
 
   /**
    * Advisor id attribute. Value <code>triggerPointAdvisorId</code>.
    */
   static const QString ATT_ADVISORID; // "triggerPointAdvisorId";
 
   /**
    * Allow label update attribute. Value <code>allowLabelUpdate</code>.
    */
   static const QString ATT_ALLOW_LABEL_UPDATE; // "allowLabelUpdate";
 
   /**
    * View multiple attribute. Value <code>allowMultiple</code>.
    */
   static const QString ATT_ALLOW_MULTIPLE; // "allowMultiple";
 
   /**
    * Attribute that specifies whether a view gets restored upon workbench restart. Value <code>restorable</code>.
    */
   static const QString ATT_RESTORABLE; // = "restorable";
 
   /**
    * Attribute that specifies whether a wizard is immediately capable of
    * finishing. Value <code>canFinishEarly</code>.
    */
   static const QString ATT_CAN_FINISH_EARLY; // "canFinishEarly";
 
   /**
    * The name of the category attribute, which appears on a command
    * definition.
    */
   static const QString ATT_CATEGORY; // "category";
 
   /**
    * Category id attribute. Value <code>categoryId</code>.
    */
   static const QString ATT_CATEGORY_ID; // "categoryId";
 
   /**
    * Class attribute. Value <code>class</code>.
    */
   static const QString ATT_CLASS; // "class";
 
   /**
    * Sticky view closable attribute. Value <code>closable</code>.
    */
   static const QString ATT_CLOSEABLE; // "closeable";
 
   /**
    * Color factory attribute. Value <code>colorFactory</code>.
    */
   static const QString ATT_COLORFACTORY; // "colorFactory";
 
   /**
    * Editor command attribute. Value <code>command</code>.
    */
   static const QString ATT_COMMAND; // "command";
 
   /**
    * The name of the attribute storing the command id.
    */
   static const QString ATT_COMMAND_ID; // "commandId";
 
   /**
    * The name of the configuration attribute storing the scheme id for a
    * binding.
    */
   static const QString ATT_CONFIGURATION; // "configuration";
 
   /**
    * Intro content detector class attribute (optional). Value <code>contentDetector</code>.
    */
   static const QString ATT_CONTENT_DETECTOR; // "contentDetector";
 
   /**
    * Editor content type id binding attribute. Value
    * <code>contentTypeId</code>.
    */
   static const QString ATT_CONTENT_TYPE_ID; // "contentTypeId";
 
   /**
    * The name of the attribute storing the context id for a binding.
    */
   static const QString ATT_CONTEXT_ID; // "contextId";
 
   /**
    * Editor contributor class attribute. Value <code>contributorClass</code>.
    */
   static const QString ATT_CONTRIBUTOR_CLASS; // "contributorClass";
 
   /**
    * The name of the attribute storing the IParameterValueConverter for
    * a commandParameterType.
    */
   static const QString ATT_CONVERTER; // "converter";
 
   /**
    * Perspective default attribute. Value <code>default</code>.
    */
   static const QString ATT_DEFAULT; // "default";
 
   /**
    * The name of the default handler attribute, which appears on a command
    * definition.
    */
   static const QString ATT_DEFAULT_HANDLER; // "defaultHandler";
 
   /**
    * Defaults-to attribute. Value <code>defaultsTo</code>.
    */
   static const QString ATT_DEFAULTS_TO; // "defaultsTo";
 
   /**
    * Action definition id attribute. Value <code>definitionId</code>.
    */
   static const QString ATT_DEFINITION_ID; // "definitionId";
 
   /**
    * The name of the description attribute, which appears on named handle
    * objects.
    */
   static const QString ATT_DESCRIPTION; // "description";
 
   /**
    * Description image attribute. Value <code>descriptionImage</code>.
    */
   static const QString ATT_DESCRIPTION_IMAGE; // "descriptionImage";
 
   /**
    * Disabled icon attribute. Value <code>disabledIcon</code>.
    */
   static const QString ATT_DISABLEDICON; // "disabledIcon";
 
   /**
    * Enables-for attribute. Value <code>enablesFor</code>.
    */
   static const QString ATT_ENABLES_FOR; // "enablesFor";
 
   /**
    * Editor extensions attribute. Value <code>extensions</code>.
    */
   static const QString ATT_EXTENSIONS; // "extensions";
 
   /**
    * View ratio attribute. Value <code>fastViewWidthRatio</code>.
    */
   static const QString ATT_FAST_VIEW_WIDTH_RATIO; // "fastViewWidthRatio";
 
   /**
    * Editor filenames attribute. Value <code>filenames</code>.
    */
   static const QString ATT_FILENAMES; // "filenames";
 
   /**
    * Trim fill major attribute. Value <code>fillMajor</code>.
    */
   static const QString ATT_FILL_MAJOR; // "fillMajor";
 
   /**
    * Trim fill minor attribute. Value <code>fillMinor</code>.
    */
   static const QString ATT_FILL_MINOR; // "fillMinor";
 
   /**
    * Perspective fixed attribute. Value <code>fixed</code>.
    */
   static const QString ATT_FIXED; // "fixed";
 
   /**
    * Attribute that specifies whether a wizard has any pages. Value
    * <code>hasPages</code>.
    */
   static const QString ATT_HAS_PAGES; // "hasPages";
 
   /**
    * Help context id attribute. Value <code>helpContextId</code>.
    */
   static const QString ATT_HELP_CONTEXT_ID; // "helpContextId";
 
   /**
    * Help url attribute. Value <code>helpHref</code>.
    */
   static const QString ATT_HELP_HREF; // "helpHref";
 
   /**
    * Hover icon attribute. Value <code>hoverIcon</code>.
    */
   static const QString ATT_HOVERICON; // "hoverIcon";
 
   /**
    * Icon attribute. Value <code>icon</code>.
    */
   static const QString ATT_ICON; // "icon";
 
   /**
    * Id attribute. Value <code>id</code>.
    */
   static const QString ATT_ID; // "id";
 
   /**
    * The name of the image style attribute, which is used on location elements
    * in the menus extension point.
    */
   static const QString ATT_IMAGE_STYLE; // "imageStyle";
 
   /**
    * Is-editable attribute. Value <code>isEditable</code>.
    */
   static const QString ATT_IS_EDITABLE; // "isEditable";
 
   /**
    * Keys attribute. Value <code>keys</code>.
    */
   static const QString ATT_KEY; // "key";
 
   /**
    * The name of the attribute storing the identifier for the active key
    * configuration identifier. This provides legacy support for the
    * <code>activeKeyConfiguration</code> element in the commands extension
    * point.
    */
   static const QString ATT_KEY_CONFIGURATION_ID; // "keyConfigurationId";
 
   /**
    * The name of the attribute storing the trigger sequence for a binding.
    * This is called a 'keySequence' for legacy reasons.
    */
   static const QString ATT_KEY_SEQUENCE; // "keySequence";
 
   /**
    * Label attribute. Value <code>label</code>.
    */
   static const QString ATT_LABEL; // "label";
 
   /**
    * Editor launcher attribute. Value <code>launcher</code>.
    */
   static const QString ATT_LAUNCHER; // "launcher";
 
   /**
    * Lightweight decorator tag. Value <code>lightweight</code>.
    */
   static const QString ATT_LIGHTWEIGHT; // "lightweight";
 
   /**
    * The name of the attribute storing the locale for a binding.
    */
   static const QString ATT_LOCALE; // "locale";
 
   /**
    * Sticky view location attribute. Value <code>location</code>.
    */
   static const QString ATT_LOCATION; // "location";
 
   /**
    * Editor management strategy attribute. Value <code>matchingStrategy</code>.
    */
   static const QString ATT_MATCHING_STRATEGY; // "matchingStrategy";
 
   /**
    * The name of the menu identifier attribute, which appears on items.
    */
   static const QString ATT_MENU_ID; // "menuId";
 
   /**
    * Menubar path attribute. Value <code>menubarPath</code>.
    */
   static const QString ATT_MENUBAR_PATH; // "menubarPath";
 
   /**
    * The name of the mnemonic attribute, which appears on locations.
    */
   static const QString ATT_MNEMONIC; // "mnemonic";
 
   /**
    * The name of the minimized attribute, which appears
    * when adding a view in a perspectiveExtension.
    */
   static const QString ATT_MINIMIZED; // "minimized";
 
   /**
    * Sticky view moveable attribute. Value <code>moveable</code>.
    */
   static const QString ATT_MOVEABLE; // "moveable";
 
   /**
    * Name attribute. Value <code>name</code>.
    */
   static const QString ATT_NAME; // "name";
 
   /**
    * Name filter attribute. Value <code>nameFilter</code>.
    */
   static const QString ATT_NAME_FILTER; // "nameFilter";
 
   /**
    * Node attribute. Value <code>node</code>.
    */
   static const QString ATT_NODE; // "node";
 
   /**
    * Object class attribute. Value <code>objectClass</code>.
    */
   static const QString ATT_OBJECTCLASS; // "objectClass";
 
   /**
    * The name of the optional attribute, which appears on parameter
    * definitions.
    */
   static const QString ATT_OPTIONAL; // "optional";
 
   /**
    * Operating system attribute. Value <code>os</code>.
    */
   static const QString ATT_OS; // "os";
 
   /**
    * The name of the deprecated parent attribute, which appears on scheme
    * definitions.
    */
   static const QString ATT_PARENT; // "parent";
 
   /**
    * View parent category attribute. Value <code>parentCategory</code>.
    */
   static const QString ATT_PARENT_CATEGORY; // "parentCategory";
 
   /**
    * Parent id attribute. Value <code>parentId</code>.
    */
   static const QString ATT_PARENT_ID; // "parentId";
 
   /**
    * The name of the deprecated parent scope attribute, which appears on
    * contexts definitions.
    */
   static const QString ATT_PARENT_SCOPE; // "parentScope";
 
   /**
    * Path attribute. Value <code>path</code>.
    */
   static const QString ATT_PATH; // "path";
 
   /**
    * The name of the attribute storing the platform for a binding.
    */
   static const QString ATT_PLATFORM; // "platform";
 
   /**
    * The name of the position attribute, which appears on order elements.
    */
   static const QString ATT_POSITION; // "position";
 
   /**
    * Presentation id attribute. Value <code>presentationId</code>.
    */
   static const QString ATT_PRESENTATIONID; // "presentationId";
 
   /**
    * Product id attribute. Value <code>productId</code>.
    */
   static const QString ATT_PRODUCTID; // "productId";
 
   /**
    * Project attribute. Value <code>project</code>.
    */
   // @issue project-specific attribute and behavior
   static const QString ATT_PROJECT; // "project";  /**
 
   /**
    * The name of the pulldown attribute, which indicates whether the class is
    * a pulldown delegate.
    */
   static const QString ATT_PULLDOWN; // "pulldown";
 
   /**
    * View ratio attribute. Value <code>ratio</code>.
    */
   static const QString ATT_RATIO; // "ratio";
 
   /**
    * Relationship attribute. Value <code>relationship</code>.
    */
   static const QString ATT_RELATIONSHIP; // "relationship";
 
   /**
    * Relative attribute. Value <code>relative</code>.
    */
   static const QString ATT_RELATIVE; // "relative";
 
   /**
    * The name of the relativeTo attribute, which appears on order elements.
    */
   static const QString ATT_RELATIVE_TO; // "relativeTo";
 
   /**
    * Retarget attribute. Value <code>retarget</code>.
    */
   static const QString ATT_RETARGET; // "retarget";
 
   /**
    * The name of the returnTypeId attribute, which appears on command
    * elements.
    */
   static const QString ATT_RETURN_TYPE_ID; // "returnTypeId";
 
   /**
-   * Role attribue. Value <code>role</code>.
+   * Role attribute. Value <code>role</code>.
    */
   static const QString ATT_ROLE; // "role";
 
   /**
    * The name of the attribute storing the identifier for the active scheme.
    * This is called a 'keyConfigurationId' for legacy reasons.
    */
   static const QString ATT_SCHEME_ID; // "schemeId";
 
   /**
    * Scope attribute. Value <code>scope</code>.
    */
   static const QString ATT_SCOPE; // "scope";
 
   /**
    * The name of the separatorsVisible attribute, which appears on group
    * elements.
    */
   static const QString ATT_SEPARATORS_VISIBLE; // "separatorsVisible";
 
   /**
    * The name of the sequence attribute for a key binding.
    */
   static const QString ATT_SEQUENCE; // "sequence";
 
   /**
    * Show title attribute. Value <code>showTitle</code>.
    */
   static const QString ATT_SHOW_TITLE; // "showTitle";
 
   /**
    * Perspective singleton attribute. Value <code>singleton</code>.
    */
   static const QString ATT_SINGLETON; // "singleton";
 
   /**
    * Splash id attribute.  Value <code>splashId</code>.
    *
    * @since 3.3
    */
   static const QString ATT_SPLASH_ID; // "splashId";
 
   /**
    * Standalone attribute. Value <code>standalone</code>.
    */
   static const QString ATT_STANDALONE; // "standalone";
 
   /**
    * Action state attribute. Value <code>state</code>.
    */
   static const QString ATT_STATE; // "state";
 
   /**
    * The name of the string attribute (key sequence) for a binding in the
    * commands extension point.
    */
   static const QString ATT_STRING; // "string";
 
   /**
    * Action style attribute. Value <code>style</code>.
    */
   static const QString ATT_STYLE; // "style";
 
   /**
    * Target attribute. Value <code>targetID</code>.
    */
   static const QString ATT_TARGET_ID; // "targetID";
 
   /**
    * Toolbar path attribute. Value <code>toolbarPath</code>.
    */
   static const QString ATT_TOOLBAR_PATH; // "toolbarPath";
 
   /**
    * Tooltip attribute. Value <code>tooltip</code>.
    */
   static const QString ATT_TOOLTIP; // "tooltip";
 
   /**
    * The name of the type attribute, which appears on bar elements and
-   * commandParameterType elments.
+   * commandParameterType elements.
    */
   static const QString ATT_TYPE; // "type";
 
   /**
    * The name of the typeId attribute, which appears on commandParameter
    * elements.
    */
   static const QString ATT_TYPE_ID; // "typeId";
 
   /**
    * Value attribute. Value <code>value</code>.
    */
   static const QString ATT_VALUE; // "value";
 
   /**
    * Visible attribute. Value <code>visible</code>.
    */
   // ATT_VISIBLE added by dan_rubel@instantiations.com
   static const QString ATT_VISIBLE; // "visible";
 
   /**
    * Windowing system attribute. Value <code>ws</code>.
    */
   static const QString ATT_WS; // "ws";
 
   /**
    * The prefix that all auto-generated identifiers start with. This makes the
    * identifier recognizable as auto-generated, and further helps ensure that
    * it does not conflict with existing identifiers.
    */
   static const QString AUTOGENERATED_PREFIX; // "AUTOGEN:::";
 
   /**
    * The legacy extension point (2.1.x and earlier) for specifying a key
    * binding scheme.
    *
    * @since 3.1.1
    */
   static const QString PL_ACCELERATOR_CONFIGURATIONS; // "acceleratorConfigurations";
 
   /**
    * The legacy extension point (2.1.x and earlier) for specifying a context.
    *
    * @since 3.1.1
    */
   static const QString PL_ACCELERATOR_SCOPES; // "acceleratorScopes";
 
   /**
    * The legacy extension point (2.1.x and earlier) for specifying a command.
    *
    * @since 3.1.1
    */
   static const QString PL_ACTION_DEFINITIONS; // "actionDefinitions";
 
   static const QString PL_ACTION_SET_PART_ASSOCIATIONS; // "actionSetPartAssociations";
 
   static const QString PL_ACTION_SETS; // "actionSets";
 
   static const QString PL_ACTIVITIES; // "activities";
 
   static const QString PL_ACTIVITYSUPPORT; // "activitySupport";
 
   /**
    * The extension point (3.1 and later) for specifying bindings, such as
    * keyboard shortcuts.
    *
    * @since 3.1.1
    */
   static const QString PL_BINDINGS; // "bindings";
 
   static const QString PL_BROWSER_SUPPORT; // "browserSupport";
 
   static const QString PL_COLOR_DEFINITIONS; // "colorDefinitions";
 
   /**
    * The extension point (3.2 and later) for associating images with commands.
    *
    * @since 3.2
    */
   static const QString PL_COMMAND_IMAGES; // "commandImages";
 
   /**
    * The extension point (2.1.x and later) for specifying a command. A lot of
    * other things have appeared first in this extension point and then been
    * moved to their own extension point.
    *
    * @since 3.1.1
    */
   static const QString PL_COMMANDS; // "commands";
 
   /**
    * The extension point (3.0 and later) for specifying a context.
    *
    * @since 3.1.1
    */
   static const QString PL_CONTEXTS; // "contexts";
 
   static const QString PL_DECORATORS; // "decorators";
 
   static const QString PL_DROP_ACTIONS; // "dropActions";
 
   static const QString PL_EDITOR; // "editors";
 
   static const QString PL_EDITOR_ACTIONS; // "editorActions";
 
   static const QString PL_ELEMENT_FACTORY; // "elementFactories";
 
   /**
    * The extension point for encoding definitions.
    */
   static const QString PL_ENCODINGS; // "encodings";
 
   static const QString PL_EXPORT; // "exportWizards";
 
   static const QString PL_FONT_DEFINITIONS; // "fontDefinitions";
 
   /**
    * The extension point (3.1 and later) for specifying handlers.
    *
    * @since 3.1.1
    */
   static const QString PL_HANDLERS; // "handlers";
 
   static const QString PL_HELPSUPPORT; // "helpSupport";
 
   static const QString PL_IMPORT; // "importWizards";
 
   static const QString PL_INTRO; // "intro";
 
   /**
    * The extension point for keyword definitions.
    *
    * @since 3.1
    */
   static const QString PL_KEYWORDS; // "keywords";
 
   /**
    * The extension point (3.2 and later) for specifying menu contributions.
    *
    * @since 3.2
    */
   static const QString PL_MENUS; // "menus";
 
   /**
    * The extension point (3.3 and later) for specifying menu contributions.
    *
    * @since 3.3
    */
   static const QString PL_MENU_CONTRIBUTION; // "menuContribution";
 
   static const QString PL_NEW; // "newWizards";
 
   static const QString PL_PERSPECTIVE_EXTENSIONS; // "perspectiveExtensions";
 
   static const QString PL_PERSPECTIVES; // "perspectives";
 
   static const QString PL_POPUP_MENU; // "popupMenus";
 
   static const QString PL_PREFERENCE_TRANSFER; // "preferenceTransfer";
 
   static const QString PL_PREFERENCES; // "preferencePages";
 
   static const QString PL_PRESENTATION_FACTORIES; // "presentationFactories";
 
   static const QString PL_PROPERTY_PAGES; // "propertyPages";
 
   static const QString PL_STARTUP; // "startup";
 
   /**
    * @since 3.3
    */
   static const QString PL_SPLASH_HANDLERS; // "splashHandlers";
 
   static const QString PL_SYSTEM_SUMMARY_SECTIONS; // "systemSummarySections";
 
   static const QString PL_THEMES; // "themes";
 
   static const QString PL_VIEW_ACTIONS; // "viewActions";
 
   static const QString PL_VIEWS; // "views";
 
   static const QString PL_WORKINGSETS; // "workingSets";
 
   /**
    * The name of the deprecated accelerator configurations extension point.
    */
   static const QString EXTENSION_ACCELERATOR_CONFIGURATIONS;
 
   /**
    * The name of the accelerator scopes extension point.
    */
   static const QString EXTENSION_ACCELERATOR_SCOPES;
 
   /**
    * The name of the action definitions extension point.
    */
   static const QString EXTENSION_ACTION_DEFINITIONS;
 
   /**
    * The name of the <code>org.blueberry.ui.actionSets</code> extension point.
    */
   static const QString EXTENSION_ACTION_SETS;
 
   /**
    * The name of the bindings extension point.
    */
   static const QString EXTENSION_BINDINGS;
 
   /**
    * The name of the commands extension point.
    */
   static const QString EXTENSION_COMMAND_IMAGES;
 
   /**
    * The name of the commands extension point, and the name of the key for the
    * commands preferences.
    */
   static const QString EXTENSION_COMMANDS;
 
   /**
    * The name of the contexts extension point.
    */
   static const QString EXTENSION_CONTEXTS;
 
   /**
    * The name of the <code>org.blueberry.ui.editorActions</code> extension
    * point.
    */
   static const QString EXTENSION_EDITOR_ACTIONS;
 
   /**
    * The name of the commands extension point.
    */
   static const QString EXTENSION_HANDLERS;
 
   /**
    * The name of the <code>org.blueberry.ui.menus</code> extension point.
    */
   static const QString EXTENSION_MENUS;
 
   /**
    * The name of the <code>org.blueberry.ui.menus2</code> extension point.
    */
   static const QString COMMON_MENU_ADDITIONS;
 
   /**
    * The name of the <code>org.blueberry.ui.popupMenus</code> extension point.
    */
   static const QString EXTENSION_POPUP_MENUS;
 
   /**
    * The name of the <code>org.blueberry.ui.viewActions</code> extension
    * point.
    */
   static const QString EXTENSION_VIEW_ACTIONS;
 
   /**
    * The constant for the position attribute corresponding to
    * {@link SOrder#POSITION_AFTER}.
    */
   static const QString POSITION_AFTER; // "after";
 
   /**
    * The constant for the position attribute corresponding to
    * {@link SOrder#POSITION_BEFORE}.
    */
   static const QString POSITION_BEFORE; // "before";
 
   /**
    * The constant for the position attribute corresponding to
    * {@link SOrder#POSITION_END}.
    */
   static const QString POSITION_END; // "end";
 
   /**
    * The constant for the position attribute corresponding to
    * {@link SOrder#POSITION_START}.
    */
   static const QString POSITION_START; // "start";
 
   /**
    * The action style for drop-down menus.
    */
   static const QString STYLE_PULLDOWN; // "pulldown";
 
   /**
    * The action style for radio buttons.
    */
   static const QString STYLE_RADIO; // "radio";
 
   /**
    * The action style for check boxes.
    */
   static const QString STYLE_TOGGLE; // "toggle";
 
   /**
    * The name of the deprecated accelerator configuration element. This
    * element was used in 2.1.x and earlier to define groups of what are now
    * called schemes.
    */
   static const QString TAG_ACCELERATOR_CONFIGURATION; // "acceleratorConfiguration";
 
   /**
    * The name of the element storing a deprecated accelerator scope.
    */
   static const QString TAG_ACCELERATOR_SCOPE; // "acceleratorScope";
 
   /**
    * Action tag. Value <code>action</code>.
    */
   static const QString TAG_ACTION; // "action";
 
   /**
    * The name of the element storing an action definition. This element only
    * existed in
    */
   static const QString TAG_ACTION_DEFINITION; // "actionDefinition";
 
   /**
    * Action set tag. Value <code>actionSet</code>.
    */
   static const QString TAG_ACTION_SET; // "actionSet";
 
   /**
    * Part association tag. Value <code>actionSetPartAssociation</code>.
    */
   static const QString TAG_ACTION_SET_PART_ASSOCIATION; // "actionSetPartAssociation";
 
   /**
    * The name of the element storing the active key configuration from the
    * commands extension point.
    */
   static const QString TAG_ACTIVE_KEY_CONFIGURATION; // "activeKeyConfiguration";
 
   /**
    * The name of the active when element, which appears on a handler
    * definition.
    */
   static const QString TAG_ACTIVE_WHEN; // "activeWhen";
 
   /**
    * Activity image binding tag. Value <code>activityImageBindingw</code>.
    */
   static const QString TAG_ACTIVITY_IMAGE_BINDING; // "activityImageBinding";
 
   /**
    * Advisor to product binding element. Value
    * <code>triggerPointAdvisorProductBinding</code>.
    */
   static const QString TAG_ADVISORPRODUCTBINDING; // "triggerPointAdvisorProductBinding";
 
   /**
    * The name of the bar element, which appears in a location definition.
    */
   static const QString TAG_BAR; // "bar";
 
   /**
    * Category tag. Value <code>category</code>.
    */
   static const QString TAG_CATEGORY; // "category";
 
   /**
    * Category image binding tag. Value <code>categoryImageBinding</code>.
    */
   static const QString TAG_CATEGORY_IMAGE_BINDING; // "categoryImageBinding";
 
   /**
    * Element category tag. Value <code>themeElementCategory</code>.
    */
   static const QString TAG_CATEGORYDEFINITION; // "themeElementCategory";
 
   /**
    * Category presentation tag. Value <code>categoryPresentationBinding</code>.
    */
   static const QString TAG_CATEGORYPRESENTATIONBINDING; // "categoryPresentationBinding";
 
   /**
    * The name of the class element, which appears on an executable extension.
    */
   static const QString TAG_CLASS; // ATT_CLASS;
 
   /**
    * Color definition tag. Value <code>colorDefinition</code>.
    */
   static const QString TAG_COLORDEFINITION; // "colorDefinition";
 
   /**
    * Color override tag. Value <code>colorOverride</code>.
    */
   static const QString TAG_COLOROVERRIDE; // "colorOverride";
 
   /**
    * Color value tag. Value <code>colorValue</code>.
    */
   static const QString TAG_COLORVALUE; // "colorValue";
 
   /**
    * The name of the element storing a command.
    */
   static const QString TAG_COMMAND; // "command";
 
   /**
    * The name of the element storing a parameter.
    */
   static const QString TAG_COMMAND_PARAMETER; // "commandParameter";
 
   /**
    * The name of the element storing a parameter type.
    */
   static const QString TAG_COMMAND_PARAMETER_TYPE; // "commandParameterType";
 
   /**
    * Editor content type binding tag. Value <code>contentTypeBinding</code>.
    */
   static const QString TAG_CONTENT_TYPE_BINDING; // "contentTypeBinding";
 
   /**
    * The name of the element storing a context.
    */
   static const QString TAG_CONTEXT; // "context";
 
   /**
    * Data tag. Value <code>data</code>.
    */
   static const QString TAG_DATA; // "data";
 
   /**
    * The name of the default handler element, which appears on a command
    * definition.
    */
   static const QString TAG_DEFAULT_HANDLER; // ATT_DEFAULT_HANDLER;
 
   /**
    * Description element. Value <code>description</code>.
    */
   static const QString TAG_DESCRIPTION; // "description";
 
   /**
    * The name of the dynamic menu element, which appears in a group or menu
    * definition.
    */
   static const QString TAG_DYNAMIC; // "dynamic";
 
   /**
    * Editor tag. Value <code>editor</code>.
    */
   static const QString TAG_EDITOR; // "editor";
 
   /**
    * The name of the deprecated editorContribution element. This is used for
    * contributing actions to the top-level menus and tool bars when particular
    * editors are visible.
    */
   static const QString TAG_EDITOR_CONTRIBUTION; // "editorContribution";
 
   /**
    * The name of the enabled when element, which appears on a handler
    * definition.
    */
   static const QString TAG_ENABLED_WHEN; // "enabledWhen";
 
   /**
    * Enablement tag. Value <code>enablement</code>.
    */
   static const QString TAG_ENABLEMENT; // "enablement";
 
   /**
    * Entry tag. Value <code>entry</code>.
    */
   static const QString TAG_ENTRY; // "entry";
 
   /**
    * Filter tag. Value <code>filter</code>.
    */
   static const QString TAG_FILTER; // "filter";
 
   /***************************************************************************
    * Font definition tag. Value <code>fontDefinition</code>.
    */
   static const QString TAG_FONTDEFINITION; // "fontDefinition";
 
   /**
    * Font override tag. Value <code>fontOverride</code>.
    */
   static const QString TAG_FONTOVERRIDE; // "fontOverride";
 
   /**
    * Font value tag. Value <code>fontValue</code>.
    */
   static const QString TAG_FONTVALUE; // "fontValue";
 
   /**
    * The name of the element storing a group.
    */
   static const QString TAG_GROUP; // "group";
 
   /**
    * Group marker tag. Value <code>groupMarker</code>.
    */
   static const QString TAG_GROUP_MARKER; // "groupMarker";
 
   /**
    * The name of the element storing a handler.
    */
   static const QString TAG_HANDLER; // "handler";
 
   /**
    * The name of the element storing a handler submission.
    */
   static const QString TAG_HANDLER_SUBMISSION; // "handlerSubmission";
 
   /**
    * Trigger point hint tag. Value <code>hint</code>.
    */
   static const QString TAG_HINT; // "hint";
 
   /**
    * The name of the element storing an image.
    */
   static const QString TAG_IMAGE; // "image";
 
   /**
    * The name of the element storing a key binding.
    */
   static const QString TAG_KEY; // "key";
 
   /**
    * The name of the key binding element in the commands extension point.
    */
   static const QString TAG_KEY_BINDING; // "keyBinding";
 
   /**
    * The name of the deprecated key configuration element in the commands
    * extension point. This element has been replaced with the scheme element
    * in the bindings extension point.
    */
   static const QString TAG_KEY_CONFIGURATION; // "keyConfiguration";
 
   /**
    * The name of the element storing a location.
    */
   static const QString TAG_LOCATION; // "location";
 
   /**
    * The name of the element defining the insertion point for menu
    * additions.
    *
    * @since 3.3
    */
   static const QString TAG_LOCATION_URI; // "locationURI";
 
   /**
    * The name of the element storing trim layout info for a widget.
    */
   static const QString TAG_LAYOUT; // "layout";
 
   /**
    * Mapping tag. Value <code>mapping</code>.
    */
   static const QString TAG_MAPPING; // "mapping";
 
   /**
    * Menu tag. Value <code>menu</code>.
    */
   static const QString TAG_MENU; // "menu";
 
   /**
    * Wizard shortcut tag. Value <code>newWizardShortcut</code>.
    */
   static const QString TAG_NEW_WIZARD_SHORTCUT; // "newWizardShortcut";
 
   /**
    * Object contribution tag. Value <code>objectContribution</code>.
    */
   static const QString TAG_OBJECT_CONTRIBUTION; // "objectContribution";
 
   /**
    * The name of the element storing the ordering information.
    */
   static const QString TAG_ORDER; // "order";
 
   /**
    * The name of the element storing a parameter.
    */
   static const QString TAG_PARAMETER; // "parameter";
 
   /**
    * Part tag. Value <code>part</code>.
    */
   static const QString TAG_PART; // "part";
 
   /**
    * Perspective shortcut tag. Value <code>perspectiveShortcut</code>.
    */
   static const QString TAG_PERSP_SHORTCUT; // "perspectiveShortcut";
 
   /**
    * Perspective tag. Value <code>perspective</code>.
    */
   static const QString TAG_PERSPECTIVE; // "perspective";
 
   /**
    * Perspective extension tag. Value <code>perspectiveExtension</code>.
    */
   static const QString TAG_PERSPECTIVE_EXTENSION; // "perspectiveExtension";
 
   /**
    * Primary wizard tag. Value <code>primaryWizard</code>.
    */
   static const QString TAG_PRIMARYWIZARD; // "primaryWizard";
 
   /**
    * The name of the element storing the a menu element reference.
    */
   static const QString TAG_REFERENCE; // "reference";
 
   /**
    * The name of the scheme element in the bindings extension point.
    */
   static const QString TAG_SCHEME; // "scheme";
 
   /**
    * The name of the element storing a deprecated scope.
    */
   static const QString TAG_SCOPE; // "scope";
 
   /**
    * Selectiont tag. Value <code>selection</code>.
    */
   static const QString TAG_SELECTION; // "selection";
 
   /**
    * Separator tag. Value <code>separator</code>.
    */
   static const QString TAG_SEPARATOR; // "separator";
 
 
   /**
    * Tag for the settings transfer entry.
    */
   static const QString TAG_SETTINGS_TRANSFER; // "settingsTransfer";
 
   /**
    * Show in part tag. Value <code>showInPart</code>.
    */
   static const QString TAG_SHOW_IN_PART; // "showInPart";
 
   /**
    * The name of the element storing some state.
    */
   static const QString TAG_STATE; // "state";
 
 
   /**
    * The name of the element describing splash handlers. Value
    * <code>splashHandler</code>.
    * @since 3.3
    */
   static const QString TAG_SPLASH_HANDLER; // "splashHandler";
 
 
   /**
    * The name of the element describing splash handler product bindings. Value
    * <code>splashHandlerProductBinding</code>.
    * @since 3.3
    */
   static const QString TAG_SPLASH_HANDLER_PRODUCT_BINDING; // "splashHandlerProductBinding";
 
   /**
    * Sticky view tag. Value <code>stickyView</code>.
    */
   static const QString TAG_STICKYVIEW; // "stickyView";
 
   /**
    * Browser support tag. Value <code>support</code>.
    */
   static const QString TAG_SUPPORT; // "support";
 
   /**
    * Theme tag. Value <code>theme</code>.
    */
   static const QString TAG_THEME; // "theme";
 
   /**
    * Transfer tag. Value <code>transfer</code>.
    */
   static const QString TAG_TRANSFER; // "transfer";
 
   /**
    * Trigger point tag. Value <code>triggerPoint</code>.
    */
   static const QString TAG_TRIGGERPOINT; // "triggerPoint";
 
   /**
    * Advisor tag. Value <code>triggerPointAdvisor</code>.
    */
   static const QString TAG_TRIGGERPOINTADVISOR; // "triggerPointAdvisor";
 
   /**
    * View tag. Value <code>view</code>.
    */
   static const QString TAG_VIEW; // "view";
 
   /**
    * View shortcut tag. Value <code>viewShortcut</code>.
    */
   static const QString TAG_VIEW_SHORTCUT; // "viewShortcut";
 
   /**
    * The name of the element storing a view contribution.
    */
   static const QString TAG_VIEW_CONTRIBUTION; // "viewContribution";
 
   /**
    * Viewer contribution tag. Value <code>viewerContribution</code>.
    */
   static const QString TAG_VIEWER_CONTRIBUTION; // "viewerContribution";
 
   /**
    * Visibility tag. Value <code>visibility</code>.
    */
   static const QString TAG_VISIBILITY; // "visibility";
 
   /**
    * The name of the element storing the visible when condition.
    */
   static const QString TAG_VISIBLE_WHEN; // "visibleWhen";
 
   /**
    * The name of the element storing a widget.
    */
   static const QString TAG_WIDGET; // "widget";
 
   /**
    * The name of the element storing a control hosted in a ToolBar.
    */
   static const QString TAG_CONTROL; // "control";
 
   /**
    * Wizard tag. Value <code>wizard</code>.
    */
   static const QString TAG_WIZARD; // "wizard";
 
   /**
    * Working set tag. Value <code>workingSet</code>.
    */
   static const QString TAG_WORKING_SET; // "workingSet";
 
   /**
    * The type of reference which refers to a group.
    */
   static const QString TYPE_GROUP; // "group";
 
   /**
    * The type of reference which refers to an item.
    */
   static const QString TYPE_ITEM; // "item";
 
   /**
    * The type of reference which refers to an menu.
    */
   static const QString TYPE_MENU; // "menu";
 
   /**
    * The type of reference which refers to the widget.
    */
   static const QString TYPE_WIDGET; // "widget";
 
   static const QString TAG_TOOLBAR; // "toolbar";
 
   static const QString TAG_SERVICE_FACTORY; // "serviceFactory";
 
   static const QString TAG_SERVICE; // "service";
 
   static const QString ATTR_FACTORY_CLASS; // "factoryClass";
 
   static const QString ATTR_SERVICE_CLASS; // "serviceClass";
 
   static const QString TAG_SOURCE_PROVIDER; // "sourceProvider";
 
   static const QString ATTR_PROVIDER; // "provider";
 
   static const QString TAG_VARIABLE; // "variable";
 
   static const QString ATT_PRIORITY_LEVEL; // "priorityLevel";
 
   static const QString ATT_MODE; // "mode";
 
 };
 
 } // namespace berry
 
 #endif // __BERRY_WORKBENCH_REGISTRY_CONSTANTS__
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.cpp b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.cpp
index 64a74090fe..5ed0e2a5e6 100644
--- a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.cpp
+++ b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.cpp
@@ -1,1936 +1,1936 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "tweaklets/berryGuiWidgetsTweaklet.h"
 #include "tweaklets/berryWorkbenchTweaklet.h"
 
 #include "berryWorkbenchWindow.h"
 
 #include "berryIWorkbenchPage.h"
 #include "berryIPerspectiveDescriptor.h"
 #include "berryIContextService.h"
 #include "berryUIException.h"
 #include "berryConstants.h"
 #include "berryIMenuService.h"
 #include "berryMenuUtil.h"
 
 #include "intro/berryIntroConstants.h"
 #include "berryWorkbenchPlugin.h"
 #include "berryWorkbenchPage.h"
 #include "berryWorkbench.h"
 #include "berryWorkbenchConstants.h"
 #include "berryPartSite.h"
 #include "berryIServiceLocatorCreator.h"
 #include "berryMenuManager.h"
 #include "berryQActionProperties.h"
 #include "berryQtControlWidget.h"
 #include "berryQtPerspectiveSwitcher.h"
 #include "berryWWinActionBars.h"
 #include "berryWorkbenchLocationService.h"
 
 #include "berryIServiceFactory.h"
 #include "berryIServiceScopes.h"
 #include "berryIEvaluationReference.h"
 
 #include "berryPlatformUI.h"
 
 #include "berryDebugUtil.h"
 
 #include <QMainWindow>
 #include <QHBoxLayout>
 #include <QMenuBar>
 #include <QMoveEvent>
 #include <QResizeEvent>
 
 namespace berry
 {
 
 const QString WorkbenchWindow::PROP_TOOLBAR_VISIBLE = "toolbarVisible";
 const QString WorkbenchWindow::PROP_PERSPECTIVEBAR_VISIBLE = "perspectiveBarVisible";
 const QString WorkbenchWindow::PROP_STATUS_LINE_VISIBLE = "statusLineVisible";
 
 const ActionBarAdvisor::FillFlags WorkbenchWindow::FILL_ALL_ACTION_BARS =
     ActionBarAdvisor::FILL_MENU_BAR | ActionBarAdvisor::FILL_TOOL_BAR |
     ActionBarAdvisor::FILL_STATUS_LINE;
 
 WorkbenchWindow::WorkbenchWindow(int number)
   : Window(Shell::Pointer(nullptr))
   , pageComposite(nullptr)
   , windowAdvisor(nullptr)
   , actionBarAdvisor(nullptr)
   , number(number)
   , largeUpdates(0)
   , closing(false)
   , shellActivated(false)
   , updateDisabled(true)
   , toolBarVisible(true)
   , perspectiveBarVisible(true)
   , statusLineVisible(true)
   , emptyWindowContentsCreated(false)
   , emptyWindowContents(nullptr)
   , asMaximizedState(false)
   , partService(this)
   , serviceLocatorOwner(new ServiceLocatorOwner(this))
   , resizeEventFilter(this)
 {
   this->Register(); // increase the reference count to avoid deleting
   // this object when temporary smart pointers
   // go out of scope
 
   // Make sure there is a workbench. This call will throw
   // an exception if workbench not created yet.
   IWorkbench* workbench = PlatformUI::GetWorkbench();
   IServiceLocatorCreator* slc = workbench->GetService<IServiceLocatorCreator>();
 
   this->serviceLocator = slc->CreateServiceLocator(
         workbench,
         nullptr,
         IDisposable::WeakPtr(serviceLocatorOwner)).Cast<ServiceLocator>();
 
   InitializeDefaultServices();
 
   // Add contribution managers that are exposed to other plugins.
   this->AddMenuBar();
   //addCoolBar(SWT.NONE);  // style is unused
   //addStatusLine();
 
   this->FireWindowOpening();
 
   // Fill the action bars
   this->FillActionBars(FILL_ALL_ACTION_BARS);
 
   this->UnRegister(false); // decrease reference count and avoid deleting
   // the window
 }
 
 WorkbenchWindow::~WorkbenchWindow()
 {
   // BERRY_INFO << "WorkbenchWindow::~WorkbenchWindow()";
 }
 
 Object* WorkbenchWindow::GetService(const QString& key)
 {
   return serviceLocator->GetService(key);
 }
 
 bool WorkbenchWindow::HasService(const QString& key) const
 {
   return serviceLocator->HasService(key);
 }
 
 Shell::Pointer WorkbenchWindow::GetShell() const
 {
   return Window::GetShell();
 }
 
 bool WorkbenchWindow::ClosePage(IWorkbenchPage::Pointer in, bool save)
 {
   // Validate the input.
   if (!pageList.Contains(in))
   {
     return false;
   }
   WorkbenchPage::Pointer oldPage = in.Cast<WorkbenchPage> ();
 
   // Save old perspective.
   if (save && oldPage->IsSaveNeeded())
   {
     if (!oldPage->SaveAllEditors(true))
     {
       return false;
     }
   }
 
   // If old page is activate deactivate.
   bool oldIsActive = (oldPage == this->GetActivePage());
   if (oldIsActive)
   {
     this->SetActivePage(IWorkbenchPage::Pointer(nullptr));
   }
 
   // Close old page.
   pageList.Remove(oldPage);
   partService.PageClosed(oldPage);
   //this->FirePageClosed(oldPage);
   //oldPage->Dispose();
 
   // Activate new page.
   if (oldIsActive)
   {
     IWorkbenchPage::Pointer newPage = pageList.GetNextActive();
     if (newPage != 0)
     {
       this->SetActivePage(newPage);
     }
   }
   if (!closing && pageList.IsEmpty())
   {
     this->ShowEmptyWindowContents();
   }
   return true;
 }
 
 void WorkbenchWindow::AddPerspectiveListener(IPerspectiveListener* l)
 {
   perspectiveEvents.AddListener(l);
 }
 
 void WorkbenchWindow::RemovePerspectiveListener(IPerspectiveListener* l)
 {
   perspectiveEvents.RemoveListener(l);
 }
 
 IPerspectiveListener::Events& WorkbenchWindow::GetPerspectiveEvents()
 {
   return perspectiveEvents;
 }
 
 void WorkbenchWindow::FireWindowOpening()
 {
   // let the application do further configuration
   this->GetWindowAdvisor()->PreWindowOpen();
 }
 
 void WorkbenchWindow::FireWindowRestored()
 {
   //StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() {
   //  public void runWithException() throws Throwable {
   this->GetWindowAdvisor()->PostWindowRestore();
   //  }
   //});
 }
 
 void WorkbenchWindow::FireWindowCreated()
 {
   this->GetWindowAdvisor()->PostWindowCreate();
 }
 
 void WorkbenchWindow::FireWindowOpened()
 {
   this->GetWorkbenchImpl()->FireWindowOpened(IWorkbenchWindow::Pointer(this));
   this->GetWindowAdvisor()->PostWindowOpen();
 }
 
 bool WorkbenchWindow::FireWindowShellClosing()
 {
   return this->GetWindowAdvisor()->PreWindowShellClose();
 }
 
 void WorkbenchWindow::FireWindowClosed()
 {
   // let the application do further deconfiguration
   this->GetWindowAdvisor()->PostWindowClose();
   this->GetWorkbenchImpl()->FireWindowClosed(IWorkbenchWindow::Pointer(this));
 }
 
 ///**
 // * Fires page activated
 // */
 //void WorkbenchWindow::FirePageActivated(IWorkbenchPage::Pointer page) {
 ////  String label = null; // debugging only
 ////  if (UIStats.isDebugging(UIStats.NOTIFY_PAGE_LISTENERS)) {
 ////    label = "activated " + page.getLabel(); //$NON-NLS-1$
 ////  }
 ////  try {
 ////    UIStats.start(UIStats.NOTIFY_PAGE_LISTENERS, label);
 ////    UIListenerLogging.logPageEvent(this, page,
 ////        UIListenerLogging.WPE_PAGE_ACTIVATED);
 //    pageEvents.FirePageActivated(page);
 //    partService.pageActivated(page);
 ////  } finally {
 ////    UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label);
 ////  }
 //}
 //
 ///**
 // * Fires page closed
 // */
 //void WorkbenchWindow::FirePageClosed(IWorkbenchPage::Pointer page) {
 //  String label = null; // debugging only
 //  if (UIStats.isDebugging(UIStats.NOTIFY_PAGE_LISTENERS)) {
 //    label = "closed " + page.getLabel(); //$NON-NLS-1$
 //  }
 //  try {
 //    UIStats.start(UIStats.NOTIFY_PAGE_LISTENERS, label);
 //    UIListenerLogging.logPageEvent(this, page,
 //        UIListenerLogging.WPE_PAGE_CLOSED);
 //    pageListeners.firePageClosed(page);
 //    partService.pageClosed(page);
 //  } finally {
 //    UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label);
 //  }
 //
 //}
 //
 ///**
 // * Fires page opened
 // */
 //void WorkbenchWindow::FirePageOpened(IWorkbenchPage::Pointer page) {
 //  String label = null; // debugging only
 //  if (UIStats.isDebugging(UIStats.NOTIFY_PAGE_LISTENERS)) {
 //    label = "opened " + page.getLabel(); //$NON-NLS-1$
 //  }
 //  try {
 //    UIStats.start(UIStats.NOTIFY_PAGE_LISTENERS, label);
 //    UIListenerLogging.logPageEvent(this, page,
 //        UIListenerLogging.WPE_PAGE_OPENED);
 //    pageListeners.firePageOpened(page);
 //    partService.pageOpened(page);
 //  } finally {
 //    UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label);
 //  }
 //}
 
 void WorkbenchWindow::FirePerspectiveActivated(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective)
 {
   //  UIListenerLogging.logPerspectiveEvent(this, page, perspective,
   //      UIListenerLogging.PLE_PERSP_ACTIVATED);
   perspectiveEvents.perspectiveActivated(page, perspective);
 }
 
 void WorkbenchWindow::FirePerspectivePreDeactivate(
     IWorkbenchPage::Pointer page, IPerspectiveDescriptor::Pointer perspective)
 {
   //  UIListenerLogging.logPerspectiveEvent(this, page, perspective,
   //      UIListenerLogging.PLE_PERSP_PRE_DEACTIVATE);
   perspectiveEvents.perspectivePreDeactivate(page, perspective);
 }
 
 void WorkbenchWindow::FirePerspectiveDeactivated(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective)
 {
   //  UIListenerLogging.logPerspectiveEvent(this, page, perspective,
   //      UIListenerLogging.PLE_PERSP_DEACTIVATED);
   perspectiveEvents.perspectiveDeactivated(page, perspective);
 }
 
 void WorkbenchWindow::FirePerspectiveChanged(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective, const QString& changeId)
 {
   // Some callers call this even when there is no active perspective.
   // Just ignore this case.
   if (perspective != 0)
   {
     //    UIListenerLogging.logPerspectiveChangedEvent(this, page,
     //        perspective, null, changeId);
     perspectiveEvents.perspectiveChanged(page, perspective, changeId);
   }
 }
 
 void WorkbenchWindow::FirePerspectiveChanged(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective,
     IWorkbenchPartReference::Pointer partRef, const QString& changeId)
 {
   // Some callers call this even when there is no active perspective.
   // Just ignore this case.
   if (perspective != 0)
   {
     //    UIListenerLogging.logPerspectiveChangedEvent(this, page,
     //        perspective, partRef, changeId);
     perspectiveEvents.perspectivePartChanged(page, perspective, partRef,
         changeId);
   }
 }
 
 void WorkbenchWindow::FirePerspectiveClosed(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective)
 {
   //  UIListenerLogging.logPerspectiveEvent(this, page, perspective,
   //      UIListenerLogging.PLE_PERSP_CLOSED);
   perspectiveEvents.perspectiveClosed(page, perspective);
 }
 
 void WorkbenchWindow::FirePerspectiveOpened(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer perspective)
 {
   //  UIListenerLogging.logPerspectiveEvent(this, page, perspective,
   //      UIListenerLogging.PLE_PERSP_OPENED);
   perspectiveEvents.perspectiveOpened(page, perspective);
 }
 
 void WorkbenchWindow::FirePerspectiveSavedAs(IWorkbenchPage::Pointer page,
     IPerspectiveDescriptor::Pointer oldPerspective,
     IPerspectiveDescriptor::Pointer newPerspective)
 {
   //  UIListenerLogging.logPerspectiveSavedAs(this, page, oldPerspective,
   //      newPerspective);
   perspectiveEvents.perspectiveSavedAs(page, oldPerspective, newPerspective);
 }
 
 void WorkbenchWindow::FillActionBars(ActionBarAdvisor::FillFlags flags)
 {
   //  Workbench workbench = getWorkbenchImpl();
   //  workbench.largeUpdateStart();
   //try {
   this->GetActionBarAdvisor()->FillActionBars(flags);
 
   IMenuService* menuService = serviceLocator->GetService<IMenuService>();
   menuService->PopulateContributionManager(dynamic_cast<ContributionManager*>(GetActionBars()->GetMenuManager()),
                                            MenuUtil::MAIN_MENU);
 //  ICoolBarManager coolbar = getActionBars().getCoolBarManager();
 //  if (coolbar != null)
 //  {
 //    menuService.populateContributionManager(
 //          (ContributionManager) coolbar,
 //          MenuUtil.MAIN_TOOLBAR);
 //  }
 
 //    } finally {
 //      workbench.largeUpdateEnd();
 //    }
 }
 
 QPoint WorkbenchWindow::GetInitialSize()
 {
   return this->GetWindowConfigurer()->GetInitialSize();
 }
 
 bool WorkbenchWindow::Close()
 {
   //BERRY_INFO << "WorkbenchWindow::Close()";
   bool ret = false;
   //BusyIndicator.showWhile(null, new Runnable() {
   //      public void run() {
   ret = this->BusyClose();
   //      }
   //    });
   return ret;
 }
 
 bool WorkbenchWindow::BusyClose()
 {
   // Whether the window was actually closed or not
   bool windowClosed = false;
 
   // Setup internal flags to indicate window is in
   // progress of closing and no update should be done.
   closing = true;
   updateDisabled = true;
 
   try
   {
     // Only do the check if it is OK to close if we are not closing
     // via the workbench as the workbench will check this itself.
     Workbench* workbench = this->GetWorkbenchImpl();
     std::size_t count = workbench->GetWorkbenchWindowCount();
 
     // also check for starting - if the first window dies on startup
     // then we'll need to open a default window.
     if (!workbench->IsStarting() && !workbench->IsClosing() && count <= 1
         && workbench->GetWorkbenchConfigurer()->GetExitOnLastWindowClose())
     {
       windowClosed = workbench->Close();
     }
     else
     {
       if (this->OkToClose())
       {
         windowClosed = this->HardClose();
       }
     }
   } catch (std::exception& exc)
   {
     if (!windowClosed)
     {
       // Reset the internal flags if window was not closed.
       closing = false;
       updateDisabled = false;
     }
 
     throw exc;
   }
 
   //    if (windowClosed && tracker != null) {
   //      tracker.close();
   //    }
 
   return windowClosed;
 }
 
 void WorkbenchWindow::MakeVisible()
 {
   Shell::Pointer shell = GetShell();
   if (shell)
   {
     // see bug 96700 and bug 4414 for a discussion on the use of open()
     // here
     shell->Open();
   }
 }
 
 bool WorkbenchWindow::OkToClose()
 {
   // Save all of the editors.
   if (!this->GetWorkbenchImpl()->IsClosing())
   {
     if (!this->SaveAllPages(true))
     {
       return false;
     }
   }
   return true;
 }
 
 bool WorkbenchWindow::SaveAllPages(bool bConfirm)
 {
   bool bRet = true;
   PageList::iterator itr = pageList.Begin();
   while (bRet && itr != pageList.End())
   {
     bRet = (*itr)->SaveAllEditors(bConfirm);
     ++itr;
   }
   return bRet;
 }
 
 bool WorkbenchWindow::HardClose()
 {
   std::exception exc;
   bool exceptionOccured = false;
 
   try
   {
     // Clear the action sets, fix for bug 27416.
     //getActionPresentation().clearActionSets();
 
     // Remove the handler submissions. Bug 64024.
     /*
      final IWorkbench workbench = getWorkbench();
      final IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
      handlerService.deactivateHandlers(handlerActivations);
      final Iterator activationItr = handlerActivations.iterator();
      while (activationItr.hasNext()) {
      final IHandlerActivation activation = (IHandlerActivation) activationItr
      .next();
      activation.getHandler().dispose();
      }
      handlerActivations.clear();
      globalActionHandlersByCommandId.clear();
      */
 
     // Remove the enabled submissions. Bug 64024.
     //IContextService* contextService = this->GetWorkbench()->GetService<IContextService>();
     //contextService->UnregisterShell(this->GetShell());
 
     this->CloseAllPages();
 
     this->FireWindowClosed();
 
     // time to wipe out our populate
     /*
      IMenuService menuService = (IMenuService) workbench
      .getService(IMenuService.class);
      menuService
      .releaseContributions(((ContributionManager) getActionBars()
      .getMenuManager()));
      ICoolBarManager coolbar = getActionBars().getCoolBarManager();
      if (coolbar != null) {
      menuService
      .releaseContributions(((ContributionManager) coolbar));
      }
      */
 
     //getActionBarAdvisor().dispose();
     //getWindowAdvisor().dispose();
     //detachedWindowShells.dispose();
     delete windowAdvisor;
     windowAdvisor = nullptr;
 
     // Null out the progress region. Bug 64024.
     //progressRegion = null;
 
     // Remove drop targets
     /*
      DragUtil.removeDragTarget(null, trimDropTarget);
      DragUtil.removeDragTarget(getShell(), trimDropTarget);
      trimDropTarget = null;
 
      if (trimMgr2 != null) {
      trimMgr2.dispose();
      trimMgr2 = null;
      }
 
      if (trimContributionMgr != null) {
      trimContributionMgr.dispose();
      trimContributionMgr = null;
      }
      */
   } catch (std::exception& e)
   {
     exc = e;
     exceptionOccured = true;
   }
 
   bool result = Window::Close();
   // Bring down all of the services ... after the window goes away
   serviceLocator->Dispose();
   //menuRestrictions.clear();
 
   if (exceptionOccured)
     throw exc;
 
   return result;
 }
 
 void WorkbenchWindow::CloseAllPages()
 {
   // Deactivate active page.
   this->SetActivePage(IWorkbenchPage::Pointer(nullptr));
 
   // Clone and deref all so that calls to getPages() returns
   // empty list (if called by pageClosed event handlers)
   PageList oldList = pageList;
   pageList.Clear();
 
   // Close all.
   for (PageList::iterator itr = oldList.Begin(); itr != oldList.End(); ++itr)
   {
     partService.PageClosed(*itr);
     //(*itr)->FirePageClosed(page);
     //page.dispose();
   }
   if (!closing)
   {
     this->ShowEmptyWindowContents();
   }
 }
 
 WWinActionBars* WorkbenchWindow::GetActionBars()
 {
   if (actionBars.IsNull())
   {
     actionBars = new WWinActionBars(this);
   }
   return actionBars.GetPointer();
 }
 
 void WorkbenchWindow::SetPerspectiveExcludeList(const QStringList& v)
 {
   perspectiveExcludeList = v;
 }
 
 QStringList WorkbenchWindow::GetPerspectiveExcludeList() const
 {
   return perspectiveExcludeList;
 }
 
 void WorkbenchWindow::SetViewExcludeList(const QStringList& v)
 {
   viewExcludeList = v;
 }
 
 QStringList WorkbenchWindow::GetViewExcludeList() const
 {
   return viewExcludeList;
 }
 
 QList<IWorkbenchPage::Pointer> WorkbenchWindow::GetPages() const
 {
   return pageList.GetPages();
 }
 
 IWorkbenchPage::Pointer WorkbenchWindow::GetActivePage() const
 {
   return pageList.GetActive();
 }
 
 IWorkbench* WorkbenchWindow::GetWorkbench() const
 {
   return PlatformUI::GetWorkbench();
 }
 
 IPartService* WorkbenchWindow::GetPartService()
 {
   return &partService;
 }
 
 ISelectionService* WorkbenchWindow::GetSelectionService() const
 {
   return partService.GetSelectionService();
 }
 
 bool WorkbenchWindow::GetToolBarVisible() const
 {
   return GetWindowConfigurer()->GetShowToolBar() && toolBarVisible;
 }
 
 bool WorkbenchWindow::GetPerspectiveBarVisible() const
 {
   return GetWindowConfigurer()->GetShowPerspectiveBar() && perspectiveBarVisible;
 }
 
 bool WorkbenchWindow::GetStatusLineVisible() const
 {
   return GetWindowConfigurer()->GetShowStatusLine() && statusLineVisible;
 }
 
 void WorkbenchWindow::AddPropertyChangeListener(IPropertyChangeListener *listener)
 {
   genericPropertyListeners.AddListener(listener);
 }
 
 void WorkbenchWindow::RemovePropertyChangeListener(IPropertyChangeListener *listener)
 {
   genericPropertyListeners.RemoveListener(listener);
 }
 
 bool WorkbenchWindow::IsClosing()
 {
   return closing || this->GetWorkbenchImpl()->IsClosing();
 }
 
 int WorkbenchWindow::Open()
 {
   if (pageList.IsEmpty())
   {
     this->ShowEmptyWindowContents();
   }
 
   this->FireWindowCreated();
   this->GetWindowAdvisor()->OpenIntro();
 
   int result = Window::Open();
 
   // It's time for a layout ... to insure that if TrimLayout
   // is in play, it updates all of the trim it's responsible
   // for. We have to do this before updating in order to get
   // the PerspectiveBar management correct...see defect 137334
   //getShell().layout();
 
   this->FireWindowOpened();
   //  if (perspectiveSwitcher != null) {
   //    perspectiveSwitcher.updatePerspectiveBar();
   //    perspectiveSwitcher.updateBarParent();
   //  }
 
   return result;
 }
 
 QWidget* WorkbenchWindow::GetPageComposite()
 {
   return pageComposite;
 }
 
 QWidget *WorkbenchWindow::CreatePageComposite(QWidget *parent)
 {
   auto   pageArea = new QtControlWidget(parent, nullptr);
   pageArea->setObjectName("Page Composite");
   new QHBoxLayout(pageArea);
   if (qobject_cast<QMainWindow*> (parent) != nullptr)
     qobject_cast<QMainWindow*> (parent)->setCentralWidget(pageArea);
   else
     parent->layout()->addWidget(pageArea);
 
   // we have to enable visibility to get a proper layout (see bug #1654)
   pageArea->setVisible(true);
   parent->setVisible(true);
 
   pageComposite = pageArea;
   return pageArea;
 }
 
 QWidget* WorkbenchWindow::CreateContents(Shell::Pointer parent)
 {
   // we know from Window.create that the parent is a Shell.
   this->GetWindowAdvisor()->CreateWindowContents(parent);
   // the page composite must be set by createWindowContents
   poco_assert(pageComposite != nullptr)
 ; // "createWindowContents must call configurer.createPageComposite"); //$NON-NLS-1$
   return pageComposite;
 }
 
 void WorkbenchWindow::CreateDefaultContents(Shell::Pointer shell)
 {
   QMainWindow* mainWindow = qobject_cast<QMainWindow*>(shell->GetControl());
 
   if (GetWindowConfigurer()->GetShowMenuBar() && mainWindow)
   {
     QMenuBar* menuBar = GetMenuBarManager()->CreateMenuBar(mainWindow);
     mainWindow->setMenuBar(menuBar);
   }
 
   if (GetWindowConfigurer()->GetShowPerspectiveBar() && mainWindow)
   {
     mainWindow->addToolBar(new QtPerspectiveSwitcher(IWorkbenchWindow::Pointer(this)));
   }
 
   // Create the client composite area (where page content goes).
   CreatePageComposite(shell->GetControl());
 }
 
 void WorkbenchWindow::CreateTrimWidgets(SmartPointer<Shell> /*shell*/)
 {
   // do nothing -- trim widgets are created in CreateDefaultContents
 }
 
 bool WorkbenchWindow::UnableToRestorePage(IMemento::Pointer pageMem)
 {
   QString pageName;
   pageMem->GetString(WorkbenchConstants::TAG_LABEL, pageName);
 
   //  return new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, NLS.bind(
   //      WorkbenchMessages.WorkbenchWindow_unableToRestorePerspective,
   //      pageName), null);
   WorkbenchPlugin::Log("Unable to restore perspective: " + pageName);
   return false;
 }
 
 bool WorkbenchWindow::RestoreState(IMemento::Pointer memento,
     IPerspectiveDescriptor::Pointer activeDescriptor)
 {
   //TODO WorkbenchWindow restore state
   poco_assert(GetShell());
 
   //  final MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK,
   //      WorkbenchMessages.WorkbenchWindow_problemsRestoringWindow, null);
   bool result = true;
 
   // Restore the window advisor state.
   IMemento::Pointer windowAdvisorState = memento
   ->GetChild(WorkbenchConstants::TAG_WORKBENCH_WINDOW_ADVISOR);
   if (windowAdvisorState)
   {
     //result.add(getWindowAdvisor().restoreState(windowAdvisorState));
     result &= GetWindowAdvisor()->RestoreState(windowAdvisorState);
   }
 
   // Restore actionbar advisor state.
   IMemento::Pointer actionBarAdvisorState = memento
   ->GetChild(WorkbenchConstants::TAG_ACTION_BAR_ADVISOR);
   if (actionBarAdvisorState)
   {
     //    result.add(getActionBarAdvisor()
     //        .restoreState(actionBarAdvisorState));
     result &= GetActionBarAdvisor()
     ->RestoreState(actionBarAdvisorState);
   }
 
   // Read window's bounds and state.
   QRect displayBounds;
   //  StartupThreading.runWithoutExceptions(new StartupRunnable() {
   //
   //    public void runWithException() {
   displayBounds = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetScreenSize();
   //displayBounds = GetShell()->GetDisplay()->GetBounds();
 
   //    }});
 
   //  final IMemento fastViewMem = memento
   //      .getChild(IWorkbenchConstants.TAG_FAST_VIEW_DATA);
   //  if (fastViewMem != null) {
   //    if (fastViewBar != null) {
   //      StartupThreading.runWithoutExceptions(new StartupRunnable() {
   //
   //        public void runWithException() {
   //          fastViewBar.restoreState(fastViewMem);
   //        }});
   //
   //    }
   //  }
 
   int x, y, w, h;
   memento->GetInteger(WorkbenchConstants::TAG_X, x);
   memento->GetInteger(WorkbenchConstants::TAG_Y, y);
   memento->GetInteger(WorkbenchConstants::TAG_WIDTH, w);
   memento->GetInteger(WorkbenchConstants::TAG_HEIGHT, h);
   QRect shellBounds(x, y, w, h);
 
   if (!shellBounds.isEmpty())
   {
     //    StartupThreading.runWithoutExceptions(new StartupRunnable() {
     //
     //      public void runWithException() {
     if (!shellBounds.intersects(displayBounds))
     {
       // Center on default screen
       QRect clientArea(Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetAvailableScreenSize());
       shellBounds.setX(clientArea.width() * 0.05);
       shellBounds.setY(clientArea.height() * 0.05);
       shellBounds.setWidth(clientArea.width() * 0.9);
       shellBounds.setHeight(clientArea.height() * 0.9);
     }
     GetShell()->SetBounds(shellBounds);
     //      }});
   }
   QString maximized; memento->GetString(WorkbenchConstants::TAG_MAXIMIZED, maximized);
   if (maximized == "true")
   {
     //    StartupThreading.runWithoutExceptions(new StartupRunnable() {
     //
     //      public void runWithException() {
     GetShell()->SetMaximized(true);
     //      }});
 
   }
   QString minimized; memento->GetString(WorkbenchConstants::TAG_MINIMIZED, minimized);
   if (minimized == "true")
   {
     // getShell().setMinimized(true);
   }
 
   //  // restore the width of the perspective bar
   //  if (perspectiveSwitcher != null) {
   //    perspectiveSwitcher.restoreState(memento);
   //  }
 
   //  // Restore the cool bar order by creating all the tool bar contribution
   //  // items
   //  // This needs to be done before pages are created to ensure proper
   //  // canonical creation
   //  // of cool items
   //  final ICoolBarManager2 coolBarMgr = (ICoolBarManager2) getCoolBarManager2();
   //      if (coolBarMgr != null) {
   //    IMemento coolBarMem = memento
   //        .getChild(IWorkbenchConstants.TAG_COOLBAR_LAYOUT);
   //    if (coolBarMem != null) {
   //      // Check if the layout is locked
   //      final Integer lockedInt = coolBarMem
   //          .getInteger(IWorkbenchConstants.TAG_LOCKED);
   //      StartupThreading.runWithoutExceptions(new StartupRunnable(){
   //
   //        public void runWithException() {
   //          if ((lockedInt != null) && (lockedInt.intValue() == 1)) {
   //            coolBarMgr.setLockLayout(true);
   //          } else {
   //            coolBarMgr.setLockLayout(false);
   //          }
   //        }});
   //
   //      // The new layout of the cool bar manager
   //      ArrayList coolBarLayout = new ArrayList();
   //      // Traverse through all the cool item in the memento
   //      IMemento contributionMems[] = coolBarMem
   //          .getChildren(IWorkbenchConstants.TAG_COOLITEM);
   //      for (int i = 0; i < contributionMems.length; i++) {
   //        IMemento contributionMem = contributionMems[i];
   //        String type = contributionMem
   //            .getString(IWorkbenchConstants.TAG_ITEM_TYPE);
   //        if (type == null) {
   //          // Do not recognize that type
   //          continue;
   //        }
   //        String id = contributionMem
   //            .getString(IWorkbenchConstants.TAG_ID);
   //
   //        // Prevent duplicate items from being read back in.
   //        IContributionItem existingItem = coolBarMgr.find(id);
   //        if ((id != null) && (existingItem != null)) {
   //          if (Policy.DEBUG_TOOLBAR_DISPOSAL) {
   //            System.out
   //                .println("Not loading duplicate cool bar item: " + id); //$NON-NLS-1$
   //          }
   //          coolBarLayout.add(existingItem);
   //          continue;
   //        }
   //        IContributionItem newItem = null;
   //        if (type.equals(IWorkbenchConstants.TAG_TYPE_SEPARATOR)) {
   //          if (id != null) {
   //            newItem = new Separator(id);
   //          } else {
   //            newItem = new Separator();
   //          }
   //        } else if (id != null) {
   //          if (type
   //              .equals(IWorkbenchConstants.TAG_TYPE_GROUPMARKER)) {
   //            newItem = new GroupMarker(id);
   //
   //          } else if (type
   //              .equals(IWorkbenchConstants.TAG_TYPE_TOOLBARCONTRIBUTION)
   //              || type
   //                  .equals(IWorkbenchConstants.TAG_TYPE_PLACEHOLDER)) {
   //
   //            // Get Width and height
   //            Integer width = contributionMem
   //                .getInteger(IWorkbenchConstants.TAG_ITEM_X);
   //            Integer height = contributionMem
   //                .getInteger(IWorkbenchConstants.TAG_ITEM_Y);
   //            // Look for the object in the current cool bar
   //            // manager
   //            IContributionItem oldItem = coolBarMgr.find(id);
   //            // If a tool bar contribution item already exists
   //            // for this id then use the old object
   //            if (oldItem != null) {
   //              newItem = oldItem;
   //            } else {
   //              IActionBarPresentationFactory actionBarPresentation = getActionBarPresentationFactory();
   //              newItem = actionBarPresentation.createToolBarContributionItem(
   //                  actionBarPresentation.createToolBarManager(), id);
   //              if (type
   //                  .equals(IWorkbenchConstants.TAG_TYPE_PLACEHOLDER)) {
   //                IToolBarContributionItem newToolBarItem = (IToolBarContributionItem) newItem;
   //                if (height != null) {
   //                  newToolBarItem.setCurrentHeight(height
   //                      .intValue());
   //                }
   //                if (width != null) {
   //                  newToolBarItem.setCurrentWidth(width
   //                      .intValue());
   //                }
   //                newItem = new PlaceholderContributionItem(
   //                    newToolBarItem);
   //              }
   //              // make it invisible by default
   //              newItem.setVisible(false);
   //              // Need to add the item to the cool bar manager
   //              // so that its canonical order can be preserved
   //              IContributionItem refItem = findAlphabeticalOrder(
   //                  IWorkbenchActionConstants.MB_ADDITIONS,
   //                  id, coolBarMgr);
   //              if (refItem != null) {
   //                coolBarMgr.insertAfter(refItem.getId(),
   //                    newItem);
   //              } else {
   //                coolBarMgr.add(newItem);
   //              }
   //            }
   //            // Set the current height and width
   //            if ((width != null)
   //                && (newItem instanceof IToolBarContributionItem)) {
   //              ((IToolBarContributionItem) newItem)
   //                  .setCurrentWidth(width.intValue());
   //            }
   //            if ((height != null)
   //                && (newItem instanceof IToolBarContributionItem)) {
   //              ((IToolBarContributionItem) newItem)
   //                  .setCurrentHeight(height.intValue());
   //            }
   //          }
   //        }
   //        // Add new item into cool bar manager
   //        if (newItem != null) {
   //          coolBarLayout.add(newItem);
   //          newItem.setParent(coolBarMgr);
   //          coolBarMgr.markDirty();
   //        }
   //      }
   //
   //      // We need to check if we have everything we need in the layout.
   //      boolean newlyAddedItems = false;
   //      IContributionItem[] existingItems = coolBarMgr.getItems();
   //      for (int i = 0; i < existingItems.length && !newlyAddedItems; i++) {
   //        IContributionItem existingItem = existingItems[i];
   //
   //        /*
   //         * This line shouldn't be necessary, but is here for
   //         * robustness.
   //         */
   //        if (existingItem == null) {
   //          continue;
   //        }
   //
   //        boolean found = false;
   //        Iterator layoutItemItr = coolBarLayout.iterator();
   //        while (layoutItemItr.hasNext()) {
   //          IContributionItem layoutItem = (IContributionItem) layoutItemItr
   //              .next();
   //          if ((layoutItem != null)
   //              && (layoutItem.equals(existingItem))) {
   //            found = true;
   //            break;
   //          }
   //        }
   //
   //        if (!found) {
   //          if (existingItem != null) {
   //            newlyAddedItems = true;
   //          }
   //        }
   //      }
   //
   //      // Set the cool bar layout to the given layout.
   //      if (!newlyAddedItems) {
   //        final IContributionItem[] itemsToSet = new IContributionItem[coolBarLayout
   //            .size()];
   //        coolBarLayout.toArray(itemsToSet);
   //        StartupThreading
   //            .runWithoutExceptions(new StartupRunnable() {
   //
   //              public void runWithException() {
   //                coolBarMgr.setItems(itemsToSet);
   //              }
   //            });
   //      }
   //
   //    } else {
-  //      // For older workbenchs
+  //      // For older workbenches
   //      coolBarMem = memento
   //          .getChild(IWorkbenchConstants.TAG_TOOLBAR_LAYOUT);
   //      if (coolBarMem != null) {
   //        // Restore an older layout
   //        restoreOldCoolBar(coolBarMem);
   //      }
   //    }
   //  }
 
   // Recreate each page in the window.
   IWorkbenchPage::Pointer newActivePage;
   QList<IMemento::Pointer> pageArray = memento
   ->GetChildren(WorkbenchConstants::TAG_PAGE);
   for (int i = 0; i < pageArray.size(); i++)
   {
     IMemento::Pointer pageMem = pageArray[i];
     QString strFocus; pageMem->GetString(WorkbenchConstants::TAG_FOCUS, strFocus);
     if (strFocus.isEmpty())
     {
       continue;
     }
 
     // Get the input factory.
     IAdaptable* input = nullptr;
     IMemento::Pointer inputMem = pageMem->GetChild(WorkbenchConstants::TAG_INPUT);
     if (inputMem)
     {
       QString factoryID; inputMem->GetString(WorkbenchConstants::TAG_FACTORY_ID, factoryID);
       if (factoryID.isEmpty())
       {
         WorkbenchPlugin
         ::Log("Unable to restore page - no input factory ID.");
         //result.add(unableToRestorePage(pageMem));
         result &= UnableToRestorePage(pageMem);
         continue;
       }
       //      try {
       //        UIStats.start(UIStats.RESTORE_WORKBENCH,
       //            "WorkbenchPageFactory"); //$NON-NLS-1$
       //        StartupThreading
       //            .runWithoutExceptions(new StartupRunnable() {
       //
       //              public void runWithException() throws Throwable {
       //                IElementFactory factory = PlatformUI
       //                    .getWorkbench().getElementFactory(
       //                        factoryID);
       //                if (factory == null) {
       //                  WorkbenchPlugin
       //                      .log("Unable to restore page - cannot instantiate input factory: " + factoryID); //$NON-NLS-1$
       //                  result
       //                      .add(unableToRestorePage(pageMem));
       //                  return;
       //                }
       //
       //                // Get the input element.
       //                input[0] = factory.createElement(inputMem);
       //              }
       //            });
       //
       //        if (input[0] == null) {
       //          WorkbenchPlugin
       //              .log("Unable to restore page - cannot instantiate input element: " + factoryID); //$NON-NLS-1$
       //          result.add(unableToRestorePage(pageMem));
       //          continue;
       //        }
       //      } finally {
       //        UIStats.end(UIStats.RESTORE_WORKBENCH, factoryID,
       //            "WorkbenchPageFactory"); //$NON-NLS-1$
       //      }
     }
     // Open the perspective.
     IAdaptable* finalInput = input;
     WorkbenchPage::Pointer newPage;
     try
     {
       //      StartupThreading.runWithWorkbenchExceptions(new StartupRunnable(){
       //
       //        public void runWithException() throws WorkbenchException {
       newPage = new WorkbenchPage(this, finalInput);
       //        }});
 
       //result.add(newPage[0].restoreState(pageMem, activeDescriptor));
       result &= newPage->RestoreState(pageMem, activeDescriptor);
       pageList.Add(newPage);
       //      StartupThreading.runWithoutExceptions(new StartupRunnable() {
       //
       //        public void runWithException() throws Throwable {
       partService.PageOpened(newPage);
       //          firePageOpened(newPage[0]);
       //        }});
 
     }
     catch (const WorkbenchException& e)
     {
       WorkbenchPlugin::Log(
           "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$
       //result.add(e.getStatus());
       continue;
     }
 
     if (!strFocus.isEmpty())
     {
       newActivePage = newPage;
     }
   }
 
   // If there are no pages create a default.
   if (pageList.IsEmpty())
   {
     try
     {
       const QString defPerspID = this->GetWorkbenchImpl()->GetPerspectiveRegistry()
       ->GetDefaultPerspective();
       if (!defPerspID.isEmpty())
       {
         WorkbenchPage::Pointer newPage;
         //StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() {
 
         //  public void runWithException() throws Throwable {
         newPage = new WorkbenchPage(this, defPerspID,
             this->GetDefaultPageInput());
         //  }});
 
         pageList.Add(newPage);
         //StartupThreading.runWithoutExceptions(new StartupRunnable() {
 
         //  public void runWithException() throws Throwable {
         //    firePageOpened(newPage[0]);
         partService.PageOpened(newPage);
         //  }});
       }
     }
     catch (WorkbenchException& e)
     {
       WorkbenchPlugin
       ::Log(
           "Unable to create default perspective - constructor failed.", e);
       result = false;
       //TODO set product name
       //      String productName = WorkbenchPlugin.getDefault()
       //          .getProductName();
       //      if (productName == null) {
       //        productName = ""; //$NON-NLS-1$
       //      }
       //      getShell().setText(productName);
     }
   }
 
   // Set active page.
   if (newActivePage.IsNull())
   {
     newActivePage = pageList.GetNextActive().Cast<IWorkbenchPage>();
   }
 
   //StartupThreading.runWithoutExceptions(new StartupRunnable() {
 
   //  public void runWithException() throws Throwable {
   this->SetActivePage(newActivePage);
   //  }});
 
 
   IMemento::Pointer introMem = memento->GetChild(WorkbenchConstants::TAG_INTRO);
   if (introMem) {
 //    StartupThreading.runWithoutExceptions(new StartupRunnable() {
 //
 //      public void runWithException() throws Throwable {
     bool isStandby = false;
     introMem->GetBoolean(WorkbenchConstants::TAG_STANDBY, isStandby);
         GetWorkbench()->GetIntroManager()->ShowIntro(
                 IWorkbenchWindow::Pointer(this), isStandby);
 //      }
 //    });
   }
   //
   //  // Only restore the trim state if we're using the default layout
   //  if (defaultLayout != null) {
   //    // Restore the trim state. We pass in the 'root'
   //    // memento since we have to check for pre-3.2
   //    // state.
   //    result.add(restoreTrimState(memento));
   //  }
 
   return result;
 }
 
 IAdaptable* WorkbenchWindow::GetDefaultPageInput()
 {
   return this->GetWorkbenchImpl()->GetDefaultPageInput();
 }
 
 IWorkbenchPage::Pointer WorkbenchWindow::OpenPage(
     const QString& perspId, IAdaptable* input)
 {
   // Run op in busy cursor.
   IWorkbenchPage::Pointer result;
   //BusyIndicator.showWhile(null, new Runnable() {
   //  public void run() {
   result = this->BusyOpenPage(perspId, input);
 
   // }
 
   return result;
 }
 
 SmartPointer<IWorkbenchPage> WorkbenchWindow::OpenPage(IAdaptable* input)
 {
   QString perspId = this->GetWorkbenchImpl()->GetDefaultPerspectiveId();
   return this->OpenPage(perspId, input);
 }
 
 IWorkbenchPage::Pointer WorkbenchWindow::BusyOpenPage(
     const QString& perspID, IAdaptable* input)
 {
   IWorkbenchPage::Pointer newPage;
 
   if (pageList.IsEmpty())
   {
     newPage = new WorkbenchPage(this, perspID, input);
     pageList.Add(newPage);
     //this->FirePageOpened(newPage);
     partService.PageOpened(newPage);
     this->SetActivePage(newPage);
   }
   else
   {
     IWorkbenchWindow::Pointer window = this->GetWorkbench()->OpenWorkbenchWindow(perspID, input);
     newPage = window->GetActivePage();
   }
 
   return newPage;
 }
 
 int WorkbenchWindow::GetNumber()
 {
   return number;
 }
 
 void WorkbenchWindow::UpdateActionBars()
 {
   if (updateDisabled || UpdatesDeferred())
   {
     return;
   }
   // updateAll required in order to enable accelerators on pull-down menus
   GetMenuBarManager()->Update(false);
   //GetToolBarManager()->Update(false);
   //GetStatusLineManager()->Update(false);
 }
 
 void WorkbenchWindow::LargeUpdateStart()
 {
   largeUpdates++;
 }
 
 void WorkbenchWindow::LargeUpdateEnd()
 {
   if (--largeUpdates == 0)
   {
     this->UpdateActionBars();
   }
 }
 
 void WorkbenchWindow::SetActivePage(IWorkbenchPage::Pointer in)
 {
   if (this->GetActivePage() == in)
   {
     return;
   }
 
   // 1FVGTNR: ITPUI:WINNT - busy cursor for switching perspectives
   //BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
   //  public void run() {
   // Deactivate old persp.
   WorkbenchPage::Pointer currentPage = pageList.GetActive();
   if (currentPage.IsNotNull())
   {
     currentPage->OnDeactivate();
   }
 
   // Activate new persp.
   if (in.IsNull() || pageList.Contains(in))
   {
     pageList.SetActive(in);
   }
   WorkbenchPage::Pointer newPage = pageList.GetActive();
   //Composite parent = getPageComposite();
   //StackLayout layout = (StackLayout) parent.getLayout();
   if (newPage.IsNotNull())
   {
     //layout.topControl = newPage.getClientComposite();
     //parent.layout();
     this->HideEmptyWindowContents();
     newPage->OnActivate();
     //this->FirePageActivated(newPage);
     partService.PageActivated(newPage);
     //TODO perspective
     if (newPage->GetPerspective() != 0)
     {
       this->FirePerspectiveActivated(newPage, newPage->GetPerspective());
     }
   }
   else
   {
     //layout.topControl = null;
     //parent.layout();
   }
 
   //updateFastViewBar();
 
   if (this->IsClosing())
   {
     return;
   }
 
   updateDisabled = false;
 
   // Update action bars ( implicitly calls updateActionBars() )
   //updateActionSets();
   //submitGlobalActions();
 
   //if (perspectiveSwitcher != null) {
   //  perspectiveSwitcher.update(false);
   //}
 
   GetMenuManager()->Update(QActionProperties::TEXT);
   //  }
   //});
 }
 
 MenuManager *WorkbenchWindow::GetMenuManager() const
 {
   return this->GetMenuBarManager();
 }
 
 bool WorkbenchWindow::SaveState(IMemento::Pointer memento)
 {
   //  MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK,
   //        WorkbenchMessages.WorkbenchWindow_problemsSavingWindow, null);
   bool result = true;
 
   // Save the window's state and bounds.
   if (GetShell()->GetMaximized() || asMaximizedState)
   {
     memento->PutString(WorkbenchConstants::TAG_MAXIMIZED, "true");
   }
   if (GetShell()->GetMinimized())
   {
     memento->PutString(WorkbenchConstants::TAG_MINIMIZED, "true");
   }
   if (normalBounds.isEmpty())
   {
     normalBounds = GetShell()->GetBounds();
   }
 
   //  IMemento fastViewBarMem = memento
   //      .createChild(IWorkbenchConstants.TAG_FAST_VIEW_DATA);
   //  if (fastViewBar != null) {
   //    fastViewBar.saveState(fastViewBarMem);
   //  }
 
   memento->PutInteger(WorkbenchConstants::TAG_X, normalBounds.x());
   memento->PutInteger(WorkbenchConstants::TAG_Y, normalBounds.y());
   memento->PutInteger(WorkbenchConstants::TAG_WIDTH, normalBounds.width());
   memento->PutInteger(WorkbenchConstants::TAG_HEIGHT, normalBounds.height());
 
   IWorkbenchPage::Pointer activePage = GetActivePage();
   if (activePage
       && activePage->FindView(IntroConstants::INTRO_VIEW_ID))
   {
     IMemento::Pointer introMem = memento
         ->CreateChild(WorkbenchConstants::TAG_INTRO);
     bool isStandby = GetWorkbench()->GetIntroManager()
         ->IsIntroStandby(GetWorkbench()->GetIntroManager()->GetIntro());
     introMem->PutBoolean(WorkbenchConstants::TAG_STANDBY, isStandby);
   }
 
   //  // save the width of the perspective bar
   //  IMemento persBarMem = memento
   //      .createChild(IWorkbenchConstants.TAG_PERSPECTIVE_BAR);
   //  if (perspectiveSwitcher != null) {
   //    perspectiveSwitcher.saveState(persBarMem);
   //  }
 
   //  // / Save the order of the cool bar contribution items
   //        ICoolBarManager2 coolBarMgr = (ICoolBarManager2) getCoolBarManager2();
   //        if (coolBarMgr != null) {
   //          coolBarMgr.refresh();
   //      IMemento coolBarMem = memento
   //          .createChild(IWorkbenchConstants.TAG_COOLBAR_LAYOUT);
   //            if (coolBarMgr.getLockLayout() == true) {
   //        coolBarMem.putInteger(IWorkbenchConstants.TAG_LOCKED, 1);
   //      } else {
   //        coolBarMem.putInteger(IWorkbenchConstants.TAG_LOCKED, 0);
   //      }
   //            IContributionItem[] items = coolBarMgr.getItems();
   //      for (int i = 0; i < items.length; i++) {
   //        IMemento coolItemMem = coolBarMem
   //            .createChild(IWorkbenchConstants.TAG_COOLITEM);
   //        IContributionItem item = items[i];
   //        // The id of the contribution item
   //        if (item.getId() != null) {
   //          coolItemMem.putString(IWorkbenchConstants.TAG_ID, item
   //              .getId());
   //        }
   //        // Write out type and size if applicable
   //        if (item.isSeparator()) {
   //          coolItemMem.putString(IWorkbenchConstants.TAG_ITEM_TYPE,
   //              IWorkbenchConstants.TAG_TYPE_SEPARATOR);
   //        } else if (item.isGroupMarker() && !item.isSeparator()) {
   //          coolItemMem.putString(IWorkbenchConstants.TAG_ITEM_TYPE,
   //              IWorkbenchConstants.TAG_TYPE_GROUPMARKER);
   //        } else {
   //          if (item instanceof PlaceholderContributionItem) {
   //            coolItemMem.putString(
   //                IWorkbenchConstants.TAG_ITEM_TYPE,
   //                IWorkbenchConstants.TAG_TYPE_PLACEHOLDER);
   //          } else {
   //            // Store the identifier.
   //            coolItemMem
   //                .putString(
   //                    IWorkbenchConstants.TAG_ITEM_TYPE,
   //                    IWorkbenchConstants.TAG_TYPE_TOOLBARCONTRIBUTION);
   //          }
   //
   //          /*
   //           * Retrieve a reasonable approximation of the height and
   //           * width, if possible.
   //           */
   //          final int height;
   //          final int width;
   //          if (item instanceof IToolBarContributionItem) {
   //            IToolBarContributionItem toolBarItem = (IToolBarContributionItem) item;
   //            toolBarItem.saveWidgetState();
   //            height = toolBarItem.getCurrentHeight();
   //            width = toolBarItem.getCurrentWidth();
   //          } else if (item instanceof PlaceholderContributionItem) {
   //            PlaceholderContributionItem placeholder = (PlaceholderContributionItem) item;
   //            height = placeholder.getHeight();
   //            width = placeholder.getWidth();
   //          } else {
   //            height = -1;
   //            width = -1;
   //          }
   //
   //          // Store the height and width.
   //          coolItemMem.putInteger(IWorkbenchConstants.TAG_ITEM_X,
   //              width);
   //          coolItemMem.putInteger(IWorkbenchConstants.TAG_ITEM_Y,
   //              height);
   //        }
   //      }
   //    }
 
 
   // Save each page.
   for (PageList::iterator itr = pageList.Begin();
       itr != pageList.End(); ++itr)
   {
     WorkbenchPage::Pointer page = itr->Cast<WorkbenchPage>();
 
     // Save perspective.
     IMemento::Pointer pageMem = memento
     ->CreateChild(WorkbenchConstants::TAG_PAGE);
     pageMem->PutString(WorkbenchConstants::TAG_LABEL, page->GetLabel());
     //result.add(page.saveState(pageMem));
     result &= page->SaveState(pageMem);
 
     if (page == GetActivePage().Cast<WorkbenchPage>())
     {
       pageMem->PutString(WorkbenchConstants::TAG_FOCUS, "true");
     }
 
     //    // Get the input.
     //    IAdaptable* input = page->GetInput();
     //    if (input != 0) {
     //      IPersistableElement persistable = (IPersistableElement) Util.getAdapter(input,
     //          IPersistableElement.class);
     //      if (persistable == null) {
     //        WorkbenchPlugin
     //            .log("Unable to save page input: " //$NON-NLS-1$
     //                + input
     //                + ", because it does not adapt to IPersistableElement"); //$NON-NLS-1$
     //      } else {
     //        // Save input.
     //        IMemento inputMem = pageMem
     //            .createChild(IWorkbenchConstants.TAG_INPUT);
     //        inputMem.putString(IWorkbenchConstants.TAG_FACTORY_ID,
     //            persistable.getFactoryId());
     //        persistable.saveState(inputMem);
     //      }
     //    }
   }
 
   // Save window advisor state.
   IMemento::Pointer windowAdvisorState = memento
   ->CreateChild(WorkbenchConstants::TAG_WORKBENCH_WINDOW_ADVISOR);
   //result.add(getWindowAdvisor().saveState(windowAdvisorState));
   result &= GetWindowAdvisor()->SaveState(windowAdvisorState);
 
   // Save actionbar advisor state.
   IMemento::Pointer actionBarAdvisorState = memento
   ->CreateChild(WorkbenchConstants::TAG_ACTION_BAR_ADVISOR);
   //result.add(getActionBarAdvisor().saveState(actionBarAdvisorState));
   result &= GetActionBarAdvisor()->SaveState(actionBarAdvisorState);
 
   //  // Only save the trim state if we're using the default layout
   //  if (defaultLayout != null) {
   //    IMemento trimState = memento.createChild(IWorkbenchConstants.TAG_TRIM);
   //    result.add(saveTrimState(trimState));
   //  }
 
   return result;
 }
 
 WorkbenchWindowConfigurer::Pointer WorkbenchWindow::GetWindowConfigurer() const
 {
   if (windowConfigurer.IsNull())
   {
     // lazy initialize
     windowConfigurer = new WorkbenchWindowConfigurer(WorkbenchWindow::Pointer(const_cast<WorkbenchWindow*>(this)));
   }
   return windowConfigurer;
 }
 
 bool WorkbenchWindow::CanHandleShellCloseEvent()
 {
   if (!Window::CanHandleShellCloseEvent())
   {
     return false;
   }
 
   // let the advisor or other interested parties
   // veto the user's explicit request to close the window
   return FireWindowShellClosing();
 }
 
 void WorkbenchWindow::ConfigureShell(Shell::Pointer shell)
 {
   Window::ConfigureShell(shell);
 
   detachedWindowShells = new ShellPool(shell, Constants::TITLE
       | Constants::MAX | Constants::CLOSE | Constants::RESIZE | Constants::BORDER );
 
   QString title = this->GetWindowConfigurer()->BasicGetTitle();
   if (!title.isEmpty())
   {
     shell->SetText(title);
   }
 
   //IWorkbench* workbench = this->GetWorkbench();
   //  workbench.getHelpSystem().setHelp(shell,
   //      IWorkbenchHelpContextIds.WORKBENCH_WINDOW);
 
   //IContextService* contextService = workbench->GetService<IContextService>();
   //contextService->RegisterShell(shell, IContextService::TYPE_WINDOW);
 
   shell->GetControl()->installEventFilter(&resizeEventFilter);
 }
 
 ShellPool::Pointer WorkbenchWindow::GetDetachedWindowPool()
 {
   return detachedWindowShells;
 }
 
 WorkbenchAdvisor* WorkbenchWindow::GetAdvisor()
 {
   return this->GetWorkbenchImpl()->GetAdvisor();
 }
 
 WorkbenchWindowAdvisor* WorkbenchWindow::GetWindowAdvisor()
 {
   if (windowAdvisor == nullptr)
   {
     windowAdvisor = this->GetAdvisor()->CreateWorkbenchWindowAdvisor(this->GetWindowConfigurer());
     poco_check_ptr(windowAdvisor);
   }
   return windowAdvisor;
 }
 
 ActionBarAdvisor::Pointer WorkbenchWindow::GetActionBarAdvisor()
 {
   if (actionBarAdvisor.IsNull())
   {
     actionBarAdvisor = this->GetWindowAdvisor()->CreateActionBarAdvisor(this->GetWindowConfigurer()->GetActionBarConfigurer());
     poco_assert(actionBarAdvisor.IsNotNull());
   }
   return actionBarAdvisor;
 }
 
 Workbench* WorkbenchWindow::GetWorkbenchImpl()
 {
   return dynamic_cast<Workbench*>(this->GetWorkbench());
 }
 
 void WorkbenchWindow::ShowEmptyWindowContents()
 {
   if (!emptyWindowContentsCreated)
   {
     QWidget* parent = this->GetPageComposite();
     emptyWindowContents = this->GetWindowAdvisor()->CreateEmptyWindowContents(
         parent);
     emptyWindowContentsCreated = true;
     //    // force the empty window composite to be layed out
     //    ((StackLayout) parent.getLayout()).topControl = emptyWindowContents;
     //    parent.layout();
   }
 }
 
 void WorkbenchWindow::HideEmptyWindowContents()
 {
   if (emptyWindowContentsCreated)
   {
     if (emptyWindowContents != nullptr)
     {
       Tweaklets::Get(GuiWidgetsTweaklet::KEY)->Dispose(emptyWindowContents);
       emptyWindowContents = nullptr;
       //this->GetPageComposite().layout();
     }
     emptyWindowContentsCreated = false;
   }
 }
 
 WorkbenchWindow::ServiceLocatorOwner::ServiceLocatorOwner(WorkbenchWindow* wnd)
 : window(wnd)
 {
 
 }
 
 void WorkbenchWindow::ServiceLocatorOwner::Dispose()
 {
   Shell::Pointer shell = window->GetShell();
   if (shell != 0)
   {
     window->Close();
   }
 }
 
 bool WorkbenchWindow::PageList::Add(IWorkbenchPage::Pointer object)
 {
   pagesInCreationOrder.push_back(object);
   pagesInActivationOrder.push_front(object);
   // It will be moved to top only when activated.
   return true;
 }
 
 WorkbenchWindow::PageList::iterator WorkbenchWindow::PageList::Begin()
 {
   return pagesInCreationOrder.begin();
 }
 
 WorkbenchWindow::PageList::iterator WorkbenchWindow::PageList::End()
 {
   return pagesInCreationOrder.end();
 }
 
 bool WorkbenchWindow::PageList::Contains(IWorkbenchPage::Pointer object)
 {
   return std::find(pagesInCreationOrder.begin(), pagesInCreationOrder.end(),
       object) != pagesInCreationOrder.end();
 }
 
 bool WorkbenchWindow::PageList::Remove(IWorkbenchPage::Pointer object)
 {
   if (active == object)
   {
     active = nullptr;
   }
   pagesInActivationOrder.removeAll(object);
   const int origSize = pagesInCreationOrder.size();
   pagesInCreationOrder.removeAll(object);
   return origSize != pagesInCreationOrder.size();
 }
 
 void WorkbenchWindow::PageList::Clear()
 {
   pagesInCreationOrder.clear();
   pagesInActivationOrder.clear();
   active = nullptr;
 }
 
 bool WorkbenchWindow::PageList::IsEmpty()
 {
   return pagesInCreationOrder.empty();
 }
 
 QList<IWorkbenchPage::Pointer> WorkbenchWindow::PageList::GetPages() const
 {
   return pagesInCreationOrder;
 }
 
 void WorkbenchWindow::PageList::SetActive(IWorkbenchPage::Pointer page)
 {
   if (active == page)
   {
     return;
   }
 
   active = page;
 
   if (page.IsNotNull())
   {
     pagesInActivationOrder.removeAll(page);
     pagesInActivationOrder.push_back(page);
   }
 }
 
 WorkbenchPage::Pointer WorkbenchWindow::PageList::GetActive() const
 {
   return active.Cast<WorkbenchPage>();
 }
 
 WorkbenchPage::Pointer WorkbenchWindow::PageList::GetNextActive()
 {
   if (active.IsNull())
   {
     if (pagesInActivationOrder.empty())
     {
       return WorkbenchPage::Pointer(nullptr);
     }
 
     return pagesInActivationOrder.back().Cast<WorkbenchPage>();
   }
 
   if (pagesInActivationOrder.size() < 2)
   {
     return WorkbenchPage::Pointer(nullptr);
   }
 
   return pagesInActivationOrder.at(pagesInActivationOrder.size()-2).Cast<WorkbenchPage>();
 }
 
 bool WorkbenchWindow::UpdatesDeferred() const
 {
   return largeUpdates > 0;
 }
 
 void WorkbenchWindow::InitializeDefaultServices()
 {
   workbenchLocationService.reset(
         new WorkbenchLocationService(IServiceScopes::WINDOW_SCOPE, GetWorkbench(), this, nullptr, 1));
   workbenchLocationService->Register();
   serviceLocator->RegisterService(workbenchLocationService.data());
 
   //ActionCommandMappingService* mappingService = new ActionCommandMappingService();
   //serviceLocator->RegisterService(IActionCommandMappingService, mappingService);
 }
 
 QSet<SmartPointer<IEvaluationReference> > WorkbenchWindow::GetMenuRestrictions() const
 {
   return QSet<SmartPointer<IEvaluationReference> >();
 }
 
 void WorkbenchWindow::FirePropertyChanged(const  QString& property, const Object::Pointer& oldValue,
                                           const Object::Pointer& newValue)
 {
   PropertyChangeEvent::Pointer event(new PropertyChangeEvent(Object::Pointer(this), property, oldValue, newValue));
   genericPropertyListeners.propertyChange(event);
 }
 
 WorkbenchWindow::ShellEventFilter::ShellEventFilter(WorkbenchWindow* window)
   : window(window)
 {
 }
 
 bool WorkbenchWindow::ShellEventFilter::eventFilter(QObject* watched, QEvent* event)
 {
   QEvent::Type eventType = event->type();
   if (eventType == QEvent::Move || eventType == QEvent::Resize)
   {
     QWidget* widget = static_cast<QWidget*>(watched);
     QRect newBounds = widget->geometry();
     if (eventType == QEvent::Move)
     {
       newBounds.setTopLeft(static_cast<QMoveEvent*>(event)->pos());
     }
     else if(eventType == QEvent::Resize)
     {
       newBounds.setSize(static_cast<QResizeEvent*>(event)->size());
     }
     this->SaveBounds(newBounds);
   }
   else if (eventType == QEvent::WindowActivate)
   {
     this->ShellActivated();
   }
   else if (eventType == QEvent::WindowDeactivate)
   {
     this->ShellDeactivated();
   }
 
   return false;
 }
 
 void WorkbenchWindow::ShellEventFilter::SaveBounds(const QRect& newBounds)
 {
   Shell::Pointer shell = window->GetShell();
   if (shell == 0)
   {
     return;
   }
   //  if (shell->IsDisposed())
   //  {
   //    return;
   //  }
   if (shell->GetMinimized())
   {
     return;
   }
   if (shell->GetMaximized())
   {
     window->asMaximizedState = true;
     return;
   }
   window->asMaximizedState = false;
   window->normalBounds = newBounds;
 }
 
 void WorkbenchWindow::ShellEventFilter::ShellActivated()
 {
   WorkbenchWindow::Pointer wnd(window);
 
   wnd->shellActivated = true;
   wnd->serviceLocator->Activate();
   wnd->GetWorkbenchImpl()->SetActivatedWindow(wnd);
   WorkbenchPage::Pointer currentPage = wnd->GetActivePage().Cast<WorkbenchPage>();
   if (currentPage != 0)
   {
     IWorkbenchPart::Pointer part = currentPage->GetActivePart();
     if (part != 0)
     {
       PartSite::Pointer site = part->GetSite().Cast<PartSite>();
       site->GetPane()->ShellActivated();
     }
     IEditorPart::Pointer editor = currentPage->GetActiveEditor();
     if (editor != 0)
     {
       PartSite::Pointer site = editor->GetSite().Cast<PartSite>();
       site->GetPane()->ShellActivated();
     }
     wnd->GetWorkbenchImpl()->FireWindowActivated(wnd);
   }
   //liftRestrictions();
 }
 
 void WorkbenchWindow::ShellEventFilter::ShellDeactivated()
 {
   WorkbenchWindow::Pointer wnd(window);
 
   wnd->shellActivated = false;
   //imposeRestrictions();
   wnd->serviceLocator->Deactivate();
   WorkbenchPage::Pointer currentPage = wnd->GetActivePage().Cast<WorkbenchPage>();
   if (currentPage != 0)
   {
     IWorkbenchPart::Pointer part = currentPage->GetActivePart();
     if (part != 0)
     {
       PartSite::Pointer site = part->GetSite().Cast<PartSite>();
       site->GetPane()->ShellDeactivated();
     }
     IEditorPart::Pointer editor = currentPage->GetActiveEditor();
     if (editor != 0)
     {
       PartSite::Pointer site = editor->GetSite().Cast<PartSite>();
       site->GetPane()->ShellDeactivated();
     }
     wnd->GetWorkbenchImpl()->FireWindowDeactivated(wnd);
   }
 }
 
 }
diff --git a/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h b/Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.h
index 05e0899876..4891d63dc2 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);
 
   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
+   * Subclasses may override 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/util/berryAbstractTabFolder.h b/Plugins/org.blueberry.ui.qt/src/internal/util/berryAbstractTabFolder.h
index fb98b040a3..249cba8cd2 100755
--- a/Plugins/org.blueberry.ui.qt/src/internal/util/berryAbstractTabFolder.h
+++ b/Plugins/org.blueberry.ui.qt/src/internal/util/berryAbstractTabFolder.h
@@ -1,203 +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 BERRYABSTRACTTABFOLDER_H_
 #define BERRYABSTRACTTABFOLDER_H_
 
 #include <berryMessage.h>
 
 #include <QRect>
 
 #include "berryPartInfo.h"
 #include "berryTabFolderEvent.h"
 
 class QWidget;
 
 namespace berry
 {
 
 class AbstractTabFolder
 {
 
 public:
 
   Message1<TabFolderEvent::Pointer> tabFolderEvent;
 
 private:
 
   int state;
   int activeState;
 
 public:
 
   AbstractTabFolder();
   virtual ~AbstractTabFolder();
 
   virtual QSize ComputeSize(int widthHint, int heightHint) = 0;
 
   virtual AbstractTabItem* Add(int index, int flags) = 0;
 
   virtual void Move(int from, int to) = 0;
 
   virtual QWidget* GetContentParent() = 0;
   virtual void SetContent(QWidget* newContent) = 0;
 
   virtual QList<AbstractTabItem*> GetItems() = 0;
 
   virtual AbstractTabItem* GetSelection() = 0;
   virtual void SetSelection(AbstractTabItem* toSelect) = 0;
   virtual void SetSelectedInfo(const PartInfo& info) = 0;
   virtual void EnablePaneMenu(bool enabled) = 0;
 
   virtual void SetActive(int activeState);
 
   virtual int GetActive();
 
   /**
    * Returns the location where the pane menu should be opened when activated
    * by a keyboard shortcut (display coordinates)
    *
    * @return the location for the pane menu (display coordinates)
    * @since 3.1
    */
   virtual QPoint GetPaneMenuLocation();
 
   /**
    * Returns the location where the part list should be opened when activated
    * by a keyboard shortcut (display coordinates)
    *
    * @return the location for the part list (display coordinates)
    * @since 3.1
    */
   virtual QPoint GetPartListLocation();
 
   /**
    * Returns the location where the pane menu should be opened when activated
    * by a keyboard shortcut (display coordinates)
    *
    * @return the location for the pane menu (display coordinates)
    * @since 3.1
    */
   virtual QPoint GetSystemMenuLocation();
 
   /**
    * Returns the main control for this folder.
    *
    * @return the main control for the folder
    * @since 3.1
    */
   virtual QWidget* GetControl() = 0;
 
   virtual AbstractTabItem* GetItem(int idx);
 
   virtual AbstractTabItem* GetItem(const QPoint& toFind);
 
   virtual AbstractTabItem* FindItem(Object::Pointer dataToFind);
 
   /**
    * Returns the index of the given item, or -1 if the given item is
    * not found in this tab folder. Subclasses should override this if
    * the underlying SWT widget has an equivalent method
    *
    * @param item item to find
    * @return the index of the given item or -1
    */
   virtual int IndexOf(AbstractTabItem* item);
 
   virtual int GetItemCount();
 
   /**
    * Sets the current state for the folder
    *
    * @param state one of the IStackPresentationSite.STATE_* constants
    */
   virtual void SetState(int state);
 
   /**
    * Returns the title area for this control (in the control's coordinate system)
    *
    * @return
    */
   virtual QRect GetTabArea() = 0;
 
   /**
    * Called when the tab folder's shell becomes active or inactive. Subclasses
    * can override this to change the appearance of the tabs based on activation.
    *
    * @param isActive
    */
   virtual void ShellActive(bool isActive);
 
   virtual void Layout(bool flushCache);
 
   virtual void SetTabPosition(int tabPosition);
 
   virtual int GetTabPosition();
 
   virtual int GetState();
 
   /**
    * Returns true iff the given point is on the border of the folder.
    * By default, double-clicking, context menus, and drag/drop are disabled
    * on the folder's border.
    *
    * @param toTest a point (display coordinates)
    * @return true iff the point is on the presentation border
    * @since 3.1
    */
   virtual bool IsOnBorder(const QPoint& toTest);
 
   /**
-   * Set the folder to visible. This can be extended to propogate the
+   * Set the folder to visible. This can be extended to propagate the
    * visibility request to other components in the subclass.
    *
    * @param visible
    *            <code>true</code> - the folder is visible.
    * @since 3.2
    */
   virtual void SetVisible(bool visible);
 
   /**
    * Cause the folder to hide or show its
    * Minimize and Maximize affordances.
    *
    * @param show
    *            <code>true</code> - the min/max buttons are visible.
    * @since 3.3
    */
   virtual void ShowMinMax(bool show);
 
 protected:
 
   friend class PresentablePartFolder;
 
   void FireEvent(TabFolderEvent::Pointer e);
 
   void FireEvent(int id);
 
   void FireEvent(int id, AbstractTabItem* w);
 
   void FireEvent(int id, AbstractTabItem* w, const QPoint& pos);
 
   void HandleContextMenu(const QPoint& displayPos);
 
   void HandleMousePress(const QPoint& displayPos);
 
   void HandleDoubleClick(const QPoint& displayPos);
 
   void HandleDragStarted(const QPoint& displayPos);
 
 };
 
 }
 
 #endif /* BERRYABSTRACTTABFOLDER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroManager.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroManager.h
index bd238a103a..3b0f2b25d4 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroManager.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 BERRYIINTROMANAGER_H_
 #define BERRYIINTROMANAGER_H_
 
 #include "berryIIntroPart.h"
 
 #include <berryIWorkbenchWindow.h>
 
 namespace berry
 {
 
 /**
  * Manages the intro part that introduces the product to new users.
  * The intro part is typically shown the first time a product is started up.
  * <p>
  * The initial behavior of the intro part is controlled by the application
  * from via the {@link WorkbenchWindowAdvisor#OpenIntro()}
  * method.
  * </p>
  * <p>
  * See {@link IIntroPart} for details on where intro parts
  * come from.
  * </p>
  * <p>
  * This interface is not intended to be extended or implemented by clients.
  * </p>
  *
  * @see org.eclipse.ui.IWorkbench#getIntroManager()
  * @since 3.0
  */
 struct BERRY_UI_QT IIntroManager
 {
 
   virtual ~IIntroManager();
   /**
    * Closes the given intro part.
    *
    * @param part the intro part
    * @return <code>true</code> if the intro part was closed, and
    * <code>false</code> otherwise.  <code>false</code> is returned
    * if part is <code>null</code> or it is not the intro part returned
    * by {@link #GetIntro()}.
    */
   virtual bool CloseIntro(IIntroPart::Pointer part) = 0;
 
   /**
    * Returns the intro part. Returns <code>null</code> if there is no intro
    * part, if it has been previously closed via {@link #CloseIntro}
    * or if there is an intro part but {@link #ShowIntro}
    * has not yet been called to create it.
    *
    * @return the intro part, or <code>null</code> if none is available
    */
   virtual IIntroPart::Pointer GetIntro() const = 0;
 
   /**
    * Return whether an intro is available. Note that this checks whether
    * there is an applicable intro part that could be instantiated and shown
    * to the user.
    * Use {@link #GetIntro} to discover whether an intro part has already
    * been created.
    *
    * @return <code>true</code> if there is an intro that could be shown, and
    * <code>false</code> if there is no intro
    */
   virtual bool HasIntro() const = 0;
 
   /**
    * Return the standby state of the given intro part.
    *
    * @param part the intro part
    * @return <code>true</code> if the part in its partially
-   * visible standy mode, and <code>false</code> if in its fully visible state.
+   * visible standby mode, and <code>false</code> if in its fully visible state.
    * <code>false</code> is returned if part is <code>null</code> or it is not
    * the intro part returned by {@link #GetIntro}.
    */
   virtual bool IsIntroStandby(IIntroPart::Pointer part) const = 0;
 
   /**
    * Sets the standby state of the given intro part. Intro part usually should
    * render themselves 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 does nothing if the part is <code>null</code> or is not
    * the intro part returned by {@link #GetIntro}.
    * </p>
    *
    * @param part the intro part, or <code>null</code>
    * @param standby <code>true</code> to put the part in its partially
-   * visible standy mode, and <code>false</code> to make it fully visible.
+   * visible standby mode, and <code>false</code> to make it fully visible.
    */
   virtual void SetIntroStandby(IIntroPart::Pointer part, bool standby) = 0;
 
   /**
    * Shows the intro part in the given workbench window. If the intro part has
    * not been created yet, one will be created. If the intro part is currently
    * being shown in some workbench window, that other window is made active.
    *
    * @param preferredWindow the preferred workbench window, or
    * <code>null</code> to indicate the currently active workbench window
    * @param standby <code>true</code> to put the intro part in its partially
-   * visible standy mode, and <code>false</code> to make it fully visible
+   * visible standby mode, and <code>false</code> to make it fully visible
    * @return the newly-created or existing intro part, or <code>null</code>
    * if no intro part is available or if <code>preferredWindow</code> is
    * <code>null</code> and there is no currently active workbench window
    */
   virtual IIntroPart::Pointer ShowIntro(
       IWorkbenchWindow::Pointer preferredWindow, bool standby) = 0;
 
   /**
    * Returns <code>true</code> if there is an intro content detector and it
    * reports that new intro content is available.
    *
    * @return <code>true</code> if new intro content is available
    *
    * @since 3.3
    */
   virtual bool IsNewContentAvailable() = 0;
 };
 
 }
 
 #endif /* BERRYIINTROMANAGER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
index 512f075bdb..db6556d234 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
@@ -1,189 +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 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
  */
 struct BERRY_UI_QT IIntroPart : public virtual Object
 { // IAdaptable {
 
   berryObjectMacro(berry::IIntroPart);
 
   ~IIntroPart() override;
 
     /**
    * 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} 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
+     * visible standby 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.
      *
      * @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.
      * <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.
      * <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}.
      * </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 92fde8c48b..7dcb60cc06 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.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 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
+ * The workbench exposes its implementation of intro part sites via this
  * interface, which is not intended to be implemented or extended by clients.
  * </p>
  */
 struct BERRY_UI_QT IIntroSite : public IWorkbenchSite
 {
 
   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.mitk.gui.common/src/mitkILifecycleAwarePart.h b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h
index af2a4bfc48..f34f9a0bdc 100644
--- a/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.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 mitkILifecycleAwarePart_h
 #define mitkILifecycleAwarePart_h
 
 #include <org_mitk_gui_common_Export.h>
 
 
 namespace mitk {
 
 /**
  * \ingroup org_mitk_gui_common
  *
  * \brief Interface for a MITK Workbench part which wants to be notified about lifecycle changes.
  *
  * This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. MITK Workbench parts
  * implementing this interface will be notified about their lifecycle changes. The same effect could
  * be achieved by registering a custom berry::IPartListener.
  *
  * \note There are no "Closed()" or "Opened()" methods. These correspond to the constructor and
- *       desctructor of the Workbench part class.
+ *       destructor of the Workbench part class.
  *
  * \see berry::IPartListener
  * \see mitk::IZombieViewPart
  */
 struct MITK_GUI_COMMON_PLUGIN ILifecycleAwarePart
 {
   virtual ~ILifecycleAwarePart();
 
   /** \see berry::IPartListener::PartActivated */
   virtual void Activated() = 0;
 
   /** \see berry::IPartListener::PartDeactivated */
   virtual void Deactivated() = 0;
 
   /** \see berry::IPartListener::PartVisible */
   virtual void Visible() = 0;
 
   /** \see berry::IPartListener::PartHidden */
   virtual void Hidden() = 0;
 };
 
 }
 
 #endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h
index 36cc14bca5..0ce6bb5a11 100644
--- a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.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 mitkILinkedRenderWindowPart_h
 #define mitkILinkedRenderWindowPart_h
 
 #include "mitkIRenderWindowPart.h"
 
 namespace mitk {
 
 /**
  * \ingroup org_mitk_gui_common
  *
  * \brief Extends the IRenderWindowPart interface with methods for controlling linked
  *        render windows.
  *
- * This inteface should be implemented by subclasses of berry::IWorkbenchPart if they
+ * This interface should be implemented by subclasses of berry::IWorkbenchPart if they
  * provided several linked QmitkRenderWindow instances.
  */
 struct MITK_GUI_COMMON_PLUGIN ILinkedRenderWindowPart : public virtual IRenderWindowPart {
 
   ~ILinkedRenderWindowPart() override;
 
 
   /**
    * Enable or disable the slicing planes linking the QmitkRenderWindow instances.
    *
    * \param enable <code>true</code> if the slicing planes should be enabled;
    *        <code>false</code> otherwise.
    */
   virtual void EnableSlicingPlanes(bool enable) = 0;
 
   /**
    * Get the enabled status of the slicing planes.
    *
    * \return <code>true</code> if the slicing planes are enabled; <code>false</code>
    *         otherwise.
    */
   virtual bool IsSlicingPlanesEnabled() const = 0;
 
 };
 
 }
 
 #endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h
index 4db09f0779..0e727d2522 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.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 mitkIRenderWindowPartListener_h
 #define mitkIRenderWindowPartListener_h
 
 #include <org_mitk_gui_common_Export.h>
 
 namespace mitk {
 
   struct IRenderWindowPart;
 
   /**
    * \ingroup org_mitk_gui_common
    *
    * \brief Interface for berry::IViewPart implementations to be notified about mitk::IRenderWindowPart lifecycle changes.
    *
    * This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. If implemented,
-   * the interface methods are called automatically if a Workbench part which implementes mitk::IRenderWindowPart
+   * the interface methods are called automatically if a Workbench part which implements mitk::IRenderWindowPart
    * is activated or deactivated.
    *
    * The notion of activated and deactivated is slightly different from the usual Workbench part lifecycle.
    */
   struct MITK_GUI_COMMON_PLUGIN IRenderWindowPartListener
   {
     virtual ~IRenderWindowPartListener();
 
     /**
      * Called when an IRenderWindowPart is activated or if it becomes visible and no
      * other IRenderWindowPart was activated before.
      *
      * \param renderWindowPart The newly activated IRenderWindowPart.
      */
     virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) = 0;
 
     /**
      * Called when an IRenderWindowPart becomes invisible and if it was active before.
      *
      * \param renderWindowPart The deactivated IRenderWindowPart.
      */
     virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) = 0;
 
     /**
     * Called when an IRenderWindowPart changes and if it was active before.
     */
     virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart*) {};
   };
 }
 
 #endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h b/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h
index 34dfd88e42..6f33da5900 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.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 mitkIRenderingManager_h
 #define mitkIRenderingManager_h
 
 #include <mitkRenderingManager.h>
 
 #include <org_mitk_gui_common_Export.h>
 
 #include <QList>
 #include <QtPlugin>
 
 namespace mitk {
 /**
  * \ingroup org_mitk_gui_common
  *
  * \brief An interface for accessing a mitk::RenderingManager instance.
  *
  * This interface acts as a wrapper to a mitk::RenderingManager instance, hiding some
  * methods from the user.
  *
  * \see MakeRenderingManagerInterface
  */
 struct IRenderingManager {
   virtual ~IRenderingManager() {}
 
   /** Get a list of all registered RenderWindows */
   virtual QList<vtkRenderWindow*> GetAllRegisteredVtkRenderWindows() const = 0;
 
   /**
    * Requests an update for the specified RenderWindow, to be executed as
    * soon as the main loop is ready for rendering.
    */
   virtual void RequestUpdate( vtkRenderWindow *renderWindow ) = 0;
 
   /** Immediately executes an update of the specified RenderWindow. */
   virtual void ForceImmediateUpdate( vtkRenderWindow *renderWindow ) = 0;
 
   /**
    * 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.
    */
   virtual void RequestUpdateAll( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
 
   /**
    * 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.
    */
   virtual void ForceImmediateUpdateAll( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
 
   /** Initializes the windows specified by requestType to the given geometry. */
   virtual bool InitializeViews( const BaseGeometry *geometry,
                                 RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL,
                                 bool preserveRoughOrientationInWorldSpace = false ) = 0;
   virtual bool InitializeViews( const TimeGeometry *geometry,
                                 RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL,
                                 bool preserveRoughOrientationInWorldSpace = false ) = 0;
 
   /**
    * Initializes the windows to the default viewing direction
-   * (geomtry information is NOT changed).
+   * (geometry information is NOT changed).
    */
   virtual bool InitializeViews( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
 
   /**
    * Initializes the specified window to the given geometry. Set
    * "initializeGlobalTimeSNC" to true in order to use this geometry as
    * global TimeGeometry.
    */
   virtual bool InitializeView( vtkRenderWindow *renderWindow, const BaseGeometry *geometry,
                                bool initializeGlobalTimeSNC = false) = 0;
 
   /**
    * Initializes the specified window to the default viewing direction
-   * (geomtry information is NOT changed).
+   * (geometry information is NOT changed).
    */
   virtual bool InitializeView( vtkRenderWindow *renderWindow ) = 0;
 
   /** Gets the TimeNavigationController responsible for time-slicing. */
   virtual const TimeNavigationController*GetTimeNavigationController() const = 0;
 
   /** Gets the TimeNavigationController responsible for time-slicing. */
   virtual TimeNavigationController*GetTimeNavigationController() = 0;
 
   virtual bool IsRendering() const = 0;
 
   virtual void AbortRendering() = 0;
 
   /** En-/Disable LOD increase globally. */
   virtual void SetLODIncreaseBlocked(bool blocked) = 0;
 
   /** Get LOD blocked status. */
   virtual bool GetLODIncreaseBlocked() const = 0;
 
   /** En-/Disable LOD abort mechanism. */
   virtual void SetLODAbortMechanismEnabled(bool abort) = 0;
 
   /** Get LOD abort mechanism status. */
   virtual bool GetLODAbortMechanismEnabled() const = 0;
 
   virtual int GetNextLOD( BaseRenderer* renderer ) const = 0;
 
   /** Set current LOD (nullptr means all renderers)*/
   virtual void SetMaximumLOD( unsigned int max ) = 0;
 
   virtual void SetShading( bool state, unsigned int lod ) = 0;
   virtual bool GetShading( unsigned int lod ) = 0;
 
   virtual void SetClippingPlaneStatus( bool status ) = 0;
   virtual bool GetClippingPlaneStatus() = 0;
 
   virtual void SetShadingValues( float ambient, float diffuse,
                                  float specular, float specpower ) = 0;
 
   virtual QList<float> GetShadingValues() const = 0;
 };
 }
 
 Q_DECLARE_INTERFACE(mitk::IRenderingManager, "org.mitk.ui.IRenderingManager")
 
 namespace mitk {
 /**
  * Create a IRenderManager interface for a given RenderingManager. Ownership of the
  * returned pointer is transferred to the caller of this function.
  *
  * \param manager The RenderingManager instance for which to create a interface.
  * \return A pointer to the interface object. The caller is responsible for deleting the pointer.
  */
 MITK_GUI_COMMON_PLUGIN IRenderingManager* MakeRenderingManagerInterface(RenderingManager::Pointer manager);
 }
 
 #endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h b/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h
index 519abda59b..c91818390b 100644
--- a/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h
+++ b/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.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 mitkWorkbenchUtil_h
 #define mitkWorkbenchUtil_h
 
 #include <org_mitk_gui_common_Export.h>
 
 #include "mitkDataStorageEditorInput.h"
 
 #include "mitkIRenderWindowPart.h"
 
 #include <berryIWorkbenchPage.h>
 #include <berryIEditorDescriptor.h>
 
 class ctkPluginContext;
 
 namespace mitk {
   /**
    * @ingroup org_mitk_gui_common
    *
    * @brief Utility class for loading data, opening editors and other tasks in a MITK Workbench.
    *
    * @note Inferring the content type is not yet supported (ignore the comments about it
    *       in the method documentation).
    */
   struct MITK_GUI_COMMON_PLUGIN WorkbenchUtil
   {
     /**
     * Describes the strategies to be used for getting an mitk::IRenderWindowPart instance.
     */
     enum IRenderWindowPartStrategy {
 
       // Do nothing.
       NONE = 0x00000000,
       // Bring the most recently activated mitk::IRenderWindowPart instance to the front.
       BRING_TO_FRONT = 0x00000001,
       // Activate an mitk::IRenderWindowPart part (implies bringing it to the front).
       ACTIVATE = 0x00000002,
-      // Create an mitk::IRenderWindowPart if none is alredy opened.
+      // Create an mitk::IRenderWindowPart if none is already opened.
       OPEN = 0x00000004
     };
 
     Q_DECLARE_FLAGS(IRenderWindowPartStrategies, IRenderWindowPartStrategy)
 
     /**
      * Loads the set of given files into the active data storage of the given Workbench window.
      *
      * If the window already has an editor open on the active datastorage then that editor
      * is activated; otherwise the default editor for the "mitk" extension is activated.
      *
      * @param fileNames
      *            A list of file names with absolute path.
      * @param wnd
      *            The Workbench window in which the data will be loaded.
      * @param openEditor
      *            Whether an Editor is to be opened on file loading (for cases there is none).
      *
      * @see mitk::IOUtil
      */
     static void LoadFiles(const QStringList& fileNames, berry::IWorkbenchWindow::Pointer wnd, bool openEditor = true);
     /**
      * Opens an editor on the given object.
      * <p>
      * If the page already has an editor open on the target object then that
      * editor is brought to front; otherwise, a new editor is opened. If
      * <code>activate == true</code> the editor will be activated.
      * <p>
      *
      * @param page
      *            the page in which the editor will be opened
      * @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 initialized
      * @see IWorkbenchPage#OpenEditor(IEditorInput::Pointer, std::string, bool)
      */
     static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, berry::IEditorInput::Pointer input, const QString& editorId, bool activate = false);
     /**
      * Opens an editor on the given file resource. This method will attempt to
      * resolve the editor based on content-type bindings as well as traditional
      * name/extension bindings if <code>determineContentType</code> is
      * <code>true</code>.
      * <p>
      * If the page already has an editor open on the target object then that
      * editor is brought to front; otherwise, a new editor is opened. If
      * <code>activate == true</code> the editor will be activated.
      * <p>
      *
      * @param page
      *            the page in which the editor will be opened
      * @param input
      *            the editor input
      * @param activate
      *            if <code>true</code> the editor will be activated
      * @param determineContentType
      *            attempt to resolve the content type for this file
      * @return an open editor or <code>null</code> if an external editor was
      *         opened
      * @exception PartInitException
      *                if the editor could not be initialized
      * @see IWorkbenchPage#OpenEditor(IEditorInput::Pointer,std::string,bool)
      */
     static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, DataStorageEditorInput::Pointer input, bool activate = false, bool determineContentType = false);
     /**
      * Returns an editor descriptor appropriate for opening a file resource with
      * the given name.
      * <p>
      * The editor descriptor is determined using a multi-step process. This
      * method will attempt to infer the content type of the file if
      * <code>inferContentType</code> is <code>true</code>.
      * </p>
      * <ol>
      * <li>The file is consulted for a persistent property named
      * <code>IDE.EDITOR_KEY</code> containing the preferred editor id to be
      * used.</li>
      * <li>The workbench editor registry is consulted to determine if an editor
      * extension has been registered for the file type. If so, an instance of
      * the editor extension is opened on the file. See
      * <code>IEditorRegistry#GetDefaultEditor(std::string)</code>.</li>
      * <li>The operating system is consulted to determine if an in-place
      * component editor is available (e.g. OLE editor on Win32 platforms).</li>
      * <li>The operating system is consulted to determine if an external editor
      * is available.</li>
      * </ol>
      * </p>
      *
      * @param name
      *            the file name
      * @param inferContentType
      *            attempt to infer the content type from the file name if this
      *            is <code>true</code>
      * @return an editor descriptor, appropriate for opening the file
      * @throws PartInitException
      *             if no editor can be found
      */
     static berry::IEditorDescriptor::Pointer GetEditorDescriptor(const QString& name, bool inferContentType = true);
     /**
      * Returns the default editor for a given file. This method will attempt to
      * resolve the editor based on content-type bindings as well as traditional
      * name/extension bindings if <code>determineContentType</code> is
      * <code>true</code>.
      * <p>
      * A default editor id may be registered for a specific file using
      * <code>setDefaultEditor</code>. If the given file has a registered
      * default editor id the default editor will derived from it. If not, the
      * default editor is determined by taking the file name for the file and
      * obtaining the default editor for that name.
      * </p>
      *
      * @param file
      *            the file
      * @param determineContentType
      *            determine the content type for the given file
      * @return the descriptor of the default editor, or <code>null</code> if
      *         not found
      */
     static berry::IEditorDescriptor::Pointer GetDefaultEditor(const QString& file, bool determineContentType);
     /**
     * @brief Returns the currently active mitk::IRenderWindowPart.
     *
     * @param page         The page in which the editor will be opened.
     * @param strategies   Strategies for returning a mitk::IRenderWindowPart instance if there
     *                     is currently no active one.
     * @return The active mitk::IRenderWindowPart.
     */
     static IRenderWindowPart* GetRenderWindowPart(berry::IWorkbenchPage::Pointer page, IRenderWindowPartStrategies strategies);
     /**
     * @brief Uses 'GetRenderWindowPart' to open the a render window part with a certain strategy:
     *        Calls 'GetRenderWindowPart' with strategy "ACTIVATE | OPEN" if the bool argument is true.
     *        Calls 'GetRenderWindowPart' with strategy "BRING_TO_FRONT | OPEN" if the bool argument is false.
     *
     * @param page         The page in which the editor will be opened.
     * @param activatedEditor   Determine if the render window part should be activated or just brought to front.
     * @return The active and opened mitk::IRenderWindowPart.
     */
     static IRenderWindowPart* OpenRenderWindowPart(berry::IWorkbenchPage::Pointer page, bool activatedEditor = true);
     /**
      * Set the "DepartmentLogo" preference using a Qt resource path.
      *
      * This is a convenience method to set the preference for a "department" logo which is usually
      * shown in render windows in the MITK workbench.
      *
      * @param logoResource A Qt resource path to the logo, e.g. ":/MyLogo.png".
      * @param context The plugin context of the plug-in containing the logo resource.
      * @return \c true if the preference was set successfully, \c false otherwise.
      */
     static bool SetDepartmentLogoPreference(const QString& logoResource, ctkPluginContext* context);
   };
 }
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(mitk::WorkbenchUtil::IRenderWindowPartStrategies)
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.aicpregistration/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.aicpregistration/documentation/UserManual/Manual.dox
index cba634a06f..4bb30a9ede 100644
--- a/Plugins/org.mitk.gui.qt.aicpregistration/documentation/UserManual/Manual.dox
+++ b/Plugins/org.mitk.gui.qt.aicpregistration/documentation/UserManual/Manual.dox
@@ -1,80 +1,80 @@
 /**
 \page org_mitk_gui_qt_aicpregistration The Anisotropic Iterative Closest Point Registration Plugin
 
 \imageMacro{"QmitkAICPRegistration_Icon-dox.xpm","Icon of the A-ICP Registration Plugin",2}
 
 \tableofcontents
 
 \section org_mitk_gui_qt_aicpregistrationOverview Overview
 
 The Surfaceregistration plugin allows the user to compute a transformation
 between two surfaces and align them in 3D space. It performs the
 registration with the anisotropic iterative closest point algorithm (A-ICP)
-presented in L. Maier-Hein et al. "Convergent Iterative Closest-Point Algorithm to Accomodate
+presented in L. Maier-Hein et al. "Convergent Iterative Closest-Point Algorithm to Accommodate
 Anisotropic and Inhomogenous Localization Error.", IEEE T Pattern Anal 34 (8),
 1520-1532, 2012. With the plugin it's also possible to compute
 the target registration error (TRE) between the two aligned surfaces with a given
 set of target points. In order to register the surfaces they need to be initially
 aligned to be able to run the fine registration with the A-ICP algorithm.
 
 \imageMacro{"QmitkAICPRegistration_Plugin.png","Overview of the A-ICP Registration Plugin.",28}
 
 \section org_mitk_gui_qt_aicpregistrationUsage Usage
 
 In order to run a registration at least two surfaces need to be loaded into
 the data manager. Once the surfaces are loaded, a moving and a
 fixed surface can be selected in the associated combo boxes of the plugin.
 When the <b>Register Surfaces</b> button is pressed the registration is started
 and the moving surface is transformed onto the fixed surface.
 
 \imageMacro{"QmitkAICPRegistration_Input.png","Select the surfaces to register.",28}
 
 \section org_mitk_gui_qt_aicpregistrationTargetRegistrationErrorCalculation Target Registration Error Calculation
 
 To compute the target registration error, enable the calculation via the checkbox
 in the target registration view. Once the TRE computation is enabled the
 combo boxes are activated to select the according target point sets.
 
 \imageMacro{"QmitkAICPRegistration_TRECalculation.png","Usage of the TRE calculation view.",28}
 
 \section org_mitk_gui_qt_aicpregistrationRegistrationSettings Registration Settings
 
 The following additional settings are available in the plugin to configure the algorithm:
 <ul>
   <li>A trimmed version of the algorithm.
   <li>Set the threshold for the algorithm to converge.
   <li>Limit the iterations.
   <li>Set the search radius.
 </ul>
 
 \imageMacro{"QmitkAICPRegistration_Settings.png","Additional registration settings.",28}
 
 \subsection org_mitk_gui_qt_aicpregistrationTrimmedRegistration Trimmed Registration
 
 This option enables a trimmed version of the algorithm to register partial overlapping
 surfaces. Once the option is enabled the user can specify the overlapping part of the surface.
 Valid values for the overlapping part lie between 0 an 1.
 The trimmed version of the algorithm uses only a fixed percentage of all correspondences found
 during one iteration. Only the best correspondences will be used during the registration process.
 
 \subsection org_mitk_gui_qt_aicpregistrationThreshold Threshold
 
 The user can specify the threshold which is used as a termination constraint for the algorithm.
 When the the change of the fiducial registration error (FRE)
 between to registrations falls under the specified threshold the algorithm terminates.
 Larger values can speedup the registration process at the cost of a more accurate result.
 
 \subsection org_mitk_gui_qt_aicpregistrationMaximumIterations Maximum Iterations
 
 The maximum amount of iterations used by the algorithm can be specified by the user.
 Once the algorithm reaches the maximum amount of iterations it will stop the registration process.
 
 \subsection org_mitk_gui_qt_aicpregistrationSearchRadius Search Radius
 
 The user can specify the search radius in mm used during the correspondence search
 in a kd tree. The default value is 30 mm. A small radius can speedup the
 algorithm but can in addition also lead in bad correspondences and therefore in an incorrect
 alignment of the surfaces.
 
 */
 
diff --git a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.cpp b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.cpp
index 367ce3599e..dbae2c4b35 100644
--- a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.cpp
+++ b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.cpp
@@ -1,422 +1,422 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Qmitk
 #include "QmitkAICPRegistrationView.h"
 
 // Qt
 #include <QMessageBox>
 #include <QThread>
 
 // MITK
 #include <mitkSurface.h>
 #include <mitkPointSet.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkAnisotropicIterativeClosestPointRegistration.h>
 #include <mitkCovarianceMatrixCalculator.h>
 #include <mitkAnisotropicRegistrationCommon.h>
 
 // vtk
 #include <vtkSmartPointer.h>
 #include <vtkPolyData.h>
 #include <vtkCleanPolyData.h>
 
 const std::string QmitkAICPRegistrationView::VIEW_ID = "org.mitk.views.aicpregistration";
 
  /**
    * @brief Pimpl holding the datastructures used by the
    *        QmitkAICPRegistrationView.
    */
 class AICPRegistrationViewData
 {
 
 public:
   QThread* m_RegistrationThread;
   UIWorker* m_Worker;
   double m_Threshold;
   double m_MaxIterations;
   double m_TrimmFactor;
   double m_SearchRadius;
 
   // anisotropic registration
   mitk::AnisotropicIterativeClosestPointRegistration::Pointer m_AICP;
 
   // covariance matrix calculator
   mitk::CovarianceMatrixCalculator::Pointer m_MatrixCalculator;
 
   vtkSmartPointer<vtkCleanPolyData> m_CleanPolyData;
 
   mitk::Surface::Pointer m_MovingSurface;
 
   mitk::Surface::Pointer m_FixedSurface;
 
   // c tor
   AICPRegistrationViewData()
    : m_RegistrationThread(new QThread()),
      m_Worker(new UIWorker()),
      m_Threshold(0.00001),
      m_MaxIterations(1000),
      m_TrimmFactor(0.0),
      m_SearchRadius(30.0),
      m_AICP(mitk::AnisotropicIterativeClosestPointRegistration::New()),
      m_MatrixCalculator(mitk::CovarianceMatrixCalculator::New()),
      m_CleanPolyData(vtkSmartPointer<vtkCleanPolyData>::New()),
      m_MovingSurface(nullptr),
      m_FixedSurface(nullptr)
   {
   }
 
   // cleanup
   ~AICPRegistrationViewData()
   {
     if ( m_RegistrationThread )
       delete m_RegistrationThread;
     if ( m_Worker )
       delete m_Worker;
 
     m_AICP = nullptr;
     m_MatrixCalculator = nullptr;
     m_CleanPolyData = nullptr;
     m_MovingSurface = nullptr;
     m_FixedSurface = nullptr;
   }
 };
 
 QmitkAICPRegistrationView::QmitkAICPRegistrationView()
 {
   d = new AICPRegistrationViewData();
 }
 
 QmitkAICPRegistrationView::~QmitkAICPRegistrationView()
 {
   if ( d )
     delete d;
 }
 
 void QmitkAICPRegistrationView::SetFocus(){}
 
 void QmitkAICPRegistrationView::CreateQtPartControl( QWidget *parent )
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi( parent );
 
   // connect signals and slots
   connect ( m_Controls.m_EnableTreCalculation,SIGNAL(clicked()),this, SLOT(OnEnableTreCalculation()) );
   connect ( m_Controls.m_RegisterSurfaceButton, SIGNAL(clicked()), this, SLOT(OnStartRegistration()) );
   connect ( m_Controls.m_EnableTrimming, SIGNAL(clicked()), this, SLOT(OnEnableTrimming()) );
   connect ( d->m_Worker, SIGNAL( RegistrationFinished()), this, SLOT( OnRegistrationFinished()) );
   connect(d->m_RegistrationThread,SIGNAL(started()), d->m_Worker,SLOT(RegistrationThreadFunc()) );
 
   // move the u worker to the thread
   d->m_Worker->moveToThread(d->m_RegistrationThread);
 
   // setup tooltips
   m_Controls.m_MovingSurfaceComboBox->setToolTip("Set the moving surface of the A-ICP algorithm");
   m_Controls.m_FixedSurfaceComboBox->setToolTip("Set the fixed surface of the A-ICP algorithm");
   m_Controls.m_EnableTreCalculation->setToolTip("Enable the trimmed version of the algorithm.");
   m_Controls.m_TrimmFactorSpinbox->setToolTip("Set the trimmfactor. The algorithm will use a percentage of the Moving pointset for the registration. Valid number are between 0 and 1.");
-  m_Controls.m_ThresholdSpinbox->setToolTip("Set the threshold to wich the algorithm will converge.");
+  m_Controls.m_ThresholdSpinbox->setToolTip("Set the threshold to which the algorithm will converge.");
   m_Controls.m_MaxIterationsSpinbox->setToolTip("The maximum number of iterations used by the algorithm.");
   m_Controls.m_SearchRadius->setToolTip("Set the search radius in mm for the calculation of the correspondences.");
   m_Controls.m_RegisterSurfaceButton->setToolTip("Start the registration.");
   m_Controls.m_EnableTrimming->setToolTip("Enables the trimmed version of the algorithm.");
-  m_Controls.m_TrimmFactorSpinbox->setToolTip("Set teh overlapping part of the surface in %. The valid range is between 0 and 1.");
+  m_Controls.m_TrimmFactorSpinbox->setToolTip("Set the overlapping part of the surface in %. The valid range is between 0 and 1.");
   m_Controls.m_MovingTargets->setToolTip("Select the targets for the moving surface.");
   m_Controls.m_FixedTargets->setToolTip("Select the targets for the fixed surface.");
 
   // init combo boxes
   m_Controls.m_FixedSurfaceComboBox->SetDataStorage(this->GetDataStorage());
   m_Controls.m_FixedSurfaceComboBox->SetPredicate(mitk::NodePredicateDataType::New("Surface"));
 
   m_Controls.m_MovingSurfaceComboBox->SetDataStorage(this->GetDataStorage());
   m_Controls.m_MovingSurfaceComboBox->SetPredicate(mitk::NodePredicateDataType::New("Surface"));
 
   m_Controls.m_MovingTargets->SetDataStorage(this->GetDataStorage());
   m_Controls.m_MovingTargets->SetPredicate(mitk::NodePredicateDataType::New("PointSet"));
 
   m_Controls.m_FixedTargets->SetDataStorage(this->GetDataStorage());
   m_Controls.m_FixedTargets->SetPredicate(mitk::NodePredicateDataType::New("PointSet"));
 
   // disable target selection
   m_Controls.m_TargetSelectFrame->setEnabled(false);
 
   // disable trimming options
   m_Controls.m_TrimmFactorLabel->setEnabled(false);
   m_Controls.m_TrimmFactorSpinbox->setEnabled(false);
 }
 
 
 bool QmitkAICPRegistrationView::CheckInput()
 {
   QMessageBox msg;
   msg.setIcon(QMessageBox::Critical);
 
   if ( m_Controls.m_MovingSurfaceComboBox->GetSelectedNode().IsNull() ||
         m_Controls.m_FixedSurfaceComboBox->GetSelectedNode().IsNull() )
   {
     const char* message = "No Surfaces selected.";
     MITK_ERROR << message;
     msg.setText(message);
     msg.exec();
     return false;
   }
 
   if ( m_Controls.m_EnableTreCalculation->isChecked() )
   {
     if ( m_Controls.m_FixedTargets->GetSelectedNode().IsNull() ||
            m_Controls.m_MovingTargets->GetSelectedNode().IsNull() )
     {
       const char* message = "TRE calculation is enabled, but no target points are selected.";
       msg.setText(message);
       msg.exec();
       return false;
     }
   }
   return true;
 }
 
 void QmitkAICPRegistrationView::OnStartRegistration()
 {
   d->m_Threshold = m_Controls.m_ThresholdSpinbox->value();
   d->m_MaxIterations = m_Controls.m_MaxIterationsSpinbox->value();
   d->m_SearchRadius = m_Controls.m_SearchRadius->value();
   d->m_TrimmFactor = 0.0;
 
   if ( m_Controls.m_EnableTrimming->isChecked() )
   {
     d->m_TrimmFactor = m_Controls.m_TrimmFactorSpinbox->value();
   }
 
   if (! CheckInput() )
     return;
 
   d->m_MovingSurface = dynamic_cast<mitk::Surface*>(
             m_Controls.m_MovingSurfaceComboBox->GetSelectedNode()->GetData() );
 
   d->m_FixedSurface = dynamic_cast<mitk::Surface*>(
             m_Controls.m_FixedSurfaceComboBox->GetSelectedNode()->GetData() );
 
   // sanity check
   if ( d->m_FixedSurface.IsNull() || d->m_MovingSurface.IsNull() )
   {
     const char* message = "Input surfaces are nullptr.";
     QMessageBox msg;
     msg.setIcon(QMessageBox::Critical);
     msg.setText(message);
     MITK_ERROR << message;
     return;
   }
 
   // enable trimming
   if ( m_Controls.m_EnableTrimming->isChecked() )
   {
     d->m_TrimmFactor = m_Controls.m_TrimmFactorSpinbox->value();
   }
 
   // set data into the UI thread
   d->m_Worker->SetRegistrationData(d);
 
   // start thread
   d->m_RegistrationThread->start();
 
   // disable registration button
   m_Controls.m_RegisterSurfaceButton->setEnabled(false);
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkAICPRegistrationView::OnEnableTreCalculation()
 {
   if ( m_Controls.m_EnableTreCalculation->isChecked() )
     m_Controls.m_TargetSelectFrame->setEnabled(true);
   else
     m_Controls.m_TargetSelectFrame->setEnabled(false);
 }
 
 void QmitkAICPRegistrationView::OnEnableTrimming()
 {
   if ( m_Controls.m_EnableTrimming->isChecked() )
   {
     // disable trimming options
     m_Controls.m_TrimmFactorLabel->setEnabled(true);
     m_Controls.m_TrimmFactorSpinbox->setEnabled(true);
   } else {
     // disable trimming options
     m_Controls.m_TrimmFactorLabel->setEnabled(false);
     m_Controls.m_TrimmFactorSpinbox->setEnabled(false);
   }
 }
 
 void QmitkAICPRegistrationView::OnRegistrationFinished()
 {
   typedef itk::Matrix<double,3,3> Matrix3x3;
   typedef itk::Vector<double,3> TranslationVector;
 
   double tre = -1.0;
   Matrix3x3 rotation = d->m_AICP->GetRotation();
   TranslationVector translation = d->m_AICP->GetTranslation();
 
   // exit the thread
   d->m_RegistrationThread->quit();
 
   MITK_INFO << "Rotation: \n" << rotation << "Translation: " << translation;
   MITK_INFO << "FRE: " << d->m_AICP->GetFRE();
 
   // compute TRE
   if ( m_Controls.m_EnableTreCalculation->isChecked() )
   {
     mitk::PointSet* movingTargets = dynamic_cast<mitk::PointSet*> (
                      m_Controls.m_MovingTargets->GetSelectedNode()->GetData() );
 
     mitk::PointSet* fixedTargets = dynamic_cast<mitk::PointSet*> (
                       m_Controls.m_FixedTargets->GetSelectedNode()->GetData() );
 
     // sanity check
     if ( movingTargets && fixedTargets )
     {
       // swap the moving and the fixed point set, since we use the inverse
       // transform
       tre = mitk::AnisotropicRegistrationCommon::ComputeTargetRegistrationError(
                                                                   movingTargets,
                                                                   fixedTargets,
                                                                   rotation,
                                                                   translation
                                                                 );
       MITK_INFO << "TRE: " << tre;
 
       // transform the fixed point set
       for ( int i = 0; i < movingTargets->GetSize(); ++i )
       {
         mitk::Point3D p = movingTargets->GetPoint(i);
 
         p = rotation * p + translation;
 
         movingTargets->SetPoint(i,p);
       }
     }
   }
   // display result in textbox ( the inverse transform )
   QString text("");
   std::ostringstream oss;
 
   oss << "<b>Iterations:</b> "<< d->m_AICP->GetNumberOfIterations()
       << "<br><b>FRE:</b> " << d->m_AICP->GetFRE()
       << "<br><b>TRE:</b> ";
 
    if ( tre != -1.0)
     oss << tre;
    else
     oss << "N/A";
 
   oss << "<br><br><b>Rotation:</b><br>";
 
   for ( int i = 0; i < 3; ++i ) {
     for ( int j = 0; j < 3; ++j )
       oss << rotation[i][j] << " ";
     oss << "<br>";
   }
 
   oss << "<br><b>Translation:</b><br>" << translation << "<br>";
 
   std::string s(oss.str());
   text.append(s.c_str());
 
   m_Controls.m_TextEdit->clear();
   m_Controls.m_TextEdit->append(text);
 
   mitk::AnisotropicRegistrationCommon::TransformPoints (
           d->m_MovingSurface->GetVtkPolyData()->GetPoints(),
           d->m_MovingSurface->GetVtkPolyData()->GetPoints(),
           rotation,
           translation
         );
 
   // set modified flag to update rendering
   d->m_MovingSurface->GetVtkPolyData()->Modified();
 
   // reanable registration button
   m_Controls.m_RegisterSurfaceButton->setEnabled(true);
 
   //update view
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void UIWorker::SetRegistrationData(AICPRegistrationViewData *data)
 {
   this->d = data;
 }
 
 void UIWorker::RegistrationThreadFunc()
 {
   typedef itk::Matrix<double,3,3> Matrix3x3;
   typedef std::vector<Matrix3x3> CovarianceMatrixList;
 
   // moving surface
   mitk::Surface::Pointer X = mitk::Surface::New();
   // helper
   vtkPolyData* data_X = vtkPolyData::New();
   // fixed surface
   mitk::Surface::Pointer Y = mitk::Surface::New();
   // helper
   vtkPolyData* data_Y = vtkPolyData::New();
 
   // clean the poly data to prevent manifold edges and duplicated vertices
   d->m_CleanPolyData->SetInputData(d->m_MovingSurface->GetVtkPolyData());
   d->m_CleanPolyData->Update();
   // copy the polys
   data_X->DeepCopy(d->m_CleanPolyData->GetOutput());
   X->SetVtkPolyData(data_X);
 
   d->m_CleanPolyData->SetInputData(d->m_FixedSurface->GetVtkPolyData());
   d->m_CleanPolyData->Update();
   data_Y->DeepCopy(d->m_CleanPolyData->GetOutput());
   Y->SetVtkPolyData(data_Y);
 
   // compute the covariance matrices for the moving surface (X)
   d->m_MatrixCalculator->SetInputSurface(X);
   d->m_MatrixCalculator->ComputeCovarianceMatrices();
   CovarianceMatrixList sigmas_X = d->m_MatrixCalculator->GetCovarianceMatrices();
   const double meanVarX = d->m_MatrixCalculator->GetMeanVariance();
 
   // compute the covariance matrices for the fixed surface (Y)
   d->m_MatrixCalculator->SetInputSurface(Y);
   d->m_MatrixCalculator->ComputeCovarianceMatrices();
   CovarianceMatrixList sigmas_Y = d->m_MatrixCalculator->GetCovarianceMatrices();
   const double meanVarY = d->m_MatrixCalculator->GetMeanVariance();
 
   // the FRE normalization factor
   const double normalizationFactor = sqrt( meanVarX + meanVarY);
 
   // set up parameters
   d->m_AICP->SetMovingSurface(X);
   d->m_AICP->SetFixedSurface(Y);
   d->m_AICP->SetCovarianceMatricesMovingSurface(sigmas_X);
   d->m_AICP->SetCovarianceMatricesFixedSurface(sigmas_Y);
   d->m_AICP->SetFRENormalizationFactor(normalizationFactor);
   d->m_AICP->SetMaxIterations(d->m_MaxIterations);
   d->m_AICP->SetSearchRadius(d->m_SearchRadius);
   d->m_AICP->SetThreshold(d->m_Threshold);
   d->m_AICP->SetTrimmFactor(d->m_TrimmFactor);
 
   // run the algorithm
   d->m_AICP->Update();
 
   data_X->Delete();
   data_Y->Delete();
 
   emit RegistrationFinished();
 }
diff --git a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h
index ac1838057d..36674ab6b7 100644
--- a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h
+++ b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.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 QmitkAICPRegistrationView_h
 #define QmitkAICPRegistrationView_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 #include <QWidget>
 #include "ui_QmitkAICPRegistrationViewControls.h"
 
 // forwarddeclaration
 class AICPRegistrationViewData;
 
 /**
-  * \brief Implemenation of a worker thread class.
+  * \brief Implementation of a worker thread class.
   *
   *        Worker class that runs the registration
-  *        in a seperate QThread to prevent the registration from blocking the
+  *        in a separate QThread to prevent the registration from blocking the
   *        GUI.
   */
 class UIWorker : public QObject
 {
   Q_OBJECT
 
   private:
     /** Pimpl with the registration data.*/
     AICPRegistrationViewData* d;
 
   public slots:
 
-    /** Method that runs the registration algorithm in a seperate QThread.*/
+    /** Method that runs the registration algorithm in a separate QThread.*/
     void RegistrationThreadFunc();
 
   signals:
 
     /** Signal emitted when the registration was successful.*/
     void RegistrationFinished();
 
   public:
 
     /** Set the data used for the registration.*/
     void SetRegistrationData(AICPRegistrationViewData* data);
 };
 
 /**
   \brief QmitkAICPRegistrationView provides a simple UI to register two
          surfaces with the AnisotropicIterativeClosestPointRegistration
          algorithm.
 
   \sa QmitkAbstractView
   \ingroup ${plugin_target}_internal
 */
 class QmitkAICPRegistrationView : 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;
 
     QmitkAICPRegistrationView();
 
     ~QmitkAICPRegistrationView() override;
 
   protected slots:
 
-    /** Starts the registration. When the method is called a seperate UIWorker
+    /** Starts the registration. When the method is called a separate UIWorker
       * thread will be run in the background to prevent blocking the GUI.
       */
     void OnStartRegistration();
 
     /** Enables/disables the calculation of the Target Registration Error (TRE).
       */
     void OnEnableTreCalculation();
 
     /** Enables/disables the trimmed version of the A-ICP algorithm.*/
     void OnEnableTrimming();
 
   public slots:
 
     /** Method called when the algorithm is finishes. This method will setup
       * the GUI.
       */
     void OnRegistrationFinished();
 
   protected:
 
     void CreateQtPartControl(QWidget *parent) override;
 
     void SetFocus() override;
 
     Ui::QmitkAICPRegistrationViewControls m_Controls;
 
   private:
 
     AICPRegistrationViewData* d;
 
     /** Check for the correct input data.*/
     bool CheckInput();
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.cpp b/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.cpp
index 8edcdadc91..e49e4ac223 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.cpp
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.cpp
@@ -1,385 +1,385 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkPreferencesDialog.h"
 
 #include "berryPlatform.h"
 #include "berryPlatformUI.h"
 #include "berryIWorkbench.h"
 #include "berryIConfigurationElement.h"
 #include "berryIExtensionRegistry.h"
 #include "berryIExtension.h"
 #include <berryIQtPreferencePage.h>
 
 #include "internal/org_mitk_gui_qt_application_Activator.h"
 
 #include <ui_QmitkPreferencesDialog.h>
 
 #include <QFileDialog>
 #include <QMessageBox>
 #include <QPushButton>
 
 #include <algorithm>
 
 #include <mitkLog.h>
 #include <mitkCoreServices.h>
 #include <mitkIPreferencesService.h>
 #include <mitkIPreferences.h>
 
 using namespace std;
 
 static std::vector<std::string> splitString(const std::string &s, char delim=' ')
 {
   std::vector < std::string > elems;
   std::stringstream ss(s);
   std::string item;
   while (std::getline(ss, item, delim))
   {
     elems.push_back(item);
   }
   return elems;
 }
 
 class QmitkPreferencesDialogPrivate : public Ui::QmitkPreferencesDialog
 {
 public:
 
   ///
   /// Just a stub class for holding information on prefpages (metadata)
   ///
   struct PrefPage
   {
     PrefPage(QString _id, QString _name, QString _category
              , QString _className, QString _keywords, berry::IConfigurationElement::Pointer _confElem)
       : id(_id), name(_name), category(_category), className(_className), keywords(_keywords),
         prefPage(nullptr), confElem(_confElem), treeWidgetItem(nullptr)
     {}
 
     bool operator==(const PrefPage& other)
     { return id == other.id; }
 
     bool operator<(const PrefPage& other)
     { return name < other.name; }
 
     QString id;
     QString name;
     QString category;
     QString className;
     QString keywords;
     berry::IQtPreferencePage* prefPage;
     berry::IConfigurationElement::Pointer confElem;
     QTreeWidgetItem* treeWidgetItem;
   };
 
   QmitkPreferencesDialogPrivate()
     : m_CurrentPage(0)
   {
     berry::IExtensionRegistry* xpService = berry::Platform::GetExtensionRegistry();
 
     // m_PrefPages
     QList<berry::IConfigurationElement::Pointer> prefPages(xpService->GetConfigurationElementsFor("org.blueberry.ui.preferencePages"));
     QList<berry::IConfigurationElement::Pointer> keywordExts(xpService->GetConfigurationElementsFor("org.blueberry.ui.keywords"));
     QList<berry::IConfigurationElement::Pointer>::iterator prefPagesIt;
 
     QList<berry::IConfigurationElement::Pointer>::iterator keywordRefsIt;
 
     for (prefPagesIt = prefPages.begin(); prefPagesIt != prefPages.end(); ++prefPagesIt)
     {
       QString id = (*prefPagesIt)->GetAttribute("id");
       QString name = (*prefPagesIt)->GetAttribute("name");
       QString className = (*prefPagesIt)->GetAttribute("class");
       if(!id.isEmpty() && !name.isEmpty() && !className.isEmpty())
       {
         QString keywordLabels;
 
         QString category = (*prefPagesIt)->GetAttribute("category");
         //# collect keywords
         QList<berry::IConfigurationElement::Pointer> keywordRefs = (*prefPagesIt)->GetChildren("keywordreference"); // get all keyword references
         for (keywordRefsIt = keywordRefs.begin()
              ; keywordRefsIt != keywordRefs.end(); ++keywordRefsIt) // iterate over all refs
         {
           QString keywordRefId = (*keywordRefsIt)->GetAttribute("id"); // get referenced id
 
           for (QList<berry::IConfigurationElement::Pointer>::iterator keywordExtsIt = keywordExts.begin();
                keywordExtsIt != keywordExts.end(); ++keywordExtsIt) // iterate over all keywords
           {
             QString keywordId = (*keywordExtsIt)->GetAttribute("id"); // get keyword id
             if(keywordId == keywordRefId) // if referenced id is equals the current keyword id
             {
               //# collect all keywords from label attribute with a tokenizer
               QString currLabel = (*keywordExtsIt)->GetAttribute("label");
               currLabel = currLabel.toLower();
               if (!currLabel.isEmpty()) keywordLabels += QString(" ") + currLabel;
 
               //break; // break here; possibly search for other referenced keywords
             }
           }
         }
 
         // add information as PrefPage
         m_PrefPages.push_back(PrefPage(id, name, category, className, keywordLabels, berry::IConfigurationElement::Pointer(*prefPagesIt)));
       }
 
     }
   }
 
   ///
   /// Saves all treewidgetitems in a map, the key is the id of the preferencepage.
   ///
   QList<PrefPage> m_PrefPages;
   int m_CurrentPage;
 
 };
 
 QmitkPreferencesDialog::QmitkPreferencesDialog(QWidget * parent, Qt::WindowFlags f)
   : QDialog(parent, f), d(new QmitkPreferencesDialogPrivate)
 {
   d->setupUi(this);
 
   QObject::connect(d->m_Keyword, SIGNAL(editingFinished()), this, SLOT(OnKeywordEditingFinished()));
   QObject::connect(d->m_Keyword, SIGNAL(textChanged(QString)), this, SLOT(OnKeywordTextChanged(QString)));
 
   QObject::connect(d->m_PreferencesTree, SIGNAL(itemSelectionChanged()), this, SLOT(OnPreferencesTreeItemSelectionChanged()));
 
   QObject::connect(this, SIGNAL(accepted()), this, SLOT(OnDialogAccepted()));
   QObject::connect(this, SIGNAL(rejected()), this, SLOT(OnDialogRejected()));
 
   this->UpdateTree();
 }
 
 QmitkPreferencesDialog::~QmitkPreferencesDialog()
 {
 }
 
 void QmitkPreferencesDialog::SetSelectedPage(const QString& id)
 {
   for(QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin(); it != d->m_PrefPages.end(); ++it)
   {
     if(it->id == id)
     {
       d->m_PreferencesTree->setCurrentItem(it->treeWidgetItem);
       break;
     }
   }
 }
 
 void QmitkPreferencesDialog::SavePreferences()
 {
   berry::IQtPreferencePage* prefPage = nullptr;
 
   for(QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin(); it != d->m_PrefPages.end(); ++it)
   {
     prefPage = it->prefPage;
     if(prefPage) {
       prefPage->PerformOk();
     }
   }
 
   /**
    * Every preference page has its own preferences, which should stay the same after a system restart. <br>
    * Therefore this method flushes all the preferences, every time a change in the preferences is <br>
    * performed and confirmed.
    *
    */
   mitk::CoreServices::GetPreferencesService()->GetSystemPreferences()->Flush();
 }
 
 void QmitkPreferencesDialog::OnDialogAccepted()
 {
   this->SavePreferences();
 }
 
 void QmitkPreferencesDialog::OnDialogRejected()
 {
   berry::IQtPreferencePage* prefPage = d->m_PrefPages[d->m_CurrentPage].prefPage;
   if(prefPage)
     prefPage->PerformCancel();
 }
 
 void QmitkPreferencesDialog::OnKeywordTextChanged(const QString &  /*s*/)
 {
   // search for text
   this->UpdateTree();
 }
 
 void QmitkPreferencesDialog::OnKeywordEditingFinished()
 {
 }
 
 void QmitkPreferencesDialog::OnPreferencesTreeItemSelectionChanged()
 {
   if(d->m_PreferencesTree == nullptr)
     return;
 
   // TODO: create page and show it
   QList<QTreeWidgetItem *> selectedItems = d->m_PreferencesTree->selectedItems();
   if(selectedItems.size()>0)
   {
 
     d->m_CurrentPage = 0;
     berry::IWorkbench* workbench = berry::PlatformUI::GetWorkbench();
     for(QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin(); it != d->m_PrefPages.end(); ++it, ++d->m_CurrentPage)
     {
       if(it->treeWidgetItem == selectedItems.at(0))
       {
         d->m_Headline->setText(it->name);
         if(it->prefPage == nullptr)
         {
           berry::IPreferencePage* page = it->confElem->CreateExecutableExtension<berry::IPreferencePage>("class");
           it->prefPage = dynamic_cast<berry::IQtPreferencePage*>(page);
           it->prefPage->Init(berry::IWorkbench::Pointer(workbench));
           it->prefPage->CreateQtControl(d->m_PreferencesPanel);
           d->m_PreferencesPanel->addWidget(it->prefPage->GetQtControl());
         }
         d->m_PreferencesPanel->setCurrentWidget(it->prefPage->GetQtControl());
 
         break;
       }
     }
   }
 }
 
 void QmitkPreferencesDialog::UpdateTree()
 {
   if(d->m_PreferencesTree == nullptr)
     return;
 
   d->m_PreferencesTree->sortByColumn(0, Qt::AscendingOrder);
 
   //m_PreferencesTree->clear();
   QString keyword = d->m_Keyword->text().toLower();
 
   map<QString, QTreeWidgetItem*> items;
   std::list< QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator > deferredItems;
 
   for (QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin();
        it != d->m_PrefPages.end(); ++it)
   {
     if (it->treeWidgetItem == nullptr)
     {
       if (it->category.isEmpty())
       {
         it->treeWidgetItem = new QTreeWidgetItem(d->m_PreferencesTree);
         it->treeWidgetItem->setText(0, it->name);
         items[it->id] = it->treeWidgetItem;
       }
       else
       {
         // the parent might not be created yet
         deferredItems.push_back(it);
       }
     }
   }
 
   // deal with deferred items. We do not know how many levels
   // of parents need to be created
   auto currentItem = deferredItems.begin();
 
   while (currentItem != deferredItems.end())
   {
     auto currentItemContent = *currentItem;
     if (items[currentItemContent->category] != nullptr)
     {
       currentItemContent->treeWidgetItem = new QTreeWidgetItem(items[currentItemContent->category]);
       currentItemContent->treeWidgetItem->setText(0, currentItemContent->name);
       items[currentItemContent->id] = currentItemContent->treeWidgetItem;
 
       deferredItems.erase(currentItem);
       currentItem = deferredItems.begin();
     }
     else
     {
       ++currentItem;
     }
   }
 
   if (!deferredItems.empty())
   {
     MITK_ERROR << "Unknown preference category. They are added top-level.";
 
     for (const auto &currentItemContent : deferredItems)
     {
       currentItemContent->treeWidgetItem = new QTreeWidgetItem(d->m_PreferencesTree);
       currentItemContent->treeWidgetItem->setText(0, currentItemContent->name);
       items[currentItemContent->id] = currentItemContent->treeWidgetItem;
     }
   }
 
-  //First, set all pages to hidden to avoid prolems
+  //First, set all pages to hidden to avoid problems
   //when iterating over the child page first which contains a specific keyword
   //and sets the parent to visible
   //but after this the parent is searched for the keyword. However, the keyword might not be available
   //so the parent and all of its children will be set to hidden.
   if(!keyword.isEmpty())
   {
     for (QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin();
          it != d->m_PrefPages.end(); ++it)
     {
       it->treeWidgetItem->setHidden(true);
     }
   }
   // we have to iterate over the list a second time, as only
   // now all parents and items are guaranteed to be created
   for (QList<QmitkPreferencesDialogPrivate::PrefPage>::iterator it = d->m_PrefPages.begin();
        it != d->m_PrefPages.end(); ++it)
   {
     // hide treeWidgetItem if keyword not matches
     if(!keyword.isEmpty())
     {
       //Split text of search box into multiple single strings
       vector<string> keywordsAvailable = splitString(keyword.toUtf8().constData());
       bool foundAll = true;
 
       //perform an AND-search
       for(unsigned int i = 0; i < keywordsAvailable.size(); i++)
       {
         if (it->keywords.indexOf(QString::fromStdString(keywordsAvailable[i])) == -1)
         {
           foundAll = false;
           break;
         }
       }
 
       if(foundAll)
       {
         //#make the whole branch visible
         QTreeWidgetItem* treeWidgetParent = it->treeWidgetItem->parent();
         while(treeWidgetParent!=nullptr)
         {
           treeWidgetParent->setHidden(false);
           treeWidgetParent->setExpanded(true);
           treeWidgetParent = treeWidgetParent->parent();
         }
 
         it->treeWidgetItem->setHidden(false);
         QFont f = it->treeWidgetItem->font(0);
         f.setBold(true);
         it->treeWidgetItem->setFont(0, f);
       }
     }
     else
     {
       QFont f = it->treeWidgetItem->font(0);
       f.setBold(false);
       it->treeWidgetItem->setFont(0, f);
       it->treeWidgetItem->setHidden(false);
     }
   }
 
   if(d->m_PrefPages.size()>0)
   {
     if(d->m_PrefPages.front().treeWidgetItem != nullptr)
       d->m_PrefPages.front().treeWidgetItem->setSelected(true);
   }
 
   d->m_PreferencesTree->expandAll();
 }
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.cpp b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.cpp
index 6bb46e064d..9329824efc 100755
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.cpp
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.cpp
@@ -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.
 
 ============================================================================*/
 
 
 #include "QmitkStatusBar.h"
 
 #include <qmainwindow.h>
 #include <qstatusbar.h>
 #include <qapplication.h>
 #include <qdesktopwidget.h>
 
 #include <mitkStatusBar.h>
 
 #include <itkObjectFactory.h>
 
 
 /**
- * Display the text in the statusbar of the applikation
+ * Display the text in the statusbar of the application
  */
 void QmitkStatusBar::DisplayText(const char* t)
 {
   m_StatusBar->showMessage(t);
   // TODO bug #1357
   //qApp->processEvents(); // produces crashes!
 }
 
 /**
- * Display the text in the statusbar of the applikation for ms seconds
+ * Display the text in the statusbar of the application for ms seconds
  */
 void QmitkStatusBar::DisplayText(const char* t, int ms)
 {
   m_StatusBar->showMessage(t, ms);
   // TODO bug #1357
   //qApp->processEvents(); // produces crashes!
 }
 /**
  * Show the grey value text in the statusbar
  */
 void QmitkStatusBar::DisplayGreyValueText(const char* t)
 {
   QString text(t);
   m_GreyValueLabel->setText(text);
 }
 /**
  * Clear the text in the StatusBar
  */
 void QmitkStatusBar::Clear()
 {
   if (m_StatusBar != nullptr)
     m_StatusBar->clearMessage();
   // TODO bug #1357
   //qApp->processEvents(); // produces crashes!
 }
 
 /**
  * enable or disable the QSizeGrip
  */
 void QmitkStatusBar::SetSizeGripEnabled(bool enable)
 {
   if (m_StatusBar != nullptr)
     m_StatusBar->setSizeGripEnabled(enable);
 }
 
 
 QmitkStatusBar::QmitkStatusBar(QStatusBar* instance)
 :StatusBarImplementation()
 {
     m_StatusBar = instance;
     m_GreyValueLabel = new QLabel(m_StatusBar,nullptr);
     int xResolution = QApplication::desktop()->screenGeometry(0).width()-100;
     m_GreyValueLabel->setMaximumSize(QSize(xResolution,50));
     m_GreyValueLabel->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Fixed);
     m_StatusBar->addPermanentWidget(m_GreyValueLabel);
     mitk::StatusBar::SetImplementation(this);
 }
 
 QmitkStatusBar::~QmitkStatusBar()
 {
 }
 
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
index 7510911680..88e822a78f 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);
 
     //##Documentation
     //##@brief Constructor;
-    //## holds param instance internaly and connects this to the mitkStatusBar
+    //## holds param instance internally 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
diff --git a/Plugins/org.mitk.gui.qt.basicimageprocessing/documentation/UserManual/QmitkBasicImageProcessing.dox b/Plugins/org.mitk.gui.qt.basicimageprocessing/documentation/UserManual/QmitkBasicImageProcessing.dox
index 8a06e1fe2a..9a4c6c5a97 100644
--- a/Plugins/org.mitk.gui.qt.basicimageprocessing/documentation/UserManual/QmitkBasicImageProcessing.dox
+++ b/Plugins/org.mitk.gui.qt.basicimageprocessing/documentation/UserManual/QmitkBasicImageProcessing.dox
@@ -1,126 +1,126 @@
 /**
 \page org_mitk_views_basicimageprocessing The Basic Image Processing
 
 \imageMacro{QmitkBasicImageProcessing_ImageProcessing_48.png,"Icon of the Basic Image Processing Plugin",2.00}
 
 \tableofcontents
 
 \section QmitkBasicImageProcessingUserManualSummary Summary
 
 This view provides an easy interface to fundamental image preprocessing and enhancement filters.
 It offers filter operations on 3D and 4D images in the areas of noise suppression, morphological operations, edge detection and image arithmetics,
 as well as image inversion and downsampling.
 
 Please see \ref QmitkBasicImageProcessingUserManualOverview for more detailed information on usage and supported filters.
 If you encounter problems using the view, please have a look at the \ref QmitkBasicImageProcessingUserManualTrouble page.
 
 \section QmitkBasicImageProcessingUserManualOverview Overview
 
 This view provides an easy interface to fundamental image preprocessing and image enhancement filters.
 It offers a variety of filter operations in the areas of noise suppression, morphological operations, edge detection and image arithmetics.
 Currently the view can be used with all 3D and 4D image types loadable by MITK.
 2D image support will be added in the future.
 All filters are encapsulated from the Insight Segmentation and Registration Toolkit (ITK, www.itk.org).
 
 \imageMacro{QmitkBasicImageProcessing_BIP_Overview.png,"MITK with the Basic Image Processing view",16.00}
 
 This document will tell you how to use this view, but it is assumed that you already know how to use MITK in general.
 
 \section QmitkBasicImageProcessingUserManualFilters Filters
 
 This section will not describe the fundamental functioning of the single filters in detail, though.
 If you want to know more about a single filter, please have a look at https://itk.org/Doxygen/html/index.html
 or in any good digital image processing book. For total denoising filter, please see Tony F. Chan et al., "The digital TV filter and nonlinear denoising".
 
 Available filters are:
 
 <H2>\a Single image operations</H2>
 
 <ul>
 <li><b>Noise Suppression</b></li>
   <ul>
   <li> Gaussian Denoising</li>
   <li> Median Filtering</li>
   <li> Total Variation Denoising</li>
   </ul>
 
 <li><b>Morphological Operations</b></li>
   <ul>
   <li> Dilation</li>
   <li> Erosion</li>
   <li> Opening</li>
   <li> Closing</li>
   </ul>
 
 <li><b>%Edge Detection</b></li>
   <ul>
   <li> Gradient Image</li>
   <li> Laplacian Operator (Second Derivative)</li>
   <li> Sobel Operator</li>
   </ul>
 
 <li><b>Misc</b></li>
   <ul>
   <li> Threshold </li>
   <li> Image Inversion</li>
   <li> Downsampling (isotropic)</li>
   </ul>
 </ul>
 
 <H2>\a Dual image operations</H2>
 
 <ul>
 <li><b>Image Arithmetics</b></li>
   <ul>
   <li> Add two images</li>
   <li> Subtract two images</li>
   <li> Multiply two images</li>
   <li> Divide two images</li>
   </ul>
 
   <li><b>Binary Operations</b></li>
   <ul>
   <li> Logical AND</li>
   <li> Logical OR</li>
   <li> Logical XOR</li>
   </ul>
 </ul>
 
 \section QmitkBasicImageProcessingUserManualUsage Usage
 
 All you have to do to use a filter is to:
 <ul>
 <li> Load an image into MITK</li>
 <li> Select it in data manager
 <li> Select which filter you want to use via the drop down list</li>
 <li> Press the execute button</li>
 </ul>
-A busy cursor appeares; when it vanishes, the operation is completed. Your filtered image is displayed and selected for further processing.
+A busy cursor appears; when it vanishes, the operation is completed. Your filtered image is displayed and selected for further processing.
 (If the  checkbox "Hide original image" is not selected, you will maybe not see the filter result imideately,
 because your filtered image is possibly hidden by the original.)
 
 For two image operations, please make sure that the correct second image is selected in the drop down menu, and the image order is correct.
 For sure, image order only plays a role for image subtraction and division. These are conducted (Image1 - Image2) or (Image1 / Image2), respectively.
 
 Please Note: When you select a 4D image, you can select the time step for the filter to work on via the time slider at the top of the GUI.
 The 3D image at this time step is extracted and processed. The result will also be a 3D image.
 This means, a true 4D filtering is not yet supported.
 
 \section QmitkBasicImageProcessingUserManualTrouble Troubleshooting
 
 <B>I get an error when using a filter on a 2D image.</B><BR>
 2D images are not yet supported...
 
 <B>I use a filter on a 4D image, and the output is 3D.</B><BR>
 When you select a 4D image, you can select the time step for the filter to work on via the time slider at the top of the GUI.
 The 3D image at this time step is extracted and processed. The result will also be a 3D image.
 This means, a true 4D filtering is not supported by now.
 
 <B>A filter crashes during execution.</B><BR>
 Maybe your image is too large. Some filter operations, like derivatives, take a lot of memory.
 Try downsampling your image first.
 
 <B>All other problems.</B><BR>
 Please report to the MITK mailing list.
 See https://www.mitk.org/wiki/MITK_Mailinglist on how to do this.
 */
diff --git a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.cpp b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.cpp
index 69d285a9db..ccdc2e081b 100644
--- a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.cpp
+++ b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.cpp
@@ -1,1342 +1,1342 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkBasicImageProcessingView.h"
 
 // QT includes (GUI)
 #include <qlabel.h>
 #include <qspinbox.h>
 #include <qpushbutton.h>
 #include <qcheckbox.h>
 #include <qgroupbox.h>
 #include <qradiobutton.h>
 #include <qmessagebox.h>
 
 // MITK includes (general)
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateDimension.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkVectorImageMapper2D.h>
 #include <mitkProperties.h>
 #include <mitkLevelWindowProperty.h>
 #include <mitkImageStatisticsHolder.h>
 #include <mitkTimeNavigationController.h>
 
 // Includes for image casting between ITK and MITK
 #include <mitkImageCast.h>
 #include <mitkITKImageImport.h>
 
 // ITK includes (general)
 #include <itkVectorImage.h>
 #include <itkImageFileWriter.h>
 
 // Morphological Operations
 #include <itkBinaryBallStructuringElement.h>
 #include <itkGrayscaleDilateImageFilter.h>
 #include <itkGrayscaleErodeImageFilter.h>
 #include <itkGrayscaleMorphologicalOpeningImageFilter.h>
 #include <itkGrayscaleMorphologicalClosingImageFilter.h>
 
 // Smoothing
 #include <itkMedianImageFilter.h>
 #include <itkDiscreteGaussianImageFilter.h>
 #include <itkTotalVariationDenoisingImageFilter.h>
 
 // Threshold
 #include <itkBinaryThresholdImageFilter.h>
 
 // Inversion
 #include <itkInvertIntensityImageFilter.h>
 
 // Derivatives
 #include <itkGradientMagnitudeRecursiveGaussianImageFilter.h>
 #include <itkLaplacianImageFilter.h>
 #include <itkSobelEdgeDetectionImageFilter.h>
 
 // Resampling
 #include <itkResampleImageFilter.h>
 #include <itkNearestNeighborInterpolateImageFunction.h>
 #include <itkBSplineInterpolateImageFunction.h>
 #include <itkCastImageFilter.h>
 #include <itkLinearInterpolateImageFunction.h>
 
 // Image Arithmetics
 #include <itkAddImageFilter.h>
 #include <itkSubtractImageFilter.h>
 #include <itkMultiplyImageFilter.h>
 #include <itkDivideImageFilter.h>
 
 // Boolean operations
 #include <itkOrImageFilter.h>
 #include <itkAndImageFilter.h>
 #include <itkXorImageFilter.h>
 
 // Flip Image
 #include <itkFlipImageFilter.h>
 
 #include <itkRescaleIntensityImageFilter.h>
 #include <itkShiftScaleImageFilter.h>
 
 // Convenient Definitions
 typedef itk::Image<short, 3>                                                            ImageType;
 typedef itk::Image<unsigned char, 3>                                                    SegmentationImageType;
 typedef itk::Image<double, 3>                                                           DoubleImageType;
 typedef itk::Image<itk::Vector<float,3>, 3>                                             VectorImageType;
 
 typedef itk::BinaryBallStructuringElement<ImageType::PixelType, 3>                      BallType;
 typedef itk::GrayscaleDilateImageFilter<ImageType, ImageType, BallType>                 DilationFilterType;
 typedef itk::GrayscaleErodeImageFilter<ImageType, ImageType, BallType>                  ErosionFilterType;
 typedef itk::GrayscaleMorphologicalOpeningImageFilter<ImageType, ImageType, BallType>   OpeningFilterType;
 typedef itk::GrayscaleMorphologicalClosingImageFilter<ImageType, ImageType, BallType>   ClosingFilterType;
 
 typedef itk::MedianImageFilter< ImageType, ImageType >                                  MedianFilterType;
 typedef itk::DiscreteGaussianImageFilter< ImageType, ImageType>                         GaussianFilterType;
 typedef itk::TotalVariationDenoisingImageFilter<DoubleImageType, DoubleImageType>       TotalVariationFilterType;
 typedef itk::TotalVariationDenoisingImageFilter<VectorImageType, VectorImageType>       VectorTotalVariationFilterType;
 
 typedef itk::BinaryThresholdImageFilter< ImageType, ImageType >                         ThresholdFilterType;
 typedef itk::InvertIntensityImageFilter< ImageType, ImageType >                         InversionFilterType;
 
 typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< ImageType, ImageType >      GradientFilterType;
 typedef itk::LaplacianImageFilter< DoubleImageType, DoubleImageType >                   LaplacianFilterType;
 typedef itk::SobelEdgeDetectionImageFilter< DoubleImageType, DoubleImageType >          SobelFilterType;
 
 typedef itk::ResampleImageFilter< ImageType, ImageType >                                ResampleImageFilterType;
 typedef itk::ResampleImageFilter< ImageType, ImageType >                                ResampleImageFilterType2;
 typedef itk::CastImageFilter< ImageType, DoubleImageType >                              ImagePTypeToFloatPTypeCasterType;
 
 typedef itk::AddImageFilter< ImageType, ImageType, ImageType >                          AddFilterType;
 typedef itk::SubtractImageFilter< ImageType, ImageType, ImageType >                     SubtractFilterType;
 typedef itk::MultiplyImageFilter< ImageType, ImageType, ImageType >                     MultiplyFilterType;
 typedef itk::DivideImageFilter< ImageType, ImageType, DoubleImageType >                 DivideFilterType;
 
 typedef itk::OrImageFilter< ImageType, ImageType >                                      OrImageFilterType;
 typedef itk::AndImageFilter< ImageType, ImageType >                                     AndImageFilterType;
 typedef itk::XorImageFilter< ImageType, ImageType >                                     XorImageFilterType;
 
 typedef itk::FlipImageFilter< ImageType >                                               FlipImageFilterType;
 
 typedef itk::LinearInterpolateImageFunction< ImageType, double >                        LinearInterpolatorType;
 typedef itk::NearestNeighborInterpolateImageFunction< ImageType, double >               NearestInterpolatorType;
 
 const std::string QmitkBasicImageProcessing::VIEW_ID = "org.mitk.views.basicimageprocessing";
 
 QmitkBasicImageProcessing::QmitkBasicImageProcessing()
   : QmitkAbstractView()
   , m_Controls(new Ui::QmitkBasicImageProcessingViewControls)
   , m_TimeStepperAdapter(nullptr)
 {
   auto isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
   auto isNotHelperObject = mitk::NodePredicateNot::New(
     mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)));
   auto dimensionPredicate = mitk::NodePredicateOr::New(
     mitk::NodePredicateDimension::New(3), mitk::NodePredicateDimension::New(4));
 
   m_IsImagePredicate = mitk::NodePredicateAnd::New(
     isImage, isNotHelperObject, dimensionPredicate);
 }
 
 QmitkBasicImageProcessing::~QmitkBasicImageProcessing()
 {
 
 }
 
 void QmitkBasicImageProcessing::CreateQtPartControl(QWidget *parent)
 {
   m_Controls->setupUi(parent);
 
   m_Controls->selectedImageWidget->SetDataStorage(this->GetDataStorage());
   m_Controls->selectedImageWidget->SetNodePredicate(m_IsImagePredicate);
   m_Controls->selectedImageWidget->SetSelectionIsOptional(true);
   m_Controls->selectedImageWidget->SetAutoSelectNewNodes(true);
   m_Controls->selectedImageWidget->SetEmptyInfo(QString("Please select a 3D / 4D image"));
   m_Controls->selectedImageWidget->SetPopUpTitel(QString("Select an image"));
 
   m_Controls->selectedImageWidget_2->SetDataStorage(this->GetDataStorage());
   m_Controls->selectedImageWidget_2->SetNodePredicate(m_IsImagePredicate);
   m_Controls->selectedImageWidget_2->SetSelectionIsOptional(true);
   m_Controls->selectedImageWidget_2->SetAutoSelectNewNodes(true);
   m_Controls->selectedImageWidget_2->SetEmptyInfo(QString("Please select a 3D / 4D image"));
   m_Controls->selectedImageWidget_2->SetPopUpTitel(QString("Select an image"));
 
   m_Controls->gbTwoImageOps->hide();
 
   m_Controls->cbWhat1->clear();
   m_Controls->cbWhat1->insertItem(NOACTIONSELECTED, "Please select an operation");
   m_Controls->cbWhat1->insertItem(CATEGORY_DENOISING, "--- Denoising ---");
   m_Controls->cbWhat1->insertItem(GAUSSIAN, "Gaussian");
   m_Controls->cbWhat1->insertItem(MEDIAN, "Median");
   m_Controls->cbWhat1->insertItem(TOTALVARIATION, "Total Variation");
   m_Controls->cbWhat1->insertItem(CATEGORY_MORPHOLOGICAL, "--- Morphological ---");
   m_Controls->cbWhat1->insertItem(DILATION, "Dilation");
   m_Controls->cbWhat1->insertItem(EROSION, "Erosion");
   m_Controls->cbWhat1->insertItem(OPENING, "Opening");
   m_Controls->cbWhat1->insertItem(CLOSING, "Closing");
   m_Controls->cbWhat1->insertItem(CATEGORY_EDGE_DETECTION, "--- Edge Detection ---");
   m_Controls->cbWhat1->insertItem(GRADIENT, "Gradient");
   m_Controls->cbWhat1->insertItem(LAPLACIAN, "Laplacian (2nd Derivative)");
   m_Controls->cbWhat1->insertItem(SOBEL, "Sobel Operator");
   m_Controls->cbWhat1->insertItem(CATEGORY_MISC, "--- Misc ---");
   m_Controls->cbWhat1->insertItem(THRESHOLD, "Threshold");
   m_Controls->cbWhat1->insertItem(INVERSION, "Image Inversion");
   m_Controls->cbWhat1->insertItem(DOWNSAMPLING, "Downsampling");
   m_Controls->cbWhat1->insertItem(FLIPPING, "Flipping");
   m_Controls->cbWhat1->insertItem(RESAMPLING, "Resample to");
   m_Controls->cbWhat1->insertItem(RESCALE, "Rescale values to interval");
   m_Controls->cbWhat1->insertItem(RESCALE2, "Rescale values by scalar");
 
   m_Controls->cbWhat2->clear();
   m_Controls->cbWhat2->insertItem(TWOIMAGESNOACTIONSELECTED, "Please select an operation");
   m_Controls->cbWhat2->insertItem(CATEGORY_ARITHMETIC, "--- Arithmetric operations ---");
   m_Controls->cbWhat2->insertItem(ADD, "Add to Image 1:");
   m_Controls->cbWhat2->insertItem(SUBTRACT, "Subtract from Image 1:");
   m_Controls->cbWhat2->insertItem(MULTIPLY, "Multiply with Image 1:");
   m_Controls->cbWhat2->insertItem(RESAMPLE_TO, "Resample Image 1 to fit geometry:");
   m_Controls->cbWhat2->insertItem(DIVIDE, "Divide Image 1 by:");
   m_Controls->cbWhat2->insertItem(CATEGORY_BOOLEAN, "--- Boolean operations ---");
   m_Controls->cbWhat2->insertItem(AND, "AND");
   m_Controls->cbWhat2->insertItem(OR, "OR");
   m_Controls->cbWhat2->insertItem(XOR, "XOR");
 
   m_Controls->cbParam4->clear();
   m_Controls->cbParam4->insertItem(LINEAR, "Linear");
   m_Controls->cbParam4->insertItem(NEAREST, "Nearest neighbor");
 
   m_Controls->dsbParam1->hide();
   m_Controls->dsbParam2->hide();
   m_Controls->dsbParam3->hide();
   m_Controls->tlParam3->hide();
   m_Controls->tlParam4->hide();
   m_Controls->cbParam4->hide();
 
   this->CreateConnections();
 }
 
 void QmitkBasicImageProcessing::CreateConnections()
 {
   connect(m_Controls->cbWhat1, QOverload<int>::of(&QComboBox::activated), this, &QmitkBasicImageProcessing::SelectAction);
   connect(m_Controls->btnDoIt, &QPushButton::clicked, this, &QmitkBasicImageProcessing::StartButtonClicked);
   connect(m_Controls->cbWhat2, QOverload<int>::of(&QComboBox::activated), this, &QmitkBasicImageProcessing::SelectAction2);
   connect(m_Controls->btnDoIt2, &QPushButton::clicked, this, &QmitkBasicImageProcessing::StartButton2Clicked);
   connect(m_Controls->rBOneImOp, &QRadioButton::clicked, this, &QmitkBasicImageProcessing::ChangeGUI);
   connect(m_Controls->rBTwoImOp, &QRadioButton::clicked, this, &QmitkBasicImageProcessing::ChangeGUI);
   connect(m_Controls->cbParam4, QOverload<int>::of(&QComboBox::activated), this, &QmitkBasicImageProcessing::SelectInterpolator);
   connect(m_Controls->selectedImageWidget, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkBasicImageProcessing::OnCurrentSelectionChanged);
   connect(m_Controls->selectedImageWidget_2, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkBasicImageProcessing::OnCurrentSelectionChanged);
 }
 
 void QmitkBasicImageProcessing::InternalGetTimeNavigationController()
 {
   auto* timeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
   if (nullptr != timeNavigationController)
   {
     m_TimeStepperAdapter = new QmitkStepperAdapter(m_Controls->timeSliceNavigationWidget, timeNavigationController->GetStepper());
   }
 }
 
 void QmitkBasicImageProcessing::SetFocus()
 {
   m_Controls->rBOneImOp->setFocus();
 }
 
 void QmitkBasicImageProcessing::OnCurrentSelectionChanged(const QList<mitk::DataNode::Pointer>& nodes)
 {
   if (nodes.empty() || nodes.front().IsNull())
   {
     m_Controls->timeSliceNavigationWidget->setEnabled(false);
     m_Controls->tlTime->setEnabled(false);
     m_Controls->tlWhat1->setEnabled(false);
     m_Controls->cbWhat1->setEnabled(false);
     m_Controls->tlWhat2->setEnabled(false);
     m_Controls->cbWhat2->setEnabled(false);
     return;
   }
 
   auto selectedImage = dynamic_cast<mitk::Image*>(nodes.front()->GetData());
   if (nullptr == selectedImage)
   {
     return;
   }
 
   if (selectedImage->GetDimension() > 3)
   {
     // try to retrieve the TNC (for 4-D Processing )
     this->InternalGetTimeNavigationController();
 
     m_Controls->timeSliceNavigationWidget->setEnabled(true);
     m_Controls->tlTime->setEnabled(true);
   }
 
   m_Controls->tlWhat1->setEnabled(true);
   m_Controls->cbWhat1->setEnabled(true);
   m_Controls->tlWhat2->setEnabled(true);
   m_Controls->cbWhat2->setEnabled(true);
 }
 
 void QmitkBasicImageProcessing::ChangeGUI()
 {
   if(m_Controls->rBOneImOp->isChecked())
   {
     m_Controls->gbTwoImageOps->hide();
     m_Controls->gbOneImageOps->show();
   }
   else if(m_Controls->rBTwoImOp->isChecked())
   {
     m_Controls->gbOneImageOps->hide();
     m_Controls->gbTwoImageOps->show();
   }
 }
 
 void QmitkBasicImageProcessing::ResetParameterPanel()
 {
   m_Controls->tlParam->setEnabled(false);
   m_Controls->tlParam1->setEnabled(false);
   m_Controls->tlParam2->setEnabled(false);
   m_Controls->tlParam3->setEnabled(false);
   m_Controls->tlParam4->setEnabled(false);
 
   m_Controls->sbParam1->setEnabled(false);
   m_Controls->sbParam2->setEnabled(false);
   m_Controls->dsbParam1->setEnabled(false);
   m_Controls->dsbParam2->setEnabled(false);
   m_Controls->dsbParam3->setEnabled(false);
   m_Controls->cbParam4->setEnabled(false);
   m_Controls->sbParam1->setValue(0);
   m_Controls->sbParam2->setValue(0);
   m_Controls->dsbParam1->setValue(0);
   m_Controls->dsbParam2->setValue(0);
   m_Controls->dsbParam3->setValue(0);
 
   m_Controls->sbParam1->show();
   m_Controls->sbParam2->show();
   m_Controls->dsbParam1->hide();
   m_Controls->dsbParam2->hide();
   m_Controls->dsbParam3->hide();
   m_Controls->cbParam4->hide();
   m_Controls->tlParam3->hide();
   m_Controls->tlParam4->hide();
 }
 
 void QmitkBasicImageProcessing::SelectAction(int action)
 {
   auto selectedImage = m_Controls->selectedImageWidget->GetSelectedNode();
   if (selectedImage.IsNull())
   {
     return;
   }
 
   // Prepare GUI
   this->ResetParameterPanel();
   m_Controls->btnDoIt->setEnabled(false);
   m_Controls->cbHideOrig->setEnabled(false);
 
   QString text1 = tr("No Parameters");
   QString text2 = text1;
   QString text3 = text1;
   QString text4 = text1;
 
   if (action != 19)
   {
     m_Controls->dsbParam1->hide();
     m_Controls->dsbParam2->hide();
     m_Controls->dsbParam3->hide();
     m_Controls->tlParam1->show();
     m_Controls->tlParam2->show();
     m_Controls->tlParam3->hide();
     m_Controls->tlParam4->hide();
     m_Controls->sbParam1->show();
     m_Controls->sbParam2->show();
     m_Controls->cbParam4->hide();
   }
 
   switch (action)
   {
   case 2:
     {
       m_SelectedAction = GAUSSIAN;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->hide();
       m_Controls->dsbParam1->show();
       m_Controls->dsbParam1->setEnabled(true);
       text1 = tr("&Variance:");
       m_Controls->tlParam2->hide();
       m_Controls->sbParam2->hide();
 
       m_Controls->dsbParam1->setMinimum( 0 );
       m_Controls->dsbParam1->setMaximum( 200 );
       m_Controls->dsbParam1->setValue( 2 );
       break;
     }
   case 3:
     {
       m_SelectedAction = MEDIAN;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("&Radius:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 200 );
       m_Controls->sbParam1->setValue( 3 );
       break;
     }
   case 4:
     {
       m_SelectedAction = TOTALVARIATION;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       m_Controls->tlParam2->setEnabled(true);
       m_Controls->sbParam2->setEnabled(true);
       text1 = tr("Number Iterations:");
       text2 = tr("Regularization\n(Lambda/1000):");
       m_Controls->sbParam1->setMinimum( 1 );
       m_Controls->sbParam1->setMaximum( 1000 );
       m_Controls->sbParam1->setValue( 40 );
       m_Controls->sbParam2->setMinimum( 0 );
       m_Controls->sbParam2->setMaximum( 100000 );
       m_Controls->sbParam2->setValue( 1 );
       break;
     }
   case 6:
     {
       m_SelectedAction = DILATION;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("&Radius:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 200 );
       m_Controls->sbParam1->setValue( 3 );
       break;
     }
   case 7:
     {
       m_SelectedAction = EROSION;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("&Radius:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 200 );
       m_Controls->sbParam1->setValue( 3 );
       break;
     }
   case 8:
     {
       m_SelectedAction = OPENING;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("&Radius:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 200 );
       m_Controls->sbParam1->setValue( 3 );
       break;
     }
   case 9:
     {
       m_SelectedAction = CLOSING;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("&Radius:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 200 );
       m_Controls->sbParam1->setValue( 3 );
       break;
     }
   case 11:
     {
       m_SelectedAction = GRADIENT;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->hide();
       m_Controls->dsbParam1->show();
       m_Controls->dsbParam1->setEnabled(true);
       text1 = tr("Sigma of Gaussian Kernel:\n(in Image Spacing Units)");
       m_Controls->tlParam2->hide();
       m_Controls->sbParam2->hide();
 
       m_Controls->dsbParam1->setMinimum( 0 );
       m_Controls->dsbParam1->setMaximum( 200 );
       m_Controls->dsbParam1->setValue( 2 );
       break;
     }
   case 12:
     {
       m_SelectedAction = LAPLACIAN;
       break;
     }
   case 13:
     {
       m_SelectedAction = SOBEL;
       break;
     }
   case 15:
     {
       m_SelectedAction = THRESHOLD;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       m_Controls->tlParam2->setEnabled(true);
       m_Controls->sbParam2->setEnabled(true);
       text1 = tr("Lower threshold:");
       text2 = tr("Upper threshold:");
       m_Controls->sbParam1->setMinimum( -100000 );
       m_Controls->sbParam1->setMaximum( 100000 );
       m_Controls->sbParam1->setValue( 0 );
       m_Controls->sbParam2->setMinimum( -100000 );
       m_Controls->sbParam2->setMaximum( 100000 );
       m_Controls->sbParam2->setValue( 300 );
       break;
     }
   case 16:
     {
       m_SelectedAction = INVERSION;
       break;
     }
   case 17:
     {
       m_SelectedAction = DOWNSAMPLING;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("Downsampling by Factor:");
       m_Controls->sbParam1->setMinimum( 1 );
       m_Controls->sbParam1->setMaximum( 100 );
       m_Controls->sbParam1->setValue( 2 );
       break;
     }
   case 18:
     {
       m_SelectedAction = FLIPPING;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(true);
       text1 = tr("Flip across axis:");
       m_Controls->sbParam1->setMinimum( 0 );
       m_Controls->sbParam1->setMaximum( 2 );
       m_Controls->sbParam1->setValue( 1 );
       break;
     }
   case 19:
     {
       m_SelectedAction = RESAMPLING;
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->sbParam1->setEnabled(false);
       m_Controls->sbParam1->hide();
       m_Controls->dsbParam1->show();
       m_Controls->dsbParam1->setEnabled(true);
       m_Controls->tlParam2->setEnabled(true);
       m_Controls->sbParam2->setEnabled(false);
       m_Controls->sbParam2->hide();
       m_Controls->dsbParam2->show();
       m_Controls->dsbParam2->setEnabled(true);
       m_Controls->tlParam3->show();
       m_Controls->tlParam3->setEnabled(true);
       m_Controls->dsbParam3->show();
       m_Controls->dsbParam3->setEnabled(true);
       m_Controls->tlParam4->show();
       m_Controls->tlParam4->setEnabled(true);
       m_Controls->cbParam4->show();
       m_Controls->cbParam4->setEnabled(true);
 
       m_Controls->dsbParam1->setMinimum(0.01);
       m_Controls->dsbParam1->setMaximum(10.0);
       m_Controls->dsbParam1->setSingleStep(0.1);
       m_Controls->dsbParam1->setValue(0.3);
       m_Controls->dsbParam2->setMinimum(0.01);
       m_Controls->dsbParam2->setMaximum(10.0);
       m_Controls->dsbParam2->setSingleStep(0.1);
       m_Controls->dsbParam2->setValue(0.3);
       m_Controls->dsbParam3->setMinimum(0.01);
       m_Controls->dsbParam3->setMaximum(10.0);
       m_Controls->dsbParam3->setSingleStep(0.1);
       m_Controls->dsbParam3->setValue(1.5);
 
       text1 = tr("x-spacing:");
       text2 = tr("y-spacing:");
       text3 = tr("z-spacing:");
       text4 = tr("Interplation:");
       break;
     }
   case 20:
     {
       m_SelectedAction = RESCALE;
       m_Controls->dsbParam1->show();
       m_Controls->tlParam1->show();
       m_Controls->dsbParam1->setEnabled(true);
       m_Controls->tlParam1->setEnabled(true);
       m_Controls->dsbParam2->show();
       m_Controls->tlParam2->show();
       m_Controls->dsbParam2->setEnabled(true);
       m_Controls->tlParam2->setEnabled(true);
       text1 = tr("Output minimum:");
       text2 = tr("Output maximum:");
       break;
     }
   case 21:
   {
       m_SelectedAction = RESCALE2;
       m_Controls->dsbParam1->show();
       m_Controls->tlParam1->show();
       m_Controls->dsbParam1->setEnabled(true);
       m_Controls->tlParam1->setEnabled(true);
       text1 = tr("Scaling value:");
       break;
   }
   default:
     return;
   }
 
   m_Controls->tlParam->setEnabled(true);
   m_Controls->tlParam1->setText(text1);
   m_Controls->tlParam2->setText(text2);
   m_Controls->tlParam3->setText(text3);
   m_Controls->tlParam4->setText(text4);
 
   m_Controls->btnDoIt->setEnabled(true);
   m_Controls->cbHideOrig->setEnabled(true);
 }
 
 void QmitkBasicImageProcessing::StartButtonClicked()
 {
   auto selectedNode = m_Controls->selectedImageWidget->GetSelectedNode();
   if (selectedNode.IsNull())
   {
     return;
   }
 
   this->BusyCursorOn();
 
   mitk::Image::Pointer newImage;
   try
   {
     newImage = dynamic_cast<mitk::Image*>(selectedNode->GetData());
   }
   catch ( std::exception &e )
   {
-  QString exceptionString = tr("An error occured during image loading:\n");
+  QString exceptionString = tr("An error occurred during image loading:\n");
   exceptionString.append( e.what() );
     QMessageBox::warning( nullptr, "Basic Image Processing", exceptionString , QMessageBox::Ok, QMessageBox::NoButton );
     this->BusyCursorOff();
     return;
   }
 
   // check if input image is valid, casting does not throw exception when casting from 'nullptr-Object'
   if ( (! newImage) || (newImage->IsInitialized() == false) )
   {
     this->BusyCursorOff();
 
     QMessageBox::warning( nullptr, "Basic Image Processing", tr("Input image is broken or not initialized. Returning."), QMessageBox::Ok, QMessageBox::NoButton );
     return;
   }
 
   // check if operation is done on 4D a image time step
   if(newImage->GetDimension() > 3)
   {
     auto timeSelector = mitk::ImageTimeSelector::New();
     timeSelector->SetInput(newImage);
     timeSelector->SetTimeNr(m_Controls->timeSliceNavigationWidget->GetPos() );
     timeSelector->Update();
     newImage = timeSelector->GetOutput();
   }
 
   // check if image or vector image
   auto itkImage = ImageType::New();
   auto itkVecImage = VectorImageType::New();
 
   int isVectorImage = newImage->GetPixelType().GetNumberOfComponents();
 
   if(isVectorImage > 1)
   {
     CastToItkImage( newImage, itkVecImage );
   }
   else
   {
     CastToItkImage( newImage, itkImage );
   }
 
   std::stringstream nameAddition("");
 
   int param1 = m_Controls->sbParam1->value();
   int param2 = m_Controls->sbParam2->value();
   double dparam1 = m_Controls->dsbParam1->value();
   double dparam2 = m_Controls->dsbParam2->value();
   double dparam3 = m_Controls->dsbParam3->value();
 
   try
   {
   switch (m_SelectedAction)
   {
   case GAUSSIAN:
     {
       GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New();
       gaussianFilter->SetInput( itkImage );
       gaussianFilter->SetVariance( dparam1 );
       gaussianFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(gaussianFilter->GetOutput())->Clone();
       nameAddition << "_Gaussian_var_" << dparam1;
       std::cout << "Gaussian filtering successful." << std::endl;
       break;
     }
   case MEDIAN:
     {
       MedianFilterType::Pointer medianFilter = MedianFilterType::New();
       MedianFilterType::InputSizeType size;
       size.Fill(param1);
       medianFilter->SetRadius( size );
       medianFilter->SetInput(itkImage);
       medianFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(medianFilter->GetOutput())->Clone();
       nameAddition << "_Median_radius_" << param1;
       std::cout << "Median Filtering successful." << std::endl;
       break;
     }
   case TOTALVARIATION:
     {
       if(isVectorImage > 1)
       {
         VectorTotalVariationFilterType::Pointer TVFilter
           = VectorTotalVariationFilterType::New();
         TVFilter->SetInput( itkVecImage.GetPointer() );
         TVFilter->SetNumberIterations(param1);
         TVFilter->SetLambda(double(param2)/1000.);
         TVFilter->UpdateLargestPossibleRegion();
 
         newImage = mitk::ImportItkImage(TVFilter->GetOutput())->Clone();
       }
       else
       {
         ImagePTypeToFloatPTypeCasterType::Pointer floatCaster = ImagePTypeToFloatPTypeCasterType::New();
         floatCaster->SetInput( itkImage );
         floatCaster->Update();
         DoubleImageType::Pointer fImage = floatCaster->GetOutput();
 
         TotalVariationFilterType::Pointer TVFilter
           = TotalVariationFilterType::New();
         TVFilter->SetInput( fImage.GetPointer() );
         TVFilter->SetNumberIterations(param1);
         TVFilter->SetLambda(double(param2)/1000.);
         TVFilter->UpdateLargestPossibleRegion();
 
         newImage = mitk::ImportItkImage(TVFilter->GetOutput())->Clone();
       }
 
       nameAddition << "_TV_Iter_" << param1 << "_L_" << param2;
       std::cout << "Total Variation Filtering successful." << std::endl;
       break;
     }
   case DILATION:
     {
       BallType binaryBall;
       binaryBall.SetRadius( param1 );
       binaryBall.CreateStructuringElement();
 
       DilationFilterType::Pointer dilationFilter = DilationFilterType::New();
       dilationFilter->SetInput( itkImage );
       dilationFilter->SetKernel( binaryBall );
       dilationFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(dilationFilter->GetOutput())->Clone();
       nameAddition << "_Dilated_by_" << param1;
       std::cout << "Dilation successful." << std::endl;
       break;
     }
   case EROSION:
     {
       BallType binaryBall;
       binaryBall.SetRadius( param1 );
       binaryBall.CreateStructuringElement();
 
       ErosionFilterType::Pointer erosionFilter = ErosionFilterType::New();
       erosionFilter->SetInput( itkImage );
       erosionFilter->SetKernel( binaryBall );
       erosionFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(erosionFilter->GetOutput())->Clone();
       nameAddition << "_Eroded_by_" << param1;
       std::cout << "Erosion successful." << std::endl;
       break;
     }
   case OPENING:
     {
       BallType binaryBall;
       binaryBall.SetRadius( param1 );
       binaryBall.CreateStructuringElement();
 
       OpeningFilterType::Pointer openFilter = OpeningFilterType::New();
       openFilter->SetInput( itkImage );
       openFilter->SetKernel( binaryBall );
       openFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(openFilter->GetOutput())->Clone();
       nameAddition << "_Opened_by_" << param1;
       std::cout << "Opening successful." << std::endl;
       break;
     }
   case CLOSING:
     {
       BallType binaryBall;
       binaryBall.SetRadius( param1 );
       binaryBall.CreateStructuringElement();
 
       ClosingFilterType::Pointer closeFilter = ClosingFilterType::New();
       closeFilter->SetInput( itkImage );
       closeFilter->SetKernel( binaryBall );
       closeFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(closeFilter->GetOutput())->Clone();
       nameAddition << "_Closed_by_" << param1;
       std::cout << "Closing successful." << std::endl;
       break;
     }
   case GRADIENT:
     {
       GradientFilterType::Pointer gradientFilter = GradientFilterType::New();
       gradientFilter->SetInput( itkImage );
       gradientFilter->SetSigma( dparam1 );
       gradientFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(gradientFilter->GetOutput())->Clone();
       nameAddition << "_Gradient_sigma_" << dparam1;
       std::cout << "Gradient calculation successful." << std::endl;
       break;
     }
   case LAPLACIAN:
     {
       // the laplace filter requires a float type image as input, we need to cast the itkImage
       // to correct type
       ImagePTypeToFloatPTypeCasterType::Pointer caster = ImagePTypeToFloatPTypeCasterType::New();
       caster->SetInput( itkImage );
       caster->Update();
       DoubleImageType::Pointer fImage = caster->GetOutput();
 
       LaplacianFilterType::Pointer laplacianFilter = LaplacianFilterType::New();
       laplacianFilter->SetInput( fImage );
       laplacianFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(laplacianFilter->GetOutput())->Clone();
       nameAddition << "_Second_Derivative";
       std::cout << "Laplacian filtering successful." << std::endl;
       break;
     }
   case SOBEL:
     {
       // the sobel filter requires a float type image as input, we need to cast the itkImage
       // to correct type
       ImagePTypeToFloatPTypeCasterType::Pointer caster = ImagePTypeToFloatPTypeCasterType::New();
       caster->SetInput( itkImage );
       caster->Update();
       DoubleImageType::Pointer fImage = caster->GetOutput();
 
       SobelFilterType::Pointer sobelFilter = SobelFilterType::New();
       sobelFilter->SetInput( fImage );
       sobelFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(sobelFilter->GetOutput())->Clone();
       nameAddition << "_Sobel";
       std::cout << "Edge Detection successful." << std::endl;
       break;
     }
   case THRESHOLD:
     {
       ThresholdFilterType::Pointer thFilter = ThresholdFilterType::New();
       thFilter->SetLowerThreshold(param1 < param2 ? param1 : param2);
       thFilter->SetUpperThreshold(param2 > param1 ? param2 : param1);
       thFilter->SetInsideValue(1);
       thFilter->SetOutsideValue(0);
       thFilter->SetInput(itkImage);
       thFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(thFilter->GetOutput())->Clone();
       nameAddition << "_Threshold";
       std::cout << "Thresholding successful." << std::endl;
       break;
     }
   case INVERSION:
     {
       InversionFilterType::Pointer invFilter = InversionFilterType::New();
       mitk::ScalarType min = newImage->GetStatistics()->GetScalarValueMin();
       mitk::ScalarType max = newImage->GetStatistics()->GetScalarValueMax();
       invFilter->SetMaximum( max + min );
       invFilter->SetInput(itkImage);
       invFilter->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(invFilter->GetOutput())->Clone();
       nameAddition << "_Inverted";
       std::cout << "Image inversion successful." << std::endl;
       break;
     }
   case DOWNSAMPLING:
     {
       ResampleImageFilterType::Pointer downsampler = ResampleImageFilterType::New();
       downsampler->SetInput( itkImage );
 
       NearestInterpolatorType::Pointer interpolator = NearestInterpolatorType::New();
       downsampler->SetInterpolator( interpolator );
 
       downsampler->SetDefaultPixelValue( 0 );
 
       ResampleImageFilterType::SpacingType spacing = itkImage->GetSpacing();
       spacing *= (double) param1;
       downsampler->SetOutputSpacing( spacing );
 
       downsampler->SetOutputOrigin( itkImage->GetOrigin() );
       downsampler->SetOutputDirection( itkImage->GetDirection() );
 
       ResampleImageFilterType::SizeType size = itkImage->GetLargestPossibleRegion().GetSize();
       for ( int i = 0; i < 3; ++i )
       {
         size[i] /= param1;
       }
       downsampler->SetSize( size );
       downsampler->UpdateLargestPossibleRegion();
 
       newImage = mitk::ImportItkImage(downsampler->GetOutput())->Clone();
       nameAddition << "_Downsampled_by_" << param1;
       std::cout << "Downsampling successful." << std::endl;
       break;
     }
   case FLIPPING:
     {
       FlipImageFilterType::Pointer flipper = FlipImageFilterType::New();
       flipper->SetInput( itkImage );
       itk::FixedArray<bool, 3> flipAxes;
       for(int i=0; i<3; ++i)
       {
         if(i == param1)
         {
           flipAxes[i] = true;
         }
         else
         {
           flipAxes[i] = false;
         }
       }
       flipper->SetFlipAxes(flipAxes);
       flipper->UpdateLargestPossibleRegion();
       newImage = mitk::ImportItkImage(flipper->GetOutput())->Clone();
       std::cout << "Image flipping successful." << std::endl;
       break;
     }
   case RESAMPLING:
     {
       std::string selectedInterpolator;
       ResampleImageFilterType::Pointer resampler = ResampleImageFilterType::New();
       switch (m_SelectedInterpolation)
       {
       case LINEAR:
         {
           LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Linear";
           break;
         }
       case NEAREST:
         {
           NearestInterpolatorType::Pointer interpolator = NearestInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Nearest";
           break;
         }
       default:
         {
           LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Linear";
           break;
         }
       }
       resampler->SetInput( itkImage );
       resampler->SetOutputOrigin( itkImage->GetOrigin() );
 
       ImageType::SizeType input_size = itkImage->GetLargestPossibleRegion().GetSize();
       ImageType::SpacingType input_spacing = itkImage->GetSpacing();
 
       ImageType::SizeType output_size;
       ImageType::SpacingType output_spacing;
 
       output_size[0] = input_size[0] * (input_spacing[0] / dparam1);
       output_size[1] = input_size[1] * (input_spacing[1] / dparam2);
       output_size[2] = input_size[2] * (input_spacing[2] / dparam3);
       output_spacing [0] = dparam1;
       output_spacing [1] = dparam2;
       output_spacing [2] = dparam3;
 
       resampler->SetSize( output_size );
       resampler->SetOutputSpacing( output_spacing );
       resampler->SetOutputDirection( itkImage->GetDirection() );
 
       resampler->UpdateLargestPossibleRegion();
 
       ImageType::Pointer resampledImage = resampler->GetOutput();
 
       newImage = mitk::ImportItkImage( resampledImage )->Clone();
       nameAddition << "_Resampled_" << selectedInterpolator;
       std::cout << "Resampling successful." << std::endl;
       break;
     }
   case RESCALE:
     {
       DoubleImageType::Pointer floatImage = DoubleImageType::New();
       CastToItkImage( newImage, floatImage );
       itk::RescaleIntensityImageFilter<DoubleImageType,DoubleImageType>::Pointer filter = itk::RescaleIntensityImageFilter<DoubleImageType,DoubleImageType>::New();
       filter->SetInput(0, floatImage);
       filter->SetOutputMinimum(dparam1);
       filter->SetOutputMaximum(dparam2);
       filter->Update();
       floatImage = filter->GetOutput();
 
       newImage = mitk::Image::New();
       newImage->InitializeByItk(floatImage.GetPointer());
       newImage->SetVolume(floatImage->GetBufferPointer());
       nameAddition << "_Rescaled";
       std::cout << "Rescaling successful." << std::endl;
 
       break;
     }
   case RESCALE2:
   {
       DoubleImageType::Pointer floatImage = DoubleImageType::New();
       CastToItkImage( newImage, floatImage );
       itk::ShiftScaleImageFilter<DoubleImageType,DoubleImageType>::Pointer filter = itk::ShiftScaleImageFilter<DoubleImageType,DoubleImageType>::New();
       filter->SetInput(0, floatImage);
       filter->SetScale(dparam1);
 
       filter->Update();
       floatImage = filter->GetOutput();
 
       newImage = mitk::Image::New();
       newImage->InitializeByItk(floatImage.GetPointer());
       newImage->SetVolume(floatImage->GetBufferPointer());
       nameAddition << "_Rescaled";
       std::cout << "Rescaling successful." << std::endl;
       break;
   }
 
   default:
     this->BusyCursorOff();
     return;
   }
   }
   catch (...)
   {
     this->BusyCursorOff();
     QMessageBox::warning(nullptr, "Warning", "Problem when applying filter operation. Check your input...");
     return;
   }
 
   newImage->DisconnectPipeline();
 
   // adjust level/window to new image
   mitk::LevelWindow levelwindow;
   levelwindow.SetAuto( newImage );
   auto levWinProp = mitk::LevelWindowProperty::New();
   levWinProp->SetLevelWindow( levelwindow );
 
   // compose new image name
   std::string name = selectedNode->GetName();
   if (name.find(".nrrd") == name.size() -5 )
   {
     name = name.substr(0,name.size() -5);
   }
   name.append( nameAddition.str() );
 
   // create final result MITK data storage node
   auto result = mitk::DataNode::New();
   result->SetProperty( "levelwindow", levWinProp );
   result->SetProperty( "name", mitk::StringProperty::New( name.c_str() ) );
   result->SetData( newImage );
 
   // for vector images, a different mapper is needed
   if(isVectorImage > 1)
   {
     auto mapper = mitk::VectorImageMapper2D::New();
     result->SetMapper(1,mapper);
   }
 
   // add new image to data storage and set as active to ease further processing
   GetDataStorage()->Add(result, selectedNode);
   if (m_Controls->cbHideOrig->isChecked() == true)
   {
     selectedNode->SetProperty("visible", mitk::BoolProperty::New(false));
   }
 
   // show the results
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   this->BusyCursorOff();
 }
 
 void QmitkBasicImageProcessing::SelectAction2(int operation)
 {
   switch (operation)
   {
   case 2:
     m_SelectedOperation = ADD;
     break;
   case 3:
     m_SelectedOperation = SUBTRACT;
     break;
   case 4:
     m_SelectedOperation = MULTIPLY;
     break;
   case 5:
     m_SelectedOperation = DIVIDE;
     break;
   case 6:
     m_SelectedOperation = RESAMPLE_TO;
     break;
   case 8:
     m_SelectedOperation = AND;
     break;
   case 9:
     m_SelectedOperation = OR;
     break;
   case 10:
     m_SelectedOperation = XOR;
     break;
   default:
     return;
   }
 
   m_Controls->selectedImageLabel_2->setEnabled(true);
   m_Controls->selectedImageWidget_2->setEnabled(true);
   m_Controls->btnDoIt2->setEnabled(true);
 }
 
 void QmitkBasicImageProcessing::StartButton2Clicked()
 {
   auto selectedNode = m_Controls->selectedImageWidget->GetSelectedNode();
   if (selectedNode.IsNull())
   {
     return;
   }
 
   auto selectedNode2 = m_Controls->selectedImageWidget_2->GetSelectedNode();
   if (selectedNode2.IsNull())
   {
     return;
   }
 
   mitk::Image::Pointer newImage1 = dynamic_cast<mitk::Image*>(selectedNode->GetData());
   mitk::Image::Pointer newImage2 = dynamic_cast<mitk::Image*>(selectedNode2->GetData());
 
   // check if images are valid
   if(newImage1.IsNull() || newImage2.IsNull() || false == newImage1->IsInitialized() || false == newImage2->IsInitialized())
   {
     itkGenericExceptionMacro(<< "At least one of the input images is broken or not initialized.");
     return;
   }
 
   this->BusyCursorOn();
 
   // check if 4D image and use filter on correct time step
   if(newImage1->GetDimension() > 3)
   {
     auto timeSelector = mitk::ImageTimeSelector::New();
 
     auto sn_widget = static_cast<QmitkSliceNavigationWidget*>(m_Controls->timeSliceNavigationWidget);
     int time = 0;
 
     if( sn_widget != nullptr )
         time = sn_widget->GetPos();
 
     timeSelector->SetInput(newImage1);
     timeSelector->SetTimeNr( time );
     timeSelector->UpdateLargestPossibleRegion();
     newImage1 = timeSelector->GetOutput();
     newImage1->DisconnectPipeline();
 
     timeSelector->SetInput(newImage2);
     timeSelector->SetTimeNr( time );
     timeSelector->UpdateLargestPossibleRegion();
     newImage2 = timeSelector->GetOutput();
     newImage2->DisconnectPipeline();
   }
 
   auto itkImage1 = ImageType::New();
   auto itkImage2 = ImageType::New();
 
   CastToItkImage( newImage1, itkImage1 );
   CastToItkImage( newImage2, itkImage2 );
 
   std::string nameAddition = "";
   try
   {
   switch (m_SelectedOperation)
   {
   case ADD:
     {
       AddFilterType::Pointer addFilter = AddFilterType::New();
       addFilter->SetInput1( itkImage1 );
       addFilter->SetInput2( itkImage2 );
       addFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(addFilter->GetOutput())->Clone();
       nameAddition = "_Added";
     }
     break;
   case SUBTRACT:
     {
       SubtractFilterType::Pointer subFilter = SubtractFilterType::New();
       subFilter->SetInput1( itkImage1 );
       subFilter->SetInput2( itkImage2 );
       subFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(subFilter->GetOutput())->Clone();
       nameAddition = "_Subtracted";
     }
     break;
   case MULTIPLY:
     {
       MultiplyFilterType::Pointer multFilter = MultiplyFilterType::New();
       multFilter->SetInput1( itkImage1 );
       multFilter->SetInput2( itkImage2 );
       multFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(multFilter->GetOutput())->Clone();
       nameAddition = "_Multiplied";
     }
     break;
   case DIVIDE:
     {
       DivideFilterType::Pointer divFilter = DivideFilterType::New();
       divFilter->SetInput1( itkImage1 );
       divFilter->SetInput2( itkImage2 );
       divFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage<DoubleImageType>(divFilter->GetOutput())->Clone();
       nameAddition = "_Divided";
     }
     break;
   case AND:
     {
       AndImageFilterType::Pointer andFilter = AndImageFilterType::New();
       andFilter->SetInput1( itkImage1 );
       andFilter->SetInput2( itkImage2 );
       andFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(andFilter->GetOutput())->Clone();
       nameAddition = "_AND";
       break;
     }
   case OR:
     {
       OrImageFilterType::Pointer orFilter = OrImageFilterType::New();
       orFilter->SetInput1( itkImage1 );
       orFilter->SetInput2( itkImage2 );
       orFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(orFilter->GetOutput())->Clone();
       nameAddition = "_OR";
       break;
     }
   case XOR:
     {
       XorImageFilterType::Pointer xorFilter = XorImageFilterType::New();
       xorFilter->SetInput1( itkImage1 );
       xorFilter->SetInput2( itkImage2 );
       xorFilter->UpdateLargestPossibleRegion();
       newImage1 = mitk::ImportItkImage(xorFilter->GetOutput())->Clone();
       nameAddition = "_XOR";
       break;
     }
   case RESAMPLE_TO:
     {
       itk::BSplineInterpolateImageFunction<DoubleImageType, double>::Pointer bspl_interpolator
         = itk::BSplineInterpolateImageFunction<DoubleImageType, double>::New();
       bspl_interpolator->SetSplineOrder( 3 );
 
       itk::NearestNeighborInterpolateImageFunction< DoubleImageType >::Pointer nn_interpolator
           = itk::NearestNeighborInterpolateImageFunction< DoubleImageType>::New();
 
       DoubleImageType::Pointer itkImage1 = DoubleImageType::New();
       DoubleImageType::Pointer itkImage2 = DoubleImageType::New();
 
       CastToItkImage( newImage1, itkImage1 );
       CastToItkImage( newImage2, itkImage2 );
 
       itk::ResampleImageFilter< DoubleImageType, DoubleImageType >::Pointer resampleFilter = itk::ResampleImageFilter< DoubleImageType, DoubleImageType >::New();
       resampleFilter->SetInput( itkImage1 );
       resampleFilter->SetReferenceImage( itkImage2 );
       resampleFilter->SetUseReferenceImage( true );
 
       // use NN interp with binary images
       if(selectedNode->GetProperty("binary") )
         resampleFilter->SetInterpolator( nn_interpolator );
       else
         resampleFilter->SetInterpolator( bspl_interpolator );
 
       resampleFilter->SetDefaultPixelValue( 0 );
 
       try
       {
         resampleFilter->UpdateLargestPossibleRegion();
       }
       catch( const itk::ExceptionObject &e)
       {
         MITK_WARN << "Updating resampling filter failed. ";
         MITK_WARN << "REASON: " << e.what();
       }
 
       DoubleImageType::Pointer resampledImage = resampleFilter->GetOutput();
 
       newImage1 = mitk::ImportItkImage( resampledImage )->Clone();
       nameAddition = "_Resampled";
       break;
     }
 
   default:
     std::cout << "Something went wrong..." << std::endl;
     this->BusyCursorOff();
     return;
   }
   }
   catch (const itk::ExceptionObject& e )
   {
     this->BusyCursorOff();
     QMessageBox::warning(nullptr, "ITK Exception", e.what() );
     QMessageBox::warning(nullptr, "Warning", tr("Problem when applying arithmetic operation to two images. Check dimensions of input images."));
     return;
   }
 
   // disconnect pipeline; images will not be reused
   newImage1->DisconnectPipeline();
   itkImage1 = nullptr;
   itkImage2 = nullptr;
 
   // adjust level/window to new image and compose new image name
   mitk::LevelWindow levelwindow;
   levelwindow.SetAuto( newImage1 );
   auto levWinProp = mitk::LevelWindowProperty::New();
   levWinProp->SetLevelWindow( levelwindow );
   std::string name = selectedNode->GetName();
   if (name.find(".nrrd") == name.size() -5 )
   {
     name = name.substr(0,name.size() -5);
   }
 
   // create final result MITK data storage node
   auto result = mitk::DataNode::New();
   result->SetProperty( "levelwindow", levWinProp );
   result->SetProperty( "name", mitk::StringProperty::New( (name + nameAddition ).c_str() ));
   result->SetData( newImage1 );
   this->GetDataStorage()->Add(result, selectedNode);
 
   if (m_Controls->cbHideOrig->isChecked() == true)
   {
     selectedNode->SetProperty("visible", mitk::BoolProperty::New(false));
     selectedNode2->SetProperty("visible", mitk::BoolProperty::New(false));
   }
 
   // show the newly created image
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   this->BusyCursorOff();
 }
 
 void QmitkBasicImageProcessing::SelectInterpolator(int interpolator)
 {
   switch (interpolator)
   {
   case 0:
     {
       m_SelectedInterpolation = LINEAR;
       break;
     }
   case 1:
     {
       m_SelectedInterpolation = NEAREST;
       break;
     }
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h
index c0cfcdce15..773a267db5 100644
--- a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h
+++ b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.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 QmitkCESTStatisticsView_h
 #define QmitkCESTStatisticsView_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 #include <QmitkSliceNavigationListener.h>
 
 #include "ui_QmitkCESTStatisticsViewControls.h"
 #include <QmitkImageStatisticsCalculationJob.h>
 
 #include <mitkPointSet.h>
 
 #include <mitkIRenderWindowPartListener.h>
 
 /**
   \brief QmitkCESTStatisticsView
 
   \warning  Basic statistics view for CEST data.
 
   \sa QmitkAbstractView
   \ingroup ${plugin_target}_internal
 */
 class QmitkCESTStatisticsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
 {
   Q_OBJECT
 
   public:
 
     static const std::string VIEW_ID;
 
     /*!
     \brief default constructor */
     QmitkCESTStatisticsView(QObject *parent = nullptr, const char *name = nullptr);
     /*!
     \brief default destructor */
     ~QmitkCESTStatisticsView() override;
 
   protected slots:
 
     /// \brief Called when the user clicks the GUI button
     void OnThreeDimToFourDimPushButtonClicked();
 
     /// \brief takes care of processing the computed data
     void OnThreadedStatisticsCalculationEnds();
 
     /// \brief Toggle whether or not the plot uses a fixed x range
     void OnFixedRangeCheckBoxToggled(bool state);
 
     /// \brief Adapt axis scale when manual ranges are set
     void OnFixedRangeDoubleSpinBoxChanged();
 
     /// \brief What to do if the crosshair moves
     void OnSliceChanged();
 
   protected:
 
     void CreateQtPartControl(QWidget *parent) override;
 
     void SetFocus() override;
 
     void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
     void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
 
     void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
                                      const QList<mitk::DataNode::Pointer>& nodes ) override;
 
-    /// parse string and set data vector returns true if succesfull
+    /// parse string and set data vector returns true if successful
     bool SetZSpectrum(mitk::StringProperty* zSpectrumProperty);
 
     /** Checks whether the currently set data appears reasonable
     */
     bool DataSanityCheck();
 
     /** Fills the plot based on a point set
     *
     * This will only use the first timestep
     */
     template <typename TPixel, unsigned int VImageDimension>
     void PlotPointSet(itk::Image<TPixel, VImageDimension>* image);
 
     /** Deletes all data
     */
     void Clear();
 
     /** Remove MZeros
     *
     * Will remove the data for the M0 images from the given input
     */
     void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues);
     void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues, QmitkPlotWidget::DataVector& stdDevs);
 
     /** Copies the first timestep of a segmentation to all others
     */
     template <typename TPixel, unsigned int VImageDimension>
     void CopyTimesteps(itk::Image<TPixel, VImageDimension>* image);
 
     Ui::QmitkCESTStatisticsViewControls m_Controls;
     QmitkImageStatisticsCalculationJob* m_CalculatorJob;
     QmitkPlotWidget::DataVector m_zSpectrum;
     mitk::Image::Pointer m_ZImage;
     mitk::Image::Pointer m_MaskImage;
     mitk::PlanarFigure::Pointer m_MaskPlanarFigure;
     mitk::PointSet::Pointer m_PointSet;
     mitk::PointSet::Pointer m_CrosshairPointSet;
 
     QmitkSliceNavigationListener m_SliceChangeListener;
 
     itk::TimeStamp m_selectedNodeTime;
     itk::TimeStamp m_currentPositionTime;
     /** @brief currently valid selected position in the inspector*/
     mitk::Point3D m_currentSelectedPosition;
     mitk::TimePointType m_currentSelectedTimePoint;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.cpp b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.cpp
new file mode 100644
index 0000000000..c5088e7c7c
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.cpp
@@ -0,0 +1,969 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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>
+
+// Qmitk
+#include "ClassificationSegmentation.h"
+
+// Qt
+#include <QMessageBox>
+
+//mitk image
+#include <mitkImage.h>
+#include <QmitkDataStorageComboBox.h>
+#include <ctkSliderWidget.h>
+#include <mitkPointSet.h>
+#include <mitkNodePredicateDataType.h>
+#include <mitkNodePredicateOr.h>
+#include "mitkVigraRandomForestClassifier.h"
+#include "mitkCLUtil.h"
+#include "qboxlayout.h"
+#include <mitkIOUtil.h>
+
+#include "Eigen/Dense"
+
+#include <mitkImageAccessByItk.h>
+#include <mitkSliceNavigationController.h>
+#include <vnl/vnl_random.h>
+
+#include <itkNeighborhoodFunctorImageFilter.h>
+#include <itkFirstOrderStatisticsFeatureFunctor.h>
+#include <itkNeighborhood.h>
+#include <itkHessianMatrixEigenvalueImageFilter.h>
+#include <itkStructureTensorEigenvalueImageFilter.h>
+#include <itkLineHistogramBasedMassImageFilter.h>
+#include <mitkHistogramGenerator.h>
+
+#include <itkImageRegionConstIteratorWithIndex.h>
+#include <itkImageRegionConstIterator.h>
+
+#include <mitkLookupTable.h>
+#include <mitkLookupTableProperty.h>
+
+#include <QFuture>
+#include <QFutureWatcher>
+#include <QtConcurrentRun>
+#include <QmitkIOUtil.h>
+const std::string ClassificationSegmentation::VIEW_ID = "org.mitk.views.classificationsegmentation";
+
+void ClassificationSegmentation::SetFocus()
+{
+  //  m_Controls.buttonPerformImageProcessing->setFocus();
+}
+
+void ClassificationSegmentation::OnButtonCSFToggle(bool checked)
+{
+  if(checked)
+    m_PointSetDataInteractor->SetDataNode(m_PointSetList[0]);
+  else
+    m_PointSetDataInteractor->SetDataNode(nullptr);
+}
+
+void ClassificationSegmentation::OnButtonLESToggle(bool checked)
+{
+  if(checked)
+    m_PointSetDataInteractor->SetDataNode(m_PointSetList[1]);
+  else
+    m_PointSetDataInteractor->SetDataNode(nullptr);
+}
+
+void ClassificationSegmentation::OnButtonBRAToggle(bool checked)
+{
+  if(checked)
+    m_PointSetDataInteractor->SetDataNode(m_PointSetList[2]);
+  else
+    m_PointSetDataInteractor->SetDataNode(nullptr);
+}
+
+void ClassificationSegmentation::OnButtonNoInteractionToggle(bool checked)
+{
+  if(checked)
+    m_PointSetDataInteractor->SetDataNode(nullptr);
+}
+
+void ClassificationSegmentation::CreateQtPartControl( QWidget *parent )
+{
+  // create GUI widgets from the Qt Designer's .ui file
+  m_Controls.setupUi( parent );
+  m_CalculateFeatures = true;
+  m_BlockManualSegmentation = false;
+  m_BlockPostProcessing = false;
+
+  QmitkDataStorageComboBox * cb_inputimage = new QmitkDataStorageComboBox(this->GetDataStorage(), mitk::TNodePredicateDataType<mitk::Image>::New());
+  QmitkDataStorageComboBox * cb_maskimage= new QmitkDataStorageComboBox(this->GetDataStorage(),mitk::TNodePredicateDataType<mitk::Image>::New());
+  QmitkDataStorageComboBox * cb_classifer= new QmitkDataStorageComboBox(this->GetDataStorage(),mitk::TNodePredicateDataType<mitk::VigraRandomForestClassifier>::New());
+
+  m_Controls.m_InputImageLayout->addWidget(cb_inputimage);
+  m_Controls.m_MaskImageLayout->addWidget(cb_maskimage);
+  m_Controls.m_ClassifierLayout->addWidget(cb_classifer);
+
+  m_Controls.m_ParameterLayout->layout()->addWidget(new QLabel("Gauss Sigma"));
+  m_GaussSlider = new ctkSliderWidget();
+  m_GaussSlider->setMinimum(0);
+  m_GaussSlider->setMaximum(10);
+  m_GaussSlider->setValue(1);
+  m_Controls.m_ParameterLayout->layout()->addWidget(m_GaussSlider);
+
+  m_Controls.m_ParameterLayout->layout()->addWidget(new QLabel("Hessian Sigma"));
+  m_HessianSlider = new ctkSliderWidget();
+  m_HessianSlider->setMinimum(0);
+  m_HessianSlider->setMaximum(10);
+  m_HessianSlider->setValue(3);
+  m_Controls.m_ParameterLayout->layout()->addWidget(m_HessianSlider);
+
+  m_Controls.m_ParameterLayout->layout()->addWidget(new QLabel("Structure Tensor Inner and Outer Scale"));
+  m_STInnerSlider = new ctkSliderWidget();
+  m_STInnerSlider->setMinimum(0);
+  m_STInnerSlider->setMaximum(10);
+  m_STInnerSlider->setValue(1.5);
+  m_Controls.m_ParameterLayout->layout()->addWidget(m_STInnerSlider);
+
+  m_STOuterSlider = new ctkSliderWidget();
+  m_STOuterSlider->setMinimum(0);
+  m_STOuterSlider->setMaximum(10);
+  m_STOuterSlider->setValue(3);
+  m_Controls.m_ParameterLayout->layout()->addWidget(m_STOuterSlider);
+
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(new QLabel("Probability map smoothing"));
+  m_GaussCSFSlider = new ctkSliderWidget;
+  m_GaussCSFSlider->setMinimum(0);
+  m_GaussCSFSlider->setMaximum(10);
+  m_GaussCSFSlider->setValue(1.5);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_GaussCSFSlider);
+
+  m_GaussLESSlider = new ctkSliderWidget;
+  m_GaussLESSlider->setMinimum(0);
+  m_GaussLESSlider->setMaximum(10);
+  m_GaussLESSlider->setValue(3);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_GaussLESSlider);
+
+  m_GaussBRASlider = new ctkSliderWidget;
+  m_GaussBRASlider->setMinimum(0);
+  m_GaussBRASlider->setMaximum(10);
+  m_GaussBRASlider->setValue(0.5);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_GaussBRASlider);
+
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(new QLabel("Probability map weighting"));
+  m_WeightCSFSlider = new ctkSliderWidget;
+  m_WeightCSFSlider->setMinimum(0.0);
+  m_WeightCSFSlider->setMaximum(2.0);
+  m_WeightCSFSlider->setValue(1.0);
+  m_WeightCSFSlider->setSingleStep(0.1);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_WeightCSFSlider);
+
+  m_WeightLESSlider = new ctkSliderWidget;
+  m_WeightLESSlider->setMinimum(0.0);
+  m_WeightLESSlider->setMaximum(2.0);
+  m_WeightLESSlider->setValue(1.0);
+  m_WeightLESSlider->setSingleStep(0.1);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_WeightLESSlider);
+
+  m_WeightBRASlider = new ctkSliderWidget;
+  m_WeightBRASlider->setMinimum(0.0);
+  m_WeightBRASlider->setMaximum(2.0);
+  m_WeightBRASlider->setValue(1.0);
+  m_WeightBRASlider->setSingleStep(0.1);
+  m_Controls.m_PostProcessingLayout->layout()->addWidget(m_WeightBRASlider);
+
+  m_PointSetDataInteractor = mitk::PointSetDataInteractor::New();
+  m_PointSetDataInteractor->LoadStateMachine("PointSet.xml");
+  m_PointSetDataInteractor->SetEventConfig("PointSetConfig.xml");
+
+  connect( cb_inputimage, SIGNAL(OnSelectionChanged(const mitk::DataNode*)), this, SLOT(OnInitializeSession(const mitk::DataNode*)));
+  connect( cb_maskimage, SIGNAL(OnSelectionChanged(const mitk::DataNode*)), this, SLOT(OnInitializeSession(const mitk::DataNode*)));
+
+  connect( m_Controls.m_SavePointsButton, SIGNAL(clicked(bool)), this, SLOT(DoSavePointsAsMask()));
+
+  connect( m_Controls.m_ButtonCSFToggle, SIGNAL(toggled(bool)), this, SLOT(OnButtonCSFToggle(bool)));
+  connect( m_Controls.m_ButtonLESToggle, SIGNAL(toggled(bool)), this, SLOT(OnButtonLESToggle(bool)));
+  connect( m_Controls.m_ButtonBRAToggle, SIGNAL(toggled(bool)), this, SLOT(OnButtonBRAToggle(bool)));
+  connect( m_Controls.m_ButtonNoInteraction, SIGNAL(toggled(bool)), this, SLOT(OnButtonNoInteractionToggle(bool)));
+  connect( &m_ManualSegmentationFutureWatcher, SIGNAL(finished()), this, SLOT(ManualSegmentationFinished()));
+  connect( &m_PostProcessingFutureWatcher, SIGNAL(finished()), this, SLOT(PostProcessingFinished()));
+
+  //connect( m_Controls.m_AddPointSets, SIGNAL(clicked()),this, SLOT(OnAddPointSets()) );
+  connect( m_GaussSlider, SIGNAL(valueChanged(double)), this, SLOT(OnFeatureSettingsChanged()));
+  connect( m_HessianSlider, SIGNAL(valueChanged(double)), this, SLOT(OnFeatureSettingsChanged()));
+  connect( m_STInnerSlider, SIGNAL(valueChanged(double)), this, SLOT(OnFeatureSettingsChanged()));
+  connect( m_STOuterSlider, SIGNAL(valueChanged(double)), this, SLOT(OnFeatureSettingsChanged()));
+
+  connect( m_GaussCSFSlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+  connect( m_GaussLESSlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+  connect( m_GaussBRASlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+  connect( m_WeightCSFSlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+  connect( m_WeightLESSlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+  connect( m_WeightBRASlider, SIGNAL(valueChanged(double)), this, SLOT(OnPostProcessingSettingsChanged()));
+
+  connect(m_Controls.m_DoAutomaticSecmentation, SIGNAL(clicked(bool)), this, SLOT(DoAutomSegmentation()));
+  connect(m_Controls.m_AddForestToDataManager, SIGNAL(clicked(bool)), this, SLOT(OnAddForestToDataManager()));
+
+  mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
+  pointSetNode->SetName("CSF_Points.");
+  pointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true));
+  pointSetNode->SetProperty("layer", mitk::IntProperty::New(1024));
+  pointSetNode->SetColor(0,1.0,0);
+  pointSetNode->SetDataInteractor(m_PointSetDataInteractor.GetPointer());
+  m_PointSetList.push_back(pointSetNode);
+  GetDataStorage()->Add(pointSetNode);
+
+  pointSetNode = mitk::DataNode::New();
+  pointSetNode->SetName("LES_Points.");
+  pointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true));
+  pointSetNode->SetProperty("layer", mitk::IntProperty::New(1024));
+  pointSetNode->SetColor(1.0,0,0);
+  pointSetNode->SetDataInteractor(m_PointSetDataInteractor.GetPointer());
+  m_PointSetList.push_back(pointSetNode);
+  GetDataStorage()->Add(pointSetNode);
+
+  pointSetNode = mitk::DataNode::New();
+  pointSetNode->SetName("BRA_Points.");
+  pointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true));
+  pointSetNode->SetProperty("layer", mitk::IntProperty::New(1024));
+  pointSetNode->SetColor(0,0,1.0);
+  pointSetNode->SetDataInteractor(m_PointSetDataInteractor.GetPointer());
+  m_PointSetList.push_back(pointSetNode);
+  GetDataStorage()->Add(pointSetNode);
+
+
+  m_Controls.m_PostProcessingLayout->hide();
+  m_Controls.m_ParameterLayout->hide();
+}
+
+void ClassificationSegmentation::OnSelectionChanged( berry::IWorkbenchPart::Pointer /*source*/,
+                                                     const QList<mitk::DataNode::Pointer>& nodes )
+{
+  // iterate all selected objects, adjust warning visibility
+  foreach( mitk::DataNode::Pointer node, nodes )
+  {
+    if( node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()) )
+    {
+      //      m_Controls.labelWarning->setVisible( false );
+      //      m_Controls.buttonPerformImageProcessing->setEnabled( true );
+      return;
+    }
+  }
+
+  //  m_Controls.labelWarning->setVisible( true );
+  //  m_Controls.buttonPerformImageProcessing->setEnabled( false );
+}
+
+void ClassificationSegmentation::OnAddForestToDataManager()
+{
+  AddAsDataNode(m_TempClassifier.GetPointer(),"ManualSegmentation_Classifier");
+}
+
+void ClassificationSegmentation::OnInitializeSession(const mitk::DataNode *)
+{
+  MITK_WARN << "Data selection changed! New session initialized.";
+
+  m_PointSetDataInteractor->SetDataNode(nullptr);
+
+  /// CSF POINTSET
+  mitk::PointSet::Pointer pntset = mitk::PointSet::New();
+  m_PointSetList[0]->SetData(pntset);
+
+  itk::SimpleMemberCommand<ClassificationSegmentation>::Pointer command = itk::SimpleMemberCommand<ClassificationSegmentation>::New();
+  command->SetCallbackFunction(this, &ClassificationSegmentation::ManualSegmentationTrigger);
+  pntset->AddObserver( mitk::PointSetAddEvent(), command );
+  pntset->AddObserver( mitk::PointSetRemoveEvent(), command );
+  pntset->AddObserver( mitk::PointSetMoveEvent(), command );
+
+  /// LES POINTSET
+  pntset = mitk::PointSet::New();
+  m_PointSetList[1]->SetData(pntset);
+
+  command = itk::SimpleMemberCommand<ClassificationSegmentation>::New();
+  command->SetCallbackFunction(this, &ClassificationSegmentation::ManualSegmentationTrigger);
+  pntset->AddObserver( mitk::PointSetAddEvent(), command );
+  pntset->AddObserver( mitk::PointSetRemoveEvent(), command );
+  pntset->AddObserver( mitk::PointSetMoveEvent(), command );
+
+  /// BRA POINTSET
+  pntset = mitk::PointSet::New();
+  m_PointSetList[2]->SetData(pntset);
+
+  command = itk::SimpleMemberCommand<ClassificationSegmentation>::New();
+  command->SetCallbackFunction(this, &ClassificationSegmentation::ManualSegmentationTrigger);
+  pntset->AddObserver( mitk::PointSetAddEvent(), command );
+  pntset->AddObserver( mitk::PointSetRemoveEvent(), command );
+  pntset->AddObserver( mitk::PointSetMoveEvent(), command );
+
+}
+
+void ClassificationSegmentation::DoSavePointsAsMask()
+{
+  mitk::Image::Pointer sampled_image = nullptr;
+  QmitkDataStorageComboBox * cb_image = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_InputImageLayout->itemAt(1)->widget());
+  mitk::Image::Pointer raw_image = dynamic_cast<mitk::Image *>(cb_image->GetSelectedNode()->GetData());
+
+  int label = 1;
+  for( auto datanode : m_PointSetList)
+  {
+    mitk::PointSet::Pointer point_set = dynamic_cast<mitk::PointSet *>(datanode->GetData());
+    mitk::Image::Pointer temp_img;
+    SampleClassMaskByPointSet(raw_image, point_set,temp_img);
+    mitk::CLUtil::InsertLabel(temp_img,sampled_image,label++);
+    QmitkIOUtil::Save(datanode->GetData(),QString("PointSet.mps"));
+  }
+
+  QmitkIOUtil::Save(sampled_image,QString("PointSetMask.nrrd"));
+}
+void ClassificationSegmentation::ProcessFeatureImages(const mitk::Image::Pointer & raw_image, const mitk::Image::Pointer & brain_mask)
+{
+  typedef itk::Image<double,3> DoubleImageType;
+  typedef itk::Image<short,3> ShortImageType;
+  typedef itk::ConstNeighborhoodIterator<DoubleImageType> NeighborhoodType; // Neighborhood iterator to access image
+  typedef itk::Functor::NeighborhoodFirstOrderStatistics<NeighborhoodType, double> FunctorType;
+  typedef itk::NeighborhoodFunctorImageFilter<DoubleImageType, DoubleImageType, FunctorType> FOSFilerType;
+
+  m_FeatureImageVector.clear();
+
+  // RAW
+  m_FeatureImageVector.push_back(raw_image);
+
+  // GAUSS
+  mitk::Image::Pointer smoothed;
+  mitk::CLUtil::GaussianFilter(raw_image,smoothed,m_GaussSlider->value());
+  m_FeatureImageVector.push_back(smoothed);
+
+  // Calculate Probability maps (parameters used from literatur)
+  // CSF
+  mitk::Image::Pointer csf_prob = mitk::Image::New();
+  mitk::CLUtil::ProbabilityMap(smoothed,13.9, 8.3,csf_prob);
+  m_FeatureImageVector.push_back(csf_prob);
+
+  // Lesion
+
+  mitk::Image::Pointer les_prob = mitk::Image::New();
+  mitk::CLUtil::ProbabilityMap(smoothed,59, 11.6,les_prob);
+  m_FeatureImageVector.push_back(les_prob);
+
+  // Barin (GM/WM)
+
+  mitk::Image::Pointer brain_prob = mitk::Image::New();
+  mitk::CLUtil::ProbabilityMap(smoothed,32, 5.6,brain_prob);
+  m_FeatureImageVector.push_back(brain_prob);
+
+  std::vector<unsigned int> FOS_sizes;
+  FOS_sizes.push_back(1);
+
+  DoubleImageType::Pointer input;
+  ShortImageType::Pointer mask;
+  mitk::CastToItkImage(smoothed, input);
+  mitk::CastToItkImage(brain_mask, mask);
+
+  for(unsigned int i = 0 ; i < FOS_sizes.size(); i++)
+  {
+    FOSFilerType::Pointer filter = FOSFilerType::New();
+    filter->SetNeighborhoodSize(FOS_sizes[i]);
+    filter->SetInput(input);
+    filter->SetMask(mask);
+
+    filter->Update();
+    FOSFilerType::DataObjectPointerArray array = filter->GetOutputs();
+
+    for( unsigned int i = 0; i < FunctorType::OutputCount; i++)
+    {
+      mitk::Image::Pointer featureimage;
+      mitk::CastToMitkImage(dynamic_cast<DoubleImageType *>(array[i].GetPointer()),featureimage);
+      m_FeatureImageVector.push_back(featureimage);
+      //      AddImageAsDataNode(featureimage,FunctorType::GetFeatureName(i))->SetVisibility(show_nodes);
+    }
+  }
+
+  {
+    itk::HessianMatrixEigenvalueImageFilter< DoubleImageType >::Pointer filter = itk::HessianMatrixEigenvalueImageFilter< DoubleImageType >::New();
+    filter->SetInput(input);
+    filter->SetImageMask(mask);
+    filter->SetSigma(m_HessianSlider->value());
+    filter->Update();
+
+    mitk::Image::Pointer o1,o2,o3;
+    mitk::CastToMitkImage(filter->GetOutput(0),o1);
+    mitk::CastToMitkImage(filter->GetOutput(1),o2);
+    mitk::CastToMitkImage(filter->GetOutput(2),o3);
+
+    m_FeatureImageVector.push_back(o1);
+    m_FeatureImageVector.push_back(o2);
+    m_FeatureImageVector.push_back(o3);
+
+    //    AddImageAsDataNode(o1,"HE_1")->SetVisibility(show_nodes);
+    //    AddImageAsDataNode(o2,"HE_2")->SetVisibility(show_nodes);
+    //    AddImageAsDataNode(o3,"HE_3")->SetVisibility(show_nodes);
+  }
+
+  {
+    itk::StructureTensorEigenvalueImageFilter< DoubleImageType >::Pointer filter = itk::StructureTensorEigenvalueImageFilter< DoubleImageType >::New();
+    filter->SetInput(input);
+    filter->SetImageMask(mask);
+    filter->SetInnerScale(m_STInnerSlider->value());
+    filter->SetOuterScale(m_STOuterSlider->value());
+    filter->Update();
+
+    mitk::Image::Pointer o1,o2,o3;
+    mitk::CastToMitkImage(filter->GetOutput(0),o1);
+    mitk::CastToMitkImage(filter->GetOutput(1),o2);
+    mitk::CastToMitkImage(filter->GetOutput(2),o3);
+
+    m_FeatureImageVector.push_back(o1);
+    m_FeatureImageVector.push_back(o2);
+    m_FeatureImageVector.push_back(o3);
+
+    //    AddImageAsDataNode(o1,"ST_1")->SetVisibility(show_nodes);
+    //    AddImageAsDataNode(o2,"ST_2")->SetVisibility(show_nodes);
+    //    AddImageAsDataNode(o3,"ST_3")->SetVisibility(show_nodes);
+  }
+
+  {
+    itk::LineHistogramBasedMassImageFilter< DoubleImageType >::Pointer filter = itk::LineHistogramBasedMassImageFilter< DoubleImageType >::New();
+    filter->SetInput(input);
+    filter->SetImageMask(mask);
+    filter->Update();
+
+    mitk::Image::Pointer o1;
+    mitk::CastToMitkImage(filter->GetOutput(0),o1);
+
+    m_FeatureImageVector.push_back(o1);
+  }
+}
+
+void ClassificationSegmentation::OnFeatureSettingsChanged()
+{
+  MITK_INFO << "FeatureSettingsChanged";
+  m_CalculateFeatures = true;
+  ManualSegmentationTrigger();
+}
+
+void ClassificationSegmentation::OnPostProcessingSettingsChanged()
+{
+  MITK_INFO << "PostProcessingSettigsChanged";
+  PostProcessingTrigger();
+}
+
+void ClassificationSegmentation::DoAutomSegmentation()
+{
+  QmitkDataStorageComboBox * cb_image = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_InputImageLayout->itemAt(1)->widget());
+  mitk::Image::Pointer raw_image = dynamic_cast<mitk::Image *>(cb_image->GetSelectedNode()->GetData());
+  QmitkDataStorageComboBox * cb_maskimage = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_MaskImageLayout->itemAt(1)->widget());
+  QmitkDataStorageComboBox * cb_rf = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_ClassifierLayout->itemAt(1)->widget());
+
+  mitk::Image::Pointer mask_image = dynamic_cast<mitk::Image *>(cb_maskimage->GetSelectedNode()->GetData());
+  mitk::VigraRandomForestClassifier::Pointer classifier = dynamic_cast<mitk::VigraRandomForestClassifier *>(cb_rf->GetSelectedNode()->GetData());
+
+  if(m_CalculateFeatures)
+  {
+    ProcessFeatureImages(raw_image,mask_image);
+    m_CalculateFeatures = false;
+  }
+
+  Eigen::MatrixXd X_test;
+
+  unsigned int count_test = 0;
+  mitk::CLUtil::CountVoxel(mask_image, count_test);
+  X_test = Eigen::MatrixXd(count_test, m_FeatureImageVector.size());
+
+  unsigned int index = 0;
+  for( const auto & image : m_FeatureImageVector)
+  {
+    X_test.col(index) = mitk::CLUtil::Transform<double>(image,mask_image);
+    ++index;
+  }
+
+  Eigen::MatrixXi Y_test = classifier->Predict(X_test);
+  mitk::Image::Pointer result_mask = mitk::CLUtil::Transform<int>(Y_test,mask_image);
+
+  auto node = AddAsDataNode(result_mask.GetPointer(),"Autom-ResultMask");
+
+  auto lut = mitk::LookupTable::New();
+  lut->SetType(mitk::LookupTable::PET_20);
+  auto * lut_prop = dynamic_cast<mitk::LookupTableProperty *>(node->GetProperty("LookupTable"));
+  lut_prop->SetLookupTable(lut);
+
+  mitk::LevelWindow lw(1,3);
+  node->SetLevelWindow(lw);
+  node->SetOpacity(0.3);
+
+  std::map<unsigned int, unsigned int> perlabelvoxelcount;
+  mitk::CLUtil::CountVoxel(result_mask, perlabelvoxelcount);
+
+  double voxel_volume = result_mask->GetGeometry()->GetSpacing().GetVnlVector().inf_norm();
+  QString newtext;
+  newtext += "Name\tVolume\tUnit\n";
+  for(const auto & pair: perlabelvoxelcount)
+  {
+    newtext += "Label" + QString::number(pair.first) + "\t" + QString::number(pair.second*voxel_volume* 0.001) + "\tml\n";
+  }
+
+  m_Controls.m_ResultTextEdit->setText(newtext);
+}
+
+std::vector<mitk::Image::Pointer> ClassificationSegmentation::ManualSegmentationCallback()
+{
+  QmitkDataStorageComboBox * cb_image = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_InputImageLayout->itemAt(1)->widget());
+  QmitkDataStorageComboBox * cb_maskimage = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_MaskImageLayout->itemAt(1)->widget());
+
+  mitk::Image::Pointer raw_image = dynamic_cast<mitk::Image *>(cb_image->GetSelectedNode()->GetData());
+  mitk::Image::Pointer mask_image = dynamic_cast<mitk::Image *>(cb_maskimage->GetSelectedNode()->GetData());
+
+  if(raw_image.IsNull() || mask_image.IsNull())
+  {
+    MITK_WARN << "Please provide input image and mask image";
+    //return nullptr;
+  }
+
+  if(m_CalculateFeatures)
+  {
+    ProcessFeatureImages(raw_image,mask_image);
+    m_CalculateFeatures = false;
+  }
+
+  mitk::Image::Pointer sampled_image = nullptr;
+  int label = 1;
+  for( auto datanode : m_PointSetList)
+  {
+    mitk::PointSet::Pointer point_set = dynamic_cast<mitk::PointSet *>(datanode->GetData());
+    mitk::Image::Pointer temp_img;
+    SampleClassMaskByPointSet(raw_image, point_set,temp_img);
+    mitk::CLUtil::InsertLabel(temp_img,sampled_image,label++);
+  }
+
+  m_TempClassifier = mitk::VigraRandomForestClassifier::New();
+  m_TempClassifier->SetTreeCount(50);
+  m_TempClassifier->SetSamplesPerTree(0.66);
+
+  Eigen::MatrixXd X_train;
+  Eigen::MatrixXd X_test;
+
+  unsigned int count_train = 0;
+  unsigned int count_test = 0;
+  mitk::CLUtil::CountVoxel(sampled_image, count_train);
+  mitk::CLUtil::CountVoxel(mask_image, count_test);
+  X_train = Eigen::MatrixXd(count_train, m_FeatureImageVector.size() );
+  X_test = Eigen::MatrixXd(count_test, m_FeatureImageVector.size());
+
+  unsigned int index = 0;
+  for( const auto & image : m_FeatureImageVector)
+  {
+    X_train.col(index) = mitk::CLUtil::Transform<double>(image,sampled_image);
+    X_test.col(index) = mitk::CLUtil::Transform<double>(image,mask_image);
+    ++index;
+  }
+
+  Eigen::MatrixXi Y = mitk::CLUtil::Transform<int>(sampled_image,sampled_image);
+  m_TempClassifier->Train(X_train,Y);
+
+  Eigen::MatrixXi Y_test = m_TempClassifier->Predict(X_test);
+  Eigen::MatrixXd Yp_test = m_TempClassifier->GetPointWiseProbabilities();
+  //  mitk::Image::Pointer result_mask = mitk::CLUtil::Transform<int>(Y_test,mask_image);
+
+  std::vector<mitk::Image::Pointer> resultvector;
+  resultvector.push_back( mitk::CLUtil::Transform<int>(Y_test,mask_image) );
+  resultvector.push_back( mitk::CLUtil::Transform<double>(Yp_test.col(0),mask_image) );
+  resultvector.push_back( mitk::CLUtil::Transform<double>(Yp_test.col(1),mask_image) );
+  resultvector.push_back( mitk::CLUtil::Transform<double>(Yp_test.col(2),mask_image) );
+
+  return resultvector;
+}
+
+void ClassificationSegmentation::ManualSegmentationFinished()
+{
+  // Receive Future result
+  m_ResultImageVector = m_ManualSegmentationFutureWatcher.result();
+
+  // Add result to Datastorage
+  mitk::DataNode::Pointer node = AddAsDataNode(m_ResultImageVector[0].GetPointer(),"Manual-ResultMask");
+  mitk::LookupTable::Pointer lut = mitk::LookupTable::New();
+  lut->SetType(mitk::LookupTable::PET_20);
+  mitk::LookupTableProperty * lut_prop = dynamic_cast<mitk::LookupTableProperty *>(node->GetProperty("LookupTable"));
+  lut_prop->SetLookupTable(lut);
+
+  mitk::LevelWindow lw(1,3);
+  node->SetLevelWindow(lw);
+  node->SetOpacity(0.3);
+
+  m_BlockManualSegmentation = false;
+  this->PostProcessingTrigger();
+
+  // Update Volume data
+  std::map<unsigned int, unsigned int> perlabelvoxelcount;
+  mitk::CLUtil::CountVoxel(m_ResultImageVector[0], perlabelvoxelcount);
+  double voxel_volume = m_ResultImageVector[0]->GetGeometry()->GetSpacing().GetVnlVector().inf_norm();
+  QString newtext;
+  newtext += "Name\tVolume\tUnit\n";
+  for(const auto & pair: perlabelvoxelcount)
+    newtext += "Label" + QString::number(pair.first) + "\t" + QString::number(pair.second*voxel_volume* 0.001) + "\tml\n";
+  m_Controls.m_ResultTextEdit->setText(newtext);
+
+
+}
+
+void ClassificationSegmentation::ManualSegmentationTrigger()
+{
+  unsigned int samplecounter = 0;
+  for( auto datanode : m_PointSetList)
+  {
+    mitk::PointSet::Pointer point_set = dynamic_cast<mitk::PointSet *>(datanode->GetData());
+    samplecounter += point_set->GetSize();
+  }
+  if(samplecounter < 10) return;
+
+  if(!m_BlockManualSegmentation){
+    // Start GUI Thread
+    m_ManualSegmentationFutureWatcher.setFuture(
+          QtConcurrent::run(this, &ClassificationSegmentation::ManualSegmentationCallback)); // on finish call OnManualSegmentationFinished();
+    m_BlockManualSegmentation = true;
+  }
+}
+
+void ClassificationSegmentation::SampleClassMaskByPointSet(const mitk::Image::Pointer & ref_img, mitk::PointSet::Pointer & pointset, mitk::Image::Pointer & outimage)
+{
+  outimage = ref_img->Clone();
+  itk::Image<unsigned short, 3>::Pointer itk_out;
+  mitk::CastToItkImage(outimage,itk_out);
+
+  itk_out->FillBuffer(0);
+
+  typedef itk::ImageRegionIteratorWithIndex<itk::Image<unsigned short, 3> > IteratorType;
+  IteratorType oit(itk_out, itk_out->GetLargestPossibleRegion());
+
+  for(int i = 0 ; i < pointset->GetSize(); ++i)
+  {
+    IteratorType::IndexType index;
+    ref_img->GetGeometry()->WorldToIndex(pointset->GetPoint(i), index);
+    oit.SetIndex(index);
+    oit.Set(1);
+  }
+
+  mitk::CastToMitkImage(itk_out,outimage);
+}
+
+// old version
+//void ClassificationSegmentation::DoImageProcessing()
+//{
+//  QmitkDataStorageComboBox * cb_image = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_InputImageLayout->itemAt(1)->widget());
+//  QmitkDataStorageComboBox * cb_maskimage = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_MaskImageLayout->itemAt(1)->widget());
+//  QmitkDataStorageComboBox * cb_classifier = dynamic_cast<QmitkDataStorageComboBox *>(m_Controls.m_RandomForestLayout->itemAt(1)->widget());
+
+//  if (cb_image == nullptr || cb_classifier == nullptr || cb_maskimage == nullptr)
+//  {
+//    QMessageBox::information( nullptr, "Template", "Please load and select an image before starting image processing.");
+//    return;
+//  }
+
+//  mitk::VigraRandomForestClassifier::Pointer rf = dynamic_cast<mitk::VigraRandomForestClassifier *>(cb_classifier->GetSelectedNode()->GetData());
+//  mitk::Image::Pointer image = dynamic_cast<mitk::Image *>(cb_image->GetSelectedNode()->GetData());
+//  mitk::Image::Pointer mask = dynamic_cast<mitk::Image *>(cb_maskimage->GetSelectedNode()->GetData());
+
+//  unsigned int n_samples = 0;
+//  mitk::CLUtil::CountVoxel(mask, n_samples);
+//  unsigned int n_features = 13; // InputImage, PROBA_CSF, PROBA_LES, PROBA_BRA, FOS_MEAN,FOS_VARIANCE,FOS_SKEWNESS, FOS_KURTOSIS, FOS_MIN, FOS_MAX, HE_1, HE_2, HE_3
+
+//  Eigen::MatrixXd feature_matrix = Eigen::MatrixXd(n_samples, n_features);
+
+//  MITK_INFO << "Remove voxels outside the mask";
+//  //  mitk::CLUtil::LogicalAndImages(image,brain_mask,image);
+//  feature_matrix.block(0,0,n_samples,1) = mitk::CLUtil::Transform<double>(image,mask);
+//  AddImageAsDataNode(image, "UI_InputImage");
+
+//  mitk::Image::Pointer csf_prob = mitk::Image::New();
+//  mitk::CLUtil::ProbabilityMap(image,13.9, 8.3,csf_prob);
+//  feature_matrix.block(0,1,n_samples,1) = mitk::CLUtil::Transform<double>(csf_prob,mask);
+//  AddImageAsDataNode(csf_prob, "UI_CSFProb");
+
+//  mitk::Image::Pointer les_prob = mitk::Image::New();
+//  mitk::CLUtil::ProbabilityMap(image,59, 11.6,les_prob);
+//  feature_matrix.block(0,2,n_samples,1) = mitk::CLUtil::Transform<double>(les_prob,mask);
+//  AddImageAsDataNode(les_prob, "UI_LESProb");
+
+//  mitk::Image::Pointer brain_prob = mitk::Image::New();
+//  mitk::CLUtil::ProbabilityMap(image,32, 5.6,brain_prob);
+//  feature_matrix.block(0,3,n_samples,1) = mitk::CLUtil::Transform<double>(brain_prob,mask);
+//  AddImageAsDataNode(brain_prob, "UI_BRAProb");
+
+//  int n = 0;
+
+//  std::vector<mitk::Image::Pointer> res;
+//  DoFirstOrderFeatureCalculation(image, mask, 1, res);
+
+//  for( const auto & img: res)
+//  {
+//    feature_matrix.block(0,3+(++n),n_samples,1) = mitk::CLUtil::Transform<double>(img,mask);
+//    std::string name;
+//    img->GetPropertyList()->GetStringProperty("name", name);
+//    AddImageAsDataNode(img.GetPointer(), name );
+//  }
+
+//  res.clear();
+//  DoHessianEigenvaluesFeatureCalculation(image, mask, 3.0, res);
+//  for( const auto & img: res)
+//  {
+//    feature_matrix.block(0,3+(++n),n_samples,1) = mitk::CLUtil::Transform<double>(img,mask);
+//    std::string name;
+//    img->GetPropertyList()->GetStringProperty("name", name);
+//    AddImageAsDataNode(img.GetPointer(), name );
+//  }
+
+//  MITK_INFO << "Start Prediction";
+//  rf->Predict(feature_matrix);
+//  MITK_INFO << "End Prediction";
+
+//  mitk::Image::Pointer result_image = mitk::CLUtil::Transform<int>(rf->GetLabels(),mask);
+//  mitk::Image::Pointer proba1_image = mitk::CLUtil::Transform<double>(rf->GetPointWiseProbabilities().col(0),mask);
+//  mitk::Image::Pointer proba2_image = mitk::CLUtil::Transform<double>(rf->GetPointWiseProbabilities().col(1),mask);
+//  mitk::Image::Pointer proba3_image = mitk::CLUtil::Transform<double>(rf->GetPointWiseProbabilities().col(2),mask);
+
+//  AddImageAsDataNode(result_image, "ClassificationResult");
+//  AddImageAsDataNode(proba1_image, "CSF_Proba_CL");
+//  AddImageAsDataNode(proba2_image, "LES_Proba_CL");
+//  AddImageAsDataNode(proba3_image, "BRA_Proba_CL");
+
+//  PostProcessing(rf,mask);
+
+//}
+
+mitk::DataNode::Pointer ClassificationSegmentation::AddAsDataNode(const mitk::BaseData::Pointer & data_, const std::string & name )
+{
+  mitk::DataNode::Pointer node = nullptr;
+  node = this->GetDataStorage()->GetNamedNode(name);
+
+  if(node.IsNull())
+  {
+    node = mitk::DataNode::New();
+    node->SetData(data_);
+    node->SetName(name);
+    this->GetDataStorage()->Add(node);
+  }else{
+
+    if(dynamic_cast<mitk::Image*>(node->GetData()) && dynamic_cast<mitk::Image*>(data_.GetPointer()))
+    {
+      mitk::Image::Pointer target_image = dynamic_cast<mitk::Image*>(node->GetData());
+      mitk::Image::Pointer source_image = dynamic_cast<mitk::Image*>(data_.GetPointer());
+      mitk::ImageReadAccessor ra(source_image);
+      target_image->SetImportVolume(const_cast<void *>(ra.GetData()));
+      this->RequestRenderWindowUpdate();
+    }
+
+    if(dynamic_cast<mitk::VigraRandomForestClassifier*>(node->GetData()) && dynamic_cast<mitk::VigraRandomForestClassifier*>(data_.GetPointer()))
+    {
+      node->SetData(data_);
+      node->Modified();
+    }
+
+  }
+
+  return node;
+}
+
+void ClassificationSegmentation::PostProcessingTrigger()
+{
+  if(m_ResultImageVector.empty() || m_ResultImageVector.size() < 4)
+  {
+    MITK_ERROR("PostProcessingCallback") << "Result image vector not initialized!";
+    return;
+  }
+
+  if(!m_BlockPostProcessing){
+    m_PostProcessingFutureWatcher.setFuture(
+          QtConcurrent::run(this, &ClassificationSegmentation::PostProcessingCallback)); // on finish call OnManualSegmentationFinished();
+    m_BlockPostProcessing = true;
+  }
+}
+
+void ClassificationSegmentation::PostProcessingFinished()
+{
+  // Receive Future result
+  m_PostProcessingImageVector = m_PostProcessingFutureWatcher.result();
+
+  // Add result to Datastorage
+  mitk::DataNode::Pointer node = AddAsDataNode(m_PostProcessingImageVector[0].GetPointer(),"Manual-ResultMask-PostProcessing");
+  mitk::LookupTable::Pointer lut = mitk::LookupTable::New();
+  lut->SetType(mitk::LookupTable::PET_20);
+  mitk::LookupTableProperty * lut_prop = dynamic_cast<mitk::LookupTableProperty *>(node->GetProperty("LookupTable"));
+  lut_prop->SetLookupTable(lut);
+
+  mitk::LevelWindow lw(1,3);
+  node->SetLevelWindow(lw);
+  node->SetOpacity(0.3);
+
+  m_BlockPostProcessing = false;
+}
+
+std::vector<mitk::Image::Pointer> ClassificationSegmentation::PostProcessingCallback()
+{
+  std::vector<mitk::Image::Pointer> resultvector;
+
+  mitk::Image::Pointer CSF_PMap = m_ResultImageVector[1]->Clone();
+  mitk::Image::Pointer LES_PMap = m_ResultImageVector[2]->Clone();
+  mitk::Image::Pointer BRA_PMap = m_ResultImageVector[3]->Clone();
+  mitk::Image::Pointer mask = m_ResultImageVector[0]->Clone();
+
+  MITK_INFO("PostProcessingCallback") << "ProbabilityMap merge start ...";
+
+  {
+    mitk::Image::Pointer resultmask = mask->Clone();
+    mitk::CLUtil::GaussianFilter(CSF_PMap, CSF_PMap, m_GaussCSFSlider->value());
+    mitk::CLUtil::GaussianFilter(LES_PMap, LES_PMap, m_GaussLESSlider->value());
+    mitk::CLUtil::GaussianFilter(BRA_PMap, BRA_PMap, m_GaussBRASlider->value());
+
+    itk::Image<double, 3>::Pointer itk_csf, itk_les, itk_bra;
+    itk::Image<unsigned char, 3>::Pointer itk_result;
+
+    mitk::CastToItkImage(CSF_PMap, itk_csf);
+    mitk::CastToItkImage(LES_PMap, itk_les);
+    mitk::CastToItkImage(BRA_PMap, itk_bra);
+    mitk::CastToItkImage(resultmask, itk_result);
+
+    itk::ImageRegionIterator<itk::Image<double, 3> > it_csf(itk_csf,itk_csf->GetLargestPossibleRegion());
+    itk::ImageRegionIterator<itk::Image<double, 3> > it_les(itk_les,itk_les->GetLargestPossibleRegion());
+    itk::ImageRegionIterator<itk::Image<double, 3> > it_bra(itk_bra,itk_bra->GetLargestPossibleRegion());
+    itk::ImageRegionIterator<itk::Image<unsigned char, 3> > it_res(itk_result,itk_result->GetLargestPossibleRegion());
+
+    while (!it_csf.IsAtEnd()) {
+      double csf = it_csf.Value() * m_WeightCSFSlider->value();
+      double les = it_les.Value() * m_WeightLESSlider->value();
+      double bra = it_bra.Value() * m_WeightBRASlider->value();
+
+      if(csf > les && csf > bra) it_res.Set(1);
+      if(les > csf && les > bra) it_res.Set(2);
+      if(bra > les && bra > csf) it_res.Set(3);
+
+      ++it_csf;
+      ++it_les;
+      ++it_bra;
+      ++it_res;
+    }
+
+    mitk::CastToMitkImage(itk_result, resultmask);
+
+    {
+      std::map<unsigned int, unsigned int> mergeinstruction ;
+      mergeinstruction[1] = 1;
+      mergeinstruction[2] = 1;
+      mergeinstruction[3] = 1;
+      mergeinstruction[4] = 1;
+      mergeinstruction[5] = 1;
+      mergeinstruction[6] = 1;
+
+      // {{1,1},{2,1},{3,1},{4,1},{5,1},{6,1}};
+      mitk::Image::Pointer brain_mask = mask->Clone();
+      mitk::CLUtil::MergeLabels(brain_mask, mergeinstruction);
+      mitk::CLUtil::ClosingBinary(brain_mask,brain_mask,2,mitk::CLUtil::All);
+      mitk::CLUtil::LogicalAndImages(resultmask, brain_mask, resultmask);
+    }
+    MITK_INFO("PostProcessingCallback") << "ProbabilityMap merge end!";
+
+    resultvector.push_back(resultmask);
+  }
+
+  return resultvector;
+
+  //  {
+  //    MITK_INFO << "Morphological processing start ...";
+  //    mitk::Image::Pointer resultmask =  mask->Clone();
+
+  //    mitk::Image::Pointer csf_mask;
+  //    mitk::CLUtil::GrabLabel(resultmask, csf_mask, 1);
+  //    mitk::CLUtil::ClosingBinary(csf_mask,csf_mask,1,mitk::CLUtil::Axial);
+
+  //    mitk::CLUtil::ErodeBinary(csf_mask, csf_mask, 2, mitk::CLUtil::Axial);
+  //    mitk::CLUtil::DilateBinary(csf_mask, csf_mask, 1, mitk::CLUtil::Axial);
+
+  //    std::map<unsigned int, unsigned int> merge_instruction = {{0,0},{1,3},{2,2},{3,3}};
+  //    mitk::CLUtil::MergeLabels(resultmask, merge_instruction);
+
+  //    mitk::CLUtil::InsertLabel(resultmask, csf_mask, 1/*as csf mask*/); // add morpological manipulated csf_mask
+
+  //    // ------------
+
+  //    mitk::Image::Pointer les_mask;
+  //    mitk::CLUtil::GrabLabel(resultmask, les_mask, 2);
+  //    mitk::CLUtil::ClosingBinary(les_mask,les_mask,1,mitk::CLUtil::Axial);
+
+  //    mitk::Image::Pointer les_cc_mask; unsigned int num = 0;
+  //    mitk::CLUtil::ConnectedComponentsImage(les_mask, mask, les_cc_mask, num);
+  //    std::map<unsigned int, unsigned int> map;
+  //    mitk::CLUtil::CountVoxel(les_cc_mask,map);
+  //    unsigned int counter = 0;
+
+  //    while(map.size() > 2)
+  //    {
+  //      mitk::CLUtil::ErodeBinary(les_mask, les_mask, 1, mitk::CLUtil::Axial);
+  //      mitk::CLUtil::LogicalAndImages(les_cc_mask,les_mask,les_cc_mask);
+  //      map.clear();
+  //      mitk::CLUtil::CountVoxel(les_cc_mask,map);
+  //      MITK_INFO("PostProcessing") << map.size();
+  //      counter++;
+  //    }
+
+  //    while(counter != 0)
+  //    {
+  //      mitk::CLUtil::DilateBinary(les_mask, les_mask, 1, mitk::CLUtil::Axial);
+  //      counter--;
+  //    }
+
+  //    merge_instruction = {{0,0},{1,1},{2,3},{3,3}};
+  //    mitk::CLUtil::MergeLabels(resultmask, merge_instruction);
+  //    mitk::CLUtil::InsertLabel(resultmask, les_mask, 2/*as les mask*/);
+
+  //    MITK_INFO << "Morphological processing end";
+
+  //    // ------------
+  //    mitk::CLUtil::LogicalAndImages(resultmask,mask,resultmask);
+
+  //    AddImageAsDataNode(resultmask,"SmoothedMaskMorphed");
+
+  //  }
+}
+
+//  mitk::Image::Pointer r= mitk::Image::New(),g= mitk::Image::New(),b = mitk::Image::New();
+
+//     unsigned int* m_ImageDimensions;
+//     m_ImageDimensions = new unsigned int[3];
+//     m_ImageDimensions[0] = raw_image->GetDimensions()[0];
+//     m_ImageDimensions[1] = raw_image->GetDimensions()[1];
+//     m_ImageDimensions[2] = 1;
+
+//     r->Initialize( mitk::MakePixelType<unsigned char,unsigned char,1>() ,3,m_ImageDimensions);
+//     g->Initialize( mitk::MakePixelType<unsigned char,unsigned char,1>() ,3,m_ImageDimensions);
+//     b->Initialize( mitk::MakePixelType<unsigned char,unsigned char,1>() ,3,m_ImageDimensions);
+
+//     mitk::ImageReadAccessor inputAccForRGB(raw_image, raw_image->GetSliceData(0,0,0));
+//     unsigned char* rbgSlice = (unsigned char*)inputAccForRGB.GetData();
+
+//     mitk::ImageReadAccessor inputAcc(r, r->GetSliceData(0,0,0));
+//     unsigned char* rData = (unsigned char*)inputAcc.GetData();
+
+//     mitk::ImageReadAccessor inputAcc2(g, g->GetSliceData(0,0,0));
+//     unsigned char* gData = (unsigned char*)inputAcc2.GetData();
+
+//     mitk::ImageReadAccessor inputAcc3(b, b->GetSliceData(0,0,0));
+//     unsigned char*
+//         bData = (unsigned char*)inputAcc3.GetData();
+
+//     for(int i = 0; i <  m_ImageDimensions[0] * m_ImageDimensions[1]*3; i+=3)
+//     {
+//       rData[i/3] = rbgSlice[i];
+//       gData[i/3] = rbgSlice[i+1];
+//       bData[i/3] = rbgSlice[i+2];
+
+//     }
+
+//  m_FeatureImageVector.push_back(r);
+//  m_FeatureImageVector.push_back(g);
+//  m_FeatureImageVector.push_back(b);
+
+//  AddImageAsDataNode(r,"r");
+//  AddImageAsDataNode(g,"g");
+//  AddImageAsDataNode(b,"b");
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/documentation/UserManual/cmdlinemodules.dox b/Plugins/org.mitk.gui.qt.cmdlinemodules/documentation/UserManual/cmdlinemodules.dox
index 8ff0940ab7..40a8735969 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/documentation/UserManual/cmdlinemodules.dox
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/documentation/UserManual/cmdlinemodules.dox
@@ -1,168 +1,168 @@
 /**
 \page org_mitk_views_cmdlinemodules The Command Line Modules View
 
 \imageMacro{cmdlinemodules_Icon.png,"Icon of the Command Line Modules View",2.00}
 
 \tableofcontents
 
 \section CLIPrefix Contribution
 
 This plugin was developed at the <a href="https://www.ucl.ac.uk/medical-image-computing/">Centre For Medical Image Computing</a> (CMIC),
 part of <a href="https://www.ucl.ac.uk/">University College London</a> (UCL) and contributed back to the
 <a href="https://www.mitk.org">MITK</a> community with thanks.
 
 \section CLIIntroduction Introduction
 
 This view provides the facility to run third party command line programs, and load the data back
 into the DataManager for immediate visualisation. All that is required is that the command line application can be called
 with an argument of --xml and respond with a valid XML description of the necessary parameters,
 and currently, that if the program requires images, they must be NifTI images.
 This view can then generate a Graphical User Interface (GUI) dynamically from the XML to enable the
 user to interact with the command line application. This provides an easy to use, and potentially
 very flexible way to integrate almost any third party, medical imaging, command line application.
 
 As a high level introduction, this view performs the following steps:
 
 \li The view searches for available programs to run, and for each valid module, stores the XML document describing
 the interface, and populates a searchable list of available programs.
 \li When a program is selected, the GUI is generated.
 \li The user can then set the necessary parameters and run the program.
 \li Multiple programs can be launched in succession and run simultaneously, and where available on the host platform,
 the user can pause, resume or cancel running jobs and see console output for each job.
 
 As a consequence of the very flexible nature of this plugin, these instructions can only describe how to launch
 command line modules in a general sense. The examples shown have been constructed by the latest version of the NiftyReg package.
-Futher information on the NiftyReg package, including links to the source code, can be found on the wiki page <a href="http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg">here</a>.
+Further information on the NiftyReg package, including links to the source code, can be found on the wiki page <a href="http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg">here</a>.
 NiftyReg provides valid XML descriptors to enable the integration of the NiftyReg affine (RegAladin) and and non-rigid (RegF3D) image registration algorithms, as well
 as utility programs to resample an image, and calculate a Jacobian image. These same XML descriptors work within
 <a href="https://www.slicer.org/">Slicer</a> and <a href="https://www.mitk.org/">MITK</a> based applications.
 
 \section CLIPreferences Preferences
 
 The first time that the Command Line Modules View is launched, it is advisable to set the user preferences for the view. Please refer
 to Figure 1.
 
 \imageMacro{cmdlinemodules_Preferences.png,"Figure 1. The Command Line Modules Preferences Page",16.00}
 
 Each of these preferences is now explained in some detail.
 
 \li show debug output: If checked will output more messages to the console for debugging purposes.
 \li show advanced widgets: If selected, additional widgets appear in the front-end for advanced users.
 \li XML time-out (secs): Sets the time-out for the retrieval of the XML.
 \li XML validation mode: The user may select a different mode for XML validation. If this is changed, the application will
 need to be restarted.  There are 3 modes available.  If the user selects "strict" mode, the XML schema produced by the
 command line application must exactly conform to <a href="https://www.slicer.org/w/index.php/Slicer3:Execution_Model_Documentation">
 this definition</a>. For "none", there will be no validation. For "weak"  validation, the application will report errors,
 but try to carry on and load as many modules as possible. The XML validation errors are available as tool-tips on
 the tab widget when the module is launched. Many third party modules included with Slicer currently have
 incorrect XML (typically, mis-ordered XML tags), and so the "weak" or "none" mode may assist in loading them.
 By default the "weak" mode is chosen so that only valid modules are loaded.
 \li max concurrent processes: Sets the maximum number of concurrent jobs that can be run via this interface. The default is 4.
 When the maximum number is reached, the green "Run" button is disabled until a job finishes.
 
 The next 7 preferences are to control where the view will search for valid command line programs. By default these are off
 as the searching process can take a long time and slow down the startup time of the GUI. The options provided are:
 
 \li scan installation dir: This is the directory where the actual application is stored.
 \li scan installation dir/cli-modules: Scans the sub-directory called cli-modules under the application installation directory.
 \li scan home dir: Scan the users home directory. (See QDir::homePath().)
 \li scan home dir/cli-modules: Scans the sub-directory called cli-modules under the users home directory.
 \li scan current dir: Scan the current working directory. (See QDir::homePath().)
 \li scan current dir/cli-modules: Scans the sub-directory called cli-modules under the current working directory.
 \li scan CTK_MODULE_LOAD_PATH: Scans the directory or list of directories defined by the environment variable CTK_MODULE_LOAD_PATH.
 A list is colon separated on Linux/Mac, and semi-colon separated on Windows.
 
 In most cases, it is suggested that the user will leave these options unchecked, as the user can also
 specify custom directories, and even cherry-pick specific command line programs to load. Figure 2 shows
 a selection box that enables the user to specify custom directories to scan, and Figure 3. shows a selection
 box that enables the user to select specific modules. Picking specific directories, and specific executables
 will most likely make the application quicker to launch.
 
 \imageMacro{cmdlinemodules_PreferencesAdditionalDirectories.png,"Figure 2. The User can specify specific directories to scan.",7.90}
 \imageMacro{cmdlinemodules_PreferencesAdditionalModules.png,"Figure 3. The User can specify specific command line programs to load.",7.92}
 
 These directory and file selection boxes enable directories or files to be added, removed and updated in a similar fashion.
 
 The user must make sure that the list of files selected in the "additional modules" section are not already contained within
 the directories specified in the "additional module directories" section.
 
 In addition, the preferences page provides:
 
 \li temporary directory: Images stored in the DataManager are first written to a temporary folder as
 <a href="https://niftilib.sourceforge.net/">Nifti</a> images before being passed to each command line program.
 This temporary directory will default to a platform specific temporary folder, but the user may select their preferred choice
 of temporary workspace.
 
 \section CLIUsage Usage
 
 When the view is launched, a simple interface is presented, as shown in Figure 4.
 
 \imageMacro{cmdlinemodules_Initial.png,"Figure 4. The initial interface\, with no command line programs available.",8.66}
 
 In this example, all the above check-box preferences were off, and the "additional module directories"
 was empty, and the "additional modules" list was empty so no command line applications were found.
 The "Search" box displays zero entries, and there is nothing to search.
 
 If the available search paths contain programs that are compatible (i.e. runnable) with this view,
 the name of the programs are displayed in the "Search" box in a nested menu, shown in Figure 5.
 
 \imageMacro{cmdlinemodules_WithPrograms.png,"Figure 5. When valid paths are set\, and programs are discovered\, the menu is recalculated to show available programs.",10.54}
 
 When a program is selected, the relevant interface is displayed, by default as collapsed group boxes to save space.
 Each section can be individually expanded if necessary to see the parameters.
 
 \imageMacro{cmdlinemodules_NiftyReg.png,"Figure 6. An example program\, showing parameters for NiftyReg's program RegAladin.",10.24}
 
 In this example, the parameters are displayed for <a href="https://sourceforge.net/projects/niftyreg/">NiftyReg</a>
 produced at <a href="https://www.ucl.ac.uk">UCL</a>, and more specifically for the affine registration program called
 RegAladin. The interface can contain a wide variety of controls. If a parameter for a command line program is an input image,
 then the widget displayed is linked to the DataManager, so that as new images are loaded, the correct image can be easily
 selected from the combo box.
 
 At this stage, multiple tabs can be opened, with one tab for each command line program. Figure 7 shows 2 tabs,
 for the RegAladin and RegF3D programs.
 
 \imageMacro{cmdlinemodules_F3D.png,"Figure 7. Multiple tabs can be opened\, one for each command line program.",10.24}
 
 The main view provides some simple controls:
 
 \li Green arrow: Launch (run) the command line executable of the currently selected tab.
 \li Yellow undo arrow: Resets the GUI controls of the currently selected tab to default values, if and only if the original XML specified a default value.
 
 At this stage, nothing has been launched.  When the user hits the green arrow button, a job is launched.
 Each running job is shown as a new progress reporting widget under the main tabbed widget, as shown in Figure 8.
 
 \imageMacro{cmdlinemodules_NiftyRegRunning2.png,"Figure 8. Multiple programs can be run\, each with individual controls and console output.",10.24}
 
 The controls for each running job are:
 
 \li Blue pause button: If supported on the host platform, this button will be enabled and can be toggled off (pause) or on (resume).
 \li Red square: If supported on the host platform, this button will kill the command line program.
 \li Black cross: Will remove the progress reporting widget from the GUI.
 
 When the user hits the green arrow in the main view:
 
 \li The currently selected tab is designated the "current" job, and contains the "current" set of parameters.
 \li A new progress reporting widget is created.
 \li The current parameters are copied to the progress reporting widget. In Figure 8. a parameters section
 is visible, and by default is collapsed, as they are simply for referring back to.
 \li All the output for the command line program is shown in the console widget, with a separate console for each job.
 \li Each new progress reporting widget is simply stacked vertically (newest is top-most), and it is up to the
 user to delete them when they are finished.
 
 It is easy to run multiple jobs. The green button simply launches the job corresponding to the current tab repeatedly.
 It is up to the user to make sure that any output file names are changed between successive invocations of the same command
-line module to avoid overwritting output data.
+line module to avoid overwriting output data.
 
 In addition, each set of parameters contains an "About" section containing details of the contributors, the licence and acknowledgements and also
 a "Help" section containing a description and a link to any online documentation.
 
 These documentation features are provided by the developers of the third party plugin, and not by the host program.
 If information is missing, the user must contact the third party developers.
 
 \section CLITechnicalNotes Technical Notes
 
 From a technical perspective, the Command Line Modules View is a simple view, harnessing the power of the CTK
 command line modules framework. For technical information see the <a href="https://commontk.org/index.php/Documentation/Command_Line_Interface">CTK wiki page</a>
 and obviously the CTK code base.
 */
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.cpp b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.cpp
index 9cebf03f75..30d4cc33a1 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.cpp
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.cpp
@@ -1,186 +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.
 
 ============================================================================*/
 
 #include "QmitkCmdLineModuleMenuComboBox.h"
 #include <iostream>
 #include <QString>
 #include <QStringList>
 #include <QDebug>
 #include <QMenu>
 #include <QAction>
 #include <QList>
 #include <cassert>
 #include <ctkCmdLineModuleDescription.h>
 #include <ctkCmdLineModuleReference.h>
 #include <ctkCmdLineModuleManager.h>
 
 // -------------------------------------------------------------------------
 QmitkCmdLineModuleMenuComboBox::QmitkCmdLineModuleMenuComboBox(QWidget* parent)
 : ctkMenuComboBox(parent)
 , m_ModuleManager(nullptr)
 {
   qRegisterMetaType<ctkCmdLineModuleReference>();
 }
 
 
 // -------------------------------------------------------------------------
 QmitkCmdLineModuleMenuComboBox::~QmitkCmdLineModuleMenuComboBox()
 {
 
 }
 
 
 // -------------------------------------------------------------------------
 void QmitkCmdLineModuleMenuComboBox::SetManager(ctkCmdLineModuleManager* manager)
 {
   if (m_ModuleManager != nullptr)
   {
     QObject::disconnect(manager, nullptr, this, nullptr);
   }
 
   m_ModuleManager = manager;
 
   connect(m_ModuleManager, SIGNAL(moduleRegistered(const ctkCmdLineModuleReference&)), this, SLOT(OnModuleRegistered(const ctkCmdLineModuleReference&)));
   connect(m_ModuleManager, SIGNAL(moduleUnregistered(const ctkCmdLineModuleReference&)), this, SLOT(OnModuleUnRegistered(const ctkCmdLineModuleReference&)));
 }
 
 
 // -------------------------------------------------------------------------
 ctkCmdLineModuleManager* QmitkCmdLineModuleMenuComboBox::GetManager() const
 {
   return m_ModuleManager;
 }
 
 
 // -------------------------------------------------------------------------
 void QmitkCmdLineModuleMenuComboBox::OnModuleRegistered(const ctkCmdLineModuleReference&)
 {
   this->RebuildMenu();
 }
 
 
 // -------------------------------------------------------------------------
 void QmitkCmdLineModuleMenuComboBox::OnModuleUnRegistered(const ctkCmdLineModuleReference&)
 {
   this->RebuildMenu();
 }
 
 
 // -------------------------------------------------------------------------
 void QmitkCmdLineModuleMenuComboBox::AddName(
     QList< QHash<QString, QMenu*>* >& listOfHashMaps,
     const int& depth,
     const QString& name,
     QMenu* menu
     )
 {
   if (depth >= listOfHashMaps.size())
   {
     int need = depth - listOfHashMaps.size();
     for (int i = 0; i <= need; i++)
     {
       auto  newHashMap = new QHash<QString, QMenu*>();
       listOfHashMaps.push_back(newHashMap);
     }
   }
   listOfHashMaps[depth]->insert(name, menu);
 }
 
 
 // -------------------------------------------------------------------------
 void QmitkCmdLineModuleMenuComboBox::RebuildMenu()
 {
   if (m_ModuleManager == nullptr)
   {
     qDebug() << "QmitkCmdLineModuleMenuComboBox::RebuildMenu(): Module Manager is nullptr? Surely a bug?";
     return;
   }
 
   // Can't see another way to get a nested menu, without rebuilding the whole thing each time.
   // :-(
 
   auto  menu = new QMenu();
   QStringList listOfModules;
 
   QList<ctkCmdLineModuleReference> references = m_ModuleManager->moduleReferences();
 
   // Get full names
   for (int i = 0; i < references.size(); i++)
   {
     ctkCmdLineModuleReference reference = references[i];
     ctkCmdLineModuleDescription description = reference.description();
     QString title = description.title();
     QString category = description.category();
     QString fullName = category + "." + title;
     listOfModules << fullName;
   }
 
   // Sort list, so menu comes out in some sort of nice order.
   listOfModules.sort();
 
   // Temporary data structure to enable connecting menus together.
   QList< QHash<QString, QMenu*>* > list;
 
   // Iterate through all modules.
   foreach (QString fullName, listOfModules)
   {
     // Pointer to keep track of where we are in the menu tree.
     QMenu *currentMenu = menu;
 
     // Get individual parts, as they correspond to menu levels.
     QStringList nameParts = fullName.split(".", QString::SkipEmptyParts);
 
     // Iterate over each part, building up either a QMenu or QAction.
     for (int i = 0; i < nameParts.size(); i++)
     {
       QString part = nameParts[i];
 
       if (i != nameParts.size() - 1)
       {
         // Need to add a menu/submenu, not an action.
         if (list.size() <= i || list[i] == nullptr || !list[i]->contains(part))
         {
           auto  newMenu = new QMenu(part);
           currentMenu->addMenu(newMenu);
           currentMenu = newMenu;
 
           // Add this newMenu pointer to temporary datastructure,
           // so we know we have already created it.
           this->AddName(list, i, part, newMenu);
         }
         else
         {
           currentMenu = list[i]->value(part);
         }
       }
       else
       {
         // Leaf node, just add the action.
         QAction *action = currentMenu->addAction(part);
 
         // We set the object name, so we can retrieve it later when we want to
         // rebuild a new GUI depending on the name of the action.
         // see QmitkCmdLineModuleProgressWidget.
         action->setObjectName(fullName);
       }
     }
   }
 
-  // Clearup termporary data structure
+  // Clearup temporary data structure
   for (int i = 0; i < list.size(); i++)
   {
     delete list[i];
   }
 
   // Set the constructed menu on the base class combo box.
   this->setMenu(menu);
 }
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h
index be48c78656..79f5caa40c 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.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 CommandLineModulesView_h
 #define CommandLineModulesView_h
 
 #include <QmitkAbstractView.h>
 #include <ctkCmdLineModuleReference.h>
 #include <ctkCmdLineModuleResult.h>
 #include <ctkCmdLineModuleManager.h>
 
 class ctkCmdLineModuleBackendLocalProcess;
 class ctkCmdLineModuleDirectoryWatcher;
 class CommandLineModulesViewControls;
 class QmitkCmdLineModuleRunner;
 class QAction;
 class QVBoxLayout;
 
 /*!
  * \class CommandLineModulesView
  * \brief Provides basic GUI interface to the CTK command line modules.
  * \author Matt Clarkson (m.clarkson@ucl.ac.uk)
  * \ingroup org_mitk_gui_qt_cmdlinemodules_internal
  * \sa QmitkAbstractView
  */
 class CommandLineModulesView : 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:
 
   CommandLineModulesView();
   ~CommandLineModulesView() override;
 
   /**
    * \brief Main method, called by framework to create the GUI at the right time.
    * \param parent The parent QWidget, as this class itself is not a QWidget subclass.
    */
   void CreateQtPartControl(QWidget *parent) override;
 
   /**
    * \brief Called by the framework to indicate that the preferences have changed.
    * \param prefs not used, as we call RetrievePreferenceValues().
    */
   void OnPreferencesChanged(const mitk::IPreferences* prefs) override;
 
 protected Q_SLOTS:
 
   /**
    * \brief Called when the ctkMenuComboBox has the menu selection changed,
    * and causes the corresponding GUI to be displayed.
    */
   void OnActionChanged(QAction*);
 
   /**
    * \brief Slot that is called when the restore defaults button is pressed,
    * to reset the current GUI form to the default values, if the XML specifies defaults.
    */
   void OnRestoreButtonPressed();
 
   /**
    * \brief Slot that is called when the Run button is pressed to run the current module.
    */
   void OnRunButtonPressed();
 
   /**
-   * \brief Alerts the user of any errors comming out of the directory watcher.
+   * \brief Alerts the user of any errors coming out of the directory watcher.
    */
   void OnDirectoryWatcherErrorsDetected(const QString&);
 
 protected:
 
   /**
    * \brief Called by framework to set the focus on the right widget
-   * when this view has focus, so currently, thats the ctkMenuCombo box.
+   * when this view has focus, so currently, that's the ctkMenuCombo box.
    */
   void SetFocus() override;
 
 private slots:
 
   /**
    * \brief Called when the user clicks to close a tab, and removes the front end from m_ListOfModules
    */
   void OnTabCloseRequested(int tabNumber);
 
   /**
    * \brief Called from QmitkCmdLineModuleProgressWidget to indicate a job has started.
    */
   void OnJobStarted();
 
   /**
    * \brief Called from QmitkCmdLineModuleProgressWidget to indicate a job has finished.
    */
   void OnJobFinished();
 
   /**
    * \brief Called when the user hits the 'clear XML cache' button.
    */
   void OnClearCache();
 
   /**
    * \brief Called when the user hits the 'reload modules' button.
    */
   void OnReloadModules();
 
 private:
 
   /**
    * \brief Called on startup and by OnPreferencesChanged to load all
    * preferences except the temporary folder into member variables.
    */
   void RetrieveAndStorePreferenceValues();
 
   /**
    * \brief Called on startup and by OnPreferencesChanged to load the temporary folder
    * preference into member variable m_TemporaryDirectoryName.
    */
   void RetrieveAndStoreTemporaryDirectoryPreferenceValues();
 
   /**
    * \brief Called on startup and by OnPreferencesChanged to set the validation mode, but will require a restart.
    */
   void RetrieveAndStoreValidationMode();
 
   /**
    * \brief Called to get hold of the actual preferences node.
    */
   mitk::IPreferences* RetrievePreferences() const;
 
   /**
    * \brief Search all modules for the one matching the given identifier.
    * \param fullName The "fullName" is the <category>.<title> from the XML.
    * \return ctkCmdLineModuleReference the reference corresponding to the fullName, or an invalid reference if non found.
    */
   ctkCmdLineModuleReference GetReferenceByFullName(QString fullName);
 
   /**
    * \brief Raises a message box asking the user to select a module first.
    */
   void AskUserToSelectAModule() const;
 
   /**
    * \brief Enables or Disables the Run Button.
    */
   void UpdateRunButtonEnabledStatus();
 
   /**
    * \brief The GUI controls contain a reset and run button, and a QWidget container, and the GUI component
    * for each command line module is added to the QWidget dynamically at run time.
    */
   CommandLineModulesViewControls *m_Controls;
 
   /**
    * \brief We store the parent, passed in via CommandLineModulesView::CreateQtPartControl,
    * as this class itself is not a QWidget.
    */
   QWidget *m_Parent;
 
   /**
    * \brief We keep a local layout, and arrange a display of QmitkCmdLineModuleProgressWidget,
    * where each QmitkCmdLineModuleProgressWidget represents a single running job.
    */
   QVBoxLayout *m_Layout;
 
   /**
    * \brief The manager is responsible for loading and instantiating command line modules.
    */
   ctkCmdLineModuleManager *m_ModuleManager;
 
   /**
    * \brief We are using a back-end that runs locally installed command line programs.
    */
   ctkCmdLineModuleBackendLocalProcess *m_ModuleBackend;
 
   /**
    * \brief The ctkCmdLineModuleDirectoryWatcher maintains the list of directories
    * we are using to load modules, to provide automatic updates.
    */
   ctkCmdLineModuleDirectoryWatcher *m_DirectoryWatcher;
 
   /**
    * \brief We store a temporary folder name, accessible via user preferences.
    */
   QString m_TemporaryDirectoryName;
 
   /**
    * \brief We store an output folder name, accessible via user preferences for when
    * the file specified in a default output path is not within a writable directory.
    */
   QString m_OutputDirectoryName;
 
   /**
    * \brief Cache the list of directory paths locally to avoid repeatedly trying to update Directory Watcher.
    */
   QStringList m_DirectoryPaths;
 
   /**
    * \brief Cache the list of module/executable paths locally to avoid repeatedly trying to update Directory Watcher.
    */
   QStringList m_ModulePaths;
 
   /**
-   * \brief We store the validation mode, accessisble via user preferences.
+   * \brief We store the validation mode, accessible via user preferences.
    */
   ctkCmdLineModuleManager::ValidationMode m_ValidationMode;
 
   /**
    * \brief We store the maximum number of concurrent processes, and disable the run button accordingly.
    */
   int m_MaximumConcurrentProcesses;
 
   /**
    * \brief Counts the number of currently running processes.
    */
   int m_CurrentlyRunningProcesses;
 
   /**
    * \brief Member variable, taken from preference page.
    */
   bool m_DebugOutput;
 
   /**
    * \brief Member variable, taken from preferences page.
    */
   int m_XmlTimeoutSeconds;
 
   /**
    * \brief We keep a list of front ends to match the m_TabWidget.
    */
   QList<ctkCmdLineModuleFrontend*> m_ListOfModules;
 };
 
 #endif // CommandLineModulesView_h
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
index 8a43d18fca..e750b9a539 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
@@ -1,232 +1,232 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkCmdLineModuleRunner_h
 #define QmitkCmdLineModuleRunner_h
 
 #include <QWidget>
 #include <QTimer>
 #include <QList>
 
 #include <ctkCmdLineModuleParameter.h>
 #include <mitkDataNode.h>
 
 class QVBoxLayout;
 class QTemporaryFile;
 class QmitkCmdLineModuleGui;
 class ctkCmdLineModuleManager;
 class ctkCmdLineModuleFutureWatcher;
 
 namespace Ui {
 class QmitkCmdLineModuleProgressWidget;
 }
 
 namespace mitk {
 class DataStorage;
 }
 
 /**
  * \class QmitkCmdLineModuleRunner
  * \brief Based on ctkCmdLineModuleExplorerProgressWidget, implements a progress widget
  * with console output, and space for storing the GUI widgets.
  * \author Matt Clarkson (m.clarkson@ucl.ac.uk)
  * \ingroup org_mitk_gui_qt_cmdlinemodules_internal
  * \sa ctkCmdLineModuleExplorerProgressWidget
  */
 class QmitkCmdLineModuleRunner : public QWidget
 {
   Q_OBJECT
 
 public:
 
   QmitkCmdLineModuleRunner(QWidget *parent = nullptr);
   ~QmitkCmdLineModuleRunner() override;
 
   /**
    * \brief Sets the manager on this object, and must be called immediately
    * after construction, before using the widget.
    */
   void SetManager(ctkCmdLineModuleManager* manager);
 
   /**
    * \brief Sets the DataStorage on this object, and must be called immediately
    * after construction, before using the widget.
    */
   void SetDataStorage(mitk::DataStorage* dataStorage);
 
   /**
    * \brief Sets the Output Directory on this widget, and must be called
    * immediately after construction, before using the widget.
    */
   void SetOutputDirectory(const QString& directoryName);
 
   /**
    * \brief Tells this widget, which module frontend it is running
    * \param frontEnd our QmitkCmdLineModuleGui class derived from ctkCmdLineModuleFrontend
    */
   void SetFrontend(QmitkCmdLineModuleGui* frontEnd);
 
   /**
    * \brief Runs the module that this widget is currently referring to.
    */
   void Run();
 
 Q_SIGNALS:
 
   // These signals so that container classes such as CommandLineModuleView
   // can keep track of how many modules are running simultaneously.
 
-  void started();   // emmitted when the module is started.
-  void finished();  // emmitted when the module is completely finished.
+  void started();   // emitted when the module is started.
+  void finished();  // emitted when the module is completely finished.
 
 private Q_SLOTS:
 
   void OnCheckModulePaused();
 
   void OnPauseButtonToggled(bool toggled);
   void OnRemoveButtonClicked();
 
   void OnModuleStarted();
   void OnModuleCanceled();
   void OnModuleFinished();
   void OnModuleResumed();
   void OnModuleProgressRangeChanged(int progressMin, int progressMax);
   void OnModuleProgressTextChanged(const QString& progressText);
   void OnModuleProgressValueChanged(int progressValue);
   void OnOutputDataReady();
   void OnErrorDataReady();
 
 private:
 
   /**
    * \brief Simply returns true if this widget is considered as having been started.
    */
   bool IsStarted() const;
 
   /**
    * \brief Used to write output to the console widget, and also to qDebug().
    */
   void PublishMessage(const QString& message);
 
   /**
    * \brief Used to write output to the console widget, and also to qDebug().
    */
   void PublishByteArray(const QByteArray& array);
 
   /**
    * \brief Destroys any images listed in m_TemporaryFileNames.
    */
   void ClearUpTemporaryFiles();
 
   /**
    * \brief Loads any data listed in m_OutputDataToLoad into the m_DataStorage.
    */
   void LoadOutputData();
 
   /**
    * \brief Saves temporary image to file.
    * \param[in] node non-nullptr pointer to node containing a non-nullptr mitk::Image.
    * \param[out] errorMessage which if not empty means an error occurred.
    * \return QTemporaryFile temporary file that the caller is responsible for deleting.
    *
    * If the returned QTemporaryFile is nullptr, check errorMessage.
    * If the returned QTemporaryFile is not-nullptr, there could still be data in the errorMessage.
    * It could be that this method tried n file extensions, before finding a successful one.
    * In this case, the returned QTemporaryFile is the successful one, and the errorMessage contains error messages of all the failed attempts.
    */
   QTemporaryFile* SaveTemporaryImage(const ctkCmdLineModuleParameter& parameter, mitk::DataNode::ConstPointer node, QString& errorMessage) const;
 
   /**
    * \brief Utility method to look up the title from the description.
    */
   QString GetTitle();
 
   /**
    * \brief Returns <category>.<title>, derived from the ctkCmdLineModuleReference and
    * hence from the ctkCmdLineModuleDescription.
    */
   QString GetFullName() const;
 
   /**
    * \brief Takes nodeName, and makes sure that it only contains A-Z, a-z, 0-9, hyphen and underscore,
    * and does not use hyphen as the first character.
    *
    * Inspired by <a href="https://www.boost.org/doc/libs/1_43_0/libs/filesystem/doc/portability_guide.htm">boost recommendations</a>.
    */
   QString GetValidNodeName(const QString& nodeName) const;
 
   /**
    * \brief This must be injected before the Widget is used.
    */
   ctkCmdLineModuleManager *m_ModuleManager;
 
   /**
    * \brief This must be injected before the Widget is used.
    */
   mitk::DataStorage *m_DataStorage;
 
   /**
    * \brief This must be injected before the Widget is used.
    */
   QString m_OutputDirectoryName;
 
   /**
    * \brief We instantiate the main widgets from this .ui file.
    */
   Ui::QmitkCmdLineModuleProgressWidget *m_UI;
 
   /**
    * \brief The m_ParametersGroupBox needs a layout.
    */
   QVBoxLayout *m_Layout;
 
   /**
    * \brief The QmitkCmdLineModuleGui is created by the QmitkCmdLineModuleFactoryGui outside
    * of this class and injected into this class before being run.
    */
   QmitkCmdLineModuleGui *m_ModuleFrontEnd;
 
   /**
    * \brief Main object to keep track of a running command line module.
    */
   ctkCmdLineModuleFutureWatcher *m_FutureWatcher;
 
   /**
    * \brief Due to Qt bug 12152, we use a timer to correctly check for a paused module.
    */
   QTimer m_PollPauseTimer;
 
   /**
    * \brief We store a list of temporary file names that are saved to disk before
    * launching a command line app, and then must be cleared up when the command line
    * app successfully finishes.
    */
   QList<QTemporaryFile*> m_TemporaryFiles;
 
   /**
    * \brief We store a list of output images, so that on successful completion of
    * the command line module, we automatically load the output data into the mitk::DataStorage.
    */
   QStringList m_OutputDataToLoad;
 
   /**
    * \brief We track how many times the OnOutputDataReady is called.
    */
   int m_OutputCount;
 
   /**
    * \brief We track how many times the OnErrorDataReady is called.
    */
   int m_ErrorCount;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h
index a714712aa0..3e280b20e0 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.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 QmitkUiLoader_h
 #define QmitkUiLoader_h
 
 #include <ctkCmdLineModuleQtUiLoader.h>
 #include <QStringList>
 #include "mitkDataStorage.h"
 
 /**
  * \class QmitkUiLoader
  * \brief Derived from ctkCmdLineModuleQtGuiLoader to enable us to instantiate widgets from Qmitk at runtime,
- * and currently we instatiate QmitkDataStorageComboBoxWithSelectNone, used for image input widgets.
+ * and currently we instantiate QmitkDataStorageComboBoxWithSelectNone, used for image input widgets.
  * \author Matt Clarkson (m.clarkson@ucl.ac.uk)
  * \ingroup org_mitk_gui_qt_cmdlinemodules_internal
  * \sa ctkCmdLineModuleQtUiLoader
  */
 class QmitkUiLoader : public ctkCmdLineModuleQtUiLoader
 {
 
   Q_OBJECT
 
 public:
   QmitkUiLoader(const mitk::DataStorage* dataStorage, QObject *parent=nullptr);
   ~QmitkUiLoader() override;
 
   /**
    * \brief Returns the list of available widgets in ctkCmdLineModuleQtGuiLoader and also QmitkDataStorageComboBoxWithSelectNone.
    * \see ctkCmdLineModuleQtGuiLoader::availableWidgets()
    */
   QStringList availableWidgets () const;
 
   /**
    * \brief If className is QmitkDataStorageComboBox, instantiates QmitkDataStorageComboBoxWithSelectNone and
    * otherwise delegates to base class.
    * \see ctkCmdLineModuleQtGuiLoader::createWidget()
    */
   QWidget* createWidget(const QString & className, QWidget * parent = nullptr, const QString & name = QString() ) override;
 
 private:
 
   const mitk::DataStorage* m_DataStorage;
 
 }; // end class
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt b/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt
new file mode 100644
index 0000000000..683e7f7561
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt
@@ -0,0 +1,2 @@
+See [Font Awesome 4] in Licenses/ICONS.md for:
+- times.svg
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
index d1eb9bf302..1860c2d453 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
@@ -1,166 +1,166 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All 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 "mitkIRenderWindowPart.h"
 
 #include <mitkIDataStorageReference.h>
 #include <mitkDataStorage.h>
 
 #include <org_mitk_gui_qt_common_Export.h>
 
 class QmitkAbstractRenderEditorPrivate;
 
 namespace mitk
 {
   class IPreferences;
 }
 
 /**
  * \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 mitk::IPreferences*)
  * </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);
 
   /**
   * \see mitk::IRenderWindowPart::GetSelectedTimePoint()
   This default implementation assumes that all renderer use the same TimeNavigationControl
   provided by this class (GetTimeNavigationControl()).
   */
   mitk::TimePointType GetSelectedTimePoint(const QString& id = QString()) const override;
 
   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 mitk::IPreferences* 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.
+   * \param requestType The type of render windows for which an immediate 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 TimeNavigationController returned by the mitk::IRenderingManager::GetTimeNavigationController()
    * method of the interface implementation returned by GetRenderingManager().
    *
    * \see mitk::IRenderingManager::GetTimeNavigationController
    */
   mitk::TimeNavigationController* 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 mitk::IPreferences*);
 
 private:
 
   QScopedPointer<QmitkAbstractRenderEditorPrivate> d;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
index b98a39219a..afe6788eb5 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
@@ -1,356 +1,356 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkAbstractView_h
 #define QmitkAbstractView_h
 
 //# blueberry stuff
 #include <berryQtViewPart.h>
 #include <berryISelectionListener.h>
 
 //# mitk stuff
 #include <org_mitk_gui_qt_common_Export.h>
 
 #include "mitkDataNodeSelection.h"
 #include "mitkIRenderWindowPart.h"
 
 #include <mitkWorkbenchUtil.h>
 
 #include <mitkDataStorage.h>
 #include <mitkRenderingManager.h>
 #include <mitkIDataStorageReference.h>
 
 #include <QItemSelectionModel>
 
 namespace mitk {
   class DataNode;
   class IPreferences;
 }
 
 class QmitkAbstractViewPrivate;
 class QmitkAbstractViewSelectionProvider;
 
 /**
  * \ingroup org_mitk_gui_qt_common
  *
  * \brief A convenient base class for MITK related BlueBerry Views.
  *
  * QmitkAbstractView provides several convenience methods that ease the introduction of a new view:
  *
  * <ol>
  *   <li> Access to the DataStorage (~ the shared data repository)
  *   <li> Access to the active IRenderWindowPart
  *   <li> Access to and update notification for the view's preferences
  *   <li> Access to and update notification for the current DataNode selection / to DataNode selection events send through the SelectionService
  *   <li> Access to and update notification for DataNode events (added/removed/modified)
  *   <li> Methods to send DataNode selections through the SelectionService
  *   <li> Some minor important convenience methods (like changing the mouse cursor/exception handling)
  * </ol>
  *
  * Usually all MITK Views inherit from QmitkAbstractView to achieve a consistent Workbench behavior.
  *
  * When inheriting from QmitkAbstractView, 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 customize your View's behavior:
  * <ul>
  * <li>void SetSelectionProvider()
  * <li>QItemSelectionModel* GetDataNodeSelectionModel() const
  * </ul>
  *
  * You may reimplement the following private virtual methods to be notified about certain changes:
  * <ul>
  * <li>void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes)
  * <li>void OnNullSelection(berry::IWorkbenchPart::Pointer part)
  * <li>void OnPreferencesChanged(const mitk::IPreferences*)
  * <li>void NodeAdded(const mitk::DataNode* node)
  * <li>void NodeChanged(const mitk::DataNode* node)
  * <li>void NodeRemoved(const mitk::DataNode* node)
  * <li>void DataStorageModified()
  * <li>void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef)
  * </ul>
  *
  * \see mitk::ILifecycleAwarePart
  * \see mitk::IZombieViewPart
  * \see mitk::IRenderWindowPartListener
  */
 class MITK_QT_COMMON QmitkAbstractView : public berry::QtViewPart
 {
 
 public:
 
   /**
    * Creates smartpointer typedefs
    */
   berryObjectMacro(QmitkAbstractView);
 
   /**
-   * Nothing to do in the standard ctor. <b>Initiliaze your GUI in CreateQtPartControl(QWidget*)</b>
+   * Nothing to do in the standard ctor. <b>Initialize your GUI in CreateQtPartControl(QWidget*)</b>
    * \see berry::QtViewPart::CreateQtPartControl(QWidget*)
    */
   QmitkAbstractView();
 
   /**
    * Disconnects all standard event listeners
    */
   ~QmitkAbstractView() override;
 
 protected:
 
   /**
    * Informs other parts of the workbench that node is selected via the blueberry selection service.
    *
    * \note This method should not be used if you have set your own selection provider via
    * SetSelectionProvider() or your own QItemSelectionModel via GetDataNodeSelectionModel().
    */
   void FireNodeSelected(mitk::DataNode::Pointer node);
 
   /**
    * Informs other parts of the workbench that the nodes are selected via the blueberry selection service.
    *
    * \note This method should not be used if you have set your own selection provider via
    * SetSelectionProvider() or your own QItemSelectionModel via GetDataNodeSelectionModel().
    */
   virtual void FireNodesSelected(const QList<mitk::DataNode::Pointer>& nodes);
 
   /**
    * \return The selection of the currently active part of the workbench or an empty list
    *         if there is no selection or if it is empty.
    *
    * \see IsCurrentSelectionValid
    */
   QList<mitk::DataNode::Pointer> GetCurrentSelection() const;
 
   /**
    * Queries the state of the current selection.
    *
    * \return If the current selection is <code>nullptr</code>, this method returns
    * <code>false</code> and <code>true</code> otherwise.
    */
   bool IsCurrentSelectionValid() const;
 
   /**
    * Returns the current selection made in the datamanager bundle or an empty list
    * if there is no selection or if it is empty.
    *
    * \see IsDataManagerSelectionValid
    */
   QList<mitk::DataNode::Pointer> GetDataManagerSelection() const;
 
   /**
    * Queries the state of the current selection of the data manager view.
    *
    * \return If the current data manager selection is <code>nullptr</code>, this method returns
    * <code>false</code> and <code>true</code> otherwise.
    */
   bool IsDataManagerSelectionValid() const;
 
   /**
    * Sets the selection of the data manager view if available.
    *
    * \param selection The new selection for the data manager.
    * \param flags The Qt selection flags for controlling the way how the selection is updated.
    */
   void SetDataManagerSelection(const berry::ISelection::ConstPointer& selection,
                                QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::ClearAndSelect) const;
 
   /**
    * Takes the current selection and sets it on the data manager. Only matching nodes in the
    * data manager view will be selected.
    */
   void SynchronizeDataManagerSelection() const;
 
   /**
    * Returns the Preferences object for this View.
-   * <b>Important</b>: When refering to this preferences, e.g. in a PreferencePage: The ID
+   * <b>Important</b>: When referring to this preferences, e.g. in a PreferencePage: The ID
    * for this preferences object is "/<VIEW-ID>", e.g. "/org.mitk.views.datamanager"
    */
   mitk::IPreferences* GetPreferences() const;
 
   /**
    * Returns a reference to the currently active DataStorage.
    */
   mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
 
   /**
    * Returns the currently active DataStorage.
    */
   mitk::DataStorage::Pointer GetDataStorage() const;
 
   /**
    * Returns the currently active mitk::IRenderWindowPart.
    *
    * \param strategies Strategies for returning a mitk::IRenderWindowPart instance if there
    *        is currently no active one.
    * \return The active mitk::IRenderWindowPart.
    */
   mitk::IRenderWindowPart* GetRenderWindowPart(mitk::WorkbenchUtil::IRenderWindowPartStrategies strategies = mitk::WorkbenchUtil::NONE) const;
 
   /**
    * Request an update of all render windows of the currently active IRenderWindowPart.
    *
    * \param requestType Specifies the type of render windows for which an update will be requested.
    */
   void RequestRenderWindowUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL);
 
   /**
    * Outputs an error message to the console and displays a message box containing
    * the exception description.
    * \param e the exception which should be handled
    * \param parent
    * \param showDialog controls, whether additionally a message box should be
    *        displayed to inform the user that something went wrong
    */
   void HandleException( std::exception& e, QWidget* parent = nullptr, bool showDialog = true ) const;
 
   /**
    * Calls HandleException ( std::exception&, QWidget*, bool ) internally
    * \see HandleException ( std::exception&, QWidget*, bool )
    */
   void HandleException( const char* str, QWidget* parent = nullptr, bool showDialog = true ) const;
 
   /**
    * Convenient method to set and reset a wait cursor ("hourglass")
    */
   void WaitCursorOn();
 
   /**
    * Convenient method to restore the standard cursor
    */
   void WaitCursorOff();
 
   /**
    * Convenient method to set and reset a busy cursor
    */
   void BusyCursorOn();
 
   /**
    * Convenient method to restore the standard cursor
    */
   void BusyCursorOff();
 
   /**
    * Convenient method to restore the standard cursor
    */
   void RestoreOverrideCursor();
 
 private:
 
   /**
    * Reimplement this method to set a custom selection provider. This method is
    * called once after CreateQtPartControl().
    *
    * The default implementation registers a QmitkDataNodeSelectionProvider with
    * a QItemSelectionModel returned by GetDataNodeSelectionModel().
    */
   virtual void SetSelectionProvider();
 
   /**
    * Reimplement this method to supply a custom Qt selection model. The custom
    * model will be used with the default selection provider QmitkDataNodeSelectionProvider
    * to inform the MITK Workbench about selection changes.
    *
    * If you reimplement this method, the methods FireNodeSelected() and FireNodesSelected()
    * will have no effect. Use your custom selection model to notify the MITK Workbench
    * about selection changes.
    *
    * The Qt item model used with the custom selection model must return mitk::DataNode::Pointer
    * objects for model indexes when the role is QmitkDataNodeRole.
    */
   virtual QItemSelectionModel* GetDataNodeSelectionModel() const;
 
   /**
    * Called when the selection in the workbench changed.
    * May be reimplemented by deriving classes.
    *
    * \param part The source part responsible for the selection change.
    * \param nodes A list of selected nodes.
    *
    * \see OnNullSelection
    */
   virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes);
 
   /**
    * Called when a <code>nullptr</code> selection occurs.
    *
    * \param part The source part responsible for the selection change.
    */
   virtual void OnNullSelection(berry::IWorkbenchPart::Pointer part);
 
   /**
    * Called when the preferences object of this view changed.
    * May be reimplemented by deriving classes.
    *
    * \see GetPreferences()
    */
   virtual void OnPreferencesChanged(const mitk::IPreferences*);
 
   /**
    * Called when a DataStorage Add event was thrown. May be reimplemented
    * by deriving classes.
    */
   virtual void NodeAdded(const mitk::DataNode* node);
 
   /**
    * Called when a DataStorage Changed event was thrown. May be reimplemented
    * by deriving classes.
    */
   virtual void NodeChanged(const mitk::DataNode* node);
 
   /**
    * Called when a DataStorage Remove event was thrown. May be reimplemented
    * by deriving classes.
    */
   virtual void NodeRemoved(const mitk::DataNode* node);
 
   /**
    * Called when a DataStorage add *or* remove *or* change event from the currently active
    * data storage is thrown.
    *
    * May be reimplemented by deriving classes.
    */
   virtual void DataStorageModified();
 
   /**
    * Called when the currently active DataStorage changed.
    * May be reimplemented by deriving classes.
    *
    * \param dsRef A reference to the new active DataStorage.
    */
   virtual void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef);
 
   /**
    * Creates a scroll area for this view and calls CreateQtPartControl then
    */
   void CreatePartControl(QWidget* parent) override;
 
   /**
    * Called immediately after CreateQtPartControl().
    * Here standard event listeners for a QmitkAbstractView are registered
    */
   void AfterCreateQtPartControl();
 
 private:
 
   friend class QmitkAbstractViewPrivate;
   friend class QmitkViewCoordinator;
 
   Q_DISABLE_COPY(QmitkAbstractView)
 
   const QScopedPointer<QmitkAbstractViewPrivate> d;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h
index d075f60572..8329792ce1 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.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 QmitkSliceNavigationListener_h
 #define QmitkSliceNavigationListener_h
 
 #include <mitkTimeGeometry.h>
 #include <mitkPoint.h>
 
 #include <itkEventObject.h>
 
 #include <QObject>
 
 #include <org_mitk_gui_qt_common_Export.h>
 
 namespace itk
 {
   class Object;
 }
 
 namespace mitk
 {
   class SliceNavigationController;
   struct IRenderWindowPart;
 }
 
 
 /** @brief Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time navigation.
- Purpose of the class to be used in view and to give the respective view class (by composition) the posibility to react
+ Purpose of the class to be used in view and to give the respective view class (by composition) the possibility to react
  on changes of the currently selected timepoint or position in the world geometry.\n
- It also offers convinient signals that are only triggered when the selected timepoint or the selected possition of the 
- active render window have realy changed.\n
+ It also offers convenient signals that are only triggered when the selected timepoint or the selected position of the 
+ active render window have really changed.\n
  In order to setup this class properly the following things must be regarded:
  - View class must also derive public from mitk::IRenderWindowPartListener
  - View class must implement void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.
 
     void QmitkMyView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
     {
       this->m_SliceNavigationListener.RenderWindowPartActivated(renderWindowPart);
     }
 
  - View class must implement void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.
 
     void QmitkMyView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart)
     {
     this->m_SliceNavigationListener.RenderWindowPartDeactivated(renderWindowPart);
     }
 
  - View class must pass its on render window part in its CreateQtPartControl(QWidget* parent)
 
     this->m_SliceNavigationListener.RenderWindowPartActivated(this->GetRenderWindowPart());
 
  - View class must connect the SliceChanged signal of the listener as see fit.
 */
 class MITK_QT_COMMON QmitkSliceNavigationListener : public QObject
   {
     Q_OBJECT
 
   public:
     QmitkSliceNavigationListener();
     ~QmitkSliceNavigationListener() override;
 
     mitk::TimePointType GetCurrentSelectedTimePoint() const;
     mitk::Point3D GetCurrentSelectedPosition() const;
 
   signals:
     /** Signal triggered as soon as there is any change. It may be a change in the position/slice or of the selected timepoint.*/
     void SliceChanged();
-    /** Convinience signal that can be used if you are only interested in changes of the current selected time point.
+    /** Convenience signal that can be used if you are only interested in changes of the current selected time point.
      Changes in spatial position will be ignored.*/
     void SelectedTimePointChanged(const mitk::TimePointType& newTimePoint);
-    /** Convinience signal that can be used if you are only interested in changes of the current selected position.
+    /** Convenience signal that can be used if you are only interested in changes of the current selected position.
      Changes in time will be ignored.*/
     void SelectedPositionChanged(const mitk::Point3D& newPoint);
 
   public slots:
     void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart);
     void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart);
     void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart);
 
   protected slots:
       /** Overwrite function to implement the behavior on slice/time changes. */
       void OnSliceChangedDelayed();
 
   protected:
 
     /**	@brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times. */
     void OnSliceChangedInternal(const itk::EventObject& e);
     void OnTimeChangedInternal(itk::Object* sender, const itk::EventObject& e);
 
     void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
 
     /** 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);
 
     bool ObserversInitialized(mitk::SliceNavigationController* controller);
 
     mitk::IRenderWindowPart* m_renderWindowPart;
 
     // 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.*/
     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;
     unsigned int m_ControllerToTimeObserverTag;
 
     mitk::Point3D m_CurrentSelectedPosition;
     mitk::TimePointType m_CurrentSelectedTimePoint;
   };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui
index 1599ef75ad..039ae9cc68 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui
@@ -1,165 +1,165 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkNodeSelectionPreferencePage</class>
  <widget class="QWidget" name="QmitkNodeSelectionPreferencePage">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>715</width>
     <height>713</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="4" column="0">
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
       <widget class="QPushButton" name="btnUp">
        <property name="text">
         <string>Up</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="btnDown">
        <property name="text">
         <string>Down</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item row="1" column="0">
     <widget class="QComboBox" name="comboPreferred">
      <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The preferred inspector is always visible.&lt;/p&gt;&lt;p&gt;Additionally the preferred inspector has always the focus when opening a node selection dialoge.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The preferred inspector is always visible.&lt;/p&gt;&lt;p&gt;Additionally the preferred inspector has always the focus when opening a node selection dialog.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <item>
       <property name="text">
        <string>Neues Element</string>
       </property>
      </item>
      <item>
       <property name="text">
        <string>2</string>
       </property>
      </item>
     </widget>
    </item>
    <item row="7" column="0">
     <widget class="QLabel" name="label_2">
      <property name="text">
       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Instruction:&lt;/span&gt;&lt;br/&gt;Only checked inspectors will be shown in node selection dialogs.&lt;br/&gt;You may change the order in the inspector list, to change the order of the tabs in the node selection dialog.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="3" column="0">
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
       <widget class="QLabel" name="label">
        <property name="text">
         <string>Inspector visiblitiy and order:</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QListWidget" name="listInspectors">
        <property name="maximumSize">
         <size>
          <width>16777215</width>
          <height>16777215</height>
         </size>
        </property>
        <property name="toolTip">
         <string>List of all available inspectors. Checked inspectores will be display</string>
        </property>
        <item>
         <property name="text">
          <string>TreeInspector</string>
         </property>
         <property name="toolTip">
          <string>ffffff</string>
         </property>
         <property name="checkState">
          <enum>Checked</enum>
         </property>
        </item>
        <item>
         <property name="text">
          <string>List</string>
         </property>
         <property name="checkState">
          <enum>Checked</enum>
         </property>
        </item>
       </widget>
      </item>
     </layout>
    </item>
    <item row="8" column="0">
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
    <item row="0" column="0">
     <widget class="QLabel" name="label_3">
      <property name="text">
       <string>Preferred inspector:</string>
      </property>
     </widget>
    </item>
    <item row="5" column="0">
     <widget class="QCheckBox" name="checkShowFav">
      <property name="text">
       <string>Show favorites inspector</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="2" column="0">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeType">
       <enum>QSizePolicy::Fixed</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>20</height>
       </size>
      </property>
     </spacer>
    </item>
    <item row="6" column="0">
     <widget class="QCheckBox" name="checkShowHistory">
      <property name="text">
       <string>Show history inspector</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.datamanager/documentation/UserManual/QmitkDatamanager.dox b/Plugins/org.mitk.gui.qt.datamanager/documentation/UserManual/QmitkDatamanager.dox
index 7c7326558c..bcf86c0feb 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/documentation/UserManual/QmitkDatamanager.dox
+++ b/Plugins/org.mitk.gui.qt.datamanager/documentation/UserManual/QmitkDatamanager.dox
@@ -1,192 +1,192 @@
 /**
 
 \page org_mitk_views_datamanager The Data Manager View
 
 \imageMacro{data-manager-dox.svg,"Icon of the Data Manager", 2.00}
 
 \tableofcontents
 
 \section DataManagerIntroduction Introduction
 
 The Datamanager is the central component to manage medical data like images, segmentation masks, registrations, surfaces, point sets, annotations, measurements, etc..<br>
 After loading data into the Datamanager the data is shown in the four-view window, the so-called <em>Standard Display</em>.
 The user can now start working on the data by interacting with the data inside the <em>Standard Display</em>,
 by using the MITK-plugins such as <em>Segmentation</em> or <em>Basic Image Processing</em> or by using the context menu inside the data manager.
 
 \section DataManagerLoadingData Loading Data
 
 There are several ways of loading data into the Datamanager as so-called <em>data nodes</em>:
 
 <ul>
   <li> drag and drop data (e.g. from a file explorer or desktop) into the Datamanager
   <li> drag and drop data (e.g. from a file explorer or desktop) into one of the four windows of the <em>Standard Display</em>
   <li> use the keyboard shortcut <em>Ctrl + o</em>
   <li> use the <em>Open File</em> Button in the left upper corner and use the <em>Open</em> Dialog
   <li> use <em>File -> Open File...</em> from the top menu
 </ul>
 
 A lot of file-formats can be loaded into MITK, for example:
 
 <ul>
   <li> 2D-images / 3D-volumes with or without several time steps (*.dcm, *.ima, *.nrrd, ...)
   <li> Surfaces (*.stl, *.vtk, ...)
   <li> Point sets (*.mps)
   <li> and many more
 </ul>
 
 The user can also load a series of 2D images (e.g. image001.png, image002.png ...) to a MITK 3D volume.
 To do this, just drag and drop one of those 2D data files into the Datamanager by holding the ALT key.
 <em>Note: What really happens is that the data nodes are stored inside a "Data storage" and the Datamanager is just a visual representation of the data inside the "Data storage".
 That's why the documentation sometimes uses the term "Data storage" instead of "Datamanager".</em>
 
 \section DataManagerSavingData Saving Data
 
 There are several ways of saving data from the Datamanager:
 
 <ul>
   <li> use the keyboard shortcut <em>Ctrl + s</em> on a single data node
   <li> use the keyboard shortcut <em>Ctrl + s</em> on multiple data nodes
   <li> use the context menu <em>right-click -> Save</em> on a single data node
   <li> use the context menu <em>right-click -> Save</em> on multiple data nodes
   <li> use <em>File -> Save...</em> from the top menu on a single data node
   <li> use <em>File -> Save...</em> from the top menu on multiple data nodes
 </ul>
 
 \section DataManagerWorking Working with the Datamanager
 
 After loading data into the Datamanager the data appears as data nodes in a sorted list inside the Datamanager.
 The user can change the order of the data nodes manually by dragging one or multiple data nodes and dropping them at any position inside the Datamanager.
 Data nodes can also be sorted hierarchically as a parent-child-relation.
 For example after using the <em>Segmentation-Plugin</em> to create a segmentation on <em>DataNode</em>, the result is created as <em>ChildNode</em>,
 which is a child of <em>DataNode</em> (see \ref ParentChild "Parent-Child-Relation" screenshot).<br>
 A parent-child-relation can be changed by dragging a child of a data node and dropping it onto another data node.
 For this the Property <em>Allow changing of parent nodes</em> needs to be enabled (see \ref DataManagerPreferences "Preferences").
 
 \anchor ParentChild
 \imageMacro{QmitkDatamanager_ParentChild.png, "Parent-Child-Relation", 16.00}
 
 \subsection DataManagerNodeVisibility Visibility of data nodes
 
 By default all loaded data nodes are visible in the <em>Standard Display</em>. The visibility is indicated by the checkbox in front of the data node name in the Datamanager.
 If a data node is visible, the checkbox is filled - an empty checkbox indicates a hidden data node (see \ref ParentChild "Parent-Child-Relation" screenshot).
 <em>Hint: The data nodes are rendered on top of each other, such that the topmost visible data node is always displayed on top of other data nodes. By hiding
 the topmost visible data node the next data node becomes the topmost visible data node and the hidden data node is not rendered anymore.</em>
 <em>Note: "Visible" does not mean that the node is correctly displayed inside the render windows. The user might have to re-initialize a data node to have it correctly displayed.</em>
 
 \subsection DataManagerNodeSelection Selection of data nodes
 
 Some MITK-plugins contain widgets to control the data nodes that are used for plugin-specific data processing. These widgets can be configured such that they listen to
 the current selection of the Datamanager. Having such a plugin active each selection change of data nodes inside the data manager will change the respective selection of
 the plugin. The data node selection widgets can have specific node predicates, which means that only specific data nodes can be controlled by the widgets. It might happen
 that a selected data node will not be represented in such a selection widget or that the selection widget will be emptied.
 
 \subsection DataManagerNodeRenaming Renaming data nodes
 
 There are two ways of changing the name of a data node inside the Datamanager:
 
 <ul>
   <li> use the <em>F2</em> key on a single data node
   <li> double-click on a single data node
 </ul>
 
 In both cases the new name can be accepted by hitting <em>Enter</em> or by clicking somewhere else.
 
 \section DataManagerContextMenu Context Menu
 
 The Datamanager provides a context menu for each data node that can be opened by right-clicking on a data node.
 An example of the context-menu can be seen in the \ref ContextMenu "Context menu" screenshot.
 The context menu allows to quickly perform common actions on data nodes. These actions differ according to the data type. Some of these actions are described here.
 For more actions see the respective modules and plugins (e.g. <tt>QmitkCreatePolygonModelAction</tt> inside the <tt>org_mitk_gui_qt_segmentation</tt>-plugin.
 
 <ul>
   <li> <em>Global Reinit</em>: Re-initializes the render windows to the common bounding box of all data nodes of the data storage that
     <ul>
       <li> have not set <tt>"includeInBoundingBox"</tt> to false
       <li> are <tt>"visible"</tt>.
     </ul>
     In this case it does not matter on which node this action is performed.
 	<li> <em>Reinit</em>: Re-initializes the render windows to the common bounding box of all selected data nodes of the data storage that
     <ul>
       <li> have not set <tt>"includeInBoundingBox"</tt> to false
       <li> are <tt>"visible"</tt>.
     </ul>
   <li> <em>Save</em>: see \ref DataManagerSavingData "Saving Data" section
   <li> <em>Remove</em>: Removes all selected data nodes from the data storage.
   <li> <em>Show only selected nodes</em>: Enables the visibility of all selected data nodes and hides all other data nodes.
   <li> <em>Toggle visibility</em>: Shows / hides each selected data node according to each node's current visibility state.
   <li> <em>Show details</em>: Opens a pop-up window with detailed information about each node, like data type, geometry, DICOM information, file path etc.
   <li> <em>Opacity</em>: Sets the opacity via a slider for the rendering of the selected data node.
   <li> <em>Color</em>: Opens a pop-up window that allows to pick an arbitrary color for the rendering of all selected data nodes.
   <li> <em>Colormap</em>: Opens another submenu with a list of different colormaps that can be chosen for the rendering of all selected data nodes.
   <li> <em>Component</em>: Sets the currently visible data component for the rendering of this particular component of the selected data node.
   <li> <em>Texture Interpolation</em>: Smooths the data visualization for rendering of a selected data node.
   <li> <em>Surface Representation</em>: Opens another submenu with the following entries:
     <ul>
       <li> <em>Points</em>: Visually represents a surface (a data type) as a set of points.
       <li> <em>Wireframe</em>: Visually represents a surface (a data type) as a wireframe model.
       <li> <em>Surface</em>: Visually represents a surface (a data type) as a solid surface.
     </ul>
 </ul>
 
 As the description of the actions showed, it is possible to open / use the context menu with a single data node or with a set of selected data nodes.
 If the data types of multiple selected data nodes differ, the actions might not appear / work as expected. Also some actions are not available for a set of selected data nodes.
 
 \anchor ContextMenu
 \imageMacro{QmitkDatamanager_ContextMenu.png, "Context menu", 16.00}
 
 \section DataManagerPreferences Preferences
 
 The MITK Workbench provides a <em>preference page</em> for specific plugins. The preference page provided for the Datamanager can be seen in the \ref PreferencePage "Preference page" screenshot.
 The user can open the preference page by
 <ul>
   <li> using the keyboard shortcut <em>Ctrl + p</em>
   <li> using <em>Window -> Preferences...</em> from the top menu.
 </ul>
 
 It allows to set the following preferences for the Datamanager, which define the behavior of the Datamanager:
 <ul>
   <li> <em>Place new nodes on top</em>: If enabled, newly added data nodes will be inserted at the top of the list of data nodes inside the Datamanager.
   If disabled, newly added nodes will be inserted at the bottom of the list.
   <li> <em>Show helper objects</em>: If enabled, data nodes that have set <tt>"helper object"</tt> to true will be displayed in the Datamanager.
   If disabled, data nodes that have set <tt>"helper object"</tt> to true will not be visible in the Datamanager.
   <li> <em>Show nodes containing no data</em>: If enabled, data nodes that have no underlying base data defined will be displayed in the Datamanager.
   If disabled, data nodes that have no underlying base data defined will not be visible in the Datamanager.
   If disabled, the surface will have its original number of triangles in the triangle mesh.
   <li> <em>Allow changing of parent node</em>: If enabled, the user can change the hierarchy of the data nodes manually by dragging one or multiple data nodes and
   dropping them at any position inside the Datamanager (see \ref DataManagerWorking "Working with the Datamanager") for changing the order of the data nodes manually).
 </ul>
 
 \anchor PreferencePage
 \imageMacro{QmitkDatamanager_PreferencePage.png, "Preference page", 16.00}
 
 \section DataManagerHotkeys Hotkeys
 
 The MITK Workbench provides hotkeys for specific plugins. The hotkeys provided for the Datamanager can be seen in the \ref Hotkeys "Hotkeys" screenshot.
 They allow to expedite common operations in relation to data nodes or the Datamanager.
 The user can customize the hotkeys by accessing the <em>preference page</em>:
 <ul>
   <li> using the keyboard shortcut <em>Ctrl + p</em>
-  <li> useing <em>Window -> Preferences...</em> from the top menu
+  <li> using <em>Window -> Preferences...</em> from the top menu
 </ul>
 
 <ul>
   <li> <em>Delete selected nodes</em> Removes all selected data nodes from the data storage.
   <li> <em>Global reinit</em> Re-initializes the render windows to the common bounding box of all data nodes of the data storage that
     <ul>
       <li> have not set <tt>"includeInBoundingBox"</tt> to false
       <li> are <tt>"visible"</tt>
     </ul>
     In this case it does not matter on which node this action is performed.
   <li> <em>Make all nodes invisible</em> Hides all data nodes of the data storage.
   <li> <em>Reinit selected nodes</em> Re-initializes the render windows to the common bounding box of all selected data nodes of the data storage that
     <ul>
       <li> have not set <tt>"includeInBoundingBox"</tt> to false
       <li> are <tt>"visible"</tt>
     </ul>
   <li> <em>Show node information</em> Opens a pop-up window with detailed information about each node, like data type, geometry, DICOM information, file path etc.
   <li> <em>Toggle visibility of selected nodes</em>: Shows / hides each selected data node according to each node's current visibility state.
 </ul>
 
 \anchor Hotkeys
 \imageMacro{QmitkDatamanager_Hotkeys.png, "Hotkeys", 16.00}
 */
diff --git a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestControls.ui b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestControls.ui
index 52a3edab6c..6d496bcf2e 100644
--- a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestControls.ui
+++ b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestControls.ui
@@ -1,210 +1,210 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkDataStorageViewerTestControls</class>
  <widget class="QWidget" name="QmitkDataStorageViewerTestControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>945</width>
     <height>456</height>
    </rect>
   </property>
   <property name="minimumSize">
    <size>
     <width>0</width>
     <height>0</height>
    </size>
   </property>
   <property name="windowTitle">
    <string>Data storage viewer test</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
     <widget class="QmitkDataStorageListInspector" name="listInspector"/>
    </item>
    <item row="0" column="1">
     <widget class="QmitkDataStorageTreeInspector" name="treeInspector"/>
    </item>
    <item row="1" column="0">
     <widget class="QCheckBox" name="selectionProviderCheckBox1">
      <property name="text">
       <string>Set as selection provider</string>
      </property>
     </widget>
    </item>
    <item row="1" column="1">
     <widget class="QCheckBox" name="selectionProviderCheckBox2">
      <property name="text">
       <string>Set as selection provider</string>
      </property>
     </widget>
    </item>
    <item row="2" column="0">
     <widget class="QCheckBox" name="selectionListenerCheckBox1">
      <property name="text">
       <string>Set as selection listener</string>
      </property>
     </widget>
    </item>
    <item row="2" column="1">
     <widget class="QCheckBox" name="selectionListenerCheckBox2">
      <property name="text">
       <string>Set as selection listener</string>
      </property>
     </widget>
    </item>
    <item row="3" column="0">
     <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>
    <item row="3" column="1">
     <widget class="QmitkMultiNodeSelectionWidget" name="multiSlot" native="true"/>
    </item>
    <item row="4" column="0">
     <widget class="QCheckBox" name="selectionProviderCheckBox3">
      <property name="text">
       <string>Set as selection provider</string>
      </property>
     </widget>
    </item>
    <item row="4" column="1">
     <widget class="QCheckBox" name="selectionProviderCheckBox4">
      <property name="text">
       <string>Set as selection provider</string>
      </property>
     </widget>
    </item>
    <item row="5" column="0">
     <widget class="QCheckBox" name="selectionListenerCheckBox3">
      <property name="text">
-      <string>Set as selection listner</string>
+      <string>Set as selection listener</string>
      </property>
     </widget>
    </item>
    <item row="5" column="1">
     <widget class="QCheckBox" name="selectionListenerCheckBox4">
      <property name="text">
-      <string>Set as selection listner</string>
+      <string>Set as selection listener</string>
      </property>
     </widget>
    </item>
    <item row="6" column="0">
     <widget class="QCheckBox" name="checkOnlyVisible1">
      <property name="text">
       <string>Only valid nodes</string>
      </property>
     </widget>
    </item>
    <item row="6" column="1">
     <widget class="QCheckBox" name="checkOnlyVisible2">
      <property name="text">
       <string>Only valid nodes</string>
      </property>
     </widget>
    </item>
    <item row="7" column="0">
     <widget class="QCheckBox" name="checkOnlyImages1">
      <property name="text">
       <string>Allow only images </string>
      </property>
     </widget>
    </item>
     <item row="7" column="1">
     <widget class="QCheckBox" name="checkOnlyImages2">
      <property name="text">
       <string>Allow only images (using NodePredicate feature and general invalid message)</string>
      </property>
     </widget>
    </item>
    <item row="8" column="1">
     <widget class="QCheckBox" name="checkOnlyUneven">
      <property name="text">
       <string>Allow only uneven selection count (using check funcktion feature)</string>
      </property>
     </widget>
    </item>
     <item row="9" column="0">
     <widget class="QCheckBox" name="checkOptional1">
      <property name="text">
       <string>Is Optional</string>
      </property>
     </widget>
    </item>
    <item row="9" column="1">
     <widget class="QCheckBox" name="checkOptional2">
      <property name="text">
       <string>Is Optional</string>
      </property>
     </widget>
    </item>
    <item row="10" column="0">
     <widget class="QCheckBox" name="checkEnabled1">
      <property name="text">
       <string>Is Enabled</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="10" column="1">
     <widget class="QCheckBox" name="checkEnabled2">
      <property name="text">
       <string>Is Enabled</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="11" column="0">
     <widget class="QCheckBox" name="checkAuto">
      <property name="text">
       <string>Auto select node</string>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkDataStorageListInspector</class>
    <extends>QWidget</extends>
    <header location="global">QmitkDataStorageListInspector.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkDataStorageTreeInspector</class>
    <extends>QWidget</extends>
    <header location="global">QmitkDataStorageTreeInspector.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkSingleNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkMultiNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkMultiNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox
index feb3c7e1f5..e4eb5ea593 100644
--- a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox
+++ b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox
@@ -1,73 +1,73 @@
 /**
 \page org_mitk_views_deformableclippingplane The Clipping Plane View
 
 \imageMacro{QmitkClippingPlane_Icon.png,"Icon of the Clipping Plane Plugin",5.00}
 
 
 \imageMacro{QmitkClippingPlane_Overview2.png,"Clipping Plane view",16.00}
 
 \tableofcontents
 
 \section org_mitk_views_clippingPlaneManualOverview Overview
 
-The <b>Clipping Plane view</b> allows you to create clipping planes and calculate the volumina of the devided parts.
+The <b>Clipping Plane view</b> allows you to create clipping planes and calculate the volumina of the divided parts.
 
 
 \section org_mitk_views_clippingPlaneTechnicalIssue Technical Issue
 
 To use the Update Volumina function your image should be binary.
 
 \section org_mitk_views_clippingPlaneManualImageSelection Image Selection
 
 The Clipping Plane view makes use of the Data Manager view to give you an overview of all images, segmentations and clipping planes.
 
 \imageMacro{QmitkClippingPlane_DataManager.png,"Data Manager is used for selecting the current clipping plane. The reference plane is selected in the drop down box of the control area.",8.00}
 
 To select the reference plane use the drop down box in the control area of the Clipping Plane view or the Data Manager. The clipping plane selected in the Data Manager is displayed below the drop down box. If no clipping plane exists or none is selected create a new clipping plane by using the "Create new clipping plane" button.
 Some items of the graphical user interface might be disabled when no plane is selected.
 In any case, the application will give you hints if a selection is needed.
 
 \section org_mitk_views_clippingPlaneCreating Creating New Clipping Plane
 
 If you want to create a new clipping plane select an image from the Data Manager and press the button "Create new clipping plane". Optionally you can enable the "...with surface model" option.
 
 \section org_mitk_views_clippingPlaneInteraction Interaction with the planes
 \imageMacro{QmitkClippingPlane_Interaction.png,"The interaction buttons",5.00}
 
 You have different options to interact with the clipping planes:
 
 \subsection org_mitk_views_clippingPlaneTranslation Translation
 
 In Translation mode you can change the position of the clipping plane.
  - Click the Translation Button
  - Move mouse over the selected clipping plane (the plane changes its color from blue to green)
  - Hold mouse-left button and move the mouse orthogonally to the plane
 
 \subsection org_mitk_views_clippingPlaneRotation Rotation
 
 In Rotation mode you can change the angle of the clipping plane.
  - Click the Rotation Button
  - Move mouse over the selected clipping plane (the plane changes its color from blue to green)
  - Hold mouse-left button and move the mouse in the direction it should be rotated
 
 \subsection org_mitk_views_clippingPlaneDeformation Deformation
 
 In Deformation mode you can change the surface of the clipping plane.
  - Click the Deformation Button
  - Move mouse over the selected clipping plane (the plane changes its color from blue to green). The deformation area is highlighted in red and yellow.
  - On mouse-scrolling you can change the size of the deformation area (Scroll-Down = smaller / Scroll-Up = bigger).
  - Hold mouse-left button and move the mouse orthogonally to the plane to deformate the plane
 
 \section org_mitk_views_clippingPlaneUpdateVolumina Update Volumina
 
 \imageMacro{QmitkClippingPlane_UpdateVolumina.png,"The 'Update Volumina' button",5.00}
 
-Calculating the volumina of the segmentation parts, which are devided by the clipping plane(s).
+Calculating the volumina of the segmentation parts, which are divided by the clipping plane(s).
  - Create a segmentation (see Segmentation-Manual)
  - Create one or more clipping plane(s)
  - Use the interaction buttons (Translation, Rotation, Deformation) to adjust the clipping plane for intersecting the segmentation
- - (You can decide which planes shouldnt be included for the calculation by changing their visibility to invisible)
+ - (You can decide which planes shouldn't be included for the calculation by changing their visibility to invisible)
  - Click button "Update Volumina" button
  - The intersected parts are displayed in different colors and their volumina are shown beneath the "Update Volumina" button
 
 **/
diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp
index 095153cb34..2d2ffa0a09 100644
--- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp
+++ b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp
@@ -1,584 +1,584 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkDeformableClippingPlaneView.h"
 
 #include <usModuleRegistry.h>
 
 // mitk core
 #include <mitkImageToSurfaceFilter.h>
 #include <mitkInteractionConst.h>
 #include <mitkLevelWindowProperty.h>
 #include <mitkLookupTableProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkRenderingModeProperty.h>
 #include <mitkRotationOperation.h>
 #include <mitkSurfaceVtkMapper3D.h>
 #include <mitkVtkRepresentationProperty.h>
 #include <mitkVtkResliceInterpolationProperty.h>
 
 #include <mitkHeightFieldSurfaceClipImageFilter.h>
 #include <mitkClippingPlaneInteractor3D.h>
 #include <mitkLabeledImageLookupTable.h>
 #include <mitkLabeledImageVolumeCalculator.h>
 #include <mitkSurfaceDeformationDataInteractor3D.h>
 
 #include <vtkFloatArray.h>
 #include <vtkPointData.h>
 #include <vtkPlaneSource.h>
 #include <vtkProperty.h>
 
 #include <mitkILinkedRenderWindowPart.h>
 
 #include <array>
 
 const std::string QmitkDeformableClippingPlaneView::VIEW_ID = "org.mitk.views.deformableclippingplane";
 
 QmitkDeformableClippingPlaneView::QmitkDeformableClippingPlaneView()
   : QmitkAbstractView()
   , m_Controls(new Ui::QmitkDeformableClippingPlaneViewControls)
   , m_WorkingNode(nullptr)
 {
   auto isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
   auto isNotHelperObject = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)));
 
   m_IsImagePredicate = mitk::NodePredicateAnd::New(isImage, isNotHelperObject);
 
   m_IsClippingPlanePredicate = mitk::NodePredicateProperty::New("clippingPlane", mitk::BoolProperty::New(true));
 }
 
 QmitkDeformableClippingPlaneView::~QmitkDeformableClippingPlaneView()
 {
   if (m_WorkingNode.IsNotNull())
     m_WorkingNode->SetDataInteractor(nullptr);
 }
 
 void QmitkDeformableClippingPlaneView::SetFocus()
 {
   m_Controls->createNewPlanePushButton->setFocus();
 }
 
 void QmitkDeformableClippingPlaneView::CreateQtPartControl(QWidget *parent)
 {
   m_Controls->setupUi(parent);
 
   m_Controls->imageSelectionWidget->SetDataStorage(GetDataStorage());
   m_Controls->imageSelectionWidget->SetNodePredicate(m_IsImagePredicate);
   m_Controls->imageSelectionWidget->SetSelectionIsOptional(false);
   m_Controls->imageSelectionWidget->SetInvalidInfo("Select an image or segmentation.");
   m_Controls->imageSelectionWidget->SetPopUpTitel("Select an image or segmentation.");
 
   m_Controls->clippingPlaneSelector->SetDataStorage(this->GetDataStorage());
   m_Controls->clippingPlaneSelector->SetPredicate(m_IsClippingPlanePredicate);
 
   m_Controls->volumeGroupBox->setEnabled(false);
   m_Controls->interactionSelectionBox->setEnabled(false);
   m_Controls->planesWarningLabel->hide();
 
   this->CreateConnections();
 
   m_Controls->imageSelectionWidget->SetAutoSelectNewNodes(true);
 }
 
 void QmitkDeformableClippingPlaneView::OnCurrentSelectionChanged(const QList<mitk::DataNode::Pointer>& /*nodes*/)
 {
   this->UpdateView();
 }
 
 void QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged(const mitk::DataNode* node)
 {
   this->DeactivateInteractionButtons();
 
   auto selectedNode = const_cast<mitk::DataNode*>(node);
   if(nullptr != selectedNode)
   {
     if(m_WorkingNode.IsNotNull())
       selectedNode->SetDataInteractor(m_WorkingNode->GetDataInteractor());
 
     m_WorkingNode = selectedNode;
   }
 
   this->UpdateView();
 }
 
 void QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane()
 {
   this->DeactivateInteractionButtons();
 
   auto plane = mitk::Surface::New();
   auto planeSource = vtkSmartPointer<vtkPlaneSource>::New();
 
   planeSource->SetOrigin(-32.0, -32.0, 0.0);
   planeSource->SetPoint1(32.0, -32.0, 0.0);
   planeSource->SetPoint2(-32.0, 32.0, 0.0);
   planeSource->SetResolution(128, 128);
   planeSource->Update();
 
   plane->SetVtkPolyData(planeSource->GetOutput());
 
   mitk::ScalarType imageDiagonal = 200.0;
 
   auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode();
   if (selectedNode.IsNotNull())
   {
     auto selectedImage = dynamic_cast<mitk::Image*>(selectedNode->GetData());
     if (nullptr != selectedImage)
     {
       // check if user wants a surface model
       if (m_Controls->surfaceModelCheckBox->isChecked())
       {
         //Check if there is a surface node from the image. If not, create one
         bool createSurfaceFromImage = true;
         auto isSurface = mitk::NodePredicateDataType::New("Surface");
         auto childNodes = GetDataStorage()->GetDerivations(selectedNode, isSurface, true);
 
         for (mitk::DataStorage::SetOfObjects::ConstIterator it = childNodes->Begin();
           it != childNodes->End(); it++)
         {
           if (it.Value().IsNotNull() && it->Value()->GetName() == selectedNode->GetName())
           {
             createSurfaceFromImage = false;
             it.Value()->SetVisibility(true);
           }
         }
 
         if (createSurfaceFromImage)
         {
           //Lsg 2: Surface for the 3D-perspective
           auto surfaceFilter = mitk::ImageToSurfaceFilter::New();
           surfaceFilter->SetInput(selectedImage);
           surfaceFilter->SetThreshold(1);
           surfaceFilter->SetSmooth(true);
           //Downsampling
           surfaceFilter->SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro);
 
           auto surfaceNode = mitk::DataNode::New();
           surfaceNode->SetData(surfaceFilter->GetOutput());
           surfaceNode->SetProperty("color", selectedNode->GetProperty("color"));
           surfaceNode->SetOpacity(0.5);
           surfaceNode->SetName(selectedNode->GetName());
           this->GetDataStorage()->Add(surfaceNode, selectedNode);
         }
       }
 
       //If an image is selected trim the plane to this.
       imageDiagonal = selectedImage->GetGeometry()->GetDiagonalLength();
       plane->SetOrigin(selectedImage->GetGeometry()->GetCenter());
 
       // Rotate plane
       mitk::Vector3D rotationAxis;
       mitk::FillVector3D(rotationAxis, 0.0, 1.0, 0.0);
       mitk::RotationOperation op(mitk::OpROTATE, selectedImage->GetGeometry()->GetCenter(), rotationAxis, 90.0);
       plane->GetGeometry()->ExecuteOperation(&op);
     }
   }
 
   // equivalent to the extent and resolution function of the clipping plane
   const auto x = imageDiagonal * 0.9;
   planeSource->SetOrigin(-x / 2.0, -x / 2.0, 0.0);
   planeSource->SetPoint1(x / 2.0, -x / 2.0, 0.0);
   planeSource->SetPoint2(-x / 2.0, x / 2.0, 0.0);
   planeSource->SetResolution(64, 64);
   planeSource->Update();
 
   plane->SetVtkPolyData(planeSource->GetOutput());
 
   // Set scalars (for colorization of plane)
   vtkFloatArray *scalars = vtkFloatArray::New();
   scalars->SetName("Distance");
   scalars->SetNumberOfComponents(1);
 
   const auto numerOfPoints = plane->GetVtkPolyData(0)->GetNumberOfPoints();
   for (std::remove_const_t<decltype(numerOfPoints)> i = 0; i < plane->GetVtkPolyData(0)->GetNumberOfPoints(); ++i)
   {
     scalars->InsertNextValue(-1.0);
   }
   plane->GetVtkPolyData(0)->GetPointData()->SetScalars(scalars);
   plane->GetVtkPolyData(0)->GetPointData()->Update();
 
   auto planeNode = mitk::DataNode::New();
   planeNode->SetData(plane);
 
   std::stringstream planeName;
   planeName << "ClippingPlane ";
   planeName << this->GetAllClippingPlanes()->Size() + 1;
 
   planeNode->SetName(planeName.str());
   planeNode->AddProperty("clippingPlane", mitk::BoolProperty::New(true));
   // Make plane pickable
   planeNode->SetBoolProperty("pickable", true);
 
   mitk::SurfaceVtkMapper3D::SetDefaultProperties(planeNode);
 
   // Don't include plane in bounding box!
   planeNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
 
   // Set lookup table for plane surface visualization
   auto lookupTablevtk = vtkSmartPointer<vtkLookupTable>::New();
   lookupTablevtk->SetHueRange(0.6, 0.0);
   lookupTablevtk->SetSaturationRange(1.0, 1.0);
   lookupTablevtk->SetValueRange(1.0, 1.0);
   lookupTablevtk->SetTableRange(-1.0, 1.0);
   lookupTablevtk->Build();
 
   auto lookupTable = mitk::LookupTable::New();
   lookupTable->SetVtkLookupTable(lookupTablevtk);
 
   auto prop = mitk::LookupTableProperty::New(lookupTable);
 
   planeNode->SetProperty("LookupTable", prop);
   planeNode->SetBoolProperty("scalar visibility", true);
   planeNode->SetBoolProperty("color mode", true);
   planeNode->SetFloatProperty("ScalarsRangeMinimum", -1.0);
   planeNode->SetFloatProperty("ScalarsRangeMaximum", 1.0);
 
   // Configure material so that only scalar colors are shown
   planeNode->SetColor(0.0f, 0.0f, 0.0f);
   planeNode->SetOpacity(1.0f);
   planeNode->SetFloatProperty("material.wireframeLineWidth", 2.0f);
 
   //Set view of plane to wireframe
   planeNode->SetProperty("material.representation", mitk::VtkRepresentationProperty::New(VTK_WIREFRAME));
 
   //Add the plane to data storage
   this->GetDataStorage()->Add(planeNode);
 
   //Change the index of the selector to the new generated node
   m_Controls->clippingPlaneSelector->setCurrentIndex(m_Controls->clippingPlaneSelector->Find(planeNode));
 
   m_Controls->interactionSelectionBox->setEnabled(true);
 
   if (auto renderWindowPart = dynamic_cast<mitk::ILinkedRenderWindowPart*>(this->GetRenderWindowPart()))
   {
     renderWindowPart->EnableSlicingPlanes(false);
   }
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkDeformableClippingPlaneView::OnCalculateClippingVolume()
 {
   auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode();
   if (selectedNode.IsNull())
   {
     MITK_ERROR << "No segmentation selected! Can't calculate volume";
     return;
   }
 
   bool isSegmentation = false;
   selectedNode->GetBoolProperty("binary", isSegmentation);
   if (!isSegmentation)
   {
     MITK_ERROR << "No segmentation selected! Can't calculate volume";
     return;
   }
 
   std::vector<mitk::Surface*> clippingPlanes;
   mitk::DataStorage::SetOfObjects::ConstPointer allClippingPlanes = this->GetAllClippingPlanes();
   for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++)
   {
     bool isVisible = false;
     itPlanes.Value()->GetBoolProperty("visible", isVisible);
     auto plane = dynamic_cast<mitk::Surface*>(itPlanes.Value()->GetData());
 
     if (isVisible && nullptr != plane)
       clippingPlanes.push_back(plane);
   }
 
   if (clippingPlanes.empty())
   {
     MITK_ERROR << "No clipping plane selected! Can't calculate volume";
     return;
   }
 
   // deactivate Tools
   this->DeactivateInteractionButtons();
   //Clear the list of volumes, before calculating the new values
   m_Controls->volumeList->clear();
 
   selectedNode->SetBoolProperty("visible", false);
 
-  //set some properties for clipping the image-->Output: labled Image
+  //set some properties for clipping the image-->Output: labeled Image
   mitk::HeightFieldSurfaceClipImageFilter::Pointer surfaceClipFilter = mitk::HeightFieldSurfaceClipImageFilter::New();
 
   surfaceClipFilter->SetInput(dynamic_cast<mitk::Image*>(selectedNode->GetData()));
   surfaceClipFilter->SetClippingModeToMultiPlaneValue();
   surfaceClipFilter->SetClippingSurfaces(clippingPlanes);
   surfaceClipFilter->Update();
 
   //delete the old clipped image node
   mitk::DataStorage::SetOfObjects::ConstPointer oldClippedNode = this->GetDataStorage()->GetSubset(mitk::NodePredicateProperty::New("name", mitk::StringProperty::New("Clipped Image")));
   if (oldClippedNode.IsNotNull())
     this->GetDataStorage()->Remove(oldClippedNode);
 
   //add the new clipped image node
   auto clippedNode = mitk::DataNode::New();
   mitk::Image::Pointer clippedImage = surfaceClipFilter->GetOutput();
   clippedImage->DisconnectPipeline();
   clippedNode->SetData(clippedImage);
   clippedNode->SetName("Clipped Image");
   clippedNode->SetColor(1.0, 1.0, 1.0);  // color property will not be used, labeled image lookuptable will be used instead
   clippedNode->SetProperty("use color", mitk::BoolProperty::New(false));
   clippedNode->SetProperty("reslice interpolation", mitk::VtkResliceInterpolationProperty::New(VTK_RESLICE_NEAREST));
   clippedNode->SetOpacity(0.4);
   this->GetDataStorage()->Add(clippedNode);
 
   auto volumeCalculator = mitk::LabeledImageVolumeCalculator::New();
   volumeCalculator->SetImage(clippedImage);
   volumeCalculator->Calculate();
 
   auto volumes = volumeCalculator->GetVolumes();
 
   auto lookupTable = mitk::LabeledImageLookupTable::New();
   int lablesWithVolume = 0;
   const auto numberOfVolumes = volumes.size();
   for (std::remove_const_t<decltype(numberOfVolumes)> i = 1; i < numberOfVolumes; ++i)
   {
     if (0 != volumes[0])
     {
       lablesWithVolume++;
 
       mitk::Color color(GetLabelColor(lablesWithVolume));
       lookupTable->SetColorForLabel(i, color.GetRed(), color.GetGreen(), color.GetBlue(), 1.0);
 
       QColor qcolor;
       qcolor.setRgbF(color.GetRed(), color.GetGreen(), color.GetBlue(), 0.7);
 
       //output volume as string "x.xx ml"
       std::stringstream stream;
       stream << std::fixed << std::setprecision(2) << 0.001 * volumes[i] << " ml";
       stream << " ml";
 
       auto item = new QListWidgetItem();
       item->setText(QString::fromStdString(stream.str()));
       item->setBackgroundColor(qcolor);
       m_Controls->volumeList->addItem(item);
     }
   }
 
   //set the rendering mode to use the lookup table and level window
   clippedNode->SetProperty("Image Rendering.Mode", mitk::RenderingModeProperty::New(mitk::RenderingModeProperty::LOOKUPTABLE_LEVELWINDOW_COLOR));
   mitk::LookupTableProperty::Pointer lutProp = mitk::LookupTableProperty::New(lookupTable.GetPointer());
   clippedNode->SetProperty("LookupTable", lutProp);
   // it is absolutely important, to use the LevelWindow settings provided by
   // the LUT generator, otherwise, it is not guaranteed, that colors show
   // up correctly.
   clippedNode->SetProperty("levelwindow", mitk::LevelWindowProperty::New(lookupTable->GetLevelWindow()));
 }
 
 void QmitkDeformableClippingPlaneView::OnTranslationMode(bool check)
 {
   if (check)
   { //uncheck all other buttons
     m_Controls->rotationPushButton->setChecked(false);
     m_Controls->deformationPushButton->setChecked(false);
 
     mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New();
     affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     affineDataInteractor->SetEventConfig("ClippingPlaneTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     affineDataInteractor->SetDataNode(m_WorkingNode);
   }
   else
     m_WorkingNode->SetDataInteractor(nullptr);
 }
 
 void QmitkDeformableClippingPlaneView::OnRotationMode(bool check)
 {
   if (check)
   { //uncheck all other buttons
     m_Controls->translationPushButton->setChecked(false);
     m_Controls->deformationPushButton->setChecked(false);
 
     mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New();
     affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     affineDataInteractor->SetEventConfig("ClippingPlaneRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     affineDataInteractor->SetDataNode(m_WorkingNode);
   }
   else
     m_WorkingNode->SetDataInteractor(nullptr);
 }
 
 void QmitkDeformableClippingPlaneView::OnDeformationMode(bool check)
 {
   if (check)
   { //uncheck all other buttons
     m_Controls->translationPushButton->setChecked(false);
     m_Controls->rotationPushButton->setChecked(false);
 
     mitk::SurfaceDeformationDataInteractor3D::Pointer surfaceDataInteractor = mitk::SurfaceDeformationDataInteractor3D::New();
     surfaceDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     surfaceDataInteractor->SetEventConfig("ClippingPlaneDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
     surfaceDataInteractor->SetDataNode(m_WorkingNode);
   }
   else
     m_WorkingNode->SetDataInteractor(nullptr);
 }
 
 void QmitkDeformableClippingPlaneView::CreateConnections()
 {
   connect(m_Controls->imageSelectionWidget, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkDeformableClippingPlaneView::OnCurrentSelectionChanged);
   connect(m_Controls->translationPushButton, &QPushButton::toggled,
     this, &QmitkDeformableClippingPlaneView::OnTranslationMode);
   connect(m_Controls->rotationPushButton, &QPushButton::toggled,
     this, &QmitkDeformableClippingPlaneView::OnRotationMode);
   connect(m_Controls->deformationPushButton, &QPushButton::toggled,
     this, &QmitkDeformableClippingPlaneView::OnDeformationMode);
   connect(m_Controls->createNewPlanePushButton, &QPushButton::clicked,
     this, &QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane);
   connect(m_Controls->updateVolumePushButton, &QPushButton::clicked,
     this, &QmitkDeformableClippingPlaneView::OnCalculateClippingVolume);
   connect(m_Controls->clippingPlaneSelector, &QmitkDataStorageComboBox::OnSelectionChanged,
     this, &QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged);
 }
 
 void QmitkDeformableClippingPlaneView::NodeRemoved(const mitk::DataNode* node)
 {
   if (m_IsClippingPlanePredicate->CheckNode(node))
   {
     if (this->GetAllClippingPlanes()->Size() <= 1)
     {
       m_WorkingNode = nullptr;
       this->UpdateView();
     }
   }
 }
 
 void::QmitkDeformableClippingPlaneView::NodeChanged(const mitk::DataNode*)
 {
   this->UpdateView();
 }
 
 void QmitkDeformableClippingPlaneView::UpdateView()
 {
   auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode();
   if (selectedNode.IsNotNull())
   {
     m_Controls->selectedReferenceImageLabel->setText(QString::fromUtf8(selectedNode->GetName().c_str()));
     if (m_WorkingNode.IsNotNull())
     {
       bool isSegmentation = false;
       selectedNode->GetBoolProperty("binary", isSegmentation);
       m_Controls->interactionSelectionBox->setEnabled(true);
 
       m_Controls->volumeGroupBox->setEnabled(isSegmentation);
 
       //clear list --> than search for all shown clipping plans (max 7 planes)
       m_Controls->selectedClippingPlanesLabel->setText("");
       m_Controls->planesWarningLabel->hide();
       int volumePlanes = 0;
 
       auto allClippingPlanes = this->GetAllClippingPlanes();
       for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++)
       {
         bool isVisible = false;
         itPlanes.Value()->GetBoolProperty("visible", isVisible);
         if (isVisible)
         {
           if (volumePlanes < 7)
           {
             ++volumePlanes;
             m_Controls->selectedClippingPlanesLabel->setText(m_Controls->selectedClippingPlanesLabel->text().append(QString::fromStdString(itPlanes.Value()->GetName()+"\n")));
           }
           else
           {
             m_Controls->planesWarningLabel->show();
             return;
           }
         }
       }
     }
     else
     {
       m_Controls->volumeGroupBox->setEnabled(false);
       m_Controls->interactionSelectionBox->setEnabled(false);
       m_Controls->selectedClippingPlanesLabel->setText("");
       m_Controls->volumeList->clear();
     }
   }
   else
   {
     m_Controls->volumeGroupBox->setEnabled(false);
     m_Controls->selectedReferenceImageLabel->setText("");
     m_Controls->selectedClippingPlanesLabel->setText("");
     m_Controls->planesWarningLabel->hide();
 
     m_Controls->interactionSelectionBox->setEnabled(m_WorkingNode.IsNotNull());
   }
 }
 
 mitk::DataStorage::SetOfObjects::ConstPointer QmitkDeformableClippingPlaneView::GetAllClippingPlanes()
 {
   auto allPlanes = GetDataStorage()->GetSubset(m_IsClippingPlanePredicate);
   return allPlanes;
 }
 
 mitk::Color QmitkDeformableClippingPlaneView::GetLabelColor(int label)
 {
   std::array<float, 3> color = { 0.0f, 0.0f, 0.0f };
 
   switch (label % 6)
   {
   case 0: // red
     color[0] = 1.0f;
     break;
   case 1: // green
     color[1] = 1.0f;
     break;
   case 2: // blue
     color[2] = 1.0f;
     break;
   case 3: // yellow
     color[0] = 1.0f;
     color[1] = 1.0f;
     break;
   case 4: // magenta
     color[0] = 1.0f;
     color[2] = 1.0f;
     break;
   case 5: // cyan
     color[1] = 1.0f;
     color[2] = 1.0f;
   default: // black
     break;
   }
 
   int outerCycleNr = label / 6;
   int cycleSize = std::min(1, static_cast<int>(std::pow(2.0, std::log(outerCycleNr) / std::log(2.0))));
   int insideCycleCounter = outerCycleNr % cycleSize;
 
   float factor;
   if (0 == outerCycleNr)
   {
     factor = 255.0f;
   }
   else
   {
     factor = 256.0f / (2.0f * cycleSize) + insideCycleCounter * (256.0f / cycleSize);
   }
 
   color = {
     std::min(1.0f, color[0] / 256.0f * factor),
     std::min(1.0f, color[1] / 256.0f * factor),
     std::min(1.0f, color[2] / 256.0f * factor)
   };
 
   return mitk::Color(color.data());
 }
 
 void QmitkDeformableClippingPlaneView::DeactivateInteractionButtons()
 {
   m_Controls->translationPushButton->setChecked(false);
   m_Controls->rotationPushButton->setChecked(false);
   m_Controls->deformationPushButton->setChecked(false);
 }
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt b/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt
index f8c21fc0fe..9be5362901 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt
@@ -1,29 +1,29 @@
 project(org_mitk_gui_qt_dicombrowser)
 
 # Note:
 # If we use an installed version of DCMTK then DCMTK_DIR points to the subdirectory
 # of the installation directory (share/dcmtk) that contains DCMTKConfig.cmake.
 # Therefore we look for the the storescp command in the '../../bin' directory, too.
 find_program(DCMTK_STORESCP
   NAMES storescp storescp${DCMTK_CMAKE_DEBUG_POSTFIX} storescp${CMAKE_DEBUG_POSTFIX}
   PATHS "${MITK_EXTERNAL_PROJECT_PREFIX}/bin"
   PATH_SUFFIXES Release Debug
-  DOC "Dcmtk storage provider which is used to store dicom files which are transfered over network."
+  DOC "Dcmtk storage provider which is used to store dicom files which are transferred over network."
   NO_DEFAULT_PATH
 )
 mark_as_advanced(DCMTK_STORESCP)
 
 if(NOT EXISTS ${DCMTK_STORESCP})
   message(WARNING "Couldn't find program storescp: Query/retrieve of the DICOM plugin won't work!")
 else()
   configure_file( org_mitk_gui_qt_dicombrowser_config.h.in org_mitk_gui_qt_dicombrowser_config.h @ONLY)
 
   MITK_INSTALL_HELPER_APP(EXECUTABLES ${DCMTK_STORESCP})
 
   mitk_create_plugin(
     EXPORT_DIRECTIVE DICOM_EXPORT
     EXPORTED_INCLUDE_SUFFIXES src
     MODULE_DEPENDS MitkContourModel MitkQtWidgetsExt MitkDICOMUI MitkRT MitkRTUI MitkDICOM
     PACKAGE_DEPENDS CTK|CTKDICOMWidgets
   )
 endif()
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox
index d69c4c5e55..913fea2601 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox
@@ -1,118 +1,118 @@
 /**
 \page org_mitk_editors_dicombrowser The Dicom Browser Plugin
 
 \imageMacro{dicombrowser-dox.svg,"Icon of the DICOM Plugin",2.00}
 
 \note This article requires a basic knowledge of the DICOM Standard.
 
 \tableofcontents
 
 \section org_mitk_gui_qt_dicomOverview Overview
 
 The DICOM editor is an experimental editor which allows for loading of DICOM images as well as server communication.
 It features a highly experimental query/retrieve (you need to configure your PACS correspondingly) as well as a DICOM browser.
 The DICOM browser allows you to navigate the DICOM folder/cd depending on its metadata (patient/study/series)
 and import selected series for viewing in your MITK based application.
 It also allows you to store your dicom data in an internal database so you can easily access often used dicom images.
 
 It is based on the <a href="https://commontk.org/index.php/Documentation/DICOM_Overview">commonTK (CTK) DICOM funcionality</a>.
 
 \section org_mitk_gui_qt_dicomDataHandling Data handling
 \imageMacro{QmitkDicom_PluginControls.png,"The dicom Plugin controls",7.37}
 In the image above you see the start page of the dicom plugin. On top of the start page you see four buttons. The Local Storage,
  the Import CD, the Import Folder and the Query Retrieve button. If you press one of these buttons, the dicom plugin will switch to your local dicom image storage or will start importing dicom images
 from CD or a folder on your hard drive or it will open the query retrieve screen.
 <ul>
 <li> Click the 'Local Storage' button to open the local storage screen.
 <li> Click the 'Import CD' button to import DICOM data from a CD.
 <li> Click the 'Import Folder' button to import DICOM date from a directory.
 <li> Click the 'Query Retrieve' button to open the query retrieve screen.
 </ul>
 
 \subsection org_mitk_gui_qt_dicomStorage Data storage
 \imageMacro{QmitkDicom_PluginExtended.png,"The DICOM data storage",16.00}
 If you open the dicom plugin the dicom data storage will be displayed. You are able to see all your stored dicom image data.
 You can browse your data by clicking on the left arrow beside the name of your data. There are three levels available.
 The first level is the patient level where you can see the patient data. On the second level you can see the dicom studies for the patient.
-on the third level you can see all available series refering to it's study.
+on the third level you can see all available series referring to its study.
 You can delete the data by selecting it and pressing the delete button.
-Be careful if you have selected a patient or a study all refering data be deleted.
-So if you delete a patient the patient and all studies and series refered to the patient will be deleted.
+Be careful if you have selected a patient or a study all referring data be deleted.
+So if you delete a patient the patient and all studies and series referred to the patient will be deleted.
 If you delete a study all series of the study will be deleted.
 If you want to view the dicom data you have to select a series and click on the View button.
-The data will appear in the DataManager and will be dispayed.
+The data will appear in the DataManager and will be displayed.
 \imageMacro{QmitkDicom_DisplayDataManager.png,"Viewed image",16.00}
 <ul>
 <li> Click on the arrow on the left of your data to expand or hide dicom data levels.
 <li> Click the 'Delete' button to delete selected DICOM data.
 <li> Click the 'View' button to view DICOM data.
 </ul>
 
 \subsection org_mitk_gui_qt_dicomImport Data import
 \imageMacro{QmitkDicom_ImportDialog.png,"The import dialog checked",9.53}
-There are two diffrent ways to import DICOM data.
-The First one is to directly imort it into your DICOM data storage. To achieve this you should toggle the checkbox 'Copy on import'.
+There are two different ways to import DICOM data.
+The First one is to directly import it into your DICOM data storage. To achieve this you should toggle the checkbox 'Copy on import'.
 The second approach is, to have a look at the data first before importing it.
 To do that you simply don't check 'Copy on import'.
-This will leed you to the leed you to the 'External Dicom Data' screen which provides you a preview of the data containing in youre choosen folder.
+This will leed you to the leed you to the 'External Dicom Data' screen which provides you a preview of the data containing in you're chosen folder.
 You can import the data here by selecting it and pressing the 'Download' button.
 It is also possible to view DICOM series directly in Mitk by selecting it here and pressing the 'View' button.
 <ul>
 <li> Click 'Import Folder' or 'Import CD' button to open the import dialog.</li>
   <ul>
   <li> Enable the 'Copy on import' checkbox and choose a folder to import into data storage directly.</li>
   <li> Disable the 'Copy on import' checkbox to get to the 'External Dicom Data' screen.</li>
       <ul>
       <li> Click on the arrow on the left of your data to expand or hide dicom data levels.
       <li> Click the 'Download' button to download selected DICOM data to your DICOM data storage.
       <li> Click the 'View' button to view DICOM data.
       </ul>
   </ul>
 </ul>
 
 \section org_mitk_gui_qt_dicomQueryRetrieve Query/Retrieve
 \warning This plugin is experimental and not all of the described features behave as expected.
 
 \note The query retrieve plugin only works if the PACS you are calling knows your machine settings.
 There are also issues when you are running a firewall.
 
 The query retrieve workflow allows you to get DICOM data from a server.
 \imageMacro{QmitkDicom_QueryRetrieve.png,"The query retrieve screen",16.00}
 
 \subsection org_mitk_gui_qt_dicomQuery Query
 \imageMacro{QmitkDicom_Nodes.png,"The DICOM network configuration",11.26}
 By performing a DICOM query you will ask a server for it's DICOM data.
 This requires to setup the DICOM network configuration of your system and the server.
 By clicking on 'Add Server' a new plain server field will appear. Now you can give it a name of your choice.
-Fill the servers "DICOM name" the AETitle. Type in it's url, it's port and the specific DICOM protocoll you want to use for image transfer.
-\note I recommend not to use CGET because most of the PACS systems (Image Servers) don't support that protocoll.
+Fill the servers "DICOM name" the AETitle. Type in it's url, it's port and the specific DICOM protocol you want to use for image transfer.
+\note I recommend not to use CGET because most of the PACS systems (Image Servers) don't support that protocol.
 
 You can configure the DICOM network configuration of your machine by editing the 'Calling AETiltle', the 'Storage AETitle' and The 'Storage Port' text fields.
-But normaly you don't have to change your configuration.
+But normally you don't have to change your configuration.
 \imageMacro{QmitkDicom_FilterWidget.png,"The DICOM search options",3.66}
 After you have finished your network configuration and before you start the query you should use the 'Search Options' to specify your query.
 Otherwise all data on the server will be queried and you will have to wait for a long time.
 You can specify your query by searching for a specific patient name or a study or a serie or a specific DICOM object by it's id.
-You are allowed to include or exclude DICOM modalities from your query and you can specify a specific time in which the DICOM images you are searching fo might been captured.
+You are allowed to include or exclude DICOM modalities from your query and you can specify a specific time in which the DICOM images you are searching for might been captured.
 When you finished that you can click the query button and the queried DICOM data will appear.
 <ul>
 <li> Click on the 'Add Server' button.
     <ul>
     <li> Edit 'Name' field.
 	<li> Edit 'AETitle' field.
-	<li> Edit 'Adress' field.
+	<li> Edit 'Address' field.
     <li> Edit 'Port' field.
     </ul>
 <li> Set search options.
 <li> Click on 'Query' button.
 </ul>
 \subsection org_mitk_gui_qt_dicomRetrieve Retrieve
 \imageMacro{QmitkDicom_Retrieve.png,"The queried DICOM data.",15.22}
 After the query you are able to select the queried data and click the 'Retrieve' button.
 This will store the queried DICOM data into your DICOM storage.
 Click on the 'Local Storage' button and work with your new data.
 <ul>
 <li> Click on the 'Retrieve' button to retrieve the data to your DICOM storage.
 <li> Click on the 'Local Storage' button.
 </ul>
 */
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h
index a30841bbba..40cf1e6355 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.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 QmitkDicomBrowser_h
 #define QmitkDicomBrowser_h
 
 // Blueberry
 #include <berryIPartListener.h>
 #include <berryISelectionListener.h>
 #include <berryQtEditorPart.h>
 
 // MITK
 #include "DicomEventHandler.h"
 #include "QmitkDicomDataEventPublisher.h"
 #include "QmitkDicomDirectoryListener.h"
 #include "QmitkStoreSCPLauncher.h"
 #include "QmitkStoreSCPLauncherBuilder.h"
 #include "ui_QmitkDicomBrowserControls.h"
 #include <org_mitk_gui_qt_dicombrowser_Export.h>
 
 // Qt
 #include <QObject>
 #include <QString>
 #include <QStringList>
 #include <QThread>
 #include <QVariant>
 
 namespace mitk
 {
   class IPreferences;
 }
 
 /**
 * \brief QmitkDicomBrowser is an editor providing functionality for dicom storage and import and query retrieve functionality.
 *
 * \sa berry::IPartListener
 * \ingroup ${plugin_target}_internal
 */
 class DICOM_EXPORT QmitkDicomBrowser : public berry::QtEditorPart, virtual public berry::IPartListener
 {
 // 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(QmitkDicomBrowser);
     static const std::string EDITOR_ID;
     static const QString TEMP_DICOM_FOLDER_SUFFIX;
 
    /**
     * \brief QmitkDicomBrowser constructor.
     */
     QmitkDicomBrowser();
 
    /**
     * \brief QmitkDicomBrowser destructor.
     */
     ~QmitkDicomBrowser() override;
 
    /**
     * \brief Init initialize the editor.
     */
     void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
 
     void SetFocus() override;
     void DoSave() override {}
     void DoSaveAs() override {}
     bool IsDirty() const override { return false; }
     bool IsSaveAsAllowed() const override { return false; }
 
     virtual void OnPreferencesChanged(const  mitk::IPreferences* prefs);
 
 signals:
 
    /**
     * \brief SignalStartDicomImport is enitted when dicom directory for import was selected.
     */
     void SignalStartDicomImport(const QString&);
 
 protected slots:
 
     /// \brief Called when import is finished.
     void OnDicomImportFinished();
 
     /// \brief Called when Query Retrieve or Import Folder was clicked.
     void OnTabChanged(int);
 
     /// \brief Called when view button is clicked. Sends out an event for adding the current selected file to the mitkDataStorage.
     void OnViewButtonAddToDataManager(QHash<QString, QVariant> eventProperties);
 
     /// \brief Called when status of dicom storage provider changes.
     void OnStoreSCPStatusChanged(const QString& status);
 
     /// \brief Called when dicom storage provider emits a network error.
     void OnDicomNetworkError(const QString& status);
 
 protected:
 
     /// \brief StartStoreSCP starts  dicom storage provider.
     void StartStoreSCP();
 
     /// \brief StopStoreSCP stops dicom storage provider.
     void StopStoreSCP();
 
     /// \brief TestHandler initializes event handler.
     void TestHandler();
 
-    /// \brief CreateTemporaryDirectory creates temporary directory in which temorary dicom objects are stored.
+    /// \brief CreateTemporaryDirectory creates temporary directory in which temporary dicom objects are stored.
     void CreateTemporaryDirectory();
 
     /// \brief StartDicomDirectoryListener starts dicom directory listener.
     void StartDicomDirectoryListener();
 
 
    /**
     * \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomBrowserControls.h.
     *
     * \param parent is a pointer to the parent widget
     */
     void CreateQtPartControl(QWidget *parent) override;
 
     /// \brief SetPluginDirectory Sets plugin directory.
     void SetPluginDirectory();
 
     Events::Types GetPartEventTypes() const override;
 
     ctkFileDialog* m_ImportDialog;
     Ui::QmitkDicomBrowserControls m_Controls;
     QmitkDicomDirectoryListener* m_DicomDirectoryListener;
     QmitkStoreSCPLauncherBuilder m_Builder;
     QmitkStoreSCPLauncher* m_StoreSCPLauncher;
     DicomEventHandler* m_Handler;
     QmitkDicomDataEventPublisher* m_Publisher;
     QString m_PluginDirectory;
     QString m_TempDirectory;
     QString m_DatabaseDirectory;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h
index c65217c047..aeff79f078 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.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 QmitkDicomDirectoryListener_h
 #define QmitkDicomDirectoryListener_h
 
 #include<QObject>
 #include<QString>
 #include<QHash>
 #include <QStringList>
 #include <QFileSystemWatcher>
 #include <QDir>
 
 
 #include<QTimer>
 
 /**
 * \brief QmitkDicomDirectoryListener class listens on a given directory for incomng files.
 */
 class QmitkDicomDirectoryListener : public QObject
 {
     Q_OBJECT
 
 public:
 
     /**
     * \brief QmitkDicomDirectoryListener default constructor.
     */
     QmitkDicomDirectoryListener();
 
     /**
     * \brief QmitkDicomDirectoryListener default destructor.
     */
     ~QmitkDicomDirectoryListener() override;
 
     /**
     * \brief sets listened directory.
     * \note that only one directory can be set.
     */
     void SetDicomListenerDirectory(const QString&);
 
     /**
     * \brief get filepath to the listened directory.
     */
     QString GetDicomListenerDirectory();
 
     /**
     * \brief get the status whether the directorey listener is listening or not.
     */
     bool IsListening();
 
     /**
     * \brief set the directory listener listening. Id listening is set false the listener won't listen anymore.
     */
     void SetListening(bool listening);
 
     /**
     * \brief set m_DicomFolderSuffix.
     */
     void SetDicomFolderSuffix(QString suffix);
 
 signals:
 
     /**
     * \brief signal starts the dicom import with given file list.
     */
     void SignalStartDicomImport(const QStringList&);
 
 public slots:
 
     /**
     * \brief called when listener directory changes
     */
     void OnDirectoryChanged(const QString&);
 
     /**
-    * \brief called when error occours during dicom store request
+    * \brief called when error occurs during dicom store request
     */
     void OnDicomNetworkError(const QString&);
 
 protected:
 
     /**
     * \brief creates directory if it's not already existing.
     */
     void CreateListenerDirectory(const QDir& directory);
 
     /**
     * \brief Composes the filename and initializes m_LastRetrievedFile with it.
     */
     void SetFilesToImport();
 
     /**
     * \brief removes files from listener directory.
     */
     void RemoveTemporaryFiles();
 
     QString m_DicomFolderSuffix;
 
     QFileSystemWatcher* m_FileSystemWatcher;
 
     QStringList m_FilesToImport;
 
     QHash<QString,QString> m_AlreadyImportedFiles;
 
     QDir m_DicomListenerDirectory;
 
     bool m_IsListening;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp
index b9ee7254b4..1ef4353f0e 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp
@@ -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.
 
 ============================================================================*/
 #include "QmitkStoreSCPLauncher.h"
 #include <QMessageBox>
 #include <QProcessEnvironment>
 #include <mitkLog.h>
 
 #include <fstream>
 #include <iostream>
 #include <QFile>
 #include <QTextStream>
 #include <QIODevice>
 #include <QDir>
 #include <QDirIterator>
 #include <QCoreApplication>
 #include "org_mitk_gui_qt_dicombrowser_config.h"
 
 QmitkStoreSCPLauncher::QmitkStoreSCPLauncher(QmitkStoreSCPLauncherBuilder* builder)
 : m_StoreSCP(new QProcess())
 {
   m_StoreSCP->setProcessChannelMode(QProcess::MergedChannels);
     connect( m_StoreSCP, SIGNAL(error(QProcess::ProcessError)),this, SLOT(OnProcessError(QProcess::ProcessError)));
     connect( m_StoreSCP, SIGNAL(stateChanged(QProcess::ProcessState)),this, SLOT(OnStateChanged(QProcess::ProcessState)));
     connect( m_StoreSCP, SIGNAL(readyReadStandardOutput()),this, SLOT(OnReadyProcessOutput()));
     SetArgumentList(builder);
 }
 
 QmitkStoreSCPLauncher::~QmitkStoreSCPLauncher()
 {
     disconnect( m_StoreSCP, SIGNAL(error(QProcess::ProcessError)),this, SLOT(OnProcessError(QProcess::ProcessError)));
     disconnect( m_StoreSCP, SIGNAL(stateChanged(QProcess::ProcessState)),this, SLOT(OnStateChanged(QProcess::ProcessState)));
     disconnect( m_StoreSCP, SIGNAL(readyReadStandardOutput()),this, SLOT(OnReadyProcessOutput()));
     m_StoreSCP->close();
     m_StoreSCP->waitForFinished(1000);
     delete m_StoreSCP;
 }
 
 void QmitkStoreSCPLauncher::StartStoreSCP()
 {
     FindPathToStoreSCP();
     m_StoreSCP->start(m_PathToStoreSCP,m_ArgumentList);
 }
 
 void QmitkStoreSCPLauncher::FindPathToStoreSCP()
 {
     QString appPath= QCoreApplication::applicationDirPath();
     if(m_PathToStoreSCP.isEmpty())
     {
         QString fileName;
 #ifdef _WIN32
         fileName = "/storescp.exe";
 #else
         fileName = "/storescp";
 #endif
 
         m_PathToStoreSCP = appPath + fileName;
 
-        //In developement the storescp isn't copied into bin directory
+        //In development the storescp isn't copied into bin directory
         if(!QFile::exists(m_PathToStoreSCP))
         {
             m_PathToStoreSCP = static_cast<QString>(DCMTK_STORESCP);
         }
     }
 }
 
 void QmitkStoreSCPLauncher::OnReadyProcessOutput()
 {
     QString out(m_StoreSCP->readAllStandardOutput());
     QStringList allDataList,importList;
 
     allDataList = out.split("\n",QString::SkipEmptyParts);
     QStringListIterator it(allDataList);
 
     while(it.hasNext())
     {
         QString output = it.next();
         if (output.contains("E: "))
         {
             output.replace("E: ","");
             m_ErrorText = output;
             OnProcessError(QProcess::UnknownError);
             return;
         }
         if(output.contains("I: storing DICOM file: "))
         {
             output.replace("I: storing DICOM file: ","");
             output.replace("\\", "/"); // cannot handle backslashes
             output.replace("\r", ""); // cannot handle carriage return
             importList += output;
         }
     }
     if(!importList.isEmpty())
     {
         emit SignalStartImport(importList);
     }
 }
 
 void QmitkStoreSCPLauncher::OnProcessError(QProcess::ProcessError err)
 {
     switch(err)
     {
     case QProcess::FailedToStart:
         m_ErrorText.prepend("Failed to start storage provider: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     case QProcess::Crashed:
         m_ErrorText.prepend("Storage provider closed: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     case QProcess::Timedout:
         m_ErrorText.prepend("Storage provider timeout: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     case QProcess::WriteError:
         m_ErrorText.prepend("Storage provider write error: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     case QProcess::ReadError:
         m_ErrorText.prepend("Storage provider read error: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     case QProcess::UnknownError:
         m_ErrorText.prepend("Storage provider unknown error: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     default:
         m_ErrorText.prepend("Storage provider unknown error: ");
         m_ErrorText.append(m_StoreSCP->errorString());
         emit SignalStoreSCPError(m_ErrorText);
         m_ErrorText.clear();
         break;
     }
 }
 
 void QmitkStoreSCPLauncher::OnStateChanged(QProcess::ProcessState status)
 {
     switch(status)
     {
     case QProcess::NotRunning:
         m_StatusText.prepend("Storage provider not running!");
         emit SignalStatusOfStoreSCP(m_StatusText);
         m_StatusText.clear();
         break;
     case QProcess::Starting:
         m_StatusText.prepend("Starting storage provider!");
         emit SignalStatusOfStoreSCP(m_StatusText);
         m_StatusText.clear();
         break;
     case QProcess::Running:
         m_StatusText.prepend(m_ArgumentList[0]).prepend(" Port: ").prepend(m_ArgumentList[2]).prepend(" AET: ").prepend("Storage provider running! ");
         emit SignalStatusOfStoreSCP(m_StatusText);
         m_StatusText.clear();
         break;
     default:
         m_StatusText.prepend("Storage provider unknown error!");
         emit SignalStatusOfStoreSCP(m_StatusText);
         m_StatusText.clear();
         break;
     }
 }
 
 void QmitkStoreSCPLauncher::SetArgumentList(QmitkStoreSCPLauncherBuilder* builder)
 {
     m_ArgumentList << *builder->GetPort() << QString("-aet") <<*builder->GetAETitle() << *builder->GetTransferSyntax()
         << *builder->GetOtherNetworkOptions() << *builder->GetMode() << QString("-od") << *builder->GetOutputDirectory();
 }
 
 QString QmitkStoreSCPLauncher::ArgumentListToQString()
 {
     QString argumentString;
     QStringListIterator argumentIterator(m_ArgumentList);
     while(argumentIterator.hasNext())
     {
         argumentString.append(" ");
         argumentString.append(argumentIterator.next());
     }
     return argumentString;
 }
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h
index 685fb5d394..dd66d73a4a 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.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 QmitkStoreSCPLauncher_h
 #define QmitkStoreSCPLauncher_h
 
 #include <QProcess>
 #include <QString>
 #include "QmitkStoreSCPLauncherBuilder.h"
 
 /**
 * \brief QmitkStoreSCPLauncher launches the dcmtk storage provider commandline tool in another process and provides basic interoperability with it.
 */
 class QmitkStoreSCPLauncher : public QObject
 {
     Q_OBJECT
 
 public:
 
     /**
     * \brief QmitkStoreSCPLauncher constructor.
     */
     QmitkStoreSCPLauncher(QmitkStoreSCPLauncherBuilder* builder);
 
     /**
     * \brief QmitkStoreSCPLauncher constructor.
     */
     ~QmitkStoreSCPLauncher() override;
 
 public slots:
 
     /**
     * \brief Starts a storage provider in a new process.
     */
     void StartStoreSCP();
 
     /**
     * \brief Called when storage provider process emits error.
     */
     void OnProcessError(QProcess::ProcessError error);
 
     /**
     * \brief Called when storage provider process changes its state.
     */
     void OnStateChanged(QProcess::ProcessState status);
 
     /**
     * \brief Called when storage provider process provides new information on its standard output.
     */
     void OnReadyProcessOutput();
 
 signals:
 
     /**
     * \brief signal is emitted if status of storage provider process has changend.
     * \param QString containing m_StatusText.
     */
     void SignalStatusOfStoreSCP(const QString&);
 
     /**
-    * \brief signal is emitted an error occours while storage provider process is running.
+    * \brief signal is emitted an error occurs while storage provider process is running.
     * \param QString containing m_ErrorText.
     */
     void SignalStoreSCPError(const QString& errorText = "");
 
     /**
     * \brief signal is emitted when storage provider process starts storing dicom files.
     * \param QStringList& of processed dicom files.
     */
     void SignalStartImport(const QStringList&);
 
     /**
     * \brief signal is emitted if import of storage provider process has finished.
     * \note currently not used.
     */
     void SignalFinishedImport();
 
 private:
 
     /**
     * \brief DicomEventHandler constructor.
     */
     void FindPathToStoreSCP();
 
     /**
     * \brief DicomEventHandler constructor.
     * \param QmitkStoreSCPLauncherBuilder* to builder object.
     */
     void SetArgumentList(QmitkStoreSCPLauncherBuilder* builder);
 
     /**
     * \brief Converts the m_ArgumentList into a QString containing all arguments from list.
     */
     QString ArgumentListToQString();
 
     QString m_PathToStoreSCP;
     QString m_ErrorText;
     QString m_StatusText;
 
     QProcess* m_StoreSCP;
     QStringList m_ArgumentList;
     QStringList m_ImportFilesList;
 };
 #endif
diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.cpp b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.cpp
index 09d2646799..1c5fa5c573 100644
--- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.cpp
+++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.cpp
@@ -1,397 +1,397 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "DoseVisualizationPreferencePage.h"
 #include "mitkRTUIConstants.h"
 
 #include <QWidget>
 #include <QMessageBox>
 #include <QInputDialog>
 #include <QMenu>
 
 #include <mitkCoreServices.h>
 #include <mitkIPreferencesService.h>
 #include <mitkIPreferences.h>
 
 #include <QmitkDoseColorDelegate.h>
 #include <QmitkDoseValueDelegate.h>
 #include <QmitkDoseVisualStyleDelegate.h>
 #include <QmitkIsoDoseLevelSetModel.h>
 
 #include "mitkIsoLevelsGenerator.h"
 
 #include "org_mitk_gui_qt_dosevisualization_Activator.h"
 
 namespace
 {
   mitk::IPreferences* GetPreferences()
   {
     auto* preferencesService = mitk::CoreServices::GetPreferencesService();
     return preferencesService->GetSystemPreferences()->Node(mitk::RTUIConstants::ROOT_DOSE_VIS_PREFERENCE_NODE_ID);
   }
 }
 
 DoseVisualizationPreferencePage::DoseVisualizationPreferencePage()
   : m_MainControl(nullptr), m_Controls(nullptr), m_referenceDoseChanged(false), m_presetMapChanged(false), m_globalVisChanged(false)
 {
 
 }
 
 DoseVisualizationPreferencePage::~DoseVisualizationPreferencePage()
 {
   delete m_LevelSetModel;
   delete m_DoseColorDelegate;
   delete m_DoseValueDelegate;
   delete m_DoseVisualDelegate;
   delete m_Controls;
 }
 
 void DoseVisualizationPreferencePage::Init(berry::IWorkbench::Pointer )
 {
 
 }
 
 void DoseVisualizationPreferencePage::CreateQtControl(QWidget* parent)
 {
   m_LevelSetModel = new QmitkIsoDoseLevelSetModel(this);
   m_DoseColorDelegate = new QmitkDoseColorDelegate(this);
   m_DoseValueDelegate = new QmitkDoseValueDelegate(this);
   m_DoseVisualDelegate = new QmitkDoseVisualStyleDelegate(this);
 
 
   m_MainControl = new QWidget(parent);
   m_Controls = new Ui::DoseVisualizationPreferencePageControls;
   m_Controls->setupUi( m_MainControl );
 
 
   this->m_Controls->isoLevelSetView->setModel(m_LevelSetModel);
   this->m_Controls->isoLevelSetView->setItemDelegateForColumn(0,m_DoseColorDelegate);
   this->m_Controls->isoLevelSetView->setItemDelegateForColumn(1,m_DoseValueDelegate);
   this->m_Controls->isoLevelSetView->setItemDelegateForColumn(2,m_DoseVisualDelegate);
   this->m_Controls->isoLevelSetView->setItemDelegateForColumn(3,m_DoseVisualDelegate);
   this->m_Controls->isoLevelSetView->setContextMenuPolicy(Qt::CustomContextMenu);
 
   connect(m_Controls->spinReferenceDose, SIGNAL(valueChanged(double)), m_LevelSetModel, SLOT(setReferenceDose(double)));
   connect(m_Controls->spinReferenceDose, SIGNAL(valueChanged(double)), this, SLOT(OnReferenceDoseChanged(double)));
   connect(m_Controls->checkGlobalSync, SIGNAL(toggled(bool)), m_Controls->spinReferenceDose, SLOT(setEnabled(bool)));
   connect(m_Controls->radioAbsDose, SIGNAL(toggled(bool)), m_LevelSetModel, SLOT(setShowAbsoluteDose(bool)));
   connect(m_Controls->isoLevelSetView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnShowContextMenuIsoSet(const QPoint&)));
   connect(m_Controls->listPresets, SIGNAL(currentItemChanged ( QListWidgetItem *, QListWidgetItem *)), this, SLOT(OnCurrentItemChanged ( QListWidgetItem *, QListWidgetItem *)));
   connect(m_Controls->btnAddPreset, SIGNAL(clicked(bool)), this, SLOT(OnAddPresetClicked(bool)));
   connect(m_Controls->btnDelPreset, SIGNAL(clicked(bool)), this, SLOT(OnDelPresetClicked(bool)));
   connect(m_Controls->btnResetPreset, SIGNAL(clicked(bool)), this, SLOT(OnResetPresetClicked(bool)));
   connect(m_Controls->btnDelLevel, SIGNAL(clicked(bool)), this, SLOT(OnDelLevelClicked(bool)));
   connect(m_Controls->btnAddLevel, SIGNAL(clicked(bool)), this, SLOT(OnAddLevelClicked(bool)));
   connect(m_Controls->checkGlobalVisColorWash, SIGNAL(toggled(bool)), this, SLOT(OnGlobalVisChanged(bool)));
   connect(m_Controls->checkGlobalVisIsoLine, SIGNAL(toggled(bool)), this, SLOT(OnGlobalVisChanged(bool)));
 
   this->Update();
 }
 
 QWidget* DoseVisualizationPreferencePage::GetQtControl() const
 {
   return m_MainControl;
 }
 
 bool DoseVisualizationPreferencePage::PerformOk()
 {
   auto* prefs = GetPreferences();
 
   prefs->PutBool(mitk::RTUIConstants::DOSE_DISPLAY_ABSOLUTE_ID,m_Controls->radioAbsDose->isChecked());
   prefs->PutBool(mitk::RTUIConstants::GLOBAL_VISIBILITY_COLORWASH_ID,m_Controls->checkGlobalVisColorWash->isChecked());
   prefs->PutBool(mitk::RTUIConstants::GLOBAL_VISIBILITY_ISOLINES_ID,m_Controls->checkGlobalVisIsoLine->isChecked());
   prefs->PutDouble(mitk::RTUIConstants::REFERENCE_DOSE_ID,m_Controls->spinReferenceDose->value());
   prefs->PutBool(mitk::RTUIConstants::GLOBAL_REFERENCE_DOSE_SYNC_ID, m_Controls->checkGlobalSync->isChecked());
 
   mitk::StorePresetsMap(this->m_Presets);
 
   if (this->m_Presets.find(this->m_selectedPresetName)==this->m_Presets.end())
   { //the preset currently selected in the application is not available any more. Change it to a valid one.
     mitk::SetSelectedPresetName(this->m_Presets.begin()->first);
   }
 
   if (this->m_LevelSetModel->isModified())
   {
     this->m_presetMapChanged = true;
   }
 
   if (m_referenceDoseChanged)
   {
     mitk::SignalReferenceDoseChange(m_Controls->checkGlobalSync->isChecked(), m_Controls->spinReferenceDose->value(), mitk::org_mitk_gui_qt_dosevisualization_Activator::GetContext());
   }
 
   if (m_presetMapChanged)
   {
     mitk::SignalPresetMapChange(mitk::org_mitk_gui_qt_dosevisualization_Activator::GetContext());
   }
 
   if(m_globalVisChanged)
   {
     mitk::SignalGlobalVisChange(m_Controls->checkGlobalSync->isChecked(), m_Controls->checkGlobalVisIsoLine->isChecked(), m_Controls->checkGlobalVisColorWash->isChecked(), mitk::org_mitk_gui_qt_dosevisualization_Activator::GetContext());
   }
 
   return true;
 }
 
 void DoseVisualizationPreferencePage::PerformCancel()
 {
 }
 
 void DoseVisualizationPreferencePage::Update()
 {
   auto* prefs = GetPreferences();
 
   m_Controls->checkGlobalVisColorWash->setChecked(prefs->GetBool(mitk::RTUIConstants::GLOBAL_VISIBILITY_COLORWASH_ID, true));
   m_Controls->checkGlobalVisIsoLine->setChecked(prefs->GetBool(mitk::RTUIConstants::GLOBAL_VISIBILITY_ISOLINES_ID, true));
   m_Controls->radioAbsDose->setChecked(prefs->GetBool(mitk::RTUIConstants::DOSE_DISPLAY_ABSOLUTE_ID, true));
   m_Controls->radioRelDose->setChecked(!(prefs->GetBool(mitk::RTUIConstants::DOSE_DISPLAY_ABSOLUTE_ID, false)));
   m_Controls->spinReferenceDose->setValue(prefs->GetDouble(mitk::RTUIConstants::REFERENCE_DOSE_ID, mitk::RTUIConstants::DEFAULT_REFERENCE_DOSE_VALUE));
   m_Controls->checkGlobalSync->setChecked(prefs->GetBool(mitk::RTUIConstants::GLOBAL_REFERENCE_DOSE_SYNC_ID, true));
 
   m_referenceDoseChanged = false;
   m_presetMapChanged = false;
   m_globalVisChanged = false;
 
 
   this->m_Presets = mitk::LoadPresetsMap();
   if(m_Presets.empty())
     return;
   this->m_selectedPresetName = mitk::GetSelectedPresetName();
   UpdatePresetsWidgets();
 }
 
 
 mitk::IsoDoseLevelSet* DoseVisualizationPreferencePage::GetSelectedIsoLevelSet()
 {
   QListWidgetItem* selectedItem = m_Controls->listPresets->currentItem();
 
   mitk::IsoDoseLevelSet::Pointer result;
 
   if (selectedItem)
   {
     result = m_Presets[selectedItem->text().toStdString()];
   }
 
   return result;
 }
 
 void DoseVisualizationPreferencePage::UpdateLevelSetWidgets()
 {
   this->m_Controls->btnAddLevel->setEnabled(this->GetSelectedIsoLevelSet()!=nullptr);
 
   QModelIndex selectedIndex = m_Controls->isoLevelSetView->currentIndex();
   this->m_Controls->btnDelLevel->setEnabled(this->GetSelectedIsoLevelSet()!=nullptr && selectedIndex.isValid());
 }
 
 void DoseVisualizationPreferencePage::UpdatePresetsWidgets()
 {
   m_Controls->listPresets->clear();
 
   QListWidgetItem* selectedItem = nullptr;
   for (PresetMapType::iterator pos = m_Presets.begin(); pos != m_Presets.end(); ++pos)
   {
     QListWidgetItem* item = new QListWidgetItem(QString::fromStdString(pos->first));
     if (!selectedItem)
     {
       selectedItem = item;
     }
 
     m_Controls->listPresets->addItem(item);
   }
 
   if (selectedItem)
   {
     m_Controls->listPresets->setCurrentItem(selectedItem);
   }
 
   if (this->m_LevelSetModel->isModified())
   {
     this->m_presetMapChanged = true;
   }
 
   this->m_LevelSetModel->setIsoDoseLevelSet(this->GetSelectedIsoLevelSet());
 
   m_Controls->btnDelPreset->setEnabled((m_Controls->listPresets->currentItem() != nullptr) && (m_Controls->listPresets->count()>1));
 }
 
 void DoseVisualizationPreferencePage::OnCurrentItemChanged (QListWidgetItem*, QListWidgetItem*)
 {
   this->m_LevelSetModel->setIsoDoseLevelSet(this->GetSelectedIsoLevelSet());
 }
 
 void DoseVisualizationPreferencePage::OnShowContextMenuIsoSet(const QPoint& pos)
 {
   QPoint globalPos = m_Controls->isoLevelSetView->viewport()->mapToGlobal(pos);
 
   QModelIndex selectedIndex = m_Controls->isoLevelSetView->currentIndex();
 
   QMenu viewMenu;
   QAction* addLevelAct = viewMenu.addAction("Add new level");
   QAction* delLevelAct = viewMenu.addAction("Delete selected level");
   delLevelAct->setEnabled(selectedIndex.isValid());
   viewMenu.addSeparator();
   QAction* invertIsoLineAct = viewMenu.addAction("Invert iso line visibility");
   QAction* activateIsoLineAct = viewMenu.addAction("Activate all iso lines");
   QAction* deactivateIsoLineAct = viewMenu.addAction("Deactivate all iso lines");
   viewMenu.addSeparator();
   QAction* invertColorWashAct = viewMenu.addAction("Invert color wash visibility");
   QAction* activateColorWashAct = viewMenu.addAction("Activate all color wash levels");
   QAction* deactivateColorWashAct = viewMenu.addAction("Deactivate all color wash levels");
   viewMenu.addSeparator();
   QAction* swapAct = viewMenu.addAction("Swap iso line/color wash visibility");
 
   QAction* selectedItem = viewMenu.exec(globalPos);
   if (selectedItem == invertIsoLineAct)
   {
     this->m_LevelSetModel->invertVisibilityIsoLines();
   }
   else if (selectedItem == activateIsoLineAct)
   {
     this->m_LevelSetModel->switchVisibilityIsoLines(true);
   }
   else if (selectedItem == deactivateIsoLineAct)
   {
     this->m_LevelSetModel->switchVisibilityIsoLines(false);
   }
   else if (selectedItem == invertColorWashAct)
   {
     this->m_LevelSetModel->invertVisibilityColorWash();
   }
   else if (selectedItem == activateColorWashAct)
   {
     this->m_LevelSetModel->switchVisibilityColorWash(true);
   }
   else if (selectedItem == deactivateColorWashAct)
   {
     this->m_LevelSetModel->switchVisibilityColorWash(false);
   }
   else if (selectedItem == swapAct)
   {
     this->m_LevelSetModel->swapVisibility();
   }
   else if (selectedItem == addLevelAct)
   {
     this->m_LevelSetModel->addLevel();
   }
   else if (selectedItem == delLevelAct)
   {
     this->m_LevelSetModel->deleteLevel(selectedIndex);
   }
 }
 
 void DoseVisualizationPreferencePage::OnAddPresetClicked(bool)
 {
   bool done = false;
   QString name = tr("new_preset");
   while (!done)
   {
     bool ok;
     name = QInputDialog::getText(m_MainControl, tr("Define name of new preset."), tr("Preset name:"), QLineEdit::Normal, name, &ok);
 
     if (!ok)
     {
-      return; //cancled by user;
+      return; //canceled by user;
     }
 
     bool uniqueName = m_Presets.find(name.toStdString()) == m_Presets.end();
     if (!uniqueName)
     {
       QMessageBox box;
       box.setText(tr("New preset name is not unique. Please, choose another one."));
       box.exec();
     }
 
     bool validName = name.indexOf(tr("/")) ==-1;
     if (!validName)
     {
       QMessageBox box;
       box.setText(tr("New preset name is not valid. Please don't use \"/\"."));
       box.exec();
     }
 
     done = uniqueName && validName;
   }
 
   mitk::IsoDoseLevelSet::Pointer newSet = mitk::GenerateIsoLevels_Virtuos();
   m_Presets.insert(std::make_pair(name.toStdString(),newSet));
 
   m_presetMapChanged = true;
 
   UpdatePresetsWidgets();
 }
 
 void DoseVisualizationPreferencePage::OnDelPresetClicked(bool)
 {
   QListWidgetItem* selectedItem = m_Controls->listPresets->currentItem();
 
   if (selectedItem)
   {
     if (m_Controls->listPresets->count() > 1)
     {
       m_Presets.erase(selectedItem->text().toStdString());
 
       m_presetMapChanged = true;
       this->UpdatePresetsWidgets();
     }
   }
 }
 
 
 void DoseVisualizationPreferencePage::OnResetPresetClicked(bool)
 {
   QMessageBox box;
   box.setText("Do you want to reset the presets?");
   box.setInformativeText("If you reset the presets. All user defined presets will be removed and the default presets will be loaded.");
   box.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
   box.setDefaultButton(QMessageBox::No);
   int ret = box.exec();
 
   if (ret == QMessageBox::Yes)
   {
     mitk::IsoDoseLevelSet::Pointer newSet = mitk::GenerateIsoLevels_Virtuos();
     m_Presets.clear();
     m_Presets.insert(std::make_pair("Virtuos",newSet));
 
     m_presetMapChanged = true;
 
     UpdatePresetsWidgets();
   }
 }
 
 
 void DoseVisualizationPreferencePage::OnAddLevelClicked(bool)
 {
   this->m_LevelSetModel->addLevel();
 }
 
 void DoseVisualizationPreferencePage::OnDelLevelClicked(bool)
 {
   QModelIndex selectedIndex = m_Controls->isoLevelSetView->currentIndex();
 
   if (!selectedIndex.isValid())
   {
     selectedIndex = m_Controls->isoLevelSetView->indexAt(QPoint(1,1));
   }
 
   this->m_LevelSetModel->deleteLevel(selectedIndex);
 }
 
 void DoseVisualizationPreferencePage::OnReferenceDoseChanged(double)
 {
   this->m_referenceDoseChanged = true;
 }
 
 void DoseVisualizationPreferencePage::OnGlobalVisChanged(bool)
 {
   this->m_globalVisChanged = true;
 }
diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.cpp b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.cpp
index 4b5b2ff5f4..abce4fae23 100644
--- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.cpp
+++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.cpp
@@ -1,821 +1,821 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // Qt
 #include <QMessageBox>
 #include <QMenu>
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // MITK
 #include <mitkNodePredicateDataProperty.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkDoseNodeHelper.h>
 #include <mitkPropertyNameHelper.h>
 #include <mitkRTConstants.h>
 #include <mitkIsoDoseLevelSetProperty.h>
 #include <mitkIsoDoseLevelVectorProperty.h>
 #include <mitkIsoLevelsGenerator.h>
 #include <mitkRTUIConstants.h>
 #include <mitkTransferFunction.h>
 #include <mitkTransferFunctionProperty.h>
 
 
 #include <service/event/ctkEventAdmin.h>
 #include <service/event/ctkEventConstants.h>
 
 // Qmitk
 #include "RTDoseVisualizer.h"
 
 #include <QmitkDoseColorDelegate.h>
 #include <QmitkDoseValueDelegate.h>
 #include <QmitkDoseVisualStyleDelegate.h>
 #include <QmitkIsoDoseLevelSetModel.h>
 #include <QmitkFreeIsoDoseLevelWidget.h>
 #include "QmitkRenderWindow.h"
 
 #include "org_mitk_gui_qt_dosevisualization_Activator.h"
 
 #include <vtkMath.h>
 #include "vtkDecimatePro.h"
 
 const std::string RTDoseVisualizer::VIEW_ID = "org.mitk.views.rt.dosevisualization";
 
 const std::string RTDoseVisualizer::ISO_LINE_NODE_NAME = "dose iso lines";
 
 namespace mitk
 {
   /** @brief Predicate to identify dose nodes. Didn't use NodePredicateeDataProperty, because we want only depend
   on the property value ('RTDOSE') and not on the property type (e.g. StringProperty or mitkTemperoSpatialStringProperty).*/
   class NodePredicateDose : public NodePredicateBase
   {
   public:
     mitkClassMacro(NodePredicateDose, NodePredicateBase);
     itkNewMacro(NodePredicateDose);
 
     ~NodePredicateDose() override
     {};
 
     bool CheckNode(const mitk::DataNode *node) const override
     {
       if (!node) return false;
 
       auto data = node->GetData();
       if (!data) {
         return false;
       }
 
       auto modalityProperty = data->GetProperty(mitk::GeneratePropertyNameForDICOMTag(0x0008, 0x0060).c_str());
       if (modalityProperty.IsNull())
       {
         return false;
       }
       std::string modality = modalityProperty->GetValueAsString();
       return modality == "RTDOSE";
     };
 
   protected:
     NodePredicateDose()
     {};
   };
 
 } // namespace mitk
 
 
 RTDoseVisualizer::RTDoseVisualizer()
 {
   m_selectedNode = nullptr;
   m_selectedPresetName = "";
   m_PrescribedDose_Data = 0.0;
   m_freeIsoValuesCount = 0;
 
   m_internalUpdate = false;
 
   m_isDoseOrIsoPredicate = mitk::NodePredicateDose::New();
   m_isIsoPredicate = mitk::NodePredicateProperty::New("name", mitk::StringProperty::New(ISO_LINE_NODE_NAME));
   m_isDosePredicate = mitk::NodePredicateAnd::New(m_isDoseOrIsoPredicate, mitk::NodePredicateNot::New(m_isIsoPredicate));
 }
 
 RTDoseVisualizer::~RTDoseVisualizer()
 {
   mitk::DataStorage::SetOfObjects::ConstPointer isoNodes = this->GetDataStorage()->GetSubset(m_isIsoPredicate);
   this->GetDataStorage()->Remove(isoNodes);
 
   delete m_LevelSetModel;
   delete m_DoseColorDelegate;
   delete m_DoseValueDelegate;
   delete m_DoseVisualDelegate;
 }
 
 void RTDoseVisualizer::SetFocus(){}
 
 void RTDoseVisualizer::CreateQtPartControl( QWidget *parent )
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi( parent );
 
   m_LevelSetModel = new QmitkIsoDoseLevelSetModel(this);
   m_LevelSetModel->setVisibilityEditOnly(true);
   m_DoseColorDelegate = new QmitkDoseColorDelegate(this);
   m_DoseValueDelegate = new QmitkDoseValueDelegate(this);
   m_DoseVisualDelegate = new QmitkDoseVisualStyleDelegate(this);
 
 
   this->UpdateByPreferences();
 
   auto doseNodes = this->GetDataStorage()->GetSubset(this->m_isDosePredicate);
   auto doseNodeIter = doseNodes->begin();
 
   while (doseNodeIter != doseNodes->end())
   {
     PrepareDoseNode(*doseNodeIter);
     ++doseNodeIter;
   }
 
   this->ActualizeIsoLevelsForAllDoseDataNodes();
   this->ActualizeReferenceDoseForAllDoseDataNodes();
   this->ActualizeDisplayStyleForAllDoseDataNodes();
 
   this->m_Controls.isoLevelSetView->setModel(m_LevelSetModel);
   this->m_Controls.isoLevelSetView->setItemDelegateForColumn(0,m_DoseColorDelegate);
   this->m_Controls.isoLevelSetView->setItemDelegateForColumn(1,m_DoseValueDelegate);
   this->m_Controls.isoLevelSetView->setItemDelegateForColumn(2,m_DoseVisualDelegate);
   this->m_Controls.isoLevelSetView->setItemDelegateForColumn(3,m_DoseVisualDelegate);
   this->m_Controls.isoLevelSetView->setContextMenuPolicy(Qt::CustomContextMenu);
 
   this->m_Controls.btnRemoveFreeValue->setDisabled(true);
 
   this->m_Controls.doseBtn->setVisible(false);
 
   connect(m_Controls.spinReferenceDose, SIGNAL(valueChanged(double)), this, SLOT(OnReferenceDoseChanged(double)));
   connect(m_Controls.spinReferenceDose, SIGNAL(valueChanged(double)), m_LevelSetModel, SLOT(setReferenceDose(double)));
   connect(m_Controls.radioAbsDose, SIGNAL(toggled(bool)), m_LevelSetModel, SLOT(setShowAbsoluteDose(bool)));
   connect(m_Controls.radioAbsDose, SIGNAL(toggled(bool)), this, SLOT(OnAbsDoseToggled(bool)));
   connect(m_Controls.btnAddFreeValue, SIGNAL(clicked()), this, SLOT(OnAddFreeValueClicked()));
   connect(m_Controls.btnRemoveFreeValue, SIGNAL(clicked()), this, SLOT(OnRemoveFreeValueClicked()));
   connect(m_Controls.checkGlobalVisColorWash, SIGNAL(toggled(bool)), this, SLOT(OnGlobalVisColorWashToggled(bool)));
   connect(m_Controls.checkGlobalVisIsoLine, SIGNAL(toggled(bool)), this, SLOT(OnGlobalVisIsoLineToggled(bool)));
   connect(m_Controls.isoLevelSetView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnShowContextMenuIsoSet(const QPoint&)));
   connect(m_Controls.comboPresets, SIGNAL(currentIndexChanged ( const QString&)), this, SLOT(OnCurrentPresetChanged(const QString&)));
   connect(m_Controls.btnUsePrescribedDose, SIGNAL(clicked()), this, SLOT(OnUsePrescribedDoseClicked()));
   connect(m_Controls.isoLevelSetView->model(), SIGNAL( modelReset()), this, SLOT(OnDataChangedInIsoLevelSetView()));
 
   ctkServiceReference ref = mitk::org_mitk_gui_qt_dosevisualization_Activator::GetContext()->getServiceReference<ctkEventAdmin>();
 
   ctkDictionary propsForSlot;
   if (ref)
   {
     ctkEventAdmin* eventAdmin = mitk::org_mitk_gui_qt_dosevisualization_Activator::GetContext()->getService<ctkEventAdmin>(ref);
 
     propsForSlot[ctkEventConstants::EVENT_TOPIC] = mitk::RTCTKEventConstants::TOPIC_ISO_DOSE_LEVEL_PRESETS_CHANGED.c_str();
     eventAdmin->subscribeSlot(this, SLOT(OnHandleCTKEventPresetsChanged(ctkEvent)), propsForSlot);
 
     propsForSlot[ctkEventConstants::EVENT_TOPIC] = mitk::RTCTKEventConstants::TOPIC_REFERENCE_DOSE_CHANGED.c_str();
     eventAdmin->subscribeSlot(this, SLOT(OnHandleCTKEventReferenceDoseChanged(ctkEvent)), propsForSlot);
 
     propsForSlot[ctkEventConstants::EVENT_TOPIC] = mitk::RTCTKEventConstants::TOPIC_GLOBAL_VISIBILITY_CHANGED.c_str();
     eventAdmin->subscribeSlot(this, SLOT(OnHandleCTKEventGlobalVisChanged(ctkEvent)), propsForSlot);
   }
 
   this->UpdateBySelectedNode();
 }
 
 void RTDoseVisualizer::OnReferenceDoseChanged(double value)
 {
   if (!  m_internalUpdate)
   {
     mitk::DoseValueAbs referenceDose = 0.0;
     bool globalSync = mitk::GetReferenceDoseValue(referenceDose);
 
     if (globalSync)
     {
       mitk::SetReferenceDoseValue(globalSync, value);
       this->ActualizeReferenceDoseForAllDoseDataNodes();
     }
     else
     {
       if (this->m_selectedNode.IsNotNull())
       {
         this->m_selectedNode->SetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), value);
         mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
         if (isoDoseNode.IsNotNull()) isoDoseNode->SetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), value);
       }
     }
     if (this->m_selectedNode.IsNotNull())
     {
       this->UpdateColorWashTransferFunction();
       mitk::RenderingManager::GetInstance()->RequestUpdateAll();
     }
   }
 }
 
 void RTDoseVisualizer::OnAddFreeValueClicked()
 {
   QColor newColor;
   //Use HSV schema of QColor to calculate a different color depending on the
   //number of already existing free iso lines.
   newColor.setHsv((m_freeIsoValuesCount*85)%360,255,255);
   mitk::IsoDoseLevel::ColorType mColor;
   mColor[0]=newColor.redF();
   mColor[1]=newColor.greenF();
   mColor[2]=newColor.blueF();
 
   mitk::IsoDoseLevelVector::Pointer freeIsoDoseVector;
   mitk::IsoDoseLevelVectorProperty::Pointer propIsoVector;
 
   mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
 
   if (isoDoseNode.IsNotNull())
   {
     propIsoVector = dynamic_cast<mitk::IsoDoseLevelVectorProperty*>(isoDoseNode->GetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str()));
 
     freeIsoDoseVector = propIsoVector->GetValue();
     if (freeIsoDoseVector.IsNull())
       mitk::IsoDoseLevelVector::Pointer freeIsoDoseVector = mitk::IsoDoseLevelVector::New();
 
     mitk::IsoDoseLevel::Pointer newLevel = mitk::IsoDoseLevel::New(0.5, mColor, true, false);
     freeIsoDoseVector->InsertElement(m_freeIsoValuesCount, newLevel);
     propIsoVector = mitk::IsoDoseLevelVectorProperty::New(freeIsoDoseVector);
 
     isoDoseNode->SetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str(), propIsoVector);
 
     m_freeIsoValuesCount++;
     this->m_Controls.btnRemoveFreeValue->setEnabled(true);
     //Update Widget
     this->UpdateFreeIsoValues();
     //Update Rendering
     this->ActualizeFreeIsoLine();
   }
 }
 
 void RTDoseVisualizer::OnRemoveFreeValueClicked()
 {
   int index = this->m_Controls.listFreeValues->currentRow();
   if (index > static_cast<int>(m_freeIsoValuesCount) || index < 0)
     return;
 
   mitk::IsoDoseLevelVectorProperty::Pointer propfreeIsoVec;
 
   mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
   propfreeIsoVec = dynamic_cast<mitk::IsoDoseLevelVectorProperty*>(isoDoseNode->GetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str()));
 
   mitk::IsoDoseLevelVector::Pointer freeIsoDoseLevelVec = propfreeIsoVec->GetValue();
   if(freeIsoDoseLevelVec->IndexExists(index))
   {
     //freeIsoDoseLevelVec->DeleteIndex(index);
     freeIsoDoseLevelVec->erase(freeIsoDoseLevelVec->begin()+index);
     --m_freeIsoValuesCount;
     if(m_freeIsoValuesCount == 0)
       this->m_Controls.btnRemoveFreeValue->setEnabled(true);
     this->UpdateFreeIsoValues();
     this->ActualizeFreeIsoLine();
   }
 
 }
 
 void RTDoseVisualizer::OnUsePrescribedDoseClicked()
 {
   m_Controls.spinReferenceDose->setValue(this->m_PrescribedDose_Data);
 }
 
 void RTDoseVisualizer::OnDataChangedInIsoLevelSetView()
 {
   //colorwash visibility changed, update the colorwash
   this->UpdateColorWashTransferFunction();
 
   if(m_selectedNode.IsNotNull())
   {
     //Hack: This is a dirty hack to reinit the isodose contour node. Only if the node (or property) has changed the rendering process register the RequestUpdateAll
     //Only way to render the isoline by changes without a global reinit
     mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
     if (isoDoseNode.IsNotNull()) isoDoseNode->Modified();
 
     // Reinit if visibility of colorwash or isodoselevel changed
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   }
 }
 
 void RTDoseVisualizer::OnShowContextMenuIsoSet(const QPoint& pos)
 {
   QPoint globalPos = m_Controls.isoLevelSetView->viewport()->mapToGlobal(pos);
 
   QMenu viewMenu;
   QAction* invertIsoLineAct = viewMenu.addAction("Invert iso line visibility");
   QAction* activateIsoLineAct = viewMenu.addAction("Activate all iso lines");
   QAction* deactivateIsoLineAct = viewMenu.addAction("Deactivate all iso lines");
   viewMenu.addSeparator();
   QAction* invertColorWashAct = viewMenu.addAction("Invert color wash visibility");
   QAction* activateColorWashAct = viewMenu.addAction("Activate all color wash levels");
   QAction* deactivateColorWashAct = viewMenu.addAction("Deactivate all color wash levels");
   viewMenu.addSeparator();
   QAction* swapAct = viewMenu.addAction("Swap iso line/color wash visibility");
   // ...
 
   QAction* selectedItem = viewMenu.exec(globalPos);
   if (selectedItem == invertIsoLineAct)
   {
     this->m_LevelSetModel->invertVisibilityIsoLines();
   }
   else if (selectedItem == activateIsoLineAct)
   {
     this->m_LevelSetModel->switchVisibilityIsoLines(true);
   }
   else if (selectedItem == deactivateIsoLineAct)
   {
     this->m_LevelSetModel->switchVisibilityIsoLines(false);
   }
   else if (selectedItem == invertColorWashAct)
   {
     this->m_LevelSetModel->invertVisibilityColorWash();
   }
   else if (selectedItem == activateColorWashAct)
   {
     this->m_LevelSetModel->switchVisibilityColorWash(true);
   }
   else if (selectedItem == deactivateColorWashAct)
   {
     this->m_LevelSetModel->switchVisibilityColorWash(false);
   }
   else if (selectedItem == swapAct)
   {
     this->m_LevelSetModel->swapVisibility();
   }
 }
 
 void RTDoseVisualizer::UpdateFreeIsoValues()
 {
   this->m_Controls.listFreeValues->clear();
 
   mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
   if (isoDoseNode.IsNotNull())
   {
 
     mitk::IsoDoseLevelVectorProperty::Pointer propfreeIsoVec;
 
     propfreeIsoVec = dynamic_cast<mitk::IsoDoseLevelVectorProperty*>(isoDoseNode->GetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str()));
 
 
     mitk::IsoDoseLevelVector::Pointer freeIsoDoseLevelVec = propfreeIsoVec->GetValue();
 
     for (mitk::IsoDoseLevelVector::Iterator pos = freeIsoDoseLevelVec->Begin(); pos != freeIsoDoseLevelVec->End(); ++pos)
     {
       QListWidgetItem* item = new QListWidgetItem;
       item->setSizeHint(QSize(0, 25));
       QmitkFreeIsoDoseLevelWidget* widget = new QmitkFreeIsoDoseLevelWidget;
 
       float pref;
       m_selectedNode->GetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), pref);
 
       widget->setIsoDoseLevel(pos.Value());
       widget->setReferenceDose(pref);
       connect(m_Controls.spinReferenceDose, SIGNAL(valueChanged(double)), widget, SLOT(setReferenceDose(double)));
       connect(widget, SIGNAL(ColorChanged(mitk::IsoDoseLevel*)), this, SLOT(ActualizeFreeIsoLine()));
       connect(widget, SIGNAL(ValueChanged(mitk::IsoDoseLevel*, mitk::DoseValueRel)), this, SLOT(ActualizeFreeIsoLine()));
       connect(widget, SIGNAL(VisualizationStyleChanged(mitk::IsoDoseLevel*)), this, SLOT(ActualizeFreeIsoLine()));
 
       this->m_Controls.listFreeValues->addItem(item);
       this->m_Controls.listFreeValues->setItemWidget(item, widget);
     }
   }
 }
 
 void RTDoseVisualizer::ActualizeFreeIsoLine()
 {
   if(m_selectedNode.IsNotNull())
   {
     //Hack: This is a dirty hack to reinit the isodose contour node. Only if the node (or property) has changed the rendering process register the RequestUpdateAll
     //Only way to render the isoline by changes without a global reinit
     mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
     if (isoDoseNode.IsNotNull()) isoDoseNode->Modified();
 
     // Reinit if visibility of colorwash or isodoselevel changed
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   }
 }
 void RTDoseVisualizer::OnAbsDoseToggled(bool showAbs)
 {
   if (!  m_internalUpdate)
   {
     mitk::SetDoseDisplayAbsolute(showAbs);
     this->ActualizeDisplayStyleForAllDoseDataNodes();
   }
 }
 
 void RTDoseVisualizer::OnGlobalVisColorWashToggled(bool showColorWash)
 {
   if (m_selectedNode.IsNotNull())
   {
     m_selectedNode->SetBoolProperty(mitk::RTConstants::DOSE_SHOW_COLORWASH_PROPERTY_NAME.c_str(), showColorWash);
     //The rendering mode could be set in the dose mapper: Refactoring!
     mitk::RenderingModeProperty::Pointer renderingMode = mitk::RenderingModeProperty::New();
     if(showColorWash)
       renderingMode->SetValue(mitk::RenderingModeProperty::COLORTRANSFERFUNCTION_COLOR);
     else
       renderingMode->SetValue(mitk::RenderingModeProperty::LOOKUPTABLE_LEVELWINDOW_COLOR);
     m_selectedNode->SetProperty("Image Rendering.Mode", renderingMode);
 
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   }
 }
 
 void RTDoseVisualizer::OnGlobalVisIsoLineToggled(bool showIsoLines)
 {
   if (m_selectedNode.IsNotNull())
   {
     mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
     if (isoDoseNode.IsNotNull())
     {
       isoDoseNode->SetBoolProperty(mitk::RTConstants::DOSE_SHOW_ISOLINES_PROPERTY_NAME.c_str(), showIsoLines);
 
       //toggle the visibility of the free isolevel sliders
       this->m_Controls.listFreeValues->setEnabled(showIsoLines);
 
       mitk::RenderingManager::GetInstance()->RequestUpdateAll();
     }
   }
 }
 
 void RTDoseVisualizer::UpdateColorWashTransferFunction()
 {
   //Generating the Colorwash
   vtkSmartPointer<vtkColorTransferFunction> transferFunction = vtkSmartPointer<vtkColorTransferFunction>::New();
 
   if(m_selectedNode.IsNotNull())
   {
     mitk::IsoDoseLevelSetProperty::Pointer propIsoSet = dynamic_cast<mitk::IsoDoseLevelSetProperty* >(m_selectedNode->GetProperty(mitk::RTConstants::DOSE_ISO_LEVELS_PROPERTY_NAME.c_str()));
     mitk::IsoDoseLevelSet::Pointer isoDoseLevelSet = propIsoSet->GetValue();
 
     float referenceDose;
     m_selectedNode->GetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(),referenceDose);
     mitk::TransferFunction::ControlPoints scalarOpacityPoints;
     scalarOpacityPoints.push_back( std::make_pair(0, 1 ) );
-    //Backgroud
+    //Background
     transferFunction->AddHSVPoint(((isoDoseLevelSet->Begin())->GetDoseValue()*referenceDose)-0.001,0,0,0,1.0,1.0);
 
     for(mitk::IsoDoseLevelSet::ConstIterator itIsoDoseLevel = isoDoseLevelSet->Begin(); itIsoDoseLevel != isoDoseLevelSet->End(); ++itIsoDoseLevel)
     {
       float *hsv = new float[3];
       //used for transfer rgb to hsv
       vtkSmartPointer<vtkMath> cCalc = vtkSmartPointer<vtkMath>::New();
 
       if(itIsoDoseLevel->GetVisibleColorWash())
       {
         cCalc->RGBToHSV(itIsoDoseLevel->GetColor()[0],itIsoDoseLevel->GetColor()[1],itIsoDoseLevel->GetColor()[2],&hsv[0],&hsv[1],&hsv[2]);
         transferFunction->AddHSVPoint(itIsoDoseLevel->GetDoseValue()*referenceDose,hsv[0],hsv[1],hsv[2],1.0,1.0);
       }
       else
       {
         scalarOpacityPoints.push_back( std::make_pair(itIsoDoseLevel->GetDoseValue()*referenceDose, 1 ) );
       }
     }
 
     mitk::TransferFunction::Pointer mitkTransFunc = mitk::TransferFunction::New();
     mitk::TransferFunctionProperty::Pointer mitkTransFuncProp = mitk::TransferFunctionProperty::New();
     mitkTransFunc->SetColorTransferFunction(transferFunction);
     mitkTransFunc->SetScalarOpacityPoints(scalarOpacityPoints);
     mitkTransFuncProp->SetValue(mitkTransFunc);
     m_selectedNode->SetProperty("Image Rendering.Transfer Function", mitkTransFuncProp);
   }
 }
 
 /**Simple check if the passed node has dose visualization properties set.*/
 bool hasDoseVisProperties(mitk::DataNode::Pointer doseNode)
 {
   return doseNode->GetProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str()) != nullptr;
 }
 
 void RTDoseVisualizer::OnSelectionChanged( berry::IWorkbenchPart::Pointer,
                                           const QList<mitk::DataNode::Pointer>&)
 {
   QList<mitk::DataNode::Pointer> dataNodes = this->GetDataManagerSelection();
 
   mitk::DataNode* selectedNode = nullptr;
 
   if (!dataNodes.empty())
   {
     bool isDoseNode = m_isDosePredicate->CheckNode(dataNodes[0].GetPointer());
 
     if (isDoseNode)
     {
       selectedNode = dataNodes[0];
     }
   }
 
   if (selectedNode != m_selectedNode.GetPointer())
   {
     m_selectedNode = selectedNode;
     if (selectedNode)
     {
       PrepareDoseNode(m_selectedNode);
     }
   }
 
   UpdateBySelectedNode();
 }
 
 void RTDoseVisualizer::PrepareDoseNode( mitk::DataNode* doseNode ) const
 {
   mitk::DoseValueAbs dose;
   mitk::GetReferenceDoseValue(dose);
   auto presetMap = mitk::LoadPresetsMap();
   auto colorPreset = mitk::GenerateIsoLevels_Virtuos();
   auto finding = presetMap.find(mitk::GetSelectedPresetName());
   if (finding != presetMap.end())
   {
     colorPreset = finding->second;
   }
 
   if (!hasDoseVisProperties(doseNode))
   {
     mitk::ConfigureNodeAsDoseNode(doseNode, colorPreset, dose, true);
   }
 
   mitk::DataNode::Pointer doseOutlineNode = this->GetIsoDoseNode(doseNode);
   if (doseOutlineNode.IsNull())
   {
     doseOutlineNode = mitk::DataNode::New();
     doseOutlineNode->SetData(doseNode->GetData());
     doseOutlineNode->SetName(ISO_LINE_NODE_NAME);
 
     mitk::ConfigureNodeAsIsoLineNode(doseOutlineNode, colorPreset, dose, true);
     this->GetDataStorage()->Add(doseOutlineNode, doseNode);
   }
 }
 
 void RTDoseVisualizer::UpdateBySelectedNode()
 {
   m_Controls.groupNodeSpecific->setEnabled(m_selectedNode.IsNotNull());
   m_Controls.groupFreeValues->setEnabled(m_selectedNode.IsNotNull());
   m_Controls.checkGlobalVisColorWash->setEnabled(m_selectedNode.IsNotNull());
   m_Controls.checkGlobalVisIsoLine->setEnabled(m_selectedNode.IsNotNull());
   m_Controls.isoLevelSetView->setEnabled(m_selectedNode.IsNotNull());
 
 
   if(m_selectedNode.IsNull())
   {
     m_Controls.NrOfFractions->setText(QString("N/A. No dose selected"));
     m_Controls.prescribedDoseSpecific->setText(QString("N/A. No dose selected"));
   }
   else
   {
     //dose specific information
       int fracCount = 1;
       m_selectedNode->GetIntProperty(mitk::RTConstants::DOSE_FRACTION_COUNT_PROPERTY_NAME.c_str(), fracCount);
       m_Controls.NrOfFractions->setText(QString::number(fracCount));
 
       m_PrescribedDose_Data = 0.0;
 
       auto prescibedDoseProperty = m_selectedNode->GetData()->GetProperty(mitk::RTConstants::PRESCRIBED_DOSE_PROPERTY_NAME.c_str());
       auto prescribedDoseGenericProperty = dynamic_cast<mitk::DoubleProperty*>(prescibedDoseProperty.GetPointer());
       m_PrescribedDose_Data = prescribedDoseGenericProperty->GetValue();
 
       m_Controls.prescribedDoseSpecific->setText(QString::number(m_PrescribedDose_Data));
 
     //free iso lines
     mitk::DataNode::Pointer isoDoseNode = this->GetIsoDoseNode(m_selectedNode);
     if (isoDoseNode)
     {
       mitk::IsoDoseLevelVectorProperty::Pointer propIsoVector;
 
       propIsoVector = dynamic_cast<mitk::IsoDoseLevelVectorProperty*>(isoDoseNode->GetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str()));
 
       if (propIsoVector.IsNull())
       {
         mitk::IsoDoseLevelVector::Pointer freeIsoValues = mitk::IsoDoseLevelVector::New();
         propIsoVector = mitk::IsoDoseLevelVectorProperty::New(freeIsoValues);
         isoDoseNode->SetProperty(mitk::RTConstants::DOSE_FREE_ISO_VALUES_PROPERTY_NAME.c_str(), propIsoVector);
       }
 
       UpdateFreeIsoValues();
 
       //global dose issues
       //ATM the IsoDoseContours have an own (helper) node which is a child of dose node; Will be fixed with the doseMapper refactoring
       bool showIsoLine = mitk::GetGlobalIsolineVis();
       isoDoseNode->GetBoolProperty(mitk::RTConstants::DOSE_SHOW_ISOLINES_PROPERTY_NAME.c_str(), showIsoLine);
       m_Controls.checkGlobalVisIsoLine->setChecked(showIsoLine);
     }
 
     bool showColorWash = mitk::GetGlobalColorwashVis();
     m_selectedNode->GetBoolProperty(mitk::RTConstants::DOSE_SHOW_COLORWASH_PROPERTY_NAME.c_str(),showColorWash);
     m_Controls.checkGlobalVisColorWash->setChecked(showColorWash);
 
     float referenceDose = 0.0;
     m_selectedNode->GetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(),referenceDose);
     m_Controls.spinReferenceDose->setValue(referenceDose);
 
     mitk::IsoDoseLevelSetProperty::Pointer propIsoSet =
       dynamic_cast<mitk::IsoDoseLevelSetProperty* >(m_selectedNode->GetProperty(mitk::RTConstants::DOSE_ISO_LEVELS_PROPERTY_NAME.c_str()));
 
     if (propIsoSet)
     {
       this->m_LevelSetModel->setIsoDoseLevelSet(propIsoSet->GetValue());
     }
   }
 }
 
 void RTDoseVisualizer::NodeRemoved(const mitk::DataNode* node)
 {
   /**@TODO This removal seems to be needed because of the current dose rendering approach (additional sub node for iso dose lines).
    As soon as we have a better and sound single node rendering mechanism for doses. This method should be removed.*/
   bool isdose = m_isDosePredicate->CheckNode(node);
   if (isdose)
   {
     mitk::DataStorage::SetOfObjects::ConstPointer childNodes = this->GetDataStorage()->GetDerivations(node, m_isIsoPredicate);
     auto iterChildNodes = childNodes->begin();
 
     while (iterChildNodes != childNodes->end())
     {
       this->GetDataStorage()->Remove((*iterChildNodes));
       ++iterChildNodes;
     }
   }
 }
 
 void RTDoseVisualizer::NodeChanged(const mitk::DataNode *node)
 {
   /**@TODO This event seems to be needed because of the current dose rendering approach (additional sub node for iso dose lines).
   As soon as we have a better and sound single node rendering mechanism for doses. This method should be removed.*/
   bool isdose = m_isDosePredicate->CheckNode(node);
   if(isdose)
   {
     bool isvisible = true;
     if(node->GetBoolProperty("visible", isvisible))
     {
       mitk::DataStorage::SetOfObjects::ConstPointer childNodes = this->GetDataStorage()->GetDerivations(node, m_isIsoPredicate);
       mitk::DataStorage::SetOfObjects::const_iterator iterChildNodes = childNodes->begin();
 
       while (iterChildNodes != childNodes->end())
       {
         (*iterChildNodes)->SetVisibility(isvisible);
         ++iterChildNodes;
       }
     }
   }
 }
 
 void RTDoseVisualizer::UpdateByPreferences()
 {
   m_Presets = mitk::LoadPresetsMap();
   m_internalUpdate = true;
   m_Controls.comboPresets->clear();
   this->m_selectedPresetName = mitk::GetSelectedPresetName();
 
   m_Controls.checkGlobalVisIsoLine->setChecked(mitk::GetGlobalIsolineVis());
   m_Controls.checkGlobalVisColorWash->setChecked(mitk::GetGlobalColorwashVis());
 
   if(m_Presets.empty())
     return;
 
   int index = 0;
   int selectedIndex = -1;
   for (mitk::PresetMapType::const_iterator pos = m_Presets.begin(); pos != m_Presets.end(); ++pos, ++index)
   {
     m_Controls.comboPresets->addItem(QString(pos->first.c_str()));
     if (this->m_selectedPresetName == pos->first)
     {
       selectedIndex = index;
     }
   }
 
   if (selectedIndex == -1)
   {
     selectedIndex = 0;
     MITK_WARN << "Error. Iso dose level preset specified in preferences does not exist. Preset name: "<<this->m_selectedPresetName;
     this->m_selectedPresetName = m_Presets.begin()->first;
     mitk::SetSelectedPresetName(this->m_selectedPresetName);
     MITK_INFO << "Changed selected iso dose level preset to first existing preset. New preset name: "<<this->m_selectedPresetName;
   }
 
   m_Controls.comboPresets->setCurrentIndex(selectedIndex);
 
   this->m_LevelSetModel->setIsoDoseLevelSet(this->m_Presets[this->m_selectedPresetName]);
 
   mitk::DoseValueAbs referenceDose = 0.0;
   bool globalSync = mitk::GetReferenceDoseValue(referenceDose);
   if (globalSync || this->m_selectedNode.IsNull())
   {
     m_Controls.spinReferenceDose->setValue(referenceDose);
   }
 
   bool displayAbsoluteDose = mitk::GetDoseDisplayAbsolute();
   m_Controls.radioAbsDose->setChecked(displayAbsoluteDose);
   m_Controls.radioRelDose->setChecked(!displayAbsoluteDose);
   this->m_LevelSetModel->setShowAbsoluteDose(displayAbsoluteDose);
   m_internalUpdate = false;
 }
 
 void RTDoseVisualizer::OnCurrentPresetChanged(const QString& presetName)
 {
   if (!  m_internalUpdate)
   {
     mitk::SetSelectedPresetName(presetName.toStdString());
     this->UpdateByPreferences();
     this->ActualizeIsoLevelsForAllDoseDataNodes();
     this->UpdateBySelectedNode();
   }
 }
 
 void RTDoseVisualizer::ActualizeIsoLevelsForAllDoseDataNodes()
 {
   std::string presetName = mitk::GetSelectedPresetName();
 
   mitk::PresetMapType presetMap = mitk::LoadPresetsMap();
 
   mitk::DataStorage::SetOfObjects::ConstPointer nodes = this->GetDataStorage()->GetSubset(m_isDoseOrIsoPredicate);
 
   if(presetMap.empty())
     return;
 
   mitk::IsoDoseLevelSet* selectedPreset = presetMap[presetName];
 
   if (!selectedPreset)
   {
     mitkThrow() << "Error. Cannot actualize iso dose level preset. Selected preset does not exist. Preset name: "<<presetName;
   }
 
   for(mitk::DataStorage::SetOfObjects::const_iterator pos = nodes->begin(); pos != nodes->end(); ++pos)
   {
     mitk::IsoDoseLevelSet::Pointer clonedPreset = selectedPreset->Clone();
     mitk::IsoDoseLevelSetProperty::Pointer propIsoSet = mitk::IsoDoseLevelSetProperty::New(clonedPreset);
     (*pos)->SetProperty(mitk::RTConstants::DOSE_ISO_LEVELS_PROPERTY_NAME.c_str(),propIsoSet);
   }
 }
 
 void RTDoseVisualizer::ActualizeReferenceDoseForAllDoseDataNodes()
 {
     mitk::DoseValueAbs value = 0;
     bool sync = mitk::GetReferenceDoseValue(value);
 
     if (sync)
     {
       mitk::DataStorage::SetOfObjects::ConstPointer nodes = this->GetDataStorage()->GetSubset(m_isDoseOrIsoPredicate);
 
         for(mitk::DataStorage::SetOfObjects::const_iterator pos = nodes->begin(); pos != nodes->end(); ++pos)
         {
             (*pos)->SetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), value);
 
             /**@TODO: ATM the IsoDoseContours have an own (helper) node which is a child of dose node; Will be fixed with the doseMapper refactoring*/
             mitk::DataStorage::SetOfObjects::ConstPointer childNodes = this->GetDataStorage()->GetDerivations(*pos);
             mitk::DataStorage::SetOfObjects::const_iterator iterChildNodes = childNodes->begin();
 
             while (iterChildNodes != childNodes->end())
             {
             (*iterChildNodes)->SetFloatProperty(mitk::RTConstants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), value);
             ++iterChildNodes;
             }
         }
     }
 }
 
 void RTDoseVisualizer::ActualizeDisplayStyleForAllDoseDataNodes()
 {
   /** @TODO Klären ob diese präsentations info global oder auch per node gespeichert wird*/
 }
 
 void RTDoseVisualizer::OnHandleCTKEventReferenceDoseChanged(const ctkEvent&)
 {
   mitk::DoseValueAbs referenceDose = 0.0;
   mitk::GetReferenceDoseValue(referenceDose);
 
   this->m_Controls.spinReferenceDose->setValue(referenceDose);
 }
 
 void RTDoseVisualizer::OnHandleCTKEventGlobalVisChanged(const ctkEvent&)
 {
   this->m_Controls.checkGlobalVisIsoLine->setChecked(mitk::GetGlobalIsolineVis());
   this->m_Controls.checkGlobalVisColorWash->setChecked(mitk::GetGlobalColorwashVis());
 }
 
 void RTDoseVisualizer::OnHandleCTKEventPresetsChanged(const ctkEvent&)
 {
   std::string currentPresetName  = mitk::GetSelectedPresetName();
 
   this->OnCurrentPresetChanged(QString::fromStdString(currentPresetName));
 }
 
 /**@TODO ATM the IsoDoseContours have an own (helper) node which is a child of dose node; Will be fixed with the doseMapper refactoring*/
 mitk::DataNode::Pointer RTDoseVisualizer::GetIsoDoseNode(mitk::DataNode::Pointer doseNode) const
 {
   mitk::DataStorage::SetOfObjects::ConstPointer childNodes = this->GetDataStorage()->GetDerivations(doseNode, m_isIsoPredicate);
   if (childNodes->empty())
   {
     return nullptr;
   }
   else
   {
     return (*childNodes->begin());
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h
index 2181adbeb5..edeee71c45 100644
--- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h
+++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.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 RTDoseVisualizer_h
 #define RTDoseVisualizer_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include "ui_RTDoseVisualizerControls.h"
 
 #include <mitkIsoDoseLevelCollections.h>
 
 #include <mitkImage.h>
 
 #include <mitkNodePredicateBase.h>
 
 #include "mitkDoseVisPreferenceHelper.h"
 
 // Shader
 #include <mitkCoreServices.h>
 
 #include <vtkSmartPointer.h>
 #include <mitkRenderingModeProperty.h>
 
 #include <vtkContourFilter.h>
 
 #include <mitkIRenderWindowPart.h>
 
 /*forward declarations*/
 class QmitkIsoDoseLevelSetModel;
 class QmitkDoseColorDelegate;
 class QmitkDoseValueDelegate;
 class QmitkDoseVisualStyleDelegate;
 class ctkEvent;
 
 /**
 \brief RTDoseVisualizer
 
 \warning  This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
 
 \sa QmitkAbstractView
 \ingroup ${plugin_target}_internal
 */
 class RTDoseVisualizer : public QmitkAbstractView
 {
   Q_OBJECT
 
 public:
 
   RTDoseVisualizer();
   ~RTDoseVisualizer() override;
   static const std::string VIEW_ID;
   static const std::string ISO_LINE_NODE_NAME;
 
   void OnSliceChanged(itk::Object *sender, const itk::EventObject &e);
 
   protected slots:
 
     void OnAddFreeValueClicked();
 
     void OnRemoveFreeValueClicked();
 
     void OnUsePrescribedDoseClicked();
 
     void OnDataChangedInIsoLevelSetView();
 
     void OnAbsDoseToggled(bool);
 
     void OnGlobalVisColorWashToggled(bool);
 
     void OnGlobalVisIsoLineToggled(bool);
 
     void OnShowContextMenuIsoSet(const QPoint&);
 
     void OnCurrentPresetChanged(const QString&);
 
     void OnReferenceDoseChanged(double);
 
     void OnHandleCTKEventReferenceDoseChanged(const ctkEvent& event);
 
     void OnHandleCTKEventPresetsChanged(const ctkEvent& event);
 
     void OnHandleCTKEventGlobalVisChanged(const ctkEvent& event);
 
     void ActualizeFreeIsoLine();
 
 protected:
 
   void CreateQtPartControl(QWidget *parent) override;
 
   void SetFocus() override;
 
   void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
     const QList<mitk::DataNode::Pointer>& nodes ) override;
 
   void PrepareDoseNode(mitk::DataNode* doseNode) const;
 
-  /** Update the transfer funtion property for the color wash*/
+  /** Update the transfer function property for the color wash*/
   void UpdateColorWashTransferFunction();
 
   /** Method updates the list widget according to the current free iso values.*/
   void UpdateFreeIsoValues();
 
   /** Update the members according to the currently selected node */
   void UpdateBySelectedNode();
 
   /** Update the member widgets according to the information stored in the application preferences*/
   void UpdateByPreferences();
 
-  /**helper function that iterates throug all data nodes and sets there iso level set property
+  /**helper function that iterates through all data nodes and sets there iso level set property
   according to the selected preset.
   @TODO: should be moved outside the class, to be available for other classes at well.*/
   void ActualizeIsoLevelsForAllDoseDataNodes();
 
-  /**helper function that iterates throug all data nodes and sets there reference dose value
+  /**helper function that iterates through all data nodes and sets there reference dose value
   according to the preference.
   @TODO: should be moved outside the class, to be available for other classes at well.*/
   void ActualizeReferenceDoseForAllDoseDataNodes();
 
   /**helper function that iterates through all data nodes and sets there dose display style (relative/absolute)
   according to the preference.
   @TODO: should be moved outside the class, to be available for other classes at well.*/
   void ActualizeDisplayStyleForAllDoseDataNodes();
 
   void NodeRemoved(const mitk::DataNode* node) override;
 
   void NodeChanged(const mitk::DataNode *node) override;
 
   Ui::RTDoseVisualizerControls m_Controls;
   mitk::DataNode::Pointer m_selectedNode;
   unsigned int m_freeIsoValuesCount;
 
   mitk::PresetMapType m_Presets;
   std::string m_selectedPresetName;
 
   /** Prescribed Dose of the selected data.*/
   mitk::DoseValueAbs m_PrescribedDose_Data;
 
   QmitkIsoDoseLevelSetModel* m_LevelSetModel;
   QmitkDoseColorDelegate* m_DoseColorDelegate;
   QmitkDoseValueDelegate* m_DoseValueDelegate;
   QmitkDoseVisualStyleDelegate* m_DoseVisualDelegate;
 
   bool m_internalUpdate;
 
   /**Predicate for dose nodes (excluding iso line nodes)*/
   mitk::NodePredicateBase::Pointer m_isDosePredicate;
   /**Predicate for dose nodes and all iso line nodes*/
   mitk::NodePredicateBase::Pointer m_isDoseOrIsoPredicate;
   /**Predicate for iso line nodes*/
   mitk::NodePredicateBase::Pointer m_isIsoPredicate;
 
 private:
   mitk::DataNode::Pointer GetIsoDoseNode(mitk::DataNode::Pointer doseNode) const;
 };
 
 #endif // RTDoseVisualizer_h
diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePageControls.ui b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePageControls.ui
index efd18081ca..b38f0d5c3c 100644
--- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePageControls.ui
+++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePageControls.ui
@@ -1,86 +1,86 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>RTUIPreferencePageControls</class>
  <widget class="QWidget" name="RTUIPreferencePageControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>403</width>
     <height>438</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Handling of unkown prescribed dose:</string>
+      <string>Handling of unknown prescribed dose:</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="1" column="1">
        <widget class="QDoubleSpinBox" name="spinRelativeToMax">
         <property name="enabled">
          <bool>false</bool>
         </property>
         <property name="suffix">
          <string> %</string>
         </property>
         <property name="maximum">
          <double>200.000000000000000</double>
         </property>
         <property name="value">
          <double>80.000000000000000</double>
         </property>
        </widget>
       </item>
       <item row="0" column="0">
        <widget class="QRadioButton" name="radioDefault">
         <property name="text">
          <string>set to default value:</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0">
        <widget class="QRadioButton" name="radioRelativeToMax">
         <property name="text">
          <string>set relative to max dose:</string>
         </property>
        </widget>
       </item>
       <item row="0" column="1">
        <widget class="QDoubleSpinBox" name="spinDefault">
         <property name="suffix">
          <string> Gy</string>
         </property>
         <property name="maximum">
          <double>9999.000000000000000</double>
         </property>
         <property name="value">
          <double>50.000000000000000</double>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.ext/resources/icons/tango/scalable/mimetypes/image-x-generic.svg b/Plugins/org.mitk.gui.qt.ext/resources/icons/tango/scalable/mimetypes/image-x-generic.svg
index 45dd641ae7..bb846d32f2 100644
--- a/Plugins/org.mitk.gui.qt.ext/resources/icons/tango/scalable/mimetypes/image-x-generic.svg
+++ b/Plugins/org.mitk.gui.qt.ext/resources/icons/tango/scalable/mimetypes/image-x-generic.svg
@@ -1,581 +1,581 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In  -->
 <svg
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:cc="http://creativecommons.org/ns#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    width="48.000000px"
    height="48.000000px"
    xml:space="preserve"
    id="svg16168"
    sodipodi:version="0.32"
    inkscape:version="0.46"
    sodipodi:docname="image-x-generic.svg"
    sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/mimetypes"
    inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
    id="metadata16236">
   <rdf:RDF>
     <cc:Work
    rdf:about="">
       <dc:format>image/svg+xml</dc:format>
 
 
 
       <dc:type
    rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
 
 
 
-    <dc:title>Genric Image</dc:title>
+    <dc:title>Generic Image</dc:title>
 <dc:creator>
   <cc:Agent>
     <dc:title>Jakub Steiner</dc:title>
   </cc:Agent>
 </dc:creator>
 <dc:subject>
   <rdf:Bag><rdf:li>image</rdf:li><rdf:li>picture</rdf:li><rdf:li>snapshot</rdf:li><rdf:li>photo</rdf:li></rdf:Bag>
 </dc:subject>
 <cc:license
    rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
 </cc:Work>
 
 
 
   
 <cc:License
    rdf:about="http://creativecommons.org/licenses/publicdomain/"><cc:permits
      rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
      rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:permits
      rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /></cc:License></rdf:RDF>
 
 
 
 </metadata>
 
 
 
 <defs
    id="defs16234"><inkscape:perspective
    sodipodi:type="inkscape:persp3d"
    inkscape:vp_x="0 : 24 : 1"
    inkscape:vp_y="0 : 1000 : 0"
    inkscape:vp_z="48 : 24 : 1"
    inkscape:persp3d-origin="24 : 16 : 1"
    id="perspective80" /><radialGradient
    inkscape:collect="always"
    xlink:href="#linearGradient5060"
    id="radialGradient6719"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
    cx="605.71429"
    cy="486.64789"
    fx="605.71429"
    fy="486.64789"
    r="117.14286" /><linearGradient
    inkscape:collect="always"
    id="linearGradient5060"><stop
      style="stop-color:black;stop-opacity:1;"
      offset="0"
      id="stop5062" /><stop
      style="stop-color:black;stop-opacity:0;"
      offset="1"
      id="stop5064" /></linearGradient><radialGradient
    inkscape:collect="always"
    xlink:href="#linearGradient5060"
    id="radialGradient6717"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
    cx="605.71429"
    cy="486.64789"
    fx="605.71429"
    fy="486.64789"
    r="117.14286" /><linearGradient
    id="linearGradient5048"><stop
      style="stop-color:black;stop-opacity:0;"
      offset="0"
      id="stop5050" /><stop
      id="stop5056"
      offset="0.5"
      style="stop-color:black;stop-opacity:1;" /><stop
      style="stop-color:black;stop-opacity:0;"
      offset="1"
      id="stop5052" /></linearGradient><linearGradient
    inkscape:collect="always"
    xlink:href="#linearGradient5048"
    id="linearGradient6715"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
    x1="302.85715"
    y1="366.64789"
    x2="302.85715"
    y2="609.50507" /><linearGradient
    id="linearGradient8171"><stop
      style="stop-color:#bbbdba;stop-opacity:1;"
      offset="0"
      id="stop8173" /><stop
      style="stop-color:#70746e;stop-opacity:1;"
      offset="1"
      id="stop8175" /></linearGradient><linearGradient
    inkscape:collect="always"
    id="linearGradient8155"><stop
      style="stop-color:#ffffff;stop-opacity:1;"
      offset="0"
      id="stop8157" /><stop
      style="stop-color:#ffffff;stop-opacity:0;"
      offset="1"
      id="stop8159" /></linearGradient><linearGradient
    id="linearGradient2224"><stop
      style="stop-color:#7c7c7c;stop-opacity:1;"
      offset="0"
      id="stop2226" /><stop
      style="stop-color:#b8b8b8;stop-opacity:1;"
      offset="1"
      id="stop2228" /></linearGradient><linearGradient
    inkscape:collect="always"
    id="linearGradient2251"><stop
      style="stop-color:#ffffff;stop-opacity:1;"
      offset="0"
      id="stop2253" /><stop
      style="stop-color:#ffffff;stop-opacity:0;"
      offset="1"
      id="stop2255" /></linearGradient><linearGradient
    id="linearGradient7648"
    gradientUnits="userSpaceOnUse"
    x1="21.9326"
    y1="24.6274"
    x2="21.9326"
    y2="7.1091"
    style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667">
 			<stop
    offset="0"
    style="stop-color:#8595bc;stop-opacity:1;"
    id="stop7650" />
 
 
 
 
 			<stop
    offset="1"
    style="stop-color:#041a3b;stop-opacity:1;"
    id="stop7652" />
 
 
 
 
 		</linearGradient><linearGradient
    id="linearGradient2392"><stop
      id="stop2394"
      offset="0.0000000"
      style="stop-color:#715b26;stop-opacity:1.0000000;" /><stop
      id="stop2396"
      offset="1.0000000"
      style="stop-color:#312710;stop-opacity:1.0000000;" /></linearGradient><linearGradient
    inkscape:collect="always"
    id="linearGradient12129"><stop
      style="stop-color:#000000;stop-opacity:1;"
      offset="0"
      id="stop12131" /><stop
      style="stop-color:#000000;stop-opacity:0;"
      offset="1"
      id="stop12133" /></linearGradient>
 		
 		<linearGradient
    style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    y2="36.0328"
    x2="31.0813"
    y1="3.7319"
    x1="12.4873"
    gradientUnits="userSpaceOnUse"
    id="aigrd1">
 			<stop
    id="stop16177"
    style="stop-color:#D2D2D2;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    offset="0" />
 
 
 
 
 			<stop
    id="stop16179"
    style="stop-color:#EDEDED;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    offset="1" />
 
 
 
 
 		</linearGradient>
 
 
 
 
 		
 		<linearGradient
    style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    y2="22.5769"
    x2="21.9168"
    y1="30.3413"
    x1="21.877"
    gradientUnits="userSpaceOnUse"
    id="aigrd2">
 			<stop
    id="stop16184"
    style="stop-color:#5e4f07;stop-opacity:1.0000000;"
    offset="0.0000000" />
 
 
 
 
 			<stop
    id="stop16186"
    style="stop-color:#348a31;stop-opacity:1.0000000;"
    offset="1.0000000" />
 
 
 
 
 		</linearGradient>
 
 
 
 
 		
 		
 		
 		
 		
 		<linearGradient
    style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    y2="7.1091"
    x2="21.9326"
    y1="24.6274"
    x1="21.9326"
    gradientUnits="userSpaceOnUse"
    id="aigrd3">
 			<stop
    id="stop16199"
    style="stop-color:#D0D6E5;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    offset="0" />
 
 
 
 
 			<stop
    id="stop16201"
    style="stop-color:#093A80;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
    offset="1" />
 
 
 
 
 		</linearGradient>
 
 
 
 
 		
 		
 		
 		
 		
 		
 		
 	
 
 
 
 
 
 
 
 
 
 
 
 <radialGradient
    inkscape:collect="always"
    xlink:href="#linearGradient12129"
    id="radialGradient12135"
    cx="24.218407"
    cy="41.636040"
    fx="24.218407"
    fy="41.636040"
    r="22.097088"
    gradientTransform="matrix(1.000000,0.000000,0.000000,0.184000,0.000000,33.97501)"
    gradientUnits="userSpaceOnUse" /><linearGradient
    inkscape:collect="always"
    xlink:href="#linearGradient7648"
    id="linearGradient7671"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(1.098989,0.000000,0.000000,-0.797757,-1.953865,37.32400)"
    x1="21.9326"
    y1="24.627399"
    x2="21.9326"
    y2="7.1090999" /><linearGradient
    inkscape:collect="always"
    xlink:href="#aigrd3"
    id="linearGradient7673"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(1.098989,0.000000,0.000000,1.106697,-1.953865,-4.922453)"
    x1="21.9326"
    y1="24.6274"
    x2="21.9326"
    y2="7.1091" /><linearGradient
    inkscape:collect="always"
    xlink:href="#aigrd1"
    id="linearGradient8148"
    gradientUnits="userSpaceOnUse"
    gradientTransform="matrix(1.434003,0.000000,0.000000,0.990087,52.32167,2.838918)"
    x1="12.4873"
    y1="3.7319"
    x2="31.0813"
    y2="36.0328" /><radialGradient
    inkscape:collect="always"
    xlink:href="#linearGradient8155"
    id="radialGradient8161"
    cx="12.700491"
    cy="10.404876"
    fx="12.700491"
    fy="10.404876"
    r="19.96875"
    gradientTransform="matrix(1.710531,-5.396358e-24,2.470345e-24,1.124849,-11.56833,1.802582)"
    gradientUnits="userSpaceOnUse" /><linearGradient
    inkscape:collect="always"
    xlink:href="#linearGradient2251"
    id="linearGradient8166"
    gradientUnits="userSpaceOnUse"
    gradientTransform="translate(5.147570,-3.409792)"
    x1="33.396004"
    y1="36.921333"
    x2="34.170048"
    y2="38.070381" /><linearGradient
    inkscape:collect="always"
    xlink:href="#linearGradient2224"
    id="linearGradient8169"
    gradientUnits="userSpaceOnUse"
    gradientTransform="translate(5.147570,-3.034792)"
    x1="35.996582"
    y1="40.458221"
    x2="33.664921"
    y2="37.770721" /><linearGradient
    inkscape:collect="always"
    xlink:href="#linearGradient8171"
    id="linearGradient8177"
    x1="42.1875"
    y1="31"
    x2="45"
    y2="39.984692"
    gradientUnits="userSpaceOnUse" /></defs>
 
 
 
 <sodipodi:namedview
    inkscape:window-height="818"
    inkscape:window-width="1238"
    inkscape:pageshadow="2"
    inkscape:pageopacity="0.0"
    borderopacity="0.07058824"
    bordercolor="#666666"
    pagecolor="#ffffff"
    id="base"
    inkscape:zoom="1"
    inkscape:cx="49.378608"
    inkscape:cy="-24.095483"
    inkscape:window-x="0"
    inkscape:window-y="30"
    inkscape:current-layer="svg16168"
    showgrid="false"
    inkscape:showpageshadow="false" />
 
 
 
 
 	
 	<g
    style="display:inline"
    transform="matrix(2.175112e-2,0,0,2.493263e-2,42.41049,33.81117)"
    id="g6707"><rect
      style="opacity:0.40206185;color:black;fill:url(#linearGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
      id="rect6709"
      width="1339.6335"
      height="478.35718"
      x="-1559.2523"
      y="-150.69685" /><path
      style="opacity:0.40206185;color:black;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
      d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z "
      id="path6711"
      sodipodi:nodetypes="cccc" /><path
      sodipodi:nodetypes="cccc"
      id="path6713"
      d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z "
      style="opacity:0.40206185;color:black;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /></g><path
    style="color:#000000;fill:url(#linearGradient8148);fill-opacity:1;fill-rule:nonzero;stroke:#bbbfbb;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
    d="M 2.7177715,6.4547749 L 43.379544,6.4547749 C 44.002793,6.4547749 44.504543,6.9565247 44.504543,7.5797745 L 44.504543,31.480581 C 44.504543,32.103831 36.047842,39.499872 35.424593,39.499872 L 2.7177715,39.499872 C 2.0945221,39.499872 1.5927727,38.998122 1.5927727,38.374872 L 1.5927727,7.5797745 C 1.5927727,6.9565247 2.0945221,6.4547749 2.7177715,6.4547749 z "
    id="rect7603"
    sodipodi:nodetypes="ccccccccc" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 <g
    id="g7654"
    transform="matrix(1.054774,0.000000,0.000000,1.049989,-0.814647,4.485012)"><path
      id="path7644"
      d="M 5.512695,30 L 39.643234,30 L 39.643234,19.627375 L 5.512695,19.627375 L 5.512695,30 z "
      style="fill:url(#linearGradient7671);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4" /><path
      style="fill:url(#linearGradient7673);fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4"
      d="M 5.512695,5.237844 L 39.643234,5.237844 L 39.643234,19.627375 L 5.512695,19.627375 L 5.512695,5.237844 z "
      id="path16203" /><g
      id="g16205"
      style="fill-rule:nonzero;stroke:#000000;stroke-width:1.15611064;stroke-miterlimit:4"
      transform="matrix(1.189217,0.000000,0.000000,1.189217,-3.525355,-6.535408)">
 			<g
    id="g16207">
 				<path
    style="opacity:0.04999994;fill:#e8f52f;stroke:none"
    d="M 18.4,15.4 C 18.4,17.6 16.6,19.5 14.3,19.5 C 12.1,19.5 10.2,17.7 10.2,15.4 C 10.2,13.2 12,11.3 14.3,11.3 C 16.5,11.3 18.4,13.1 18.4,15.4 z "
    id="path16209" />
 
 
 
 
 				<path
    style="opacity:0.20829994;fill:#ecf751;stroke:none"
    d="M 18,15.4 C 18,17.4 16.4,19.1 14.3,19.1 C 12.3,19.1 10.6,17.5 10.6,15.4 C 10.6,13.4 12.2,11.7 14.3,11.7 C 16.3,11.7 18,13.3 18,15.4 L 18,15.4 z "
    id="path16211" />
 
 
 
 
 				<path
    style="opacity:0.36669994;fill:#f0f972;stroke:none"
    d="M 17.6,15.4 C 17.6,17.2 16.1,18.7 14.3,18.7 C 12.5,18.7 11,17.2 11,15.4 C 11,13.6 12.5,12.1 14.3,12.1 C 16.1,12.1 17.6,13.6 17.6,15.4 L 17.6,15.4 z "
    id="path16213" />
 
 
 
 
 				<path
    style="opacity:0.525;fill:#f4fa95;stroke:none"
    d="M 17.2,15.4 C 17.2,17 15.9,18.3 14.3,18.3 C 12.7,18.3 11.4,17 11.4,15.4 C 11.4,13.8 12.7,12.5 14.3,12.5 C 15.9,12.5 17.2,13.8 17.2,15.4 z "
    id="path16215" />
 
 
 
 
 				<path
    style="opacity:0.6833;fill:#f7fcb7;stroke:none"
    d="M 16.8,15.4 C 16.8,16.8 15.7,17.9 14.3,17.9 C 12.9,17.9 11.8,16.8 11.8,15.4 C 11.8,14 12.9,12.9 14.3,12.9 C 15.7,12.9 16.8,14 16.8,15.4 L 16.8,15.4 z "
    id="path16217" />
 
 
 
 
 				<path
    style="opacity:0.8417;fill:#fbfddb;stroke:none"
    d="M 16.4,15.4 C 16.4,16.6 15.4,17.5 14.3,17.5 C 13.2,17.5 12.2,16.5 12.2,15.4 C 12.2,14.3 13.2,13.3 14.3,13.3 C 15.4,13.3 16.4,14.3 16.4,15.4 z "
    id="path16219" />
 
 
 
 
 				<path
    style="fill:#ffffff;stroke:none"
    d="M 16,15.4 C 16,16.4 15.2,17.2 14.2,17.2 C 13.2,17.2 12.4,16.4 12.4,15.4 C 12.4,14.4 13.2,13.6 14.2,13.6 C 15.2,13.6 16,14.4 16,15.4 L 16,15.4 z "
    id="path16221" />
 
 
 
 
 			</g>
 
 
 
 
 		</g><path
      style="opacity:0.3;fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4"
      d="M 25.015859,21.649044 L 33.697148,21.649044 L 35.362052,22.124732 L 32.507931,22.124732 C 32.507931,22.124732 35.362052,22.362574 36.789115,24.146401 C 38.216174,25.811305 35.12421,27.832976 35.12421,27.832976 C 35.12421,27.832976 35.12421,27.832976 35.12421,27.832976 C 35.005288,27.47621 34.291756,24.622087 32.864696,23.43287 C 31.794399,22.481496 30.605182,22.243652 30.605182,22.243652 L 25.015859,22.243652 L 25.015859,21.767966 L 25.015859,21.649044 z "
      id="path16223" /><path
      style="opacity:0.3;fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4"
      d="M 30.724106,22.362574 L 25.729391,22.362574 L 35.005288,27.595131 L 30.724106,22.362574 L 30.724106,22.362574 z "
      id="path16225" /><path
      style="fill:#515151;fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4"
      d="M 25.015859,21.767966 L 33.697148,21.767966 L 35.005288,20.935513 L 32.151167,20.935513 C 32.151167,20.935513 34.767443,20.459827 35.12421,17.486782 C 35.480973,14.513739 31.080869,11.183931 31.080869,11.183931 C 31.080869,11.183931 31.080869,11.183931 31.080869,11.302853 C 31.19979,12.016383 32.389007,17.011096 31.556557,18.913846 C 31.19979,20.578747 30.129495,20.935513 30.129495,20.935513 L 24.659094,20.935513 L 24.896938,21.767966 L 25.015859,21.767966 z "
      id="path16227" /><path
      style="fill:#515151;fill-rule:nonzero;stroke:none;stroke-width:1.2166667;stroke-miterlimit:4"
      d="M 30.248418,20.459827 L 25.253704,20.459827 L 31.19979,11.421773 L 30.248418,20.459827 z "
      id="path16229" /></g><path
    style="color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99999976;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
    d="M 2.8042317,7.4528585 L 43.233985,7.4528585 C 43.384366,7.4528585 43.505431,7.5739234 43.505431,7.7243045 L 43.505431,31.422651 C 43.505431,32.368527 36.401687,38.5 36.251306,38.5 L 2.8042317,38.5 C 2.6538507,38.5 2.5327858,38.378935 2.5327858,38.228554 L 2.5327858,7.7243045 C 2.5327858,7.5739234 2.6538507,7.4528585 2.8042317,7.4528585 z "
    id="rect7675"
    sodipodi:nodetypes="ccccccccc" /><rect
    style="opacity:0.84659095;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#4f4f4f;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
    id="rect8163"
    width="35.0625"
    height="25.0625"
    x="5.5"
    y="10.5" /><path
    style="color:#000000;fill:url(#linearGradient8169);fill-opacity:1.0;fill-rule:evenodd;stroke:url(#linearGradient8177);stroke-width:1.00000024;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
    d="M 35.206652,39.468763 C 37.23707,39.798661 44.795445,34.938834 44.491063,30.970919 C 42.927801,33.394016 39.732541,32.257657 35.623783,32.416667 C 35.623783,32.416667 36.019152,38.968763 35.206652,39.468763 z "
    id="path2210"
    sodipodi:nodetypes="cccc" /><path
    sodipodi:nodetypes="cccc"
    id="path2247"
    d="M 36.657089,37.277261 C 38.026868,36.593432 41.085338,35.130796 42.384719,33.249792 C 40.788625,33.929847 39.436909,33.459288 36.682385,33.440197 C 36.682385,33.440197 36.844707,36.502291 36.657089,37.277261 z "
    style="opacity:0.36931817;color:#000000;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient8166);stroke-width:0.99999982;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path
    style="opacity:0.30113636;color:#000000;fill:url(#radialGradient8161);fill-opacity:1.0;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
    d="M 3.0625,8 L 3.0625,30.0625 C 25.388579,30.950861 27.884634,17 43,17 L 43,8 L 3.0625,8 z "
    id="rect8150"
    sodipodi:nodetypes="ccccc" /></svg>
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h
index abb00fc229..4566f7f45d 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.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 QmitkOpenStdMultiWidgetEditorAction_h
 #define QmitkOpenStdMultiWidgetEditorAction_h
 
 #ifdef __MINGW32__
-// We need to inlclude winbase.h here in order to declare
+// We need to include winbase.h here in order to declare
 // atomic intrinsics like InterlockedIncrement correctly.
-// Otherwhise, they would be declared wrong within qatomic_windows.h .
+// Otherwise, they would be declared wrong within qatomic_windows.h .
 #include <windows.h>
 #endif
 
 #include <QAction>
 #include <QIcon>
 
 #include <org_mitk_gui_qt_ext_Export.h>
 
 #include <berryIWorkbenchWindow.h>
 
 class MITK_QT_COMMON_EXT_EXPORT QmitkOpenStdMultiWidgetEditorAction : public QAction
 {
   Q_OBJECT
 
 public:
 
   QmitkOpenStdMultiWidgetEditorAction(berry::IWorkbenchWindow::Pointer window);
   QmitkOpenStdMultiWidgetEditorAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window);
 
 protected slots:
 
   void Run();
 
 private:
 
   void init(berry::IWorkbenchWindow::Pointer window);
   berry::IWorkbenchWindow::Pointer m_Window;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
index a237a8d02e..c5c190b5fa 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.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 QmitkExtWorkbenchWindowAdvisorHack_h
 #define QmitkExtWorkbenchWindowAdvisorHack_h
 
 #include <QObject>
 
 class ctkPluginContext;
 class QmitkPreferencesDialog;
 
 class QmitkExtWorkbenchWindowAdvisorHack : public QObject
 {
   Q_OBJECT
 
   public slots:
 
     void onUndo();
     void onRedo();
     void onImageNavigator();
     void onViewNavigator();
     void onEditPreferences();
     void onQuit();
 
     void onResetPerspective();
     void onClosePerspective();
     void onNewWindow();
     void onIntro();
 
     /**
-     * @brief This slot is called if the user klicks the menu item "help->context help" or presses F1.
+     * @brief This slot is called if the user clicks the menu item "help->context help" or presses F1.
      * The help page is shown in a workbench editor.
      */
     void onHelp();
 
     void onHelpOpenHelpPerspective();
 
     /**
      * @brief This slot is called if the user clicks in help menu the about button
      */
     void onAbout();
 
   public:
 
     QmitkExtWorkbenchWindowAdvisorHack();
     ~QmitkExtWorkbenchWindowAdvisorHack() override;
 
     static QmitkExtWorkbenchWindowAdvisorHack* undohack;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.fit.genericfitting/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.fit.genericfitting/documentation/UserManual/Manual.dox
index 7ecdc6d7f9..7993e936b0 100644
--- a/Plugins/org.mitk.gui.qt.fit.genericfitting/documentation/UserManual/Manual.dox
+++ b/Plugins/org.mitk.gui.qt.fit.genericfitting/documentation/UserManual/Manual.dox
@@ -1,70 +1,76 @@
 /**
 \page org_mitk_views_fit_genericfitting The Model Fit Generic Fitting View
 
 \imageMacro{fit_generic_doc.svg,"Icon of the  Generic Fitting View",3.0}
 
 \tableofcontents
 
 \section FIT_GENERIC_Introduction Introduction
 This views offers a generic fitting component for time resolved image data.
 
 \section FIT_GENERIC__Contact Contact information
 If you have any questions, need support, find a bug or have a feature request, feel free to contact us at www.mitk.org.
 
 \subsection FIT_GENERIC__Cite Citation information
 If you use the view for your research please cite our work as reference:\n\n
 Debus C and Floca R, Ingrisch M, Kompan I, Maier-Hein K, Abdollahi A, Nolden M, <i>MITK-ModelFit: generic open-source framework for model fits and their exploration in medical imaging – design, implementation and application on the example of DCE-MRI</i>. https://doi.org/10.1186/s12859-018-2588-1 (BMC Bioinformatics 2019 20:31)
 
 
 \section FIT_GENERIC__Data_and_ROI_Selection Time series and mask selection
 \imageMacro{modelfit_generic_maskAndFittingStrategy.png, "Time series and mask selection.", 10}
 In principle, every model can be fitted on the entire image. However, for model configuration reasons and computational time cost, this is often not advisable.
 Therefore, apart from the image to be fitted (<i>Selected Time Series</i>), a ROI segmentation can be defined (<i>Selected Mask</i>), within which model fitting is performed.
 The view currently offers <i>Pixel based</i> and/or <i>ROI based</i> averaged fits of time-varying curves. The <i>ROI based</i> fitting option becomes enabled, if a mask is selected.
 
 \section FIT_GENERIC_General_models Supported models
-Currently the following models are available for fitting:
--	<b> Linear model </b>: y = offset + slope*x
--       <b> Generic parameter model </b>: A simple formula can be manually provided and will be parsed for fitting.
--       <b> T2 decay model </b>: y = A*exp(-t/B)
+The supported models are generic model which can represent any kind of data values y with generic units of y on any kind of data grid x with generic units of x.
+When using these model for fitting to your data, be aware that you have to keep track of the quantities and units.
+Currently the following models are available:
+-	    <b> Linear Model </b>: <br> <i> y(x) = y-intercept + slope*x </i>
+-       <b> Generic parameter Model </b>: <br> A simple formula can be manually provided and will be parsed for fitting.
+-       <b> Exponential Decay Model </b>: <br> <i> y(x) = y-intercept * exp(-x/&lambda;) </i>
+-       <b> Exponential Decay Offset Model</b>: <br> <i> y(x) = y-intercept * exp(-x/&lambda;) + baseline </i>
+-		<b> Exponential Saturation Model </b>: <br> <i> if x<onset: y(x) = baseline, <br> else: y(x) = baseline + (y_final-baseline) * (1 - exp(-rate*(x-onset))) </i>
+-       <b> Two Step Linear Model </b>: <br> <i> if x < x_changepoint: y(x) = y-intercept + slope1*x, <br> else: y(x) = y-intercept1 + slope2*x </i>
+-       <b> Three Step Linear Model </b>: <br> <i> if x < x_changepoint1: y(x) = baseline, <br> else if x_changepoint1 <= x <= x_changepoint2: y(x) = y-intercept1 + slope1*x, <br> else if x>x_changepoint2: y(x) = y-intercept2 + slope2*x </i> <br>,
 
 
 \section FIT_GENERIC_Settings Model settings
 
 \subsection FIT_GENERIC_Settings_model Model specific settings
 Selecting one of the \ref FIT_GENERIC_General_models "supported models" will open below tabs for further configuration of the model.
 - The Generic parameter model required as input a formula to be parsed and the number parameters to fit. In the following image, detailed formula information is given.
 \imageMacro{modelfit_generic_genericParamModelSettings.png, "Formula info for the generic parameter model", 10}
 
 \subsection FIT_GENERIC_Settings_start Start parameter
 In cases of noisy data it can be useful to define the initial starting values of the parameter estimates, at which optimization starts, in order to prevent optimization results in local optima.
 Each model has default scalar values (applied to every voxel) for initial values of each parameter, however these can be adjusted.
 Moreover, initial values can also be defined locally for each individual voxel via starting value images. To load a starting value image, change the <i>Type</i> from <i>scalar</i> to <i>image</i>. This can be done by double-clicking on the type cell.
 In the <i>Value</i> column, selection of a starting value image will be available.
 
 \subsection FIT_GENERIC_Settings_constraint Constraints settings
 To limit the fitting search space and to exclude unphysical/illogical results for model parameter estimates, constraints to individual parameters as well as combinations can be imposed.
 Each model has default constraints, however, new ones can be defined or removed by the + and – buttons in the table.
 The first column specifies the parameter(s) involved in the constraint (if multiple parameters are selected, their sum will be used) by selection in the drop down menu.
 The second column <i>Type</i> defines whether the constraint defines an upper or lower boundary.
 <i>Value</i> defines the actual constraint value, that should not be crossed, and <i>Width</i> allows for a certain tolerance width.
 
 
 \section FIT_GENERIC_Fitting Executing a fit
 
 In order to distinguish results from different model fits to the data, a <i>Fitting name</i> can be defined.
 As default, the name of the model and the fitting strategy (pixel/ROI) are given. This name will then be appended by the respective parameter name.\n\n
 
 For development purposes and evaluation of the fits, the option <i>Generate debug parameter images</i> is available.
 Enabling this option will result in additional parameter maps displaying the status of the optimizer at fit termination.
 In the following definitions, an <i>evaluation</i> describes the process of cost function calculation and evaluation by the optimizer for a given parameter set.
 
 - <i>Stop condition</i>: Reasons for the fit termination, i.e. criterion reached, maximum number of iterations,...
 - <i>Optimization time</i>: The overall time from fitting start to termination.
 - <i>Number of iterations</i>: The number of iterations from fitting start to termination.
 
 After all necessary configurations are set, the button <i>Start Modelling</i> is enabled, which starts the fitting routine.
 Progress can be seen in the message box on the bottom. Resulting parameter maps will afterwards be added to the Data Manager as sub-nodes of the analyzed 4D image.
 
 
 */
diff --git a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.cpp b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.cpp
index b22c7e827b..51f148467d 100644
--- a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.cpp
+++ b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.cpp
@@ -1,680 +1,718 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "GenericDataFittingView.h"
 
 #include "mitkWorkbenchUtil.h"
 
 #include <mitkLinearModelFactory.h>
 #include <mitkLinearModelParameterizer.h>
 #include <mitkGenericParamModelFactory.h>
 #include <mitkGenericParamModelParameterizer.h>
-#include <mitkT2DecayModelFactory.h>
-#include <mitkT2DecayModelParameterizer.h>
+#include <mitkExponentialDecayModelFactory.h>
+#include <mitkExponentialDecayModelParameterizer.h>
 #include <mitkExponentialSaturationModel.h>
 #include <mitkExponentialSaturationModelFactory.h>
 #include <mitkExponentialSaturationModelParameterizer.h>
+#include "mitkTwoStepLinearModelFactory.h"
+#include "mitkTwoStepLinearModelParameterizer.h"
+#include "mitkThreeStepLinearModelFactory.h"
+#include "mitkThreeStepLinearModelParameterizer.h"
 
 #include <mitkValueBasedParameterizationDelegate.h>
 
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkPixelBasedParameterFitImageGenerator.h>
 #include <mitkROIBasedParameterFitImageGenerator.h>
 #include <mitkLevenbergMarquardtModelFitFunctor.h>
 #include <mitkSumOfSquaredDifferencesFitCostFunction.h>
 #include <mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 #include <mitkModelFitResultHelper.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkMaskedDynamicImageStatisticsGenerator.h>
 #include <mitkExtractTimeGrid.h>
 
 #include <QMessageBox>
 #include <QThreadPool>
 #include <QmitkDataStorageComboBox.h>
 
 // Includes for image casting between ITK and MITK
 #include <mitkImage.h>
 #include "mitkImageCast.h"
 #include "mitkITKImageImport.h"
 #include <itkImage.h>
 #include <itkImageRegionIterator.h>
 #include <iostream>
 
 
 const std::string GenericDataFittingView::VIEW_ID = "org.mitk.views.fit.genericfitting";
 
 void GenericDataFittingView::SetFocus()
 {
   m_Controls.btnModelling->setFocus();
 }
 
 void GenericDataFittingView::CreateQtPartControl(QWidget* parent)
 {
   m_Controls.setupUi(parent);
 
   m_Controls.btnModelling->setEnabled(false);
 
   this->InitModelComboBox();
 
   connect(m_Controls.btnModelling, SIGNAL(clicked()), this, SLOT(OnModellingButtonClicked()));
 
   connect(m_Controls.comboModel, SIGNAL(currentIndexChanged(int)), this, SLOT(OnModellSet(int)));
   connect(m_Controls.radioPixelBased, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
 
-  //Gerneric setting
+  //Generic setting
   m_Controls.groupGeneric->hide();
   m_Controls.labelFormulaInfo->hide();
   connect(m_Controls.editFormula, SIGNAL(textChanged(const QString&)), this,
           SLOT(UpdateGUIControls()));
   connect(m_Controls.checkFormulaInfo, SIGNAL(toggled(bool)), m_Controls.labelFormulaInfo,
           SLOT(setVisible(bool)));
   connect(m_Controls.nrOfParams, SIGNAL(valueChanged(int)), this, SLOT(OnNrOfParamsChanged()));
 
 
   //Model fit configuration
   m_Controls.groupBox_FitConfiguration->hide();
 
   m_Controls.checkBox_Constraints->setEnabled(false);
   m_Controls.constraintManager->setEnabled(false);
   m_Controls.initialValuesManager->setEnabled(false);
   m_Controls.initialValuesManager->setDataStorage(this->GetDataStorage());
 
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.initialValuesManager, SIGNAL(initialValuesChanged(void)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), this,
           SLOT(UpdateGUIControls()));
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)),
           m_Controls.initialValuesManager,
           SLOT(setEnabled(bool)));
 
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager,
           SLOT(setEnabled(bool)));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager,
           SLOT(setVisible(bool)));
 
   UpdateGUIControls();
 }
 
 void GenericDataFittingView::UpdateGUIControls()
 {
   m_Controls.lineFitName->setPlaceholderText(QString::fromStdString(this->GetDefaultFitName()));
   m_Controls.lineFitName->setEnabled(!m_FittingInProgress);
 
   m_Controls.checkBox_Constraints->setEnabled(m_modelConstraints.IsNotNull());
 
   bool isGenericFactory = dynamic_cast<mitk::GenericParamModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
 
   m_Controls.groupGeneric->setVisible(isGenericFactory);
 
   m_Controls.groupBox_FitConfiguration->setVisible(m_selectedModelFactory);
 
   m_Controls.groupBox->setEnabled(!m_FittingInProgress);
   m_Controls.comboModel->setEnabled(!m_FittingInProgress);
   m_Controls.groupGeneric->setEnabled(!m_FittingInProgress);
   m_Controls.groupBox_FitConfiguration->setEnabled(!m_FittingInProgress);
 
   m_Controls.radioROIbased->setEnabled(m_selectedMask.IsNotNull());
 
   m_Controls.btnModelling->setEnabled(m_selectedImage.IsNotNull()
                                       && m_selectedModelFactory.IsNotNull() && !m_FittingInProgress && CheckModelSettings());
 }
 
 std::string GenericDataFittingView::GetFitName() const
 {
   std::string fitName = m_Controls.lineFitName->text().toStdString();
   if (fitName.empty())
   {
     fitName = m_Controls.lineFitName->placeholderText().toStdString();
   }
   return fitName;
 }
 
 std::string GenericDataFittingView::GetDefaultFitName() const
 {
     std::string defaultName = "undefined model";
 
     if (this->m_selectedModelFactory.IsNotNull())
     {
         defaultName = this->m_selectedModelFactory->GetClassID();
     }
 
     if (this->m_Controls.radioPixelBased->isChecked())
     {
         defaultName += "_pixel";
     }
     else
     {
         defaultName += "_roi";
     }
 
     return defaultName;
 }
 
 
 void GenericDataFittingView::OnNrOfParamsChanged()
 {
   PrepareFitConfiguration();
   UpdateGUIControls();
 }
 
 
 void GenericDataFittingView::OnModellSet(int index)
 {
   m_selectedModelFactory = nullptr;
 
   if (index > 0)
   {
     if (static_cast<ModelFactoryStackType::size_type>(index) <= m_FactoryStack.size() )
     {
         m_selectedModelFactory = m_FactoryStack[index - 1];
     }
     else
     {
         MITK_WARN << "Invalid model index. Index outside of the factory stack. Factory stack size: "<< m_FactoryStack.size() << "; invalid index: "<< index;
     }
   }
-
   if (m_selectedModelFactory)
   {
     this->m_modelConstraints = dynamic_cast<mitk::SimpleBarrierConstraintChecker*>
       (m_selectedModelFactory->CreateDefaultConstraints().GetPointer());
 
+    if (this->m_modelConstraints.IsNull())
+    {
+      this->m_modelConstraints = mitk::SimpleBarrierConstraintChecker::New();
+    }
+
     m_Controls.initialValuesManager->setInitialValues(m_selectedModelFactory->GetParameterNames(),
       m_selectedModelFactory->GetDefaultInitialParameterization());
 
     m_Controls.constraintManager->setChecker(this->m_modelConstraints,
       this->m_selectedModelFactory->GetParameterNames());
 
   }
 
   UpdateGUIControls();
 }
 
 bool GenericDataFittingView::IsGenericParamFactorySelected() const
 {
   return dynamic_cast<mitk::GenericParamModelFactory*>
     (m_selectedModelFactory.GetPointer()) != nullptr;
 }
 
 void GenericDataFittingView::PrepareFitConfiguration()
 {
   if (m_selectedModelFactory)
   {
     mitk::ModelBase::ParameterNamesType paramNames = m_selectedModelFactory->GetParameterNames();
     unsigned int nrOfPools = this->m_Controls.nrOfParams->value();
 
     //init values
     if (this->IsGenericParamFactorySelected())
     {
       mitk::modelFit::ModelFitInfo::Pointer fitInfo = mitk::modelFit::ModelFitInfo::New();
       fitInfo->staticParamMap.Add(mitk::GenericParamModel::NAME_STATIC_PARAMETER_number, { static_cast<double>(nrOfPools) });
 
       auto parameterizer = m_selectedModelFactory->CreateParameterizer(fitInfo);
       paramNames = parameterizer->GetParameterNames();
 
       m_Controls.initialValuesManager->setInitialValues(paramNames, parameterizer->GetDefaultInitialParameterization());
     }
     else
     {
       m_Controls.initialValuesManager->setInitialValues(paramNames, this->m_selectedModelFactory->GetDefaultInitialParameterization());
     }
 
     //constraints
     this->m_modelConstraints = dynamic_cast<mitk::SimpleBarrierConstraintChecker*>
       (m_selectedModelFactory->CreateDefaultConstraints().GetPointer());
 
     if (this->m_modelConstraints.IsNull())
     {
       this->m_modelConstraints = mitk::SimpleBarrierConstraintChecker::New();
     }
 
     m_Controls.constraintManager->setChecker(this->m_modelConstraints, paramNames);
   }
 };
 
 void GenericDataFittingView::OnModellingButtonClicked()
 {
   //check if all static parameters set
   if (m_selectedModelFactory.IsNotNull() && CheckModelSettings())
   {
     mitk::ParameterFitImageGeneratorBase::Pointer generator = nullptr;
     mitk::modelFit::ModelFitInfo::Pointer fitSession = nullptr;
 
     bool isLinearFactory = dynamic_cast<mitk::LinearModelFactory*>
                            (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isGenericFactory = dynamic_cast<mitk::GenericParamModelFactory*>
                             (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isT2DecayFactory = dynamic_cast<mitk::T2DecayModelFactory*>
+    bool isExponentialDecayFactory = dynamic_cast<mitk::ExponentialDecayModelFactory*>
+      (m_selectedModelFactory.GetPointer()) != nullptr;
+    bool isTwoStepLinearFactory = dynamic_cast<mitk::TwoStepLinearModelFactory*>
+      (m_selectedModelFactory.GetPointer()) != nullptr;
+    bool isThreeStepLinearFactory = dynamic_cast<mitk::ThreeStepLinearModelFactory*>
       (m_selectedModelFactory.GetPointer()) != nullptr;
 
     bool isExponentialSaturationFactory = dynamic_cast<mitk::ExponentialSaturationModelFactory*>
       (m_selectedModelFactory.GetPointer()) != nullptr;
 
     if (isLinearFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::LinearModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::LinearModelParameterizer>(fitSession, generator);
       }
     }
     else if (isGenericFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::GenericParamModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::GenericParamModelParameterizer>(fitSession, generator);
       }
     }
-    else if (isT2DecayFactory)
+    else if (isExponentialDecayFactory)
+    {
+      if (this->m_Controls.radioPixelBased->isChecked())
+      {
+        GenerateModelFit_PixelBased<mitk::ExponentialDecayModelParameterizer>(fitSession, generator);
+      }
+      else
+      {
+        GenerateModelFit_ROIBased<mitk::ExponentialDecayModelParameterizer>(fitSession, generator);
+      }
+    }
+    else if (isTwoStepLinearFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
-        GenerateModelFit_PixelBased<mitk::T2DecayModelParameterizer>(fitSession, generator);
+        GenerateModelFit_PixelBased<mitk::TwoStepLinearModelParameterizer>(fitSession, generator);
       }
       else
       {
-        GenerateModelFit_ROIBased<mitk::T2DecayModelParameterizer>(fitSession, generator);
+        GenerateModelFit_ROIBased<mitk::TwoStepLinearModelParameterizer>(fitSession, generator);
+      }
+    }
+    else if (isThreeStepLinearFactory)
+    {
+      if (this->m_Controls.radioPixelBased->isChecked())
+      {
+        GenerateModelFit_PixelBased<mitk::ThreeStepLinearModelParameterizer>(fitSession, generator);
+      }
+      else
+      {
+        GenerateModelFit_ROIBased<mitk::ThreeStepLinearModelParameterizer>(fitSession, generator);
       }
     }
     else if (isExponentialSaturationFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::ExponentialSaturationModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::ExponentialSaturationModelParameterizer>(fitSession, generator);
       }
     }
     //add other models with else if
 
     if (generator.IsNotNull() && fitSession.IsNotNull())
     {
       m_FittingInProgress = true;
       UpdateGUIControls();
       DoFit(fitSession, generator);
     }
     else
     {
       QMessageBox box;
       box.setText("Fitting error!");
       box.setInformativeText("Could not establish fitting job. Error when setting ab generator, model parameterizer or session info.");
       box.setStandardButtons(QMessageBox::Ok);
       box.setDefaultButton(QMessageBox::Ok);
       box.setIcon(QMessageBox::Warning);
       box.exec();
     }
 
   }
   else
   {
     QMessageBox box;
     box.setText("Static parameters for model are not set!");
     box.setInformativeText("Some static parameters, that are needed for calculation are not set and equal to zero. Modeling not possible");
     box.setStandardButtons(QMessageBox::Ok);
     box.setDefaultButton(QMessageBox::Ok);
     box.setIcon(QMessageBox::Warning);
     box.exec();
   }
 }
 
 
 void GenericDataFittingView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/,
     const QList<mitk::DataNode::Pointer>& selectedNodes)
 {
   m_selectedNode = nullptr;
   m_selectedImage = nullptr;
   m_selectedMaskNode = nullptr;
   m_selectedMask = nullptr;
 
   m_Controls.masklabel->setText("No (valid) mask selected.");
   m_Controls.timeserieslabel->setText("No (valid) series selected.");
 
   QList<mitk::DataNode::Pointer> nodes = selectedNodes;
 
   mitk::NodePredicateDataType::Pointer isLabelSet = mitk::NodePredicateDataType::New("LabelSetImage");
   mitk::NodePredicateDataType::Pointer isImage = mitk::NodePredicateDataType::New("Image");
   mitk::NodePredicateProperty::Pointer isBinary = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
   mitk::NodePredicateAnd::Pointer isLegacyMask = mitk::NodePredicateAnd::New(isImage, isBinary);
 
   mitk::NodePredicateOr::Pointer maskPredicate = mitk::NodePredicateOr::New(isLegacyMask, isLabelSet);
 
   if (nodes.size() > 0 && isImage->CheckNode(nodes.front()))
   {
     this->m_selectedNode = nodes.front();
     this->m_selectedImage = dynamic_cast<mitk::Image*>(this->m_selectedNode->GetData());
     m_Controls.timeserieslabel->setText((this->m_selectedNode->GetName()).c_str());
     nodes.pop_front();
   }
 
   if (nodes.size() > 0 && maskPredicate->CheckNode(nodes.front()))
   {
       this->m_selectedMaskNode = nodes.front();
       this->m_selectedMask = dynamic_cast<mitk::Image*>(this->m_selectedMaskNode->GetData());
 
       if (this->m_selectedMask->GetTimeSteps() > 1)
       {
         MITK_INFO <<
                   "Selected mask has multiple timesteps. Only use first timestep to mask model fit. Mask name: " <<
                   m_selectedMaskNode->GetName();
         mitk::ImageTimeSelector::Pointer maskedImageTimeSelector = mitk::ImageTimeSelector::New();
         maskedImageTimeSelector->SetInput(this->m_selectedMask);
         maskedImageTimeSelector->SetTimeNr(0);
         maskedImageTimeSelector->UpdateLargestPossibleRegion();
         this->m_selectedMask = maskedImageTimeSelector->GetOutput();
       }
 
       m_Controls.masklabel->setText((this->m_selectedMaskNode->GetName()).c_str());
   }
 
   if (m_selectedMask.IsNull())
   {
     this->m_Controls.radioPixelBased->setChecked(true);
   }
 
   UpdateGUIControls();
 }
 
 bool GenericDataFittingView::CheckModelSettings() const
 {
   bool ok = true;
 
-  //check wether any model is set at all. Otherwise exit with false
+  //check whether any model is set at all. Otherwise exit with false
   if (m_selectedModelFactory.IsNotNull())
   {
     bool isGenericFactory = dynamic_cast<mitk::GenericParamModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
 
     if (isGenericFactory)
     {
       ok = !m_Controls.editFormula->text().isEmpty();
     }
   }
   else
   {
     ok = false;
   }
   if (this->m_Controls.radioButton_StartParameters->isChecked() && !this->m_Controls.initialValuesManager->hasValidInitialValues())
   {
     std::string warning = "Warning. Invalid start parameters. At least one parameter has an invalid image setting as source.";
     MITK_ERROR << warning;
     m_Controls.infoBox->append(QString("<font color='red'><b>") + QString::fromStdString(warning) + QString("</b></font>"));
 
     ok = false;
   };
 
   return ok;
 }
 
 void GenericDataFittingView::ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase*
     parameterizer) const
 {
   if (m_Controls.radioButton_StartParameters->isChecked())
   {
     //use user defined initial parameters
     mitk::ValueBasedParameterizationDelegate::Pointer paramDelegate =
       mitk::ValueBasedParameterizationDelegate::New();
     paramDelegate->SetInitialParameterization(m_Controls.initialValuesManager->getInitialValues());
 
     parameterizer->SetInitialParameterizationDelegate(paramDelegate);
   }
 
   mitk::GenericParamModelParameterizer* genericParameterizer =
     dynamic_cast<mitk::GenericParamModelParameterizer*>(parameterizer);
 
   if (genericParameterizer)
   {
     genericParameterizer->SetFunctionString(m_Controls.editFormula->text().toStdString());
   }
 }
 
 template <typename TParameterizer>
 void GenericDataFittingView::GenerateModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::PixelBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::PixelBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
   auto genericParameterizer = dynamic_cast<mitk::GenericParamModelParameterizer*>(modelParameterizer.GetPointer());
   if (genericParameterizer)
   {
     genericParameterizer->SetNumberOfParameters(this->m_Controls.nrOfParams->value());
   }
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   std::string roiUID = "";
 
   if (m_selectedMask.IsNotNull())
   {
     fitGenerator->SetMask(m_selectedMask);
     roiUID = m_selectedMask->GetUID();
   }
 
   fitGenerator->SetDynamicImage(this->m_selectedImage);
   fitGenerator->SetFitFunctor(fitFunctor);
 
   generator = fitGenerator.GetPointer();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED(), this->GetFitName(),
                  roiUID);
 }
 
 template <typename TParameterizer>
 void GenericDataFittingView::GenerateModelFit_ROIBased(
   mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo,
   mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::ROIBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::ROIBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
   auto genericParameterizer = dynamic_cast<mitk::GenericParamModelParameterizer*>(modelParameterizer.GetPointer());
   if (genericParameterizer)
   {
     genericParameterizer->SetNumberOfParameters(this->m_Controls.nrOfParams->value());
   }
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Compute ROI signal
   mitk::MaskedDynamicImageStatisticsGenerator::Pointer signalGenerator =
     mitk::MaskedDynamicImageStatisticsGenerator::New();
   signalGenerator->SetMask(m_selectedMask);
   signalGenerator->SetDynamicImage(m_selectedImage);
   signalGenerator->Generate();
 
   mitk::MaskedDynamicImageStatisticsGenerator::ResultType roiSignal = signalGenerator->GetMean();
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   fitGenerator->SetMask(m_selectedMask);
   fitGenerator->SetFitFunctor(fitFunctor);
   fitGenerator->SetSignal(roiSignal);
   fitGenerator->SetTimeGrid(mitk::ExtractTimeGrid(m_selectedImage));
 
   generator = fitGenerator.GetPointer();
 
   std::string roiUID = this->m_selectedMask->GetUID();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_ROIBASED(), this->GetFitName(),
                  roiUID);
 
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::MaskedDynamicImageStatisticsGenerator::ResultType::const_iterator pos =
          roiSignal.begin(); pos != roiSignal.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("ROI", infoSignal);
 }
 
 void GenericDataFittingView::DoFit(const mitk::modelFit::ModelFitInfo* fitSession,
                                    mitk::ParameterFitImageGeneratorBase* generator)
 {
   QString message = "<font color='green'>Fitting Data Set . . .</font>";
   m_Controls.infoBox->append(message);
 
   /////////////////////////
   //create job and put it into the thread pool
   ParameterFitBackgroundJob* pJob = new ParameterFitBackgroundJob(generator, fitSession, this->m_selectedNode);
   pJob->setAutoDelete(true);
 
   connect(pJob, SIGNAL(Error(QString)), this, SLOT(OnJobError(QString)));
   connect(pJob, SIGNAL(Finished()), this, SLOT(OnJobFinished()));
   connect(pJob, SIGNAL(ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                        const ParameterFitBackgroundJob*)), this,
           SLOT(OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                                         const ParameterFitBackgroundJob*)), Qt::BlockingQueuedConnection);
 
   connect(pJob, SIGNAL(JobProgress(double)), this, SLOT(OnJobProgress(double)));
   connect(pJob, SIGNAL(JobStatusChanged(QString)), this, SLOT(OnJobStatusChanged(QString)));
 
   QThreadPool* threadPool = QThreadPool::globalInstance();
   threadPool->start(pJob);
 }
 
 GenericDataFittingView::GenericDataFittingView() : m_FittingInProgress(false)
 {
   m_selectedImage = nullptr;
   m_selectedMask = nullptr;
 
   mitk::ModelFactoryBase::Pointer factory =
     mitk::LinearModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
   factory = mitk::GenericParamModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
-  factory = mitk::T2DecayModelFactory::New().GetPointer();
+  factory = mitk::ExponentialDecayModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
   factory = mitk::ExponentialSaturationModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
+  factory = mitk::TwoStepLinearModelFactory::New().GetPointer();
+  m_FactoryStack.push_back(factory);
+  factory = mitk::ThreeStepLinearModelFactory::New().GetPointer();
+  m_FactoryStack.push_back(factory);
 
   this->m_IsNotABinaryImagePredicate = mitk::NodePredicateAnd::New(
                                          mitk::TNodePredicateDataType<mitk::Image>::New(),
                                          mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("binary",
                                              mitk::BoolProperty::New(true))),
                                          mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
   this->m_IsBinaryImagePredicate = mitk::NodePredicateAnd::New(
                                      mitk::TNodePredicateDataType<mitk::Image>::New(),
                                      mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true)),
                                      mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 }
 
 void GenericDataFittingView::OnJobFinished()
 {
   this->m_Controls.infoBox->append(QString("<font color='green'>Fitting finished</font>"));
   this->m_FittingInProgress = false;
   this->UpdateGUIControls();
 };
 
 void GenericDataFittingView::OnJobError(QString err)
 {
   MITK_ERROR << err.toStdString().c_str();
 
   m_Controls.infoBox->append(QString("<font color='red'><b>") + err + QString("</b></font>"));
 
 };
 
 void GenericDataFittingView::OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType
     results,
     const ParameterFitBackgroundJob* pJob)
 {
   //Store the resulting parameter fit image via convenience helper function in data storage
   //(handles the correct generation of the nodes and their properties)
   mitk::modelFit::StoreResultsInDataStorage(this->GetDataStorage(), results, pJob->GetParentNode());
 };
 
 void GenericDataFittingView::OnJobProgress(double progress)
 {
   QString report = QString("Progress. ") + QString::number(progress);
   this->m_Controls.infoBox->append(report);
 };
 
 void GenericDataFittingView::OnJobStatusChanged(QString info)
 {
   this->m_Controls.infoBox->append(info);
 }
 
 
 void GenericDataFittingView::InitModelComboBox() const
 {
   this->m_Controls.comboModel->clear();
   this->m_Controls.comboModel->addItem(tr("No model selected"));
 
   for (ModelFactoryStackType::const_iterator pos = m_FactoryStack.begin();
        pos != m_FactoryStack.end(); ++pos)
   {
     this->m_Controls.comboModel->addItem(QString::fromStdString((*pos)->GetClassID()));
   }
 
   this->m_Controls.comboModel->setCurrentIndex(0);
 };
 
 mitk::ModelFitFunctorBase::Pointer GenericDataFittingView::CreateDefaultFitFunctor(
   const mitk::ModelParameterizerBase* parameterizer) const
 {
   mitk::LevenbergMarquardtModelFitFunctor::Pointer fitFunctor =
     mitk::LevenbergMarquardtModelFitFunctor::New();
 
   mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::Pointer chi2 =
     mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::New();
   fitFunctor->RegisterEvaluationParameter("Chi^2", chi2);
 
   if (m_Controls.checkBox_Constraints->isChecked())
   {
     fitFunctor->SetConstraintChecker(m_modelConstraints);
   }
 
   mitk::ModelBase::Pointer refModel = parameterizer->GenerateParameterizedModel();
 
   ::itk::LevenbergMarquardtOptimizer::ScalesType scales;
   scales.SetSize(refModel->GetNumberOfParameters());
   scales.Fill(1.0);
   fitFunctor->SetScales(scales);
 
   fitFunctor->SetDebugParameterMaps(m_Controls.checkDebug->isChecked());
 
   return fitFunctor.GetPointer();
 }
diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp
index 50ae633df5..bb5465eb1b 100644
--- a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp
+++ b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp
@@ -1,918 +1,918 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "ModelFitInspectorView.h"
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 #include <berryIWorkbenchPage.h>
 
 // mitk
 #include <QmitkRenderWindow.h>
 
 // Qt
 #include <QMessageBox>
 #include <QFileDialog>
 #include <QTableWidget>
 #include <qwt_plot_marker.h>
 #include <QmitkPlotWidget.h>
 
 #include <mitkNodePredicateFunction.h>
 #include <mitkScalarListLookupTableProperty.h>
 #include <mitkModelFitConstants.h>
 #include <mitkExtractTimeGrid.h>
 #include <mitkModelGenerator.h>
 #include <mitkModelFitException.h>
 #include <mitkModelFitParameterValueExtraction.h>
 #include <mitkModelFitResultRelationRule.h>
 #include <mitkModelFitPlotDataHelper.h>
 #include <mitkTimeGridHelper.h>
 #include <mitkTimeNavigationController.h>
 
 const std::string ModelFitInspectorView::VIEW_ID = "org.mitk.views.fit.inspector";
 const unsigned int ModelFitInspectorView::INTERPOLATION_STEPS = 10;
 const std::string DEFAULT_X_AXIS = "Time [s]";
 
 ModelFitInspectorView::ModelFitInspectorView() :
   m_renderWindowPart(nullptr),
   m_internalUpdateFlag(false),
   m_currentFit(nullptr),
   m_currentModelParameterizer(nullptr),
   m_currentModelProviderService(nullptr),
   m_currentSelectedTimeStep(0),
   m_currentSelectedNode(nullptr)
 
 {
   m_currentSelectedPosition.Fill(0.0);
   m_modelfitList.clear();
 }
 
 ModelFitInspectorView::~ModelFitInspectorView()
 {
 }
 
 void ModelFitInspectorView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   if (m_renderWindowPart != renderWindowPart)
   {
     m_renderWindowPart = renderWindowPart;
   }
 
   this->m_SliceChangeListener.RenderWindowPartActivated(renderWindowPart);
 }
 
 void ModelFitInspectorView::RenderWindowPartDeactivated(
   mitk::IRenderWindowPart* renderWindowPart)
 {
   m_renderWindowPart = nullptr;
   this->m_SliceChangeListener.RenderWindowPartDeactivated(renderWindowPart);
 }
 
 void ModelFitInspectorView::CreateQtPartControl(QWidget* parent)
 {
   m_Controls.setupUi(parent);
 
   m_SelectionServiceConnector = std::make_unique<QmitkSelectionServiceConnector>();
   m_SelectionServiceConnector->AddPostSelectionListener(this->GetSite()->GetWorkbenchWindow()->GetSelectionService());
 
   m_Controls.inputNodeSelector->SetDataStorage(GetDataStorage());
   m_Controls.inputNodeSelector->SetEmptyInfo(QString("Please select input data to be viewed."));
   m_Controls.inputNodeSelector->SetInvalidInfo(QString("<b><font color=\"red\">No input data is selected</font></b>"));
   m_Controls.inputNodeSelector->SetPopUpTitel(QString("Choose 3D+t input data that should be viewed!"));
   m_Controls.inputNodeSelector->SetSelectionIsOptional(false);
   m_Controls.inputNodeSelector->SetSelectOnlyVisibleNodes(true);
 
   auto predicate = mitk::NodePredicateFunction::New([](const mitk::DataNode *node) {
     bool isModelFitNode = node->GetData() && node->GetData()->GetProperty(mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str()).IsNotNull();
     return isModelFitNode || (node && node->GetData() && node->GetData()->GetTimeSteps() > 1);
   });
 
   m_Controls.inputNodeSelector->SetNodePredicate(predicate);
 
   connect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged, m_Controls.inputNodeSelector, &QmitkSingleNodeSelectionWidget::SetCurrentSelection);
   connect(m_Controls.inputNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &ModelFitInspectorView::OnInputChanged);
 
   this->m_SliceChangeListener.RenderWindowPartActivated(this->GetRenderWindowPart());
   connect(&m_SliceChangeListener, SIGNAL(SliceChanged()), this, SLOT(OnSliceChanged()));
 
   connect(m_Controls.cmbFit, SIGNAL(currentIndexChanged(int)), this,
           SLOT(OnFitSelectionChanged(int)));
 
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.sbFixMin,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.sbFixMax,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.labelFixMin,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.labelFixMax,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.btnScaleToData,
           SLOT(setEnabled(bool)));
 
   connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), this, SLOT(OnScaleFixedYChecked(bool)));
 
   connect(m_Controls.btnScaleToData, SIGNAL(clicked()), this, SLOT(OnScaleToDataYClicked()));
   connect(m_Controls.sbFixMax, SIGNAL(valueChanged(double)), this,
           SLOT(OnFixedScalingYChanged(double)));
   connect(m_Controls.sbFixMin, SIGNAL(valueChanged(double)), this,
           SLOT(OnFixedScalingYChanged(double)));
 
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.sbFixMin_x,
     SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.sbFixMax_x,
     SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.labelFixMin_x,
     SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.labelFixMax_x,
     SLOT(setEnabled(bool)));
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.btnScaleToData_x,
     SLOT(setEnabled(bool)));
 
   connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), this, SLOT(OnScaleFixedXChecked(bool)));
 
   connect(m_Controls.btnScaleToData_x, SIGNAL(clicked()), this, SLOT(OnScaleToDataXClicked()));
   connect(m_Controls.sbFixMax_x, SIGNAL(valueChanged(double)), this,
     SLOT(OnFixedScalingXChanged(double)));
   connect(m_Controls.sbFixMin_x, SIGNAL(valueChanged(double)), this,
     SLOT(OnFixedScalingXChanged(double)));
 
   connect(m_Controls.btnFullPlot, SIGNAL(clicked(bool)), this, SLOT(OnFullPlotClicked(bool)));
 
   this->EnsureBookmarkPointSet();
   m_Controls.inspectionPositionWidget->SetPositionBookmarkNode(m_PositionBookmarksNode.Lock());
 
   connect(m_Controls.inspectionPositionWidget, SIGNAL(PositionBookmarksChanged()), this, SLOT(OnPositionBookmarksChanged()));
 
   // For some reason this needs to be called to set the plot widget's minimum width to an
   // acceptable level (since Qwt 6).
   // Otherwise it tries to keep both axes equal in length, resulting in a minimum width of
   // 400-500px which is way too much.
   m_Controls.widgetPlot->GetPlot()->updateAxes();
 
   m_Controls.cmbFit->clear();
 
   mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart();
   RenderWindowPartActivated(renderWindowPart);
 }
 
 void ModelFitInspectorView::SetFocus()
 {
 }
 
 void ModelFitInspectorView::NodeRemoved(const mitk::DataNode* node)
 {
   if (node == this->m_currentSelectedNode)
   {
     QmitkSingleNodeSelectionWidget::NodeList emptylist;
     this->m_Controls.inputNodeSelector->SetCurrentSelection(emptylist);
   }
 }
 
 void ModelFitInspectorView::OnScaleFixedYChecked(bool checked)
 {
   m_Controls.widgetPlot->GetPlot()->setAxisAutoScale(QwtPlot::yLeft, !checked);
 
   if (checked)
   {
     OnScaleToDataYClicked();
   }
 
   m_Controls.widgetPlot->GetPlot()->replot();
 };
 
 void ModelFitInspectorView::OnScaleFixedXChecked(bool checked)
 {
   m_Controls.widgetPlot->GetPlot()->setAxisAutoScale(QwtPlot::xBottom, !checked);
 
   if (checked)
   {
     OnScaleToDataXClicked();
   }
 
   m_Controls.widgetPlot->GetPlot()->replot();
 };
 
 void ModelFitInspectorView::OnScaleToDataYClicked()
 {
   auto minmax = this->m_PlotCurves.GetYMinMax();
 
   auto min = minmax.first - std::abs(minmax.first) * 0.01;
   auto max = minmax.second + std::abs(minmax.second) * 0.01;
 
   m_Controls.sbFixMin->setValue(min);
   m_Controls.sbFixMax->setValue(max);
 };
 
 void ModelFitInspectorView::OnScaleToDataXClicked()
 {
   auto minmax = this->m_PlotCurves.GetXMinMax();
 
   auto min = minmax.first - std::abs(minmax.first) * 0.01;
   auto max = minmax.second + std::abs(minmax.second) * 0.01;
 
   m_Controls.sbFixMin_x->setValue(min);
   m_Controls.sbFixMax_x->setValue(max);
 };
 
 void ModelFitInspectorView::OnFixedScalingYChanged(double /*value*/)
 {
   m_Controls.widgetPlot->GetPlot()->setAxisScale(QwtPlot::yLeft, m_Controls.sbFixMin->value(),
       m_Controls.sbFixMax->value());
   m_Controls.widgetPlot->GetPlot()->replot();
 };
 
 void ModelFitInspectorView::OnFixedScalingXChanged(double /*value*/)
 {
   m_Controls.widgetPlot->GetPlot()->setAxisScale(QwtPlot::xBottom, m_Controls.sbFixMin_x->value(),
     m_Controls.sbFixMax_x->value());
   m_Controls.widgetPlot->GetPlot()->replot();
 };
 
 void ModelFitInspectorView::OnFullPlotClicked(bool checked)
 {
   m_Controls.tabWidget->setVisible(!checked);
 };
 
 int ModelFitInspectorView::ActualizeFitSelectionWidget()
 {
   mitk::modelFit::ModelFitInfo::UIDType selectedFitUD = "";
   bool isModelFitNode = false;
   if (this->m_Controls.inputNodeSelector->GetSelectedNode().IsNotNull())
   {
     isModelFitNode = this->m_Controls.inputNodeSelector->GetSelectedNode()->GetData()->GetPropertyList()->GetStringProperty(
       mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str(), selectedFitUD);
   }
 
   mitk::DataStorage::Pointer storage = this->GetDataStorage();
 
   mitk::modelFit::NodeUIDSetType fitUIDs = mitk::modelFit::GetFitUIDsOfNode(
     this->m_currentSelectedNode, storage);
 
   this->m_modelfitList.clear();
   this->m_Controls.cmbFit->clear();
 
   for (const auto & fitUID : fitUIDs)
   {
     mitk::modelFit::ModelFitInfo::ConstPointer info = mitk::modelFit::CreateFitInfoFromNode(fitUID,
       storage).GetPointer();
 
     if (info.IsNotNull())
     {
       this->m_modelfitList.insert(std::make_pair(info->uid, info));
       std::ostringstream nameStrm;
       if (info->fitName.empty())
       {
         nameStrm << info->uid;
       }
       else
       {
         nameStrm << info->fitName;
       }
       nameStrm << " (" << info->modelName << ")";
       QVariant data(info->uid.c_str());
       m_Controls.cmbFit->addItem(QString::fromStdString(nameStrm.str()), data);
     }
     else
     {
       MITK_ERROR <<
         "Was not able to extract model fit information from storage. Node properties in storage may be invalid. Failed fit UID:"
         << fitUID;
     }
   }
 
   int cmbIndex = 0;
 
   if (m_modelfitList.empty())
   {
     cmbIndex = -1;
   };
 
   if (isModelFitNode)
   {
     //model was selected, thus select this one in combobox
     QVariant data(selectedFitUD.c_str());
     cmbIndex = m_Controls.cmbFit->findData(data);
 
     if (cmbIndex == -1)
     {
       MITK_WARN <<
-        "Model fit Inspector in invalid state. Selected fit seems to be not avaible in plugin selection. Failed fit UID:"
+        "Model fit Inspector in invalid state. Selected fit seems to be not available in plugin selection. Failed fit UID:"
         << selectedFitUD;
     }
   };
 
   m_Controls.cmbFit->setCurrentIndex(cmbIndex);
 
   return cmbIndex;
 }
 
 void ModelFitInspectorView::OnInputChanged(const QList<mitk::DataNode::Pointer>& nodes)
 {
   if (nodes.size() > 0)
   {
     if (nodes.front() != this->m_currentSelectedNode)
     {
 
       m_internalUpdateFlag = true;
 
       this->m_currentSelectedNode = nodes.front();
 
       mitk::modelFit::ModelFitInfo::UIDType selectedFitUD = "";
       bool isModelFitNode = this->m_currentSelectedNode->GetData()->GetPropertyList()->GetStringProperty(
                               mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str(), selectedFitUD);
 
       if (isModelFitNode)
       {
         this->m_currentSelectedNode = this->GetInputNode(this->m_currentSelectedNode);
         if (this->m_currentSelectedNode.IsNull())
         {
           MITK_WARN <<
             "Model fit Inspector in invalid state. Input image for selected fit cannot be found in data storage. Failed fit UID:"
             << selectedFitUD;
         }
       }
 
       auto cmbIndex = ActualizeFitSelectionWidget();
 
       m_internalUpdateFlag = false;
 
       m_selectedNodeTime.Modified();
 
       if (cmbIndex == -1)
       {
         //only raw 4D data selected. Just update plots for current position
         m_currentFit = nullptr;
         m_currentFitTime.Modified();
         OnSliceChanged();
         m_Controls.plotDataWidget->SetXName(DEFAULT_X_AXIS);
       }
       else
       {
         //refresh fit selection (and implicitly update plots)
         OnFitSelectionChanged(cmbIndex);
       }
     }
   }
   else
   {
     if (this->m_currentSelectedNode.IsNotNull())
     {
       m_internalUpdateFlag = true;
       this->m_currentSelectedNode = nullptr;
       this->m_currentFit = nullptr;
       this->m_modelfitList.clear();
       this->m_Controls.cmbFit->clear();
       m_internalUpdateFlag = false;
 
       m_selectedNodeTime.Modified();
       OnFitSelectionChanged(0);
       RefreshPlotData();
       m_Controls.plotDataWidget->SetPlotData(&(this->m_PlotCurves));
       m_Controls.fitParametersWidget->setFits(QmitkFitParameterModel::FitVectorType());
       RenderPlot();
     }
   }
 
 }
 
 mitk::DataNode::ConstPointer
 ModelFitInspectorView::GetInputNode(mitk::DataNode::ConstPointer node)
 {
   if (node.IsNotNull())
   {
     std::string selectedFitUD = "";
 
     auto rule = mitk::ModelFitResultRelationRule::New();
     auto predicate = rule->GetDestinationsDetector(node);
     mitk::DataStorage::SetOfObjects::ConstPointer parentNodeList =
       GetDataStorage()->GetSubset(predicate);
 
     if (parentNodeList->size() > 0)
     {
       return parentNodeList->front().GetPointer();
     }
   }
 
   return mitk::DataNode::ConstPointer();
 }
 
 
 void ModelFitInspectorView::ValidateAndSetCurrentPosition()
 {
   const mitk::Point3D currentSelectedPosition = GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetSelectedPosition(nullptr);
   const unsigned int currentSelectedTimestep = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimeStep();
 
   if (m_currentSelectedPosition != currentSelectedPosition
       || m_currentSelectedTimeStep != 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;
 
     auto inputImage = this->GetCurrentInputImage();
 
     if (inputImage.IsNull())
     {
       return;
     }
 
     mitk::BaseGeometry::ConstPointer geometry = inputImage->GetTimeGeometry()->GetGeometryForTimeStep(
       m_currentSelectedTimeStep).GetPointer();
 
     // check for invalid time step
     if (geometry.IsNull())
     {
       geometry = inputImage->GetTimeGeometry()->GetGeometryForTimeStep(0);
     }
 
     if (geometry.IsNull())
     {
       return;
     }
 
     m_validSelectedPosition = geometry->IsInside(m_currentSelectedPosition);
 
   }
 }
 
 mitk::Image::ConstPointer  ModelFitInspectorView::GetCurrentInputImage() const
 {
   mitk::Image::ConstPointer result = nullptr;
 
   if (this->m_currentFit.IsNotNull())
   {
     result = m_currentFit->inputImage;
   }
   else if (this->m_currentSelectedNode.IsNotNull())
   {
     result = dynamic_cast<mitk::Image*>(this->m_currentSelectedNode->GetData());
 
     if (result.IsNotNull() && result->GetTimeSteps() <= 1)
     {
       //if the image is not dynamic, we can't use it.
       result = nullptr;
     }
   }
 
   return result;
 };
 
 const mitk::ModelBase::TimeGridType ModelFitInspectorView::GetCurrentTimeGrid() const
 {
   if (m_currentModelProviderService && m_currentFit.IsNotNull())
   {
     return m_currentModelProviderService->GetVariableGrid(m_currentFit);
   }
   else
   { //fall back if there is no model provider we assume to use the normal time grid.
     return ExtractTimeGrid(GetCurrentInputImage());
   }
 };
 
 void ModelFitInspectorView::OnSliceChanged()
 {
   ValidateAndSetCurrentPosition();
 
   m_Controls.widgetPlot->setEnabled(m_validSelectedPosition);
 
   if (m_currentSelectedNode.IsNotNull())
   {
     m_Controls.inspectionPositionWidget->SetCurrentPosition(m_currentSelectedPosition);
 
     if (RefreshPlotData())
     {
       RenderPlot();
       m_Controls.plotDataWidget->SetPlotData(&m_PlotCurves);
       RenderFitInfo();
     }
   }
 }
 
 void ModelFitInspectorView::OnPositionBookmarksChanged()
 {
     if (RefreshPlotData())
     {
       RenderPlot();
       m_Controls.plotDataWidget->SetPlotData(&m_PlotCurves);
       RenderFitInfo();
     }
 }
 
 void ModelFitInspectorView::OnFitSelectionChanged(int index)
 {
   if (!m_internalUpdateFlag)
   {
     MITK_DEBUG << "selected fit index: " << index;
 
     std::string uid = "";
 
 
     if (m_Controls.cmbFit->count() > index)
     {
       uid = m_Controls.cmbFit->itemData(index).toString().toStdString();
     }
 
     mitk::modelFit::ModelFitInfo::ConstPointer newFit = nullptr;
 
     ModelFitInfoListType::iterator finding = m_modelfitList.find(uid);
 
     if (finding != m_modelfitList.end())
     {
       newFit = finding->second;
     }
 
     if (m_currentFit != newFit)
     {
       m_currentModelParameterizer = nullptr;
       m_currentModelProviderService = nullptr;
 
       if (newFit.IsNotNull())
       {
         m_currentModelParameterizer = mitk::ModelGenerator::GenerateModelParameterizer(*newFit);
         m_currentModelProviderService = mitk::ModelGenerator::GetProviderService(newFit->functionClassID);
       }
 
       m_currentFit = newFit;
 
       m_currentFitTime.Modified();
 
       auto name = m_currentFit->xAxisName;
       if (!m_currentFit->xAxisUnit.empty())
       {
         name += " [" + m_currentFit->xAxisUnit + "]";
       }
       m_Controls.plotDataWidget->SetXName(name);
 
       OnSliceChanged();
     }
   }
 }
 
 mitk::PlotDataCurveCollection::Pointer ModelFitInspectorView::RefreshPlotDataCurveCollection(const mitk::Point3D& position,
   const mitk::Image* input, const mitk::modelFit::ModelFitInfo* fitInfo,
   const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer)
 {
   mitk::PlotDataCurveCollection::Pointer result = mitk::PlotDataCurveCollection::New();
 
   //sample curve
   if (input)
   {
     result->InsertElement(mitk::MODEL_FIT_PLOT_SAMPLE_NAME(), GenerateImageSamplePlotData(position, input, timeGrid));
   }
 
   //model signal curve
   if (fitInfo)
   {
     // Interpolate time grid (x values) so the curve looks smooth
     const mitk::ModelBase::TimeGridType interpolatedTimeGrid = mitk::GenerateSupersampledTimeGrid(timeGrid, INTERPOLATION_STEPS);
     auto hires_curve = mitk::GenerateModelSignalPlotData(position, fitInfo, interpolatedTimeGrid, parameterizer);
     result->InsertElement(mitk::MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME(), hires_curve);
     auto curve = mitk::GenerateModelSignalPlotData(position, fitInfo, timeGrid, parameterizer);
     result->InsertElement(mitk::MODEL_FIT_PLOT_SIGNAL_NAME(), curve);
   }
 
   return result;
 };
 
 bool ModelFitInspectorView::RefreshPlotData()
 {
   bool changed = false;
 
   if (m_currentSelectedNode.IsNull())
   {
     this->m_PlotCurves = mitk::ModelFitPlotData();
 
     changed = m_selectedNodeTime > m_lastRefreshTime;
     m_lastRefreshTime.Modified();
   }
   else
   {
     assert(GetRenderWindowPart() != NULL);
 
     const mitk::Image* input = GetCurrentInputImage();
     const mitk::ModelBase::TimeGridType timeGrid = GetCurrentTimeGrid();
 
     if (m_currentFitTime > m_lastRefreshTime || m_currentPositionTime > m_lastRefreshTime)
     {
       if (m_validSelectedPosition)
       {
         m_PlotCurves.currentPositionPlots = RefreshPlotDataCurveCollection(m_currentSelectedPosition,input,m_currentFit, timeGrid, m_currentModelParameterizer);
       }
       else
       {
         m_PlotCurves.currentPositionPlots = mitk::PlotDataCurveCollection::New();
       }
 
       changed = true;
     }
 
     auto bookmarks = m_PositionBookmarks.Lock();
     if (bookmarks.IsNotNull())
     {
       if (m_currentFitTime > m_lastRefreshTime || bookmarks->GetMTime() > m_lastRefreshTime)
       {
         m_PlotCurves.positionalPlots.clear();
 
         auto endIter = bookmarks->End();
         for (auto iter = bookmarks->Begin(); iter != endIter; iter++)
         {
           auto collection = RefreshPlotDataCurveCollection(iter.Value(), input, m_currentFit, timeGrid, m_currentModelParameterizer);
           m_PlotCurves.positionalPlots.emplace(iter.Index(), std::make_pair(iter.Value(), collection));
         }
 
         changed = true;
       }
     }
     else
     {
       m_PlotCurves.positionalPlots.clear();
     }
 
     // input data curve
     if (m_currentFitTime > m_lastRefreshTime)
     {
       m_PlotCurves.staticPlots->clear();
 
       if (m_currentFit.IsNotNull())
       {
         m_PlotCurves.staticPlots = GenerateAdditionalModelFitPlotData(m_currentSelectedPosition, m_currentFit, timeGrid);
       }
 
       changed = true;
     }
 
     m_lastRefreshTime.Modified();
   }
 
   return changed;
 }
 
 void ModelFitInspectorView::RenderFitInfo()
 {
     assert(m_renderWindowPart != nullptr);
 
     // configure fit information
 
     if (m_currentFit.IsNull())
     {
         m_Controls.lFitType->setText("");
         m_Controls.lFitUID->setText("");
         m_Controls.lModelName->setText("");
         m_Controls.lModelType->setText("");
     }
     else
     {
         m_Controls.lFitType->setText(QString::fromStdString(m_currentFit->fitType));
         m_Controls.lFitUID->setText(QString::fromStdString(m_currentFit->uid));
         m_Controls.lModelName->setText(QString::fromStdString(m_currentFit->modelName));
         m_Controls.lModelType->setText(QString::fromStdString(m_currentFit->modelType));
     }
 
     // print results
     std::stringstream infoOutput;
 
   m_Controls.fitParametersWidget->setVisible(false);
     m_Controls.groupSettings->setVisible(false);
 
     if (m_currentFit.IsNull())
     {
         infoOutput << "No fit selected. Only raw image data is plotted.";
     }
     else if (!m_validSelectedPosition)
     {
         infoOutput <<
                "Current position is outside of the input image of the selected fit.\nInspector is deactivated.";
     }
     else
     {
         m_Controls.fitParametersWidget->setVisible(true);
     m_Controls.fitParametersWidget->setFits({ m_currentFit });
 
     m_Controls.fitParametersWidget->setPositionBookmarks(m_PositionBookmarks.Lock());
     m_Controls.fitParametersWidget->setCurrentPosition(m_currentSelectedPosition);
     }
 
     // configure data table
     m_Controls.tableInputData->clearContents();
 
     if (m_currentFit.IsNull())
     {
         infoOutput << "No fit selected. Only raw image data is plotted.";
     }
     else
     {
         m_Controls.groupSettings->setVisible(true);
         m_Controls.tableInputData->setRowCount(m_PlotCurves.staticPlots->size());
 
         unsigned int rowIndex = 0;
 
     for (mitk::PlotDataCurveCollection::const_iterator pos = m_PlotCurves.staticPlots->begin();
             pos != m_PlotCurves.staticPlots->end(); ++pos, ++rowIndex)
         {
             QColor dataColor;
 
             if (pos->first == "ROI")
             {
                 dataColor = QColor(0, 190, 0);
             }
             else
             {
                 //Use HSV schema of QColor to calculate a different color depending on the
                 //number of already existing free iso lines.
                 dataColor.setHsv(((rowIndex + 1) * 85) % 360, 255, 255);
             }
 
             QTableWidgetItem* newItem = new QTableWidgetItem(QString::fromStdString(pos->first));
             m_Controls.tableInputData->setItem(rowIndex, 0, newItem);
             newItem = new QTableWidgetItem();
             newItem->setBackgroundColor(dataColor);
             m_Controls.tableInputData->setItem(rowIndex, 1, newItem);
         }
     }
 
     m_Controls.lInfo->setText(QString::fromStdString(infoOutput.str()));
 }
 
 void ModelFitInspectorView::RenderPlotCurve(const mitk::PlotDataCurveCollection* curveCollection, const QColor& sampleColor, const QColor& signalColor, const std::string& posString)
 {
   auto sampleCurve = mitk::ModelFitPlotData::GetSamplePlot(curveCollection);
   if (sampleCurve)
   {
     std::string name = mitk::MODEL_FIT_PLOT_SAMPLE_NAME() + posString;
     unsigned int curveId = m_Controls.widgetPlot->InsertCurve(name.c_str());
     m_Controls.widgetPlot->SetCurveData(curveId, sampleCurve->GetValues());
     m_Controls.widgetPlot->SetCurvePen(curveId, QPen(Qt::NoPen));
 
     // QwtSymbol needs to passed as a real pointer from MITK v2013.09.0 on
     // (QwtPlotCurve deletes it on destruction and assignment).
     QwtSymbol* dataSymbol = new QwtSymbol(QwtSymbol::Diamond, sampleColor, sampleColor, QSize(8, 8));
     m_Controls.widgetPlot->SetCurveSymbol(curveId, dataSymbol);
 
     // Again, there is no way to set a curve's legend attributes via QmitkPlotWidget so this
     // gets unnecessarily complicated.
     QwtPlotCurve* measurementCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot->
       GetPlot()->itemList(QwtPlotItem::Rtti_PlotCurve).back());
     measurementCurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol);
     measurementCurve->setLegendIconSize(QSize(8, 8));
   }
 
   //draw model curve
   auto signalCurve = mitk::ModelFitPlotData::GetInterpolatedSignalPlot(curveCollection);
   if (signalCurve)
   {
     std::string name = mitk::MODEL_FIT_PLOT_SIGNAL_NAME() + posString;
     QPen pen;
     pen.setColor(signalColor);
     pen.setWidth(2);
     unsigned int curveId = m_Controls.widgetPlot->InsertCurve(name.c_str());
     m_Controls.widgetPlot->SetCurveData(curveId, signalCurve->GetValues());
     m_Controls.widgetPlot->SetCurvePen(curveId, pen);
 
     // Manually set the legend attribute to use the symbol as the legend icon and alter its
     // size. Otherwise it would revert to default which is drawing a square which is the color
     // of the curve's pen, so in this case none which defaults to black.
     // Unfortunately, QmitkPlotWidget offers no way to set the legend attribute and icon size so
     // this looks a bit hacky.
     QwtPlotCurve* fitCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot->GetPlot()->
       itemList(QwtPlotItem::Rtti_PlotCurve).back());
     fitCurve->setLegendAttribute(QwtPlotCurve::LegendShowLine);
   }
 
 }
 
 void ModelFitInspectorView::RenderPlot()
 {
   m_Controls.widgetPlot->Clear();
 
   std::string xAxis = DEFAULT_X_AXIS;
   std::string yAxis = "Intensity";
   std::string plotTitle = "Raw data plot: no data";
 
   if (m_currentSelectedNode.IsNotNull())
   {
     plotTitle = "Raw data plot: " + m_currentSelectedNode->GetName();
   }
 
   if (m_currentFit.IsNotNull())
   {
     plotTitle = m_currentFit->modelName.c_str();
     xAxis = m_currentFit->xAxisName;
 
     if (!m_currentFit->xAxisUnit.empty())
     {
       xAxis += " [" + m_currentFit->xAxisUnit + "]";
     }
 
     yAxis = m_currentFit->yAxisName;
 
     if (!m_currentFit->yAxisUnit.empty())
     {
       yAxis += " [" + m_currentFit->yAxisUnit + "]";
     }
   }
 
   m_Controls.widgetPlot->SetAxisTitle(QwtPlot::xBottom, xAxis.c_str());
   m_Controls.widgetPlot->SetAxisTitle(QwtPlot::yLeft, yAxis.c_str());
   m_Controls.widgetPlot->SetPlotTitle(plotTitle.c_str());
 
   // Draw static curves
   unsigned int colorIndex = 0;
 
   for (mitk::PlotDataCurveCollection::const_iterator pos = m_PlotCurves.staticPlots->begin();
        pos != m_PlotCurves.staticPlots->end(); ++pos)
   {
     QColor dataColor;
 
     unsigned int curveId = m_Controls.widgetPlot->InsertCurve(pos->first.c_str());
     m_Controls.widgetPlot->SetCurveData(curveId, pos->second->GetValues());
 
     if (pos->first == "ROI")
     {
       dataColor = QColor(0, 190, 0);
       QPen pen;
       pen.setColor(dataColor);
       pen.setStyle(Qt::SolidLine);
       m_Controls.widgetPlot->SetCurvePen(curveId, pen);
     }
     else
     {
       //Use HSV schema of QColor to calculate a different color depending on the
       //number of already existing curves.
       dataColor.setHsv((++colorIndex * 85) % 360, 255, 150);
       m_Controls.widgetPlot->SetCurvePen(curveId, QPen(Qt::NoPen));
     }
 
     // QwtSymbol needs to passed as a real pointer from MITK v2013.09.0 on
     // (QwtPlotCurve deletes it on destruction and assignment).
     QwtSymbol* dataSymbol = new QwtSymbol(QwtSymbol::Triangle, dataColor, dataColor,
                                           QSize(8, 8));
     m_Controls.widgetPlot->SetCurveSymbol(curveId, dataSymbol);
 
     // Again, there is no way to set a curve's legend attributes via QmitkPlotWidget so this
     // gets unnecessarily complicated.
     QwtPlotCurve* measurementCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot->
                                      GetPlot()->itemList(QwtPlotItem::Rtti_PlotCurve).back());
     measurementCurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol);
     measurementCurve->setLegendIconSize(QSize(8, 8));
   }
 
   // Draw positional curves
   for (const auto& posIter : this->m_PlotCurves.positionalPlots)
   {
     QColor dataColor;
     dataColor.setHsv((++colorIndex * 85) % 360, 255, 150);
 
     this->RenderPlotCurve(posIter.second.second, dataColor, dataColor, " @ "+mitk::ModelFitPlotData::GetPositionalCollectionName(posIter));
   }
 
   // Draw current pos curve
   this->RenderPlotCurve(m_PlotCurves.currentPositionPlots, QColor(Qt::red), QColor(Qt::black), "");
 
   QwtLegend* legend = new QwtLegend();
   legend->setFrameShape(QFrame::Box);
   legend->setFrameShadow(QFrame::Sunken);
   legend->setLineWidth(1);
   m_Controls.widgetPlot->SetLegend(legend, QwtPlot::BottomLegend);
 
   m_Controls.widgetPlot->Replot();
 }
 
 void ModelFitInspectorView::EnsureBookmarkPointSet()
 {
   if (m_PositionBookmarks.IsExpired() || m_PositionBookmarksNode.IsExpired())
   {
     const char* nodeName = "org.mitk.gui.qt.fit.inspector.positions";
     mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode(nodeName);
 
     if (!node)
     {
       node = mitk::DataNode::New();
       node->SetName(nodeName);
       node->SetBoolProperty("helper object", true);
       this->GetDataStorage()->Add(node);
     }
     m_PositionBookmarksNode = node;
 
     mitk::PointSet::Pointer pointSet = dynamic_cast<mitk::PointSet*>(node->GetData());
     if (pointSet.IsNull())
     {
       pointSet = mitk::PointSet::New();
       node->SetData(pointSet);
     }
 
     m_PositionBookmarks = pointSet;
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorViewControls.ui b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorViewControls.ui
index 28f81f5577..691f3784be 100644
--- a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorViewControls.ui
@@ -1,762 +1,762 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>ModelFitInspectorViewControls</class>
  <widget class="QWidget" name="ModelFitInspectorViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>721</width>
     <height>865</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" stretch="0,4,0,0,0">
    <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="QFormLayout" name="formLayout_2">
      <property name="horizontalSpacing">
       <number>6</number>
      </property>
      <property name="verticalSpacing">
       <number>6</number>
      </property>
      <item row="2" column="0">
       <widget class="QLabel" name="lblFit">
        <property name="text">
         <string>Modelfit:</string>
        </property>
       </widget>
      </item>
      <item row="2" column="1">
       <widget class="QComboBox" name="cmbFit"/>
      </item>
      <item row="1" column="1">
       <widget class="QmitkSingleNodeSelectionWidget" name="inputNodeSelector" native="true"/>
      </item>
      <item row="1" column="0">
       <widget class="QLabel" name="lblInput">
        <property name="text">
         <string>Input</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QmitkPlotWidget" name="widgetPlot" native="true">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>400</height>
       </size>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="lInfo">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_3">
      <item>
       <spacer name="horizontalSpacer_5">
        <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="QPushButton" name="btnFullPlot">
        <property name="text">
         <string>Full screen plot</string>
        </property>
        <property name="checkable">
         <bool>true</bool>
        </property>
        <property name="flat">
         <bool>false</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="tabInfo">
       <attribute name="title">
        <string>Fit info</string>
       </attribute>
       <layout class="QFormLayout" name="formLayout">
        <item row="0" column="0">
         <widget class="QLabel" name="label_3">
          <property name="maximumSize">
           <size>
            <width>50</width>
            <height>16777215</height>
           </size>
          </property>
          <property name="text">
           <string>Fit type</string>
          </property>
         </widget>
        </item>
        <item row="0" column="1">
         <widget class="QLabel" name="lFitType">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="label_4">
          <property name="text">
           <string>Fit uid:</string>
          </property>
         </widget>
        </item>
        <item row="1" column="1">
         <widget class="QLabel" name="lFitUID">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
        <item row="2" column="0">
         <widget class="QLabel" name="label">
          <property name="text">
           <string>Model name:</string>
          </property>
         </widget>
        </item>
        <item row="3" column="0">
         <widget class="QLabel" name="label_2">
          <property name="text">
           <string>Model type:</string>
          </property>
         </widget>
        </item>
        <item row="2" column="1">
         <widget class="QLabel" name="lModelName">
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
        <item row="3" column="1">
         <widget class="QLabel" name="lModelType">
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tabResults">
       <attribute name="title">
        <string>Fit parameter</string>
       </attribute>
       <attribute name="toolTip">
        <string>Parameter used for the fit.</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_4">
        <property name="spacing">
         <number>3</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>
         <widget class="QmitkFitParameterWidget" name="fitParametersWidget" native="true"/>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tabBookmarks">
       <attribute name="title">
        <string>Inspection positions</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_3">
        <property name="spacing">
         <number>3</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>
         <widget class="QmitkInspectionPositionWidget" name="inspectionPositionWidget" native="true"/>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tabSettings">
       <attribute name="title">
        <string>View settings</string>
       </attribute>
       <attribute name="toolTip">
        <string>Settings for the visualization of fittings</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_5">
        <property name="spacing">
         <number>3</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>
         <widget class="QGroupBox" name="groupBox_x">
          <property name="title">
           <string>X-axis scaling:</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_8">
           <item>
            <widget class="QRadioButton" name="radioScaleAuto_x">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="text">
              <string>automatic</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="radioScaleFixed_x">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="text">
              <string>fixed</string>
             </property>
             <property name="checked">
              <bool>false</bool>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_2">
             <item>
              <widget class="QLabel" name="labelFixMin_x">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="maximumSize">
                <size>
                 <width>40</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="text">
                <string>min:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="sbFixMin_x">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="minimum">
                <double>-9999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_3">
               <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="labelFixMax_x">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="maximumSize">
                <size>
                 <width>40</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="text">
                <string>max:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="sbFixMax_x">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="minimum">
                <double>-9999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_4">
               <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="QPushButton" name="btnScaleToData_x">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="toolTip">
                <string>Sets the min and max to the current range of data +-10%</string>
               </property>
               <property name="text">
                <string>Scale to data</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="groupBox_y">
          <property name="title">
           <string>Y-axis scaling:</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_6">
           <item>
            <widget class="QRadioButton" name="radioScaleAuto">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="text">
              <string>automatic</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="radioScaleFixed">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="text">
              <string>fixed</string>
             </property>
             <property name="checked">
              <bool>false</bool>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout">
             <item>
              <widget class="QLabel" name="labelFixMin">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="maximumSize">
                <size>
                 <width>40</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="text">
                <string>min:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="sbFixMin">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="minimum">
                <double>-9999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <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="labelFixMax">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="maximumSize">
                <size>
                 <width>40</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="text">
                <string>max:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="sbFixMax">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="minimum">
                <double>-9999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_2">
               <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="QPushButton" name="btnScaleToData">
               <property name="enabled">
                <bool>false</bool>
               </property>
               <property name="toolTip">
                <string>Sets the min and max to the current range of data +-10%</string>
               </property>
               <property name="text">
                <string>Scale to data</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="groupSettings">
          <property name="title">
           <string>Additional input data visibility:</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_2">
           <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>
            <widget class="QTableWidget" name="tableInputData">
             <property name="font">
              <font>
               <pointsize>8</pointsize>
              </font>
             </property>
             <attribute name="horizontalHeaderDefaultSectionSize">
              <number>150</number>
             </attribute>
             <attribute name="horizontalHeaderHighlightSections">
              <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>Name</string>
              </property>
              <property name="toolTip">
               <string extracomment="Name of the data"/>
              </property>
             </column>
             <column>
              <property name="text">
               <string>Color</string>
              </property>
              <property name="toolTip">
               <string extracomment="Visibility of the data in diagram"/>
              </property>
             </column>
            </widget>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>40</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tabData">
       <attribute name="title">
        <string>Plot data export</string>
       </attribute>
       <attribute name="toolTip">
-       <string>Display and export option for the current data samples, model signals and additinal fitting informations of the plot.</string>
+       <string>Display and export option for the current data samples, model signals and additional fitting information of the plot.</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_7">
        <property name="spacing">
         <number>3</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>
         <widget class="QmitkFitPlotDataWidget" name="plotDataWidget" native="true">
          <property name="minimumSize">
           <size>
            <width>80</width>
            <height>0</height>
           </size>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
     </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>
   <customwidget>
    <class>QmitkPlotWidget</class>
    <extends>QWidget</extends>
    <header>QmitkPlotWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkFitParameterWidget</class>
    <extends>QWidget</extends>
    <header>QmitkFitParameterWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkInspectionPositionWidget</class>
    <extends>QWidget</extends>
    <header>QmitkInspectionPositionWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkFitPlotDataWidget</class>
    <extends>QWidget</extends>
    <header>QmitkFitPlotDataWidget.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections>
   <connection>
    <sender>radioScaleFixed</sender>
    <signal>clicked(bool)</signal>
    <receiver>sbFixMin</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>66</x>
      <y>528</y>
     </hint>
     <hint type="destinationlabel">
      <x>86</x>
      <y>559</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>radioScaleFixed</sender>
    <signal>clicked(bool)</signal>
    <receiver>sbFixMax</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>208</x>
      <y>535</y>
     </hint>
     <hint type="destinationlabel">
      <x>195</x>
      <y>559</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>radioScaleFixed</sender>
    <signal>clicked(bool)</signal>
    <receiver>btnScaleToData</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>299</x>
      <y>530</y>
     </hint>
     <hint type="destinationlabel">
      <x>292</x>
      <y>557</y>
     </hint>
    </hints>
   </connection>
  </connections>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h
index e77da14cc8..56cff93fcf 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.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 QmitkFlowApplicationWorkbenchWindowAdvisorHack_h
 #define QmitkFlowApplicationWorkbenchWindowAdvisorHack_h
 
 #include <QObject>
 
 class ctkPluginContext;
 class QmitkPreferencesDialog;
 
 /** This class is a "hack" due to the currently missing command framework. It is a direct clone of QmitkExtWorkbenchWindowAdvisorHack.*/
 class QmitkFlowApplicationWorkbenchWindowAdvisorHack : public QObject
 {
   Q_OBJECT
 
   public slots:
 
     void onUndo();
     void onRedo();
     void onImageNavigator();
     void onEditPreferences();
     void onQuit();
 
     void onResetPerspective();
     void onClosePerspective();
     void onIntro();
 
     /**
-     * @brief This slot is called if the user klicks the menu item "help->context help" or presses F1.
+     * @brief This slot is called if the user clicks the menu item "help->context help" or presses F1.
      * The help page is shown in a workbench editor.
      */
     void onHelp();
 
     void onHelpOpenHelpPerspective();
 
     /**
      * @brief This slot is called if the user clicks in help menu the about button
      */
     void onAbout();
 
   public:
 
     QmitkFlowApplicationWorkbenchWindowAdvisorHack();
     ~QmitkFlowApplicationWorkbenchWindowAdvisorHack() override;
 
     static QmitkFlowApplicationWorkbenchWindowAdvisorHack* undohack;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.cpp b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.cpp
index 7ca288ff21..31b08445a6 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.cpp
@@ -1,1152 +1,1152 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // Qmitk
 #include "QmitkIGTTrackingDataEvaluationView.h"
 
 // Qt
 #include <QMessageBox>
 #include <qfiledialog.h>
 #include <qstringlist.h>
 
 // MITK
 #include "mitkNavigationDataCSVSequentialPlayer.h"
 #include <mitkNavigationDataRecorderDeprecated.h>
 #include <mitkQuaternionAveraging.h>
 #include <mitkTransform.h>
 #include <mitkStaticIGTHelperFunctions.h>
 #include <mitkNodePredicateDataType.h>
 
 
 //ITK
 #include <itksys/SystemTools.hxx>
 
 //VNL
 #include <vnl/vnl_vector.h>
 
 //vtk headers
 #include <vtkPoints.h>
 #include <vtkSmartPointer.h>
 #include <vtkLandmarkTransform.h>
 
 const std::string QmitkIGTTrackingDataEvaluationView::VIEW_ID = "org.mitk.views.igttrackingdataevaluation";
 
 QmitkIGTTrackingDataEvaluationView::QmitkIGTTrackingDataEvaluationView()
   : m_Controls(nullptr)
   , m_scalingfactor(1)
 {
   m_CSVtoXMLInputFilenameVector = std::vector<std::string>();
   m_CSVtoXMLOutputFilenameVector = std::vector<std::string>();
 }
 
 QmitkIGTTrackingDataEvaluationView::~QmitkIGTTrackingDataEvaluationView()
 {
 }
 
 void QmitkIGTTrackingDataEvaluationView::CreateQtPartControl(QWidget *parent)
 {
   // build up qt view, unless already done
   if (!m_Controls)
   {
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls = new Ui::QmitkIGTTrackingDataEvaluationViewControls;
     m_Controls->setupUi(parent);
 
     connect(m_Controls->m_LoadInputFileList, SIGNAL(clicked()), this, SLOT(OnLoadFileList()));
     connect(m_Controls->m_StartEvaluation, SIGNAL(clicked()), this, SLOT(OnEvaluateData()));
     connect(m_Controls->m_AddToCurrentList, SIGNAL(clicked()), this, SLOT(OnAddToCurrentList()));
     connect(m_Controls->m_GeneratePointSetOfMeanPositions, SIGNAL(clicked()), this, SLOT(OnGeneratePointSet()));
     connect(m_Controls->m_GenerateRotationLines, SIGNAL(clicked()), this, SLOT(OnGenerateRotationLines()));
     connect(m_Controls->m_GeneratePointSet, SIGNAL(clicked()), this, SLOT(OnGenerateGroundTruthPointSet()));
     connect(m_Controls->m_Convert, SIGNAL(clicked()), this, SLOT(OnConvertCSVtoXMLFile()));
     connect(m_Controls->m_loadCSVtoXMLInputList, SIGNAL(clicked()), this, SLOT(OnCSVtoXMLLoadInputList()));
     connect(m_Controls->m_loadCSVtoXMLOutputList, SIGNAL(clicked()), this, SLOT(OnCSVtoXMLLoadOutputList()));
     connect(m_Controls->m_OrientationCalculationGenerateReference, SIGNAL(clicked()), this, SLOT(OnOrientationCalculation_CalcRef()));
     connect(m_Controls->m_OrientationCalculationWriteOrientationsToFile, SIGNAL(clicked()), this, SLOT(OnOrientationCalculation_CalcOrientandWriteToFile()));
     connect(m_Controls->m_GeneratePointSetsOfSinglePositions, SIGNAL(clicked()), this, SLOT(OnGeneratePointSetsOfSinglePositions()));
     connect(m_Controls->m_StartEvaluationAll, SIGNAL(clicked()), this, SLOT(OnEvaluateDataAll()));
     connect(m_Controls->m_GridMatching, SIGNAL(clicked()), this, SLOT(OnPerfomGridMatching()));
     connect(m_Controls->m_ComputeRotation, SIGNAL(clicked()), this, SLOT(OnComputeRotation()));
 
     //initialize data storage combo boxes
     m_Controls->m_ReferencePointSetComboBox->SetDataStorage(this->GetDataStorage());
     m_Controls->m_ReferencePointSetComboBox->SetAutoSelectNewItems(true);
     m_Controls->m_ReferencePointSetComboBox->SetPredicate(mitk::NodePredicateDataType::New("PointSet"));
     m_Controls->m_MeasurementPointSetComboBox->SetDataStorage(this->GetDataStorage());
     m_Controls->m_MeasurementPointSetComboBox->SetAutoSelectNewItems(true);
     m_Controls->m_MeasurementPointSetComboBox->SetPredicate(mitk::NodePredicateDataType::New("PointSet"));
   }
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnComputeRotation()
 {
   //Get all data from UI
   auto EvaluationDataCollection = GetAllDataFromUIList();
   //Compute mean Quaternions
   auto OrientationVector = GetMeanOrientationsOfAllData(EvaluationDataCollection);
 
   //Compute Rotations
 
   itk::Vector<double> rotationVec;
   //adapt for Aurora 5D tools: [0,0,1000]
   rotationVec[0] = m_Controls->m_rotVecX->value(); //X
   rotationVec[1] = m_Controls->m_rotVecY->value(); //Y
   rotationVec[2] = m_Controls->m_rotVecZ->value(); //Z
 
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> allOrientationErrors;
   for (std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError>::size_type i = 0; i < OrientationVector.size() - 1; ++i)
   {
     double AngleBetweenTwoQuaternions = mitk::StaticIGTHelperFunctions::GetAngleBetweenTwoQuaterions(OrientationVector.at(i), OrientationVector.at(i+1), rotationVec);
     double AngularError = fabs(AngleBetweenTwoQuaternions - 11.25);
     std::stringstream description;
     description << "Rotation Error ROT" << (i + 1) << " / ROT" << (i + 2);
     allOrientationErrors.push_back({ AngularError, description.str() });
     MITK_INFO << description.str() << ": " << AngularError;
   }
 
   //compute statistics
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> orientationErrorStatistics;
   orientationErrorStatistics = mitk::HummelProtocolEvaluation::ComputeStatistics(allOrientationErrors);
   MITK_INFO << "## Rotation error statistics: ##";
   for (auto stat : orientationErrorStatistics) { MITK_INFO << stat.description << ": " << stat.distanceError; }
 
   //write results to file
   allOrientationErrors.insert(allOrientationErrors.end(), orientationErrorStatistics.begin(), orientationErrorStatistics.end());
   allOrientationErrors.push_back({rotationVec[0],"Rot Vector [x]"});
   allOrientationErrors.push_back({rotationVec[1], "Rot Vector [y]"});
   allOrientationErrors.push_back({rotationVec[2], "Rot Vector [z]"});
   std::stringstream filenameOrientationStat;
   filenameOrientationStat << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".orientationStatistics.csv";
   MITK_INFO << "Writing output to file " << filenameOrientationStat.str();
   writeToFile(filenameOrientationStat.str(), allOrientationErrors);
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnPerfomGridMatching()
 {
   mitk::PointSet::Pointer reference = dynamic_cast<mitk::PointSet*>(m_Controls->m_ReferencePointSetComboBox->GetSelectedNode()->GetData());
   mitk::PointSet::Pointer measurement = dynamic_cast<mitk::PointSet*>(m_Controls->m_MeasurementPointSetComboBox->GetSelectedNode()->GetData());
   //convert point sets to vtk poly data
   vtkSmartPointer<vtkPoints> sourcePoints = vtkSmartPointer<vtkPoints>::New();
   vtkSmartPointer<vtkPoints> targetPoints = vtkSmartPointer<vtkPoints>::New();
   for (int i = 0; i<reference->GetSize(); i++)
   {
     double point[3] = { reference->GetPoint(i)[0], reference->GetPoint(i)[1], reference->GetPoint(i)[2] };
     sourcePoints->InsertNextPoint(point);
     double point_targets[3] = { measurement->GetPoint(i)[0], measurement->GetPoint(i)[1], measurement->GetPoint(i)[2] };
     targetPoints->InsertNextPoint(point_targets);
   }
   //compute transform
   vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
   transform->SetSourceLandmarks(sourcePoints);
   transform->SetTargetLandmarks(targetPoints);
   transform->SetModeToRigidBody();
   transform->Modified();
   transform->Update();
   //compute FRE of transform
   double FRE = mitk::StaticIGTHelperFunctions::ComputeFRE(reference, measurement, transform);
   MITK_INFO << "FRE after grid matching: " + QString::number(FRE) + " mm";
   //convert from vtk to itk data types
   itk::Matrix<float, 3, 3> rotationFloat = itk::Matrix<float, 3, 3>();
   itk::Vector<float, 3> translationFloat = itk::Vector<float, 3>();
   itk::Matrix<double, 3, 3> rotationDouble = itk::Matrix<double, 3, 3>();
   itk::Vector<double, 3> translationDouble = itk::Vector<double, 3>();
 
   vtkSmartPointer<vtkMatrix4x4> m = transform->GetMatrix();
   for (int k = 0; k<3; k++) for (int l = 0; l<3; l++)
   {
     rotationFloat[k][l] = m->GetElement(k, l);
     rotationDouble[k][l] = m->GetElement(k, l);
 
   }
   for (int k = 0; k<3; k++)
   {
     translationFloat[k] = m->GetElement(k, 3);
     translationDouble[k] = m->GetElement(k, 3);
   }
   //create affine transform 3D
   mitk::AffineTransform3D::Pointer mitkTransform = mitk::AffineTransform3D::New();
   mitkTransform->SetMatrix(rotationDouble);
   mitkTransform->SetOffset(translationDouble);
   mitk::NavigationData::Pointer transformNavigationData = mitk::NavigationData::New(mitkTransform);
   m_Controls->m_ReferencePointSetComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(mitkTransform);
   m_Controls->m_ReferencePointSetComboBox->GetSelectedNode()->GetData()->GetGeometry()->Modified();
 
   //write to file
 
   std::stringstream filename;
   filename << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".GridMatchingResult.csv";
   MITK_INFO << "Writing output to file " << filename.str();
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> FRE_Error;
   FRE_Error.push_back({ FRE, "FRE after grid matching [mm]" });
   writeToFile(filename.str(), FRE_Error);
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnOrientationCalculation_CalcRef()
 {
   if (m_FilenameVector.size() != 3)
   {
     MessageBox("Need exactly three points as reference, aborting!");
     return;
   }
 
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector[i]);
 
     //check if the stream is valid and skip file if not
 
     //create evaluation filter
     mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 
     //connect pipeline
     for (unsigned int j = 0; j < myPlayer->GetNumberOfOutputs(); ++j)
       myEvaluationFilter->SetInput(j, myPlayer->GetOutput(j));
 
     //update pipline until number of samples is reached
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); ++j)
       myEvaluationFilter->Update();
 
     //store mean position as reference
     switch (i)
     {
     case 0:
       m_RefPoint1 = myEvaluationFilter->GetPositionMean(0);
       break;
     case 1:
       m_RefPoint2 = myEvaluationFilter->GetPositionMean(0);
       break;
     case 2:
       m_RefPoint3 = myEvaluationFilter->GetPositionMean(0);
       break;
     }
   }
   MessageBox("Created Reference!");
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnOrientationCalculation_CalcOrientandWriteToFile()
 {
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //open file header
     QString outputname = QString(m_FilenameVector.at(i).c_str()) + "_orientationFile.csv";
     m_CurrentWriteFile.open(outputname.toStdString().c_str(), std::ios::out);
     if (m_CurrentWriteFile.bad())
     {
       MessageBox("Error: Can't open output file!");
       return;
     }
 
     //write header to file
     m_CurrentWriteFile << "Nr;Calypso_Time;Valid_Reference;MeasureTool_Measurement-Tool[x];MeasureTool_Measurement-Tool[y];MeasureTool_Measurement-Tool[z];MeasureTool_Measurement-Tool[qx];MeasureTool_Measurement-Tool[qy];MeasureTool_Measurement-Tool[qz];MeasureTool_Measurement-Tool[qr]\n";
 
     //update pipeline until number of samples is reached
     int step = 0;
     mitk::Point3D point1, point2, point3;
     mitk::Quaternion current_orientation;
 
     for (int j = 0; !myPlayer->IsAtEnd(); j++)
     {
       myPlayer->Update();
       mitk::NavigationData::Pointer currentNavData = myPlayer->GetOutput(0);
       switch (step)
       {
       case 0:
         step++;
         point1 = currentNavData->GetPosition();
         break;
       case 1:
         step++;
         point2 = currentNavData->GetPosition();
         break;
       case 2:
         step = 0;
         point3 = currentNavData->GetPosition();
 
         //compute transform from reference to current points
         if (point1[0] == 0 &&
           point1[1] == 0 &&
           point1[2] == 0 &&
           point2[0] == 0 &&
           point2[1] == 0 &&
           point2[2] == 0 &&
           point3[0] == 0 &&
           point3[1] == 0 &&
           point3[2] == 0
           ) current_orientation.fill(0);
         else
         {
           vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
           vtkSmartPointer<vtkPoints> sourcePoints = vtkSmartPointer<vtkPoints>::New();
           double sourcepoint1[3] = { point1[0], point1[1], point1[2] };
           double sourcepoint2[3] = { point2[0], point2[1], point2[2] };
           double sourcepoint3[3] = { point3[0], point3[1], point3[2] };
           sourcePoints->InsertNextPoint(sourcepoint1);
           sourcePoints->InsertNextPoint(sourcepoint2);
           sourcePoints->InsertNextPoint(sourcepoint3);
           vtkSmartPointer<vtkPoints> targetPoints = vtkSmartPointer<vtkPoints>::New();
           double targetpoint1[3] = { m_RefPoint1[0], m_RefPoint1[1], m_RefPoint1[2] };
           double targetpoint2[3] = { m_RefPoint2[0], m_RefPoint2[1], m_RefPoint2[2] };
           double targetpoint3[3] = { m_RefPoint3[0], m_RefPoint3[1], m_RefPoint3[2] };
           targetPoints->InsertNextPoint(targetpoint1);
           targetPoints->InsertNextPoint(targetpoint2);
           targetPoints->InsertNextPoint(targetpoint3);
 
           transform->SetSourceLandmarks(sourcePoints);
           transform->SetTargetLandmarks(targetPoints);
           transform->Modified();
           transform->Update();
 
           mitk::Transform::Pointer newTransform = mitk::Transform::New();
           newTransform->SetMatrix(transform->GetMatrix());
           current_orientation = newTransform->GetOrientation();
 
           //add pointset with the three positions
           if ((j > 15) && (j < 18))
           {
             mitk::DataNode::Pointer newNode = mitk::DataNode::New();
             mitk::PointSet::Pointer newPointSet = mitk::PointSet::New();
             newPointSet->InsertPoint(0, point1);
             newPointSet->InsertPoint(1, point2);
             newPointSet->InsertPoint(2, point3);
             QString name = QString(m_FilenameVector.at(i).c_str());
             newNode->SetName(name.toStdString().c_str());
             newNode->SetData(newPointSet);
             newNode->SetFloatProperty("pointsize", 0.1);
             this->GetDataStorage()->Add(newNode);
           }
         }
 
         break;
       }
       m_CurrentWriteFile << i << ";";
       m_CurrentWriteFile << currentNavData->GetTimeStamp() << ";"; //IMPORTANT: change to GetIGTTimeStamp in new version!
       m_CurrentWriteFile << "true;";
       m_CurrentWriteFile << currentNavData->GetPosition()[0] << ";";
       m_CurrentWriteFile << currentNavData->GetPosition()[1] << ";";
       m_CurrentWriteFile << currentNavData->GetPosition()[2] << ";";
       m_CurrentWriteFile << current_orientation.x() << ";";
       m_CurrentWriteFile << current_orientation.y() << ";";
       m_CurrentWriteFile << current_orientation.z() << ";";
       m_CurrentWriteFile << current_orientation.r() << ";";
       m_CurrentWriteFile << "\n";
     }
     //close output file
     m_CurrentWriteFile.close();
   }
   MessageBox("Finished!");
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnAddToCurrentList()
 {
   //read in files
   QStringList files = QFileDialog::getOpenFileNames(nullptr, "Select one or more files to open", "/", "CSV (*.csv)");
   if (files.isEmpty()) return;
 
   for (int i = 0; i < files.size(); i++)
   {
     std::string tmp = files.at(i).toStdString().c_str();
     m_FilenameVector.push_back(tmp);
   }
 
   //fill list at GUI
   m_Controls->m_FileList->clear();
   for (unsigned int i = 0; i < m_FilenameVector.size(); i++) { new QListWidgetItem(tr(m_FilenameVector.at(i).c_str()), m_Controls->m_FileList); }
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnLoadFileList()
 {
   m_FilenameVector = std::vector<std::string>();
   m_FilenameVector.clear();
   OnAddToCurrentList();
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnEvaluateDataAll()
 {
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> results5cm, results15cm, results30cm, resultsAccum;
   mitk::HummelProtocolEvaluation::HummelProtocolMeasurementVolume volume;
   if (m_Controls->m_standardVolume->isChecked())
   {
     volume = mitk::HummelProtocolEvaluation::standard;
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_PointSetMeanPositions, volume, results5cm);
     mitk::HummelProtocolEvaluation::Evaluate15cmDistances(m_PointSetMeanPositions, volume, results15cm);
     mitk::HummelProtocolEvaluation::Evaluate30cmDistances(m_PointSetMeanPositions, volume, results30cm);
     mitk::HummelProtocolEvaluation::EvaluateAccumulatedDistances(m_PointSetMeanPositions, volume, resultsAccum);
   }
   else if (m_Controls->m_smallVolume->isChecked())
   {
     volume = mitk::HummelProtocolEvaluation::small;
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_PointSetMeanPositions, volume, results5cm);
   }
   else if (m_Controls->m_mediumVolume->isChecked())
   {
     volume = mitk::HummelProtocolEvaluation::medium;
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_PointSetMeanPositions, volume, results5cm);
   }
 
 
   //write results to file
   std::stringstream filename5cm;
   filename5cm << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".results5cm.csv";
   MITK_INFO << "Writing output to file " << filename5cm.str();
   writeToFile(filename5cm.str(), results5cm);
 
   std::stringstream filename15cm;
   filename15cm << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".results15cm.csv";
   MITK_INFO << "Writing output to file " << filename15cm.str();
   writeToFile(filename15cm.str(), results15cm);
 
   std::stringstream filename30cm;
   filename30cm << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".results30cm.csv";
   MITK_INFO << "Writing output to file " << filename30cm.str();
   writeToFile(filename30cm.str(), results30cm);
 
   std::stringstream filenameAccum;
   filenameAccum << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".resultsAccumDist.csv";
   MITK_INFO << "Writing output to file " << filenameAccum.str();
   writeToFile(filenameAccum.str(), resultsAccum);
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnEvaluateData()
 {
   //open output file
   m_CurrentWriteFile.open(std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str(), std::ios::out);
   if (m_CurrentWriteFile.bad())
   {
     MessageBox("Error: Can't open output file!");
     return;
   }
 
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> jitterValues;
 
   //write output file header
   WriteHeader();
 
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //create evaluation filter
     mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 
     //connect pipeline
     for (unsigned int j = 0; j < myPlayer->GetNumberOfOutputs(); ++i) { myEvaluationFilter->SetInput(j, myPlayer->GetOutput(j)); }
 
     if (myPlayer->GetNumberOfSnapshots() < m_Controls->m_NumberOfSamples->value())
     {
       MITK_WARN << "Number of snapshots (" << myPlayer->GetNumberOfSnapshots() << ") smaller than number of samples to evaluate (" << m_Controls->m_NumberOfSamples->value() << ") ! Cannot proceed!";
       return;
     }
 
     //update pipline until number of samples is reached
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); j++)
       myEvaluationFilter->Update();
 
     //store all jitter values in separate vector for statistics
     jitterValues.push_back({ myEvaluationFilter->GetPositionErrorRMS(0), "RMS" });
 
     //write result to output file
     WriteDataSet(myEvaluationFilter, m_FilenameVector.at(i));
   }
 
   //close output file for single data
   m_CurrentWriteFile.close();
 
   //compute statistics
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> jitterStatistics = mitk::HummelProtocolEvaluation::ComputeStatistics(jitterValues);
   MITK_INFO << "## Jitter (RMS) statistics: ##";
   for (auto jitterStat : jitterStatistics) {MITK_INFO << jitterStat.description << ": " << jitterStat.distanceError;}
 
   //write statistic results to separate file
   std::stringstream filenameJitterStat;
   filenameJitterStat << std::string(m_Controls->m_OutputFilename->text().toUtf8()).c_str() << ".resultsJitterStatistics.csv";
   MITK_INFO << "Writing output to file " << filenameJitterStat.str();
   writeToFile(filenameJitterStat.str(), jitterStatistics);
 
   //calculate angles if option is on
   if (m_Controls->m_settingDifferenceAngles->isChecked() || m_Controls->m_DifferencesSLERP->isChecked()) CalculateDifferenceAngles();
 
   MessageBox("Finished!");
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnGeneratePointSetsOfSinglePositions()
 {
   m_scalingfactor = m_Controls->m_ScalingFactor->value();
 
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create point set for this file
     mitk::PointSet::Pointer thisPointSet = mitk::PointSet::New();
 
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //update pipline until number of samlples is reached and store every single point
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); j++)
     {
       myPlayer->Update();
       mitk::Point3D thisPoint = myPlayer->GetOutput()->GetPosition();
       thisPoint[0] *= m_scalingfactor;
       thisPoint[1] *= m_scalingfactor;
       thisPoint[2] *= m_scalingfactor;
       thisPointSet->InsertPoint(j, thisPoint);
     }
 
     //add point set to data storage
     mitk::DataNode::Pointer newNode = mitk::DataNode::New();
     QString name = this->m_Controls->m_prefix->text() + QString("PointSet_of_All_Positions_") + QString::number(i);
     newNode->SetName(name.toStdString());
     newNode->SetData(thisPointSet);
     this->GetDataStorage()->Add(newNode);
   }
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnGeneratePointSet()
 {
   m_scalingfactor = m_Controls->m_ScalingFactor->value();
 
   mitk::PointSet::Pointer generatedPointSet = mitk::PointSet::New();
 
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //create evaluation filter
     mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 
     //connect pipeline
     for (unsigned int j = 0; j < myPlayer->GetNumberOfOutputs(); ++j) { myEvaluationFilter->SetInput(j, myPlayer->GetOutput(j)); }
 
     //update pipline until number of samlples is reached
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); ++j) { myEvaluationFilter->Update(); }
 
     //add mean position to point set
     mitk::Point3D meanPos = myEvaluationFilter->GetPositionMean(0);
     if (m_scalingfactor != 1)
     {
       meanPos[0] *= m_scalingfactor;
       meanPos[1] *= m_scalingfactor;
       meanPos[2] *= m_scalingfactor;
     }
     generatedPointSet->InsertPoint(i, meanPos);
   }
 
   //add point set to data storage
   mitk::DataNode::Pointer newNode = mitk::DataNode::New();
   QString name = this->m_Controls->m_prefix->text() + "PointSet_of_Mean_Positions";
   newNode->SetName(name.toStdString());
   newNode->SetData(generatedPointSet);
   newNode->SetFloatProperty("pointsize", 5);
   this->GetDataStorage()->Add(newNode);
   m_PointSetMeanPositions = generatedPointSet;
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnGenerateRotationLines()
 {
   m_scalingfactor = m_Controls->m_ScalingFactor->value();
 
   //start loop and iterate through all files of list
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //create evaluation filter
     mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 
     //connect pipeline
     for (unsigned int j = 0; j < myPlayer->GetNumberOfOutputs(); ++j) { myEvaluationFilter->SetInput(j, myPlayer->GetOutput(j)); }
 
     //update pipline until number of samlples is reached
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); ++j)
       myEvaluationFilter->Update();
 
     //create line from mean pos to a second point which lies along the sensor (1,0,0 in tool coordinates for aurora)
     mitk::Point3D meanPos = myEvaluationFilter->GetPositionMean(0);
     if (m_scalingfactor != 1)
     {
       meanPos[0] *= m_scalingfactor;
       meanPos[1] *= m_scalingfactor;
       meanPos[2] *= m_scalingfactor;
     }
     mitk::Point3D secondPoint;
     mitk::Point3D thirdPoint;
     mitk::Point3D fourthPoint;
 
     mitk::FillVector3D(secondPoint, 2, 0, 0); //X
     vnl_vector<mitk::ScalarType> secondPointTransformed = myEvaluationFilter->GetQuaternionMean(0).rotation_matrix_transpose().transpose() * secondPoint.GetVnlVector() + meanPos.GetVnlVector();
     mitk::Point3D secondPointTransformedMITK;
     mitk::FillVector3D(secondPointTransformedMITK, secondPointTransformed[0], secondPointTransformed[1], secondPointTransformed[2]);
 
     mitk::FillVector3D(thirdPoint, 0, 4, 0); //Y
     vnl_vector<mitk::ScalarType> thirdPointTransformed = myEvaluationFilter->GetQuaternionMean(0).rotation_matrix_transpose().transpose() * thirdPoint.GetVnlVector() + meanPos.GetVnlVector();
     mitk::Point3D thirdPointTransformedMITK;
     mitk::FillVector3D(thirdPointTransformedMITK, thirdPointTransformed[0], thirdPointTransformed[1], thirdPointTransformed[2]);
 
     mitk::FillVector3D(fourthPoint, 0, 0, 6); //Z
     vnl_vector<mitk::ScalarType> fourthPointTransformed = myEvaluationFilter->GetQuaternionMean(0).rotation_matrix_transpose().transpose() * fourthPoint.GetVnlVector() + meanPos.GetVnlVector();
     mitk::Point3D fourthPointTransformedMITK;
     mitk::FillVector3D(fourthPointTransformedMITK, fourthPointTransformed[0], fourthPointTransformed[1], fourthPointTransformed[2]);
 
     mitk::PointSet::Pointer rotationLine = mitk::PointSet::New();
     rotationLine->InsertPoint(0, secondPointTransformedMITK);
     rotationLine->InsertPoint(1, meanPos);
     rotationLine->InsertPoint(2, thirdPointTransformedMITK);
     rotationLine->InsertPoint(3, meanPos);
     rotationLine->InsertPoint(4, fourthPointTransformedMITK);
 
     mitk::DataNode::Pointer newNode = mitk::DataNode::New();
     QString nodeName = this->m_Controls->m_prefix->text() + "RotationLineNumber" + QString::number(i);
     newNode->SetName(nodeName.toStdString());
     newNode->SetData(rotationLine);
     newNode->SetBoolProperty("show contour", true);
     newNode->SetFloatProperty("pointsize", 0.5);
     this->GetDataStorage()->Add(newNode);
   }
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnGenerateGroundTruthPointSet()
 {
   mitk::PointSet::Pointer generatedPointSet = mitk::PointSet::New();
   int currentPointID = 0;
   mitk::Point3D currentPoint;
   mitk::FillVector3D(currentPoint, 0, 0, 0);
   for (int i = 0; i < m_Controls->m_PointNumber2->value(); i++)
   {
     for (int j = 0; j < m_Controls->m_PointNumber1->value(); j++)
     {
       generatedPointSet->InsertPoint(currentPointID, currentPoint);
       currentPointID++;
       currentPoint[1] += m_Controls->m_PointDistance->value();
     }
     currentPoint[1] = 0;
     currentPoint[2] += m_Controls->m_PointDistance->value();
   }
   mitk::DataNode::Pointer newNode = mitk::DataNode::New();
   QString nodeName = "GroundTruthPointSet_" + QString::number(m_Controls->m_PointNumber1->value()) + "x" + QString::number(m_Controls->m_PointNumber2->value()) + "_(" + QString::number(m_Controls->m_PointDistance->value()) + "mm)";
   newNode->SetName(nodeName.toStdString());
   newNode->SetData(generatedPointSet);
   newNode->SetFloatProperty("pointsize", 5);
   this->GetDataStorage()->Add(newNode);
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnConvertCSVtoXMLFile()
 {
   if (m_Controls->m_ConvertSingleFile->isChecked())
   { //convert one file
     int lines = ConvertOneFile(this->m_Controls->m_InputCSV->text().toStdString(), this->m_Controls->m_OutputXML->text().toStdString());
 
     QString result = "Converted one file with" + QString::number(lines) + " data sets";
     MessageBox(result.toStdString());
   }
   else //converte file list
   {
     if (m_CSVtoXMLInputFilenameVector.empty() || m_CSVtoXMLOutputFilenameVector.empty())
     {
       MessageBox("Error: one list is not loaded!");
       return;
     }
     else if (m_CSVtoXMLInputFilenameVector.size() != m_CSVtoXMLOutputFilenameVector.size())
     {
       MessageBox("Error: lists do not have the same number of files!");
       return;
     }
     for (std::size_t i = 0; i < m_CSVtoXMLInputFilenameVector.size(); ++i)
     {
       ConvertOneFile(m_CSVtoXMLInputFilenameVector.at(i), m_CSVtoXMLOutputFilenameVector.at(i));
     }
     QString result = "Converted " + QString::number(m_CSVtoXMLInputFilenameVector.size()) + " files from file list!";
     MessageBox(result.toStdString());
   }
 }
 
 int QmitkIGTTrackingDataEvaluationView::ConvertOneFile(std::string inputFilename, std::string outputFilename)
 {
   std::vector<mitk::NavigationData::Pointer> myNavigationDatas = GetNavigationDatasFromFile(inputFilename);
   mitk::NavigationDataRecorderDeprecated::Pointer myRecorder = mitk::NavigationDataRecorderDeprecated::New();
   myRecorder->SetFileName(outputFilename.c_str());
   mitk::NavigationData::Pointer input = mitk::NavigationData::New();
   if (m_Controls->m_ConvertCSV->isChecked()) myRecorder->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::csv);
   myRecorder->AddNavigationData(input);
   myRecorder->StartRecording();
   for (std::size_t i = 0; i < myNavigationDatas.size(); ++i)
   {
     input->Graft(myNavigationDatas.at(i));
     myRecorder->Update();
   }
   myRecorder->StopRecording();
   return myNavigationDatas.size();
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnCSVtoXMLLoadInputList()
 {
   //read in filename
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Measurement Filename List"), "/", tr("All Files (*.*)"));
   if (filename.isNull()) return;
 
   m_CSVtoXMLInputFilenameVector = this->GetFileContentLineByLine(filename.toStdString());
 
   m_Controls->m_labelCSVtoXMLInputList->setText("READY");
 }
 
 void QmitkIGTTrackingDataEvaluationView::OnCSVtoXMLLoadOutputList()
 {
   //read in filename
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Measurement Filename List"), "/", tr("All Files (*.*)"));
   if (filename.isNull()) return;
 
   m_CSVtoXMLOutputFilenameVector = this->GetFileContentLineByLine(filename.toStdString());
 
   m_Controls->m_labelCSVtoXMLOutputList->setText("READY");
 }
 
 void QmitkIGTTrackingDataEvaluationView::MessageBox(std::string s)
 {
   QMessageBox msgBox;
   msgBox.setText(s.c_str());
   msgBox.exec();
 }
 
 void QmitkIGTTrackingDataEvaluationView::WriteHeader()
 {
   m_CurrentWriteFile << "Filename;";
   m_CurrentWriteFile << "N;";
   m_CurrentWriteFile << "N_invalid;";
   m_CurrentWriteFile << "Percentage_invalid;";
 
   if (m_Controls->m_settingPosMean->isChecked())
   {
     m_CurrentWriteFile << "Position_Mean[x];";
     m_CurrentWriteFile << "Position_Mean[y];";
     m_CurrentWriteFile << "Position_Mean[z];";
   }
 
   if (m_Controls->m_settingPosStabw->isChecked())
   {
     m_CurrentWriteFile << "Position_StandDev[x];";
     m_CurrentWriteFile << "Position_StandDev[y];";
     m_CurrentWriteFile << "Position_StandDev[z];";
   }
 
   if (m_Controls->m_settingPosSampleStabw->isChecked())
   {
     m_CurrentWriteFile << "Position_SampleStandDev[x];";
     m_CurrentWriteFile << "Position_SampleStandDev[y];";
     m_CurrentWriteFile << "Position_SampleStandDev[z];";
   }
 
   if (m_Controls->m_settingQuaternionMean->isChecked())
   {
     m_CurrentWriteFile << "Quaternion_Mean[qx];";
     m_CurrentWriteFile << "Quaternion_Mean[qy];";
     m_CurrentWriteFile << "Quaternion_Mean[qz];";
     m_CurrentWriteFile << "Quaternion_Mean[qr];";
   }
 
   if (m_Controls->m_settionQuaternionStabw->isChecked())
   {
     m_CurrentWriteFile << "Quaternion_StandDev[qx];";
     m_CurrentWriteFile << "Quaternion_StandDev[qy];";
     m_CurrentWriteFile << "Quaternion_StandDev[qz];";
     m_CurrentWriteFile << "Quaternion_StandDev[qr];";
   }
 
   if (m_Controls->m_settingPosErrorMean->isChecked()) m_CurrentWriteFile << "PositionError_Mean;";
 
   if (m_Controls->m_settingPosErrorStabw->isChecked()) m_CurrentWriteFile << "PositionError_StandDev;";
 
   if (m_Controls->m_settingPosErrorSampleStabw->isChecked()) m_CurrentWriteFile << "PositionError_SampleStandDev;";
 
   if (m_Controls->m_settingPosErrorRMS->isChecked()) m_CurrentWriteFile << "PositionError_RMS;";
 
   if (m_Controls->m_settingPosErrorMedian->isChecked()) m_CurrentWriteFile << "PositionError_Median;";
 
   if (m_Controls->m_settingPosErrorMinMax->isChecked())
   {
     m_CurrentWriteFile << "PositionError_Max;";
     m_CurrentWriteFile << "PositionError_Min;";
   }
 
   if (m_Controls->m_settingEulerMean->isChecked())
   {
     m_CurrentWriteFile << "Euler_tx;";
     m_CurrentWriteFile << "Euler_ty;";
     m_CurrentWriteFile << "Euler_tz;";
   }
 
   if (m_Controls->m_settingEulerRMS->isChecked())
   {
     m_CurrentWriteFile << "EulerErrorRMS (rad);";
     m_CurrentWriteFile << "EulerErrorRMS (grad);";
   }
 
   m_CurrentWriteFile << "\n";
 }
 
 void QmitkIGTTrackingDataEvaluationView::WriteDataSet(mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter, std::string dataSetName)
 {
   if (myEvaluationFilter->GetNumberOfOutputs() == 0) m_CurrentWriteFile << "Error: no input \n";
   else
   {
     m_CurrentWriteFile << dataSetName << ";";
     m_CurrentWriteFile << myEvaluationFilter->GetNumberOfAnalysedNavigationData(0) << ";";
     m_CurrentWriteFile << myEvaluationFilter->GetNumberOfInvalidSamples(0) << ";";
     m_CurrentWriteFile << myEvaluationFilter->GetPercentageOfInvalidSamples(0) << ";";
 
     if (m_Controls->m_settingPosMean->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetPositionMean(0)[0] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionMean(0)[1] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionMean(0)[2] << ";";
     }
 
     if (m_Controls->m_settingPosStabw->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetPositionStandardDeviation(0)[0] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionStandardDeviation(0)[1] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionStandardDeviation(0)[2] << ";";
     }
 
     if (m_Controls->m_settingPosSampleStabw->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetPositionSampleStandardDeviation(0)[0] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionSampleStandardDeviation(0)[1] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionSampleStandardDeviation(0)[2] << ";";
     }
 
     if (m_Controls->m_settingQuaternionMean->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionMean(0).x() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionMean(0).y() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionMean(0).z() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionMean(0).r() << ";";
     }
 
     if (m_Controls->m_settionQuaternionStabw->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionStandardDeviation(0).x() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionStandardDeviation(0).y() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionStandardDeviation(0).z() << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetQuaternionStandardDeviation(0).r() << ";";
     }
 
     if (m_Controls->m_settingPosErrorMean->isChecked()) m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorMean(0) << ";";
     if (m_Controls->m_settingPosErrorStabw->isChecked()) m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorStandardDeviation(0) << ";";
     if (m_Controls->m_settingPosErrorSampleStabw->isChecked()) m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorSampleStandardDeviation(0) << ";";
     if (m_Controls->m_settingPosErrorRMS->isChecked()) m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorRMS(0) << ";";
     if (m_Controls->m_settingPosErrorMedian->isChecked()) m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorMedian(0) << ";";
     if (m_Controls->m_settingPosErrorMinMax->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorMax(0) << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetPositionErrorMin(0) << ";";
     }
 
     if (m_Controls->m_settingEulerMean->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetEulerAnglesMean(0)[0] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetEulerAnglesMean(0)[1] << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetEulerAnglesMean(0)[2] << ";";
     }
 
     if (m_Controls->m_settingEulerRMS->isChecked())
     {
       m_CurrentWriteFile << myEvaluationFilter->GetEulerAnglesRMS(0) << ";";
       m_CurrentWriteFile << myEvaluationFilter->GetEulerAnglesRMSDegree(0) << ";";
     }
 
     m_CurrentWriteFile << "\n";
   }
 }
 
 
 std::vector<mitk::Quaternion> QmitkIGTTrackingDataEvaluationView::GetMeanOrientationsOfAllData(std::vector<mitk::NavigationDataEvaluationFilter::Pointer> allData, bool useSLERP)
 {
   std::vector<mitk::Quaternion> returnValue;
 
   for (auto dataSet : allData)
   {
     if (useSLERP) returnValue.push_back(GetSLERPAverage(dataSet));
     else returnValue.push_back(dataSet->GetQuaternionMean(0));
   }
 
   return returnValue;
 }
 
 
 std::vector<mitk::NavigationDataEvaluationFilter::Pointer> QmitkIGTTrackingDataEvaluationView::GetAllDataFromUIList()
 {
   std::vector<mitk::NavigationDataEvaluationFilter::Pointer> EvaluationDataCollection;
 
   //start loop and iterate through all files of list: store the evaluation data
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     //create navigation data player
     mitk::NavigationDataCSVSequentialPlayer::Pointer myPlayer = ConstructNewNavigationDataPlayer();
     myPlayer->SetFiletype(mitk::NavigationDataCSVSequentialPlayer::ManualLoggingCSV);
     myPlayer->SetFileName(m_FilenameVector.at(i));
 
     //create evaluation filter
     mitk::NavigationDataEvaluationFilter::Pointer myEvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 
     //connect pipeline
     for (unsigned int j = 0; j < myPlayer->GetNumberOfOutputs(); ++j)
       myEvaluationFilter->SetInput(j, myPlayer->GetOutput(j));
 
     //update pipline until number of samlples is reached
     for (int j = 0; j < m_Controls->m_NumberOfSamples->value(); ++j)
       myEvaluationFilter->Update();
 
     myEvaluationFilter->SetInput(nullptr);
     myPlayer = nullptr;
     EvaluationDataCollection.push_back(myEvaluationFilter);
   }
 
   return EvaluationDataCollection;
 }
 
 void QmitkIGTTrackingDataEvaluationView::CalculateDifferenceAngles()
 {
   //Get all data from UI
   std::vector<mitk::NavigationDataEvaluationFilter::Pointer> EvaluationDataCollection = GetAllDataFromUIList();
 
   //calculation and writing of output data
   //open output file
   m_CurrentAngleDifferencesWriteFile.open(std::string((m_Controls->m_OutputFilename->text() + ".angledifferences.csv").toUtf8()).c_str(), std::ios::out);
   if (m_CurrentAngleDifferencesWriteFile.bad())
   {
     MessageBox("Error: Can't open output file for angle differences calculation!");
     return;
   }
   //write header
   WriteDifferenceAnglesHeader();
   //compute angle differences
   QString pos1 = "invalid";
   QString pos2 = "invalid";
   //now iterate through all evaluation data and calculate the angles
   for (std::size_t i = 0; i < m_FilenameVector.size(); ++i)
   {
     pos1 = QString::fromStdString(itksys::SystemTools::GetFilenameWithoutLastExtension(m_FilenameVector.at(i)));
     for (std::size_t j = 0; j < m_FilenameVector.size(); ++j)
     {
       pos2 = QString::fromStdString(itksys::SystemTools::GetFilenameWithoutLastExtension(m_FilenameVector.at(j)));
 
       mitk::Quaternion q1;
       mitk::Quaternion q2;
 
       if (m_Controls->m_DifferencesSLERP->isChecked())
       {
         //compute slerp average
         q1 = GetSLERPAverage(EvaluationDataCollection.at(i));
         q2 = GetSLERPAverage(EvaluationDataCollection.at(j));
       }
       else
       {
         //compute arithmetic average
         q1 = EvaluationDataCollection.at(i)->GetQuaternionMean(0);
         q2 = EvaluationDataCollection.at(j)->GetQuaternionMean(0);
       }
 
       itk::Vector<double> rotationVec;
       //adapt for Aurora 5D tools: [0,0,1000]
       rotationVec[0] = 10000; //X
       rotationVec[1] = 0; //Y
       rotationVec[2] = 0; //Z
       double AngleBetweenTwoQuaternions = mitk::StaticIGTHelperFunctions::GetAngleBetweenTwoQuaterions(q1, q2, rotationVec);
 
       //write data set
       WriteDifferenceAnglesDataSet(pos1.toStdString(), pos2.toStdString(), i, j, AngleBetweenTwoQuaternions);
     }
   }
 
   //close output file
   m_CurrentAngleDifferencesWriteFile.close();
 }
 
 void QmitkIGTTrackingDataEvaluationView::WriteDifferenceAnglesHeader()
 {
   m_CurrentAngleDifferencesWriteFile << "Name;Idx1;Idx2;Angle [Degree]\n";
 }
 
 void QmitkIGTTrackingDataEvaluationView::WriteDifferenceAnglesDataSet(std::string pos1, std::string pos2, int idx1, int idx2, double angle)
 {
   m_CurrentAngleDifferencesWriteFile << "Angle between " << pos1 << " and " << pos2 << ";" << idx1 << ";" << idx2 << ";" << angle << "\n";
   MITK_INFO << "Angle: " << angle;
 }
 
 std::vector<mitk::NavigationData::Pointer> QmitkIGTTrackingDataEvaluationView::GetNavigationDatasFromFile(std::string filename)
 {
   std::vector<mitk::NavigationData::Pointer> returnValue = std::vector<mitk::NavigationData::Pointer>();
   std::vector<std::string> fileContentLineByLine = GetFileContentLineByLine(filename);
   for (std::size_t i = 1; i < fileContentLineByLine.size(); ++i) //skip header so start at 1
   {
     returnValue.push_back(GetNavigationDataOutOfOneLine(fileContentLineByLine.at(i)));
   }
 
   return returnValue;
 }
 
 std::vector<std::string> QmitkIGTTrackingDataEvaluationView::GetFileContentLineByLine(std::string filename)
 {
   std::vector<std::string> readData = std::vector<std::string>();
 
   //save old locale
   char * oldLocale;
   oldLocale = setlocale(LC_ALL, nullptr);
 
   //define own locale
   std::locale C("C");
   setlocale(LC_ALL, "C");
 
   //read file
   std::ifstream file;
   file.open(filename.c_str(), std::ios::in);
   if (file.good())
   {
     //read out file
     file.seekg(0L, std::ios::beg);  // move to begin of file
     while (!file.eof())
     {
       std::string buffer;
       std::getline(file, buffer);    // read out file line by line
       if (buffer.size() > 0) readData.push_back(buffer);
     }
   }
 
   file.close();
 
   //switch back to old locale
   setlocale(LC_ALL, oldLocale);
 
   return readData;
 }
 
 mitk::NavigationData::Pointer QmitkIGTTrackingDataEvaluationView::GetNavigationDataOutOfOneLine(std::string line)
 {
   mitk::NavigationData::Pointer returnValue = mitk::NavigationData::New();
 
   QString myLine = QString(line.c_str());
 
   QStringList myLineList = myLine.split(';');
 
   mitk::Point3D position;
   mitk::Quaternion orientation;
 
   bool valid = false;
   if (myLineList.at(2).toStdString() == "1") valid = true;
 
   position[0] = myLineList.at(3).toDouble();
   position[1] = myLineList.at(4).toDouble();
   position[2] = myLineList.at(5).toDouble();
 
   orientation[0] = myLineList.at(6).toDouble();
   orientation[1] = myLineList.at(7).toDouble();
   orientation[2] = myLineList.at(8).toDouble();
   orientation[3] = myLineList.at(9).toDouble();
 
   returnValue->SetDataValid(valid);
   returnValue->SetPosition(position);
   returnValue->SetOrientation(orientation);
 
   return returnValue;
 }
 
 mitk::Quaternion QmitkIGTTrackingDataEvaluationView::GetSLERPAverage(mitk::NavigationDataEvaluationFilter::Pointer evaluationFilter)
 {
   mitk::Quaternion average;
 
-  //build a vector of quaternions from the evaulation filter (caution always takes the first (0) input of the filter
+  //build a vector of quaternions from the evaluation filter (caution always takes the first (0) input of the filter
   std::vector<mitk::Quaternion> quaternions = std::vector<mitk::Quaternion>();
   for (int i = 0; i < evaluationFilter->GetNumberOfAnalysedNavigationData(0); i++)
   {
     mitk::Quaternion currentq = evaluationFilter->GetLoggedOrientation(i, 0);
 
     quaternions.push_back(currentq);
   }
 
   //compute the slerp average using the quaternion averaging class
   mitk::QuaternionAveraging::Pointer myAverager = mitk::QuaternionAveraging::New();
   average = myAverager->CalcAverage(quaternions);
 
   return average;
 }
 
 void QmitkIGTTrackingDataEvaluationView::writeToFile(std::string filename, std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> values)
 {
   std::fstream currentFile;
   currentFile.open(filename.c_str(), std::ios::out);
   if (currentFile.bad()) { MITK_WARN << "Cannot open file, aborting!"; return; }
   currentFile << "Description" << ";" << "Error[mm]" << "\n";
   for (auto currentError : values)
   {
     currentFile << currentError.description << ";" << currentError.distanceError << "\n";
   }
   currentFile.close();
 }
 
 mitk::NavigationDataCSVSequentialPlayer::Pointer QmitkIGTTrackingDataEvaluationView::ConstructNewNavigationDataPlayer()
 {
     bool rightHanded = m_Controls->m_RigthHanded->isChecked();
     QString separator =  m_Controls->m_SeparatorSign->text();
     QChar sepaSign = separator.at(0);
     //char separatorSign;
     char separatorSign = sepaSign.toLatin1();
     //std::string separatorSign = m_Controls->m_SeparatorSign->text().toStdString();
     int sampleCount = m_Controls->m_SampleCount->value();
     bool headerRow = m_Controls->m_HeaderRow->isChecked();
     int xPos = m_Controls->m_XPos->value();
     int yPos = m_Controls->m_YPos->value();
     int zPos = m_Controls->m_ZPos->value();
     bool useQuats = m_Controls->m_UseQuats->isChecked();
     int qx = m_Controls->m_Qx->value();
     int qy = m_Controls->m_Qy->value();
     int qz = m_Controls->m_Qz->value();
     int qr = m_Controls->m_Qr->value();
     int azimuth = m_Controls->m_Azimuth->value();
     int elevation = m_Controls->m_Elevation->value();
     int roll = m_Controls->m_Roll->value();
     bool eulersInRad = m_Controls->m_Radiants->isChecked();
     //need to find the biggest column number to determine the  minimal number of columns the .csv file has to have
     int allInts[] = {xPos, yPos, zPos, qx, qy, qr, azimuth, elevation, roll};
     int minNumberOfColumns = (*std::max_element(allInts, allInts+9)+1); //size needs to be +1 because columns start at 0 but size at 1
 
     mitk::NavigationDataCSVSequentialPlayer::Pointer navDataPlayer = mitk::NavigationDataCSVSequentialPlayer::New();
     navDataPlayer->SetOptions(rightHanded, separatorSign, sampleCount, headerRow, xPos, yPos, zPos, useQuats,
                               qx, qy, qz, qr, azimuth, elevation, roll, eulersInRad, minNumberOfColumns);
     return navDataPlayer;
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h
index 634b99190e..0c9453a938 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.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 QmitkIGTTrackingDataEvaluationView_h
 #define QmitkIGTTrackingDataEvaluationView_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include "ui_QmitkIGTTrackingDataEvaluationViewControls.h"
 #include "mitkHummelProtocolEvaluation.h"
 
 #include <mitkNavigationDataEvaluationFilter.h>
 #include "mitkNavigationDataCSVSequentialPlayer.h"
 
 /*!
   \brief QmitkIGTTrackingDataEvaluationView
 
   \warning  This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
 
 */
 class QmitkIGTTrackingDataEvaluationView : public QmitkAbstractView
 {
   Q_OBJECT
 
   public:
 
     static const std::string VIEW_ID;
 
     QmitkIGTTrackingDataEvaluationView();
     ~QmitkIGTTrackingDataEvaluationView() override;
 
     void CreateQtPartControl(QWidget *parent) override;
     void SetFocus() override {}
 
   protected slots:
 
     void OnLoadFileList();
     void OnAddToCurrentList();
     void OnEvaluateData();
     void OnEvaluateDataAll();
     void OnGeneratePointSet();
     void OnGeneratePointSetsOfSinglePositions();
     void OnGenerateRotationLines();
     void OnGenerateGroundTruthPointSet();
     void OnConvertCSVtoXMLFile();
     void OnCSVtoXMLLoadInputList();
     void OnCSVtoXMLLoadOutputList();
     void OnPerfomGridMatching();
     void OnComputeRotation();
 
-    /** Reads in exactly three position files als reference. */
+    /** Reads in exactly three position files as reference. */
     void OnOrientationCalculation_CalcRef();
-    /** Uses always three positions (1,2,3: first orientation; 4,5,6: second orientation; and so on) in every file to calcualte a orientation. */
+    /** Uses always three positions (1,2,3: first orientation; 4,5,6: second orientation; and so on) in every file to calculate a orientation. */
     void OnOrientationCalculation_CalcOrientandWriteToFile();
 
 
   protected:
 
     Ui::QmitkIGTTrackingDataEvaluationViewControls* m_Controls;
 
     std::vector<std::string> m_FilenameVector;
 
     void MessageBox(std::string s);
 
     std::fstream m_CurrentWriteFile;
     void WriteHeader();
     void WriteDataSet(mitk::NavigationDataEvaluationFilter::Pointer evaluationFilter, std::string dataSetName);
 
     //members for orientation calculation
     mitk::Point3D m_RefPoint1;
     mitk::Point3D m_RefPoint2;
     mitk::Point3D m_RefPoint3;
 
     double m_scalingfactor; //scaling factor for visualization, 1 by default
 
-    //angle diffrences: seperated file
+    //angle differences: separated file
     std::fstream m_CurrentAngleDifferencesWriteFile;
     void CalculateDifferenceAngles();
     void WriteDifferenceAnglesHeader();
     void WriteDifferenceAnglesDataSet(std::string pos1, std::string pos2, int idx1, int idx2, double angle);
 
     void writeToFile(std::string filename, std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> values);
 
     //different help methods to read a csv logging file
     std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
     std::vector<std::string> GetFileContentLineByLine(std::string filename);
     mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
 
     //help method to sonstruct the NavigationDataCSVSequentialPlayer filled with all the options from the UI
     mitk::NavigationDataCSVSequentialPlayer::Pointer ConstructNewNavigationDataPlayer();
 
     //CSV to XML members
     std::vector<std::string> m_CSVtoXMLInputFilenameVector;
     std::vector<std::string> m_CSVtoXMLOutputFilenameVector;
 
     //returns the number of converted lines
     int ConvertOneFile(std::string inputFilename, std::string outputFilename);
 
     /** @brief calculates the angle in the plane perpendicular to the rotation axis of the two quaterions. */
     double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b);
 
     /** @brief calculates the slerp average of a set of quaternions which is stored in the navigation data evaluation filter */
     mitk::Quaternion GetSLERPAverage(mitk::NavigationDataEvaluationFilter::Pointer);
 
     /** @brief Stores the mean positions of all evaluated data */
     mitk::PointSet::Pointer m_PointSetMeanPositions;
 
     /** @return returns the mean orientation of all given data */
     std::vector<mitk::Quaternion> GetMeanOrientationsOfAllData(std::vector<mitk::NavigationDataEvaluationFilter::Pointer> allData, bool useSLERP = false);
 
     /** @return returns all data read from the data list as NavigationDataEvaluationFilters */
     std::vector<mitk::NavigationDataEvaluationFilter::Pointer> GetAllDataFromUIList();
 };
 
 
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationViewControls.ui b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationViewControls.ui
index 2dd08f80f3..05b3634caa 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationViewControls.ui
@@ -1,1780 +1,1780 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkIGTTrackingDataEvaluationViewControls</class>
  <widget class="QWidget" name="QmitkIGTTrackingDataEvaluationViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>448</width>
     <height>955</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_2">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="tab">
       <attribute name="title">
        <string>Evaluation</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout">
        <item>
         <widget class="QLabel" name="label">
          <property name="text">
           <string>Input File List (recorded NavigationData / *.csv):</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QListWidget" name="m_FileList"/>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout">
          <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="QPushButton" name="m_LoadInputFileList">
            <property name="minimumSize">
             <size>
              <width>120</width>
              <height>0</height>
             </size>
            </property>
            <property name="text">
             <string>Load New List</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_6">
          <item>
           <spacer name="horizontalSpacer_4">
            <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="QPushButton" name="m_AddToCurrentList">
            <property name="minimumSize">
             <size>
              <width>120</width>
              <height>0</height>
             </size>
            </property>
            <property name="text">
             <string>Add To Current List</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <widget class="Line" name="line_3">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_17">
          <property name="text">
           <string>(1) - VISUALIZATION - of all data sets:</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_17">
          <item>
           <widget class="QLabel" name="label_18">
            <property name="text">
             <string>Prefix for Data Nodes:</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QLineEdit" name="m_prefix"/>
          </item>
         </layout>
        </item>
        <item>
         <widget class="QPushButton" name="m_GeneratePointSetOfMeanPositions">
          <property name="text">
           <string>Generate PointSet of Mean Positions</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="m_GeneratePointSetsOfSinglePositions">
          <property name="text">
           <string>Generate PointSets of Single Positions</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="m_GenerateRotationLines">
          <property name="text">
           <string>Generate Lines for Rotation</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="Line" name="line_4">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_19">
          <property name="text">
           <string>(3) - JITTER - Evaluation per file / data set:</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Result CSV Filename:</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QLineEdit" name="m_OutputFilename">
            <property name="text">
             <string>D:/tmp/output.csv</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_3">
          <item>
           <spacer name="horizontalSpacer_2">
            <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="QPushButton" name="m_StartEvaluation">
            <property name="minimumSize">
             <size>
              <width>220</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
              <width>200</width>
              <height>50</height>
             </size>
            </property>
            <property name="text">
             <string>COMPUTE RESULTS PER DATA SET</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_3">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
              <width>40</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <widget class="Line" name="line_5">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_20">
          <property name="text">
           <string>(3) - ACCURACY - Evaluation of all data sets:</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_16">
          <item>
           <spacer name="horizontalSpacer_16">
            <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="QPushButton" name="m_StartEvaluationAll">
            <property name="minimumSize">
             <size>
              <width>220</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
              <width>200</width>
              <height>50</height>
             </size>
            </property>
            <property name="text">
             <string>COMPUTE RESULTS OF ALL DATA</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_17">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
              <width>40</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <widget class="Line" name="line_6">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_21">
          <property name="text">
           <string>(4) - GRID MATCHING - Evaluation of all data sets:</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_19">
          <item>
           <widget class="QLabel" name="label_22">
            <property name="text">
             <string>Reference PointSet:</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_20">
            <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="QmitkDataStorageComboBox" name="m_ReferencePointSetComboBox">
            <property name="minimumSize">
             <size>
              <width>150</width>
              <height>0</height>
             </size>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_20">
          <item>
           <widget class="QLabel" name="label_23">
            <property name="text">
             <string>Measurement PointSet:</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_21">
            <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="QmitkDataStorageComboBox" name="m_MeasurementPointSetComboBox">
            <property name="minimumSize">
             <size>
              <width>150</width>
              <height>0</height>
             </size>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_18">
          <item>
           <spacer name="horizontalSpacer_18">
            <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="QPushButton" name="m_GridMatching">
            <property name="minimumSize">
             <size>
              <width>220</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
              <width>200</width>
              <height>50</height>
             </size>
            </property>
            <property name="text">
-            <string>PERFOM GRID MATCHING</string>
+            <string>PERFORM GRID MATCHING</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_19">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
              <width>40</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <widget class="Line" name="line_7">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_24">
          <property name="text">
           <string>(5) - ROTATION - Evaluation of all data sets:</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_21">
          <item>
           <spacer name="horizontalSpacer_22">
            <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="QPushButton" name="m_ComputeRotation">
            <property name="minimumSize">
             <size>
              <width>220</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
              <width>200</width>
              <height>50</height>
             </size>
            </property>
            <property name="text">
             <string>COMPUTE ROTATION ERRORS</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_23">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
              <width>40</width>
              <height>20</height>
             </size>
            </property>
           </spacer>
          </item>
         </layout>
        </item>
        <item>
         <spacer name="spacer1">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeType">
           <enum>QSizePolicy::Expanding</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>220</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab_2">
       <attribute name="title">
        <string>Settings</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_5">
        <item row="0" column="0">
         <widget class="QToolBox" name="toolBox">
          <widget class="QWidget" name="page_5">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>409</width>
             <height>768</height>
            </rect>
           </property>
           <attribute name="label">
            <string>General</string>
           </attribute>
           <layout class="QVBoxLayout" name="verticalLayout_4">
            <item>
             <widget class="QGroupBox" name="GeneralOptions">
              <property name="title">
               <string/>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_5">
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_5">
                 <item>
                  <widget class="QLabel" name="label_16">
                   <property name="text">
                    <string>Scaling Factor for Visualization:</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_15">
                   <property name="orientation">
                    <enum>Qt::Horizontal</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                    <size>
                     <width>38</width>
                     <height>20</height>
                    </size>
                   </property>
                  </spacer>
                 </item>
                 <item>
                  <widget class="QDoubleSpinBox" name="m_ScalingFactor">
                   <property name="minimum">
                    <double>1.000000000000000</double>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_4">
                 <item>
                  <widget class="QLabel" name="label_3">
                   <property name="text">
                    <string>Number of samples to analyze:</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_5">
                   <property name="orientation">
                    <enum>Qt::Horizontal</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                    <size>
                     <width>60</width>
                     <height>20</height>
                    </size>
                   </property>
                  </spacer>
                 </item>
                 <item>
                  <widget class="QSpinBox" name="m_NumberOfSamples">
                   <property name="maximum">
                    <number>1000000</number>
                   </property>
                   <property name="value">
                    <number>150</number>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <widget class="Line" name="line_8">
                 <property name="orientation">
                  <enum>Qt::Horizontal</enum>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QLabel" name="label_15">
                 <property name="text">
                  <string>Tracking Volume:</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QRadioButton" name="m_standardVolume">
                 <property name="text">
                  <string>Standard Volume (10 X 9 Positions)</string>
                 </property>
                 <property name="checked">
                  <bool>true</bool>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QRadioButton" name="m_mediumVolume">
                 <property name="text">
                  <string>Medium Volume (5 X 5 Positions)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QRadioButton" name="m_smallVolume">
                 <property name="text">
                  <string>Small Volume (3 X 4 Positions)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="Line" name="line_9">
                 <property name="orientation">
                  <enum>Qt::Horizontal</enum>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QLabel" name="label_40">
                 <property name="text">
                  <string>Rotation Evaluation:</string>
                 </property>
                </widget>
               </item>
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_26">
                 <item>
                  <widget class="QLabel" name="label_41">
                   <property name="text">
                    <string>Rotation Vector:</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_28">
                   <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="label_42">
                   <property name="text">
                    <string>X</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <widget class="QSpinBox" name="m_rotVecX">
                   <property name="maximum">
                    <number>99999</number>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_27">
                   <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="label_43">
                   <property name="text">
                    <string>Y</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <widget class="QSpinBox" name="m_rotVecY">
                   <property name="maximum">
                    <number>99999</number>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_26">
                   <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="label_44">
                   <property name="text">
                    <string>Z</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <widget class="QSpinBox" name="m_rotVecZ">
                   <property name="maximum">
                    <number>99999</number>
                   </property>
                   <property name="value">
                    <number>10000</number>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <spacer name="verticalSpacer">
                 <property name="orientation">
                  <enum>Qt::Vertical</enum>
                 </property>
                 <property name="sizeHint" stdset="0">
                  <size>
                   <width>20</width>
                   <height>40</height>
                  </size>
                 </property>
                </spacer>
               </item>
              </layout>
             </widget>
            </item>
           </layout>
          </widget>
          <widget class="QWidget" name="page">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>286</width>
             <height>746</height>
            </rect>
           </property>
           <attribute name="label">
            <string>.csv file input options</string>
           </attribute>
           <layout class="QVBoxLayout" name="verticalLayout_13">
            <item>
             <widget class="QGroupBox" name="m_FileOptionsBox">
              <property name="title">
               <string>File Options:</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_12">
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_23">
                 <item>
                  <widget class="QLabel" name="label_26">
                   <property name="text">
                    <string>Separator in the csv file: </string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_25">
                   <property name="orientation">
                    <enum>Qt::Horizontal</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                    <size>
                     <width>60</width>
                     <height>20</height>
                    </size>
                   </property>
                  </spacer>
                 </item>
                 <item>
                  <widget class="QLineEdit" name="m_SeparatorSign">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                     <horstretch>0</horstretch>
                     <verstretch>0</verstretch>
                    </sizepolicy>
                   </property>
                   <property name="maximumSize">
                    <size>
                     <width>40</width>
                     <height>16777215</height>
                    </size>
                   </property>
                   <property name="text">
                    <string>;</string>
                   </property>
                   <property name="maxLength">
                    <number>1</number>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_25">
                 <item>
                  <widget class="QLabel" name="label_25">
                   <property name="text">
-                   <string>Use every n-th smaple n:</string>
+                   <string>Use every n-th sample n:</string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <spacer name="horizontalSpacer_24">
                   <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="QSpinBox" name="m_SampleCount">
                   <property name="value">
                    <number>1</number>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <widget class="QCheckBox" name="m_HeaderRow">
                 <property name="text">
                  <string>The csv file has a header row</string>
                 </property>
                 <property name="checked">
                  <bool>true</bool>
                 </property>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="CoordinateType">
              <property name="title">
               <string>Type of Coordinate System:</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_19">
               <item>
                <layout class="QHBoxLayout" name="horizontalLayout_24">
                 <item>
                  <widget class="QRadioButton" name="m_LeftHanded">
                   <property name="text">
                    <string>Left handed </string>
                   </property>
                  </widget>
                 </item>
                 <item>
                  <widget class="QRadioButton" name="m_RigthHanded">
                   <property name="text">
                    <string>Right handed</string>
                   </property>
                   <property name="checked">
                    <bool>true</bool>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
              </layout>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="PositionAndOrientationOptions">
              <property name="title">
               <string>Position and Orientation Options:</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_11">
               <item>
                <layout class="QGridLayout" name="gridLayout">
                 <item row="2" column="0">
                  <widget class="QLabel" name="label_28">
                   <property name="text">
                    <string>Y</string>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="1">
                  <widget class="QSpinBox" name="m_YPos">
                   <property name="value">
                    <number>4</number>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QLabel" name="label_29">
                   <property name="text">
                    <string>Z</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="1">
                  <widget class="QSpinBox" name="m_ZPos">
                   <property name="value">
                    <number>5</number>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="0">
                  <widget class="QLabel" name="label_27">
                   <property name="text">
                    <string>X</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
                  <widget class="QSpinBox" name="m_XPos">
                   <property name="value">
                    <number>3</number>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="0">
                  <widget class="QLabel" name="label_4">
                   <property name="text">
                    <string>Coordinate:</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="1">
                  <widget class="QLabel" name="label_5">
                   <property name="text">
-                   <string>Colum number:</string>
+                   <string>Column number:</string>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <widget class="QRadioButton" name="m_UseQuats">
                 <property name="text">
                  <string>Use Quaternions for Orientation</string>
                 </property>
                 <property name="checked">
                  <bool>true</bool>
                 </property>
                </widget>
               </item>
               <item>
                <layout class="QGridLayout" name="gridLayout_2">
                 <item row="4" column="0">
                  <widget class="QLabel" name="label_35">
                   <property name="text">
                    <string>Qr</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="1">
                  <widget class="QSpinBox" name="m_Qz">
                   <property name="value">
                    <number>8</number>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="0">
                  <widget class="QLabel" name="label_33">
                   <property name="text">
                    <string>Qy</string>
                   </property>
                  </widget>
                 </item>
                 <item row="4" column="1">
                  <widget class="QSpinBox" name="m_Qr">
                   <property name="value">
                    <number>9</number>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="1">
                  <widget class="QSpinBox" name="m_Qy">
                   <property name="value">
                    <number>7</number>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
                  <widget class="QSpinBox" name="m_Qx">
                   <property name="value">
                    <number>6</number>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="0">
                  <widget class="QLabel" name="label_32">
                   <property name="text">
                    <string>Qx</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QLabel" name="label_34">
                   <property name="text">
                    <string>Qz</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="0">
                  <widget class="QLabel" name="label_6">
                   <property name="text">
                    <string>Quaternion component:</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="1">
                  <widget class="QLabel" name="label_36">
                   <property name="text">
                    <string>Column number:</string>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <widget class="QRadioButton" name="m_UseEuler">
                 <property name="text">
                  <string>Use Euler Angles for Orientation</string>
                 </property>
                </widget>
               </item>
               <item>
                <layout class="QGridLayout" name="gridLayout_3">
                 <item row="0" column="1">
                  <widget class="QLabel" name="label_30">
                   <property name="text">
                    <string>Column number:</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="0">
                  <widget class="QLabel" name="label_37">
                   <property name="text">
                    <string>Azimuth</string>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="1">
                  <widget class="QSpinBox" name="m_Elevation">
                   <property name="minimum">
                    <number>-1</number>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QLabel" name="label_39">
                   <property name="text">
                    <string>Roll</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="0">
                  <widget class="QLabel" name="label_7">
                   <property name="text">
                    <string>Angle:</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="1">
                  <widget class="QSpinBox" name="m_Roll">
                   <property name="minimum">
                    <number>-1</number>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="0">
                  <widget class="QLabel" name="label_38">
                   <property name="text">
                    <string>Elevation</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
                  <widget class="QSpinBox" name="m_Azimuth">
                   <property name="minimum">
                    <number>-1</number>
                   </property>
                  </widget>
                 </item>
                </layout>
               </item>
               <item>
                <widget class="QWidget" name="EulerUnity" native="true">
                 <layout class="QVBoxLayout" name="verticalLayout_18">
                  <item>
                   <widget class="QLabel" name="label_31">
                    <property name="text">
                     <string>Unity for Euler Angles:</string>
                    </property>
                   </widget>
                  </item>
                  <item>
                   <layout class="QHBoxLayout" name="horizontalLayout_22">
                    <item>
                     <widget class="QRadioButton" name="m_Radiants">
                      <property name="text">
                       <string>Radiants</string>
                      </property>
                      <property name="checked">
                       <bool>true</bool>
                      </property>
                     </widget>
                    </item>
                    <item>
                     <widget class="QRadioButton" name="m_Degrees">
                      <property name="text">
                       <string>Degrees</string>
                      </property>
                      <property name="checked">
                       <bool>false</bool>
                      </property>
                     </widget>
                    </item>
                   </layout>
                  </item>
                 </layout>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
           </layout>
          </widget>
          <widget class="QWidget" name="toolBoxPage1">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>343</width>
             <height>607</height>
            </rect>
           </property>
           <attribute name="label">
            <string>Output per data set</string>
           </attribute>
           <layout class="QVBoxLayout" name="verticalLayout_17">
            <item>
             <widget class="QGroupBox" name="groupBox">
              <property name="title">
               <string>Position</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_14">
               <item>
                <widget class="QCheckBox" name="m_settingPosMean">
                 <property name="text">
                  <string>Mean (x,y,z)</string>
                 </property>
                 <property name="checked">
                  <bool>true</bool>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosStabw">
                 <property name="text">
                  <string>Standard Deviation (x,y,z)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosSampleStabw">
                 <property name="text">
                  <string>Sample Standard Deviation (x,y,z)</string>
                 </property>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_6">
              <property name="title">
               <string>Orientation</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_3">
               <item>
                <widget class="QCheckBox" name="m_settingQuaternionMean">
                 <property name="text">
                  <string>Quaternion Mean (qx,qy,qz,qr)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_QuaternionMeanSlerp">
                 <property name="text">
                  <string>Quaternion Mean (SLERP)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settionQuaternionStabw">
                 <property name="text">
                  <string>Quaternion Standard Deviation (qx,qy,qz,qr)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingEulerMean">
                 <property name="text">
                  <string>Euler Mean (tx,ty,tz)</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingDifferenceAngles">
                 <property name="text">
                  <string>Difference Angles to all other Positions</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_DifferencesSLERP">
                 <property name="text">
                  <string>Difference Angles to all other Positions (SLERP)</string>
                 </property>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_7">
              <property name="title">
               <string>Position Error</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_15">
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorMean">
                 <property name="text">
                  <string>Mean</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorStabw">
                 <property name="text">
                  <string>Standard Deviation</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorSampleStabw">
                 <property name="text">
                  <string>Sample Standard Deviation</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorRMS">
                 <property name="text">
                  <string>RMS</string>
                 </property>
                 <property name="checked">
                  <bool>true</bool>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorMedian">
                 <property name="text">
                  <string>Median</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="QCheckBox" name="m_settingPosErrorMinMax">
                 <property name="text">
                  <string>Min/Max</string>
                 </property>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_8">
              <property name="title">
               <string>Orientation Error</string>
              </property>
              <layout class="QVBoxLayout" name="verticalLayout_16">
               <item>
                <widget class="QCheckBox" name="m_settingEulerRMS">
                 <property name="text">
                  <string>Euler RMS</string>
                 </property>
                </widget>
               </item>
              </layout>
             </widget>
            </item>
           </layout>
          </widget>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab_3">
       <attribute name="title">
        <string>Tools</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_10">
        <item>
         <widget class="QGroupBox" name="groupBox_2">
          <property name="title">
           <string>Point Set Ground Truth Generator</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_6">
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_8">
             <item>
              <widget class="QLabel" name="label_8">
               <property name="text">
                <string>Generate</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QSpinBox" name="m_PointNumber1">
               <property name="minimum">
                <number>1</number>
               </property>
               <property name="maximum">
                <number>999</number>
               </property>
               <property name="value">
                <number>10</number>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_9">
               <property name="text">
                <string>X</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QSpinBox" name="m_PointNumber2">
               <property name="minimum">
                <number>1</number>
               </property>
               <property name="maximum">
                <number>999</number>
               </property>
               <property name="value">
                <number>9</number>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_10">
               <property name="text">
                <string>Point Set</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_7">
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
               </property>
               <property name="sizeHint" stdset="0">
                <size>
                 <width>40</width>
                 <height>20</height>
                </size>
               </property>
              </spacer>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_7">
             <item>
              <widget class="QLabel" name="label_11">
               <property name="text">
                <string>Inter Point Distance (in mm):</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_8">
               <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="QSpinBox" name="m_PointDistance">
               <property name="minimum">
                <number>1</number>
               </property>
               <property name="maximum">
                <number>99999</number>
               </property>
               <property name="value">
                <number>50</number>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_9">
             <item>
              <spacer name="horizontalSpacer_6">
               <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="QPushButton" name="m_GeneratePointSet">
               <property name="text">
                <string>Generate</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="groupBox_3">
          <property name="title">
           <string>Result CSV File to NavigationData Converter</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_7">
           <item>
            <widget class="QRadioButton" name="m_ConvertSingleFile">
             <property name="text">
              <string>Convert Single File</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="label_12">
             <property name="text">
              <string>Input CSV Logging File:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLineEdit" name="m_InputCSV">
             <property name="text">
              <string>C:/Tools/test.csv</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="label_13">
             <property name="text">
              <string>Output Navigation Data File:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLineEdit" name="m_OutputXML">
             <property name="text">
              <string>C:/Tools/testoutput.xml</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="Line" name="line_2">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="m_ConvertFileList">
             <property name="text">
              <string>Convert File List</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="label_14">
             <property name="text">
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-style:italic;&quot;&gt;(use text files with a complete filename in every line)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_11">
             <item>
              <widget class="QLabel" name="m_labelCSVtoXMLInputList">
               <property name="text">
                <string>not loaded</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_10">
               <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="QPushButton" name="m_loadCSVtoXMLInputList">
               <property name="minimumSize">
                <size>
                 <width>100</width>
                 <height>0</height>
                </size>
               </property>
               <property name="text">
                <string>Load Input List</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_12">
             <item>
              <widget class="QLabel" name="m_labelCSVtoXMLOutputList">
               <property name="text">
                <string>not loaded</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_11">
               <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="QPushButton" name="m_loadCSVtoXMLOutputList">
               <property name="minimumSize">
                <size>
                 <width>100</width>
                 <height>0</height>
                </size>
               </property>
               <property name="text">
                <string>Load Output List</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <widget class="Line" name="line">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_14">
             <item>
              <spacer name="horizontalSpacer_12">
               <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="QGroupBox" name="groupBox_4">
               <property name="title">
                <string>Output Format</string>
               </property>
               <layout class="QVBoxLayout" name="verticalLayout_9">
                <item>
                 <widget class="QRadioButton" name="m_ConvertXML">
                  <property name="text">
                   <string>XML</string>
                  </property>
                  <property name="checked">
                   <bool>true</bool>
                  </property>
                 </widget>
                </item>
                <item>
                 <widget class="QRadioButton" name="m_ConvertCSV">
                  <property name="text">
                   <string>CSV</string>
                  </property>
                 </widget>
                </item>
               </layout>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_10">
             <item>
              <spacer name="horizontalSpacer_9">
               <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="QPushButton" name="m_Convert">
               <property name="text">
                <string>Convert</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="groupBox_5">
          <property name="title">
           <string>Orientation Calculation (out of three positions)</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_8">
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_13">
             <item>
              <spacer name="horizontalSpacer_13">
               <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="QPushButton" name="m_OrientationCalculationGenerateReference">
               <property name="text">
                <string>Generate Reference From Current List</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_15">
             <item>
              <spacer name="horizontalSpacer_14">
               <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="QPushButton" name="m_OrientationCalculationWriteOrientationsToFile">
               <property name="text">
                <string>Write Orientation Quaternions To File</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>632</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkDataStorageComboBox</class>
    <extends>QComboBox</extends>
    <header>QmitkDataStorageComboBox.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.cpp b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.cpp
index 096380482c..275e53428e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.cpp
@@ -1,606 +1,606 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Qmitk
 #include "QmitkIGTTrackingSemiAutomaticMeasurementView.h"
 
 // Qt
 #include <QMessageBox>
 #include <qfiledialog.h>
 #include <qevent.h>
 #include <QCheckBox>
 
 // MITK
 #include <mitkNavigationToolStorageDeserializer.h>
 #include <mitkTrackingDeviceSourceConfigurator.h>
 #include <mitkLogBackend.h>
 #include "mitkHummelProtocolEvaluation.h"
 
 // POCO
 #include <Poco/File.h>
 #include <Poco/Path.h>
 
 const std::string QmitkIGTTrackingSemiAutomaticMeasurementView::VIEW_ID = "org.mitk.views.igttrackingsemiautomaticmeasurement";
 
 QmitkIGTTrackingSemiAutomaticMeasurementView::QmitkIGTTrackingSemiAutomaticMeasurementView()
   : m_Controls(nullptr)
 {
   m_NextFile = 0;
   m_FilenameVector = std::vector<std::string>();
   m_Timer = new QTimer(this);
   m_logging = false;
   m_referenceValid = true;
   m_tracking = false;
   m_EvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
 }
 
 QmitkIGTTrackingSemiAutomaticMeasurementView::~QmitkIGTTrackingSemiAutomaticMeasurementView()
 {
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::CreateResults()
 {
   QString LogFileName = m_Controls->m_OutputPath->text() + "_results.log";
   mitk::LogBackend::Unregister();
   mitk::LogBackend::SetLogFile(LogFileName.toStdString());
   mitk::LogBackend::Register();
 
   double RMSmean = 0;
   for (std::size_t i = 0; i < m_RMSValues.size(); ++i)
   {
     MITK_INFO << "RMS at " << this->m_FilenameVector.at(i) << ": " << m_RMSValues.at(i);
     RMSmean += m_RMSValues.at(i);
   }
   RMSmean /= m_RMSValues.size();
   MITK_INFO << "RMS mean over " << m_RMSValues.size() << " values: " << RMSmean;
 
   mitk::DataNode::Pointer newNode = mitk::DataNode::New();
   newNode->SetName("Tracking Results");
   newNode->SetData(this->m_MeanPoints);
   this->GetDataStorage()->Add(newNode);
 
   std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> results5cmDistances;
   if (m_Controls->m_mediumVolume->isChecked())
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_MeanPoints, mitk::HummelProtocolEvaluation::medium, results5cmDistances);
   else if (m_Controls->m_smallVolume->isChecked())
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_MeanPoints, mitk::HummelProtocolEvaluation::small, results5cmDistances);
   else if (m_Controls->m_standardVolume->isChecked())
     mitk::HummelProtocolEvaluation::Evaluate5cmDistances(m_MeanPoints, mitk::HummelProtocolEvaluation::standard, results5cmDistances);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::CreateQtPartControl(QWidget *parent)
 {
   // build up qt view, unless already done
   if (!m_Controls)
   {
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls = new Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls;
     m_Controls->setupUi(parent);
 
     //buttons
     connect(m_Controls->m_LoadMeasurementToolStorage, SIGNAL(clicked()), this, SLOT(OnLoadMeasurementStorage()));
     connect(m_Controls->m_LoadReferenceToolStorage, SIGNAL(clicked()), this, SLOT(OnLoadReferenceStorage()));
     connect(m_Controls->m_StartTracking, SIGNAL(clicked()), this, SLOT(OnStartTracking()));
     connect(m_Controls->m_LoadList, SIGNAL(clicked()), this, SLOT(OnMeasurementLoadFile()));
     connect(m_Controls->m_StartNextMeasurement, SIGNAL(clicked()), this, SLOT(StartNextMeasurement()));
     connect(m_Controls->m_ReapeatLastMeasurement, SIGNAL(clicked()), this, SLOT(RepeatLastMeasurement()));
     connect(m_Controls->m_SetReference, SIGNAL(clicked()), this, SLOT(OnSetReference()));
     connect(m_Controls->m_UseReferenceTrackingSystem, SIGNAL(toggled(bool)), this, SLOT(OnUseReferenceToggled(bool)));
     connect(m_Controls->m_CreateResults, SIGNAL(clicked()), this, SLOT(CreateResults()));
 
     //event filter
     qApp->installEventFilter(this);
 
     //timers
     connect(m_Timer, SIGNAL(timeout()), this, SLOT(UpdateTimer()));
   }
 
   //initialize some view
   m_Controls->m_StopTracking->setEnabled(false);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnUseReferenceToggled(bool state)
 {
   if (state)
   {
     m_Controls->m_ReferenceBox->setEnabled(true);
     m_Controls->m_SetReference->setEnabled(true);
   }
 
   else
   {
     m_Controls->m_ReferenceBox->setEnabled(false);
     m_Controls->m_SetReference->setEnabled(false);
   }
 }
 
 mitk::NavigationToolStorage::Pointer QmitkIGTTrackingSemiAutomaticMeasurementView::ReadStorage(std::string file)
 {
   mitk::NavigationToolStorage::Pointer returnValue;
 
   //initialize tool storage
   returnValue = mitk::NavigationToolStorage::New();
 
   //read tool storage from disk
   mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(GetDataStorage());
   returnValue = myDeserializer->Deserialize(file);
   if (returnValue.IsNull())
   {
     QMessageBox msgBox;
     msgBox.setText(myDeserializer->GetErrorMessage().c_str());
     msgBox.exec();
 
     returnValue = nullptr;
   }
 
   return returnValue;
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnSetReference()
 {
   //initialize reference
   m_ReferenceStartPositions = std::vector<mitk::Point3D>();
   m_ReferenceTrackingDeviceSource->Update();
   QString Label = "Positions At Start: ";
   for (unsigned int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); ++i)
   {
     mitk::Point3D position = m_ReferenceTrackingDeviceSource->GetOutput(i)->GetPosition();
     Label = Label + "Tool" + QString::number(i) + ":[" + QString::number(position[0]) + ":" + QString::number(position[1]) + ":" + QString::number(position[1]) + "] ";
     m_ReferenceStartPositions.push_back(position);
   }
   m_Controls->m_ReferencePosAtStart->setText(Label);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnLoadMeasurementStorage()
 {
   //read in filename
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Toolfile"), "/", tr("All Files (*.*)"));
   if (filename.isNull()) return;
 
   m_MeasurementStorage = ReadStorage(filename.toStdString());
 
   //update label
-  Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to seperate filename from path
+  Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to separate filename from path
   QString toolLabel = QString("Tool Storage: ") + QString::number(m_MeasurementStorage->GetToolCount()) + " Tools from " + myPath.getFileName().c_str();
   m_Controls->m_MeasurementToolStorageLabel->setText(toolLabel);
 
   //update status widget
   m_Controls->m_ToolStatusWidget->RemoveStatusLabels();
   m_Controls->m_ToolStatusWidget->PreShowTools(m_MeasurementStorage);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnLoadReferenceStorage()
 {
   //read in filename
   static QString oldFile;
   if (oldFile.isNull()) oldFile = "/";
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Toolfile"), oldFile, tr("All Files (*.*)"));
   if (filename.isNull()) return;
   oldFile = filename;
 
   m_ReferenceStorage = ReadStorage(filename.toStdString());
 
   //update label
-  Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to seperate filename from path
+  Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to separate filename from path
   QString toolLabel = QString("Tool Storage: ") + QString::number(m_ReferenceStorage->GetToolCount()) + " Tools from " + myPath.getFileName().c_str();
   m_Controls->m_ReferenceToolStorageLabel->setText(toolLabel);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnStartTracking()
 {
   //check if everything is ready to start tracking
   if (m_MeasurementStorage.IsNull())
   {
     MessageBox("Error: No measurement tools loaded yet!");
     return;
   }
   else if (m_ReferenceStorage.IsNull() && m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
-    MessageBox("Error: No refernce tools loaded yet!");
+    MessageBox("Error: No reference tools loaded yet!");
     return;
   }
   else if (m_MeasurementStorage->GetToolCount() == 0)
   {
     MessageBox("Error: No way to track without tools!");
     return;
   }
   else if (m_Controls->m_UseReferenceTrackingSystem->isChecked() && (m_ReferenceStorage->GetToolCount() == 0))
   {
     MessageBox("Error: No way to track without tools!");
     return;
   }
 
   //build the first IGT pipeline (MEASUREMENT)
   mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory1 = mitk::TrackingDeviceSourceConfigurator::New(this->m_MeasurementStorage, this->m_Controls->m_MeasurementTrackingDeviceConfigurationWidget->GetTrackingDevice());
   m_MeasurementTrackingDeviceSource = myTrackingDeviceSourceFactory1->CreateTrackingDeviceSource(this->m_MeasurementToolVisualizationFilter);
   if (m_MeasurementTrackingDeviceSource.IsNull())
   {
     MessageBox(myTrackingDeviceSourceFactory1->GetErrorMessage());
     return;
   }
   //connect the tool visualization widget
   for (unsigned int i = 0; i < m_MeasurementTrackingDeviceSource->GetNumberOfOutputs(); ++i)
   {
     m_Controls->m_ToolStatusWidget->AddNavigationData(m_MeasurementTrackingDeviceSource->GetOutput(i));
     m_EvaluationFilter->SetInput(i, m_MeasurementTrackingDeviceSource->GetOutput(i));
   }
   m_Controls->m_ToolStatusWidget->ShowStatusLabels();
   m_Controls->m_ToolStatusWidget->SetShowPositions(true);
   m_Controls->m_ToolStatusWidget->SetShowQuaternions(true);
 
   //build the second IGT pipeline (REFERENCE)
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory2 = mitk::TrackingDeviceSourceConfigurator::New(this->m_ReferenceStorage, this->m_Controls->m_ReferenceDeviceConfigurationWidget->GetTrackingDevice());
     m_ReferenceTrackingDeviceSource = myTrackingDeviceSourceFactory2->CreateTrackingDeviceSource();
     if (m_ReferenceTrackingDeviceSource.IsNull())
     {
       MessageBox(myTrackingDeviceSourceFactory2->GetErrorMessage());
       return;
     }
   }
 
   //initialize tracking
   try
   {
     m_MeasurementTrackingDeviceSource->Connect();
     m_MeasurementTrackingDeviceSource->StartTracking();
     if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
     {
       m_ReferenceTrackingDeviceSource->Connect();
       m_ReferenceTrackingDeviceSource->StartTracking();
     }
   }
   catch (...)
   {
     MessageBox("Error while starting the tracking device!");
     return;
   }
 
   //set reference
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked()) OnSetReference();
 
   //start timer
   m_Timer->start(1000 / (m_Controls->m_SamplingRate->value()));
 
   m_Controls->m_StartTracking->setEnabled(false);
   m_Controls->m_StartTracking->setEnabled(true);
 
   m_tracking = true;
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnStopTracking()
 {
   if (this->m_logging) FinishMeasurement();
   m_MeasurementTrackingDeviceSource->Disconnect();
   m_MeasurementTrackingDeviceSource->StopTracking();
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     m_ReferenceTrackingDeviceSource->Disconnect();
     m_ReferenceTrackingDeviceSource->StopTracking();
   }
   m_Timer->stop();
   m_Controls->m_StartTracking->setEnabled(true);
   m_Controls->m_StartTracking->setEnabled(false);
   m_tracking = false;
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::OnMeasurementLoadFile()
 {
   m_FilenameVector = std::vector<std::string>();
   m_FilenameVector.clear();
   m_NextFile = 0;
 
   //read in filename
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Measurement Filename List"), "/", tr("All Files (*.*)"));
   if (filename.isNull()) return;
 
   //define own locale
   std::locale C("C");
   setlocale(LC_ALL, "C");
 
   //read file
   std::ifstream file;
   file.open(filename.toStdString().c_str(), std::ios::in);
   if (file.good())
   {
     //read out file
     file.seekg(0L, std::ios::beg);  // move to begin of file
     while (!file.eof())
     {
       std::string buffer;
       std::getline(file, buffer);    // read out file line by line
       if (buffer.size() > 0) m_FilenameVector.push_back(buffer);
     }
   }
 
   //fill list at GUI
   m_Controls->m_MeasurementList->clear();
   for (unsigned int i = 0; i < m_FilenameVector.size(); i++) { new QListWidgetItem(tr(m_FilenameVector.at(i).c_str()), m_Controls->m_MeasurementList); }
 
   //update label next measurement
   std::stringstream label;
   label << "Next Measurement: " << m_FilenameVector.at(0);
   m_Controls->m_NextMeasurement->setText(label.str().c_str());
 
   //reset results files
   m_MeanPoints = mitk::PointSet::New();
   m_RMSValues = std::vector<double>();
   m_EvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
   if (m_MeasurementToolVisualizationFilter.IsNotNull()) m_EvaluationFilter->SetInput(0, m_MeasurementToolVisualizationFilter->GetOutput(0));
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::UpdateTimer()
 {
   if (m_EvaluationFilter.IsNotNull() && m_logging) m_EvaluationFilter->Update();
   else m_MeasurementToolVisualizationFilter->Update();
 
   m_Controls->m_ToolStatusWidget->Refresh();
 
   //update reference
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     m_ReferenceTrackingDeviceSource->Update();
     QString Label = "Current Positions: ";
     bool distanceThresholdExceeded = false;
     for (unsigned int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); ++i)
     {
       mitk::Point3D position = m_ReferenceTrackingDeviceSource->GetOutput(i)->GetPosition();
       Label = Label + "Tool" + QString::number(i) + ":[" + QString::number(position[0]) + ":" + QString::number(position[1]) + ":" + QString::number(position[1]) + "] ";
       if (position.EuclideanDistanceTo(m_ReferenceStartPositions.at(i)) > m_Controls->m_ReferenceThreshold->value()) distanceThresholdExceeded = true;
     }
     m_Controls->m_ReferenceCurrentPos->setText(Label);
     if (distanceThresholdExceeded)
     {
       m_Controls->m_ReferenceOK->setText("<html><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:28pt; font-weight:400; font-style:normal;\">NOT OK!</body></html>");
       m_referenceValid = false;
     }
     else
     {
       m_Controls->m_ReferenceOK->setText("<html><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:28pt; font-weight:400; font-style:normal;\">OK</body></html>");
       m_referenceValid = true;
     }
   }
 
   //update logging
   if (m_logging)
   {
     //check for missing objects
     if (m_MeasurementLoggingFilterXML.IsNull() ||
       m_MeasurementLoggingFilterCSV.IsNull()
       )
     {
       return;
     }
 
     //log/measure
     m_MeasurementLoggingFilterXML->Update();
     m_MeasurementLoggingFilterCSV->Update();
 
     if (m_Controls->m_UseReferenceTrackingSystem->isChecked() &&
       m_ReferenceLoggingFilterXML.IsNotNull() &&
       m_ReferenceLoggingFilterCSV.IsNotNull())
     {
       m_ReferenceLoggingFilterXML->Update();
       m_ReferenceLoggingFilterCSV->Update();
     }
     m_loggedFrames++;
     LogAdditionalCSVFile();
 
     //check if all frames are logged ... if yes finish the measurement
     if (m_loggedFrames > m_Controls->m_SamplesPerMeasurement->value()) { FinishMeasurement(); }
 
     //update logging label
     QString loggingLabel = "Collected Samples: " + QString::number(m_loggedFrames);
     m_Controls->m_CollectedSamples->setText(loggingLabel);
   }
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::StartNextMeasurement()
 {
   if (this->m_NextFile >= static_cast<int>(m_FilenameVector.size()))
   {
     MessageBox("Last Measurement reached!");
     return;
   }
 
   m_loggedFrames = 0;
   m_logging = true;
 
   //check if directory exists, if not create one
   Poco::File myPath(std::string(m_Controls->m_OutputPath->text().toUtf8()).c_str());
   if (!myPath.exists()) myPath.createDirectory();
 
   QString LogFileName = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".log";
   mitk::LogBackend::Unregister();
   mitk::LogBackend::SetLogFile(LogFileName.toStdString());
   mitk::LogBackend::Register();
 
   //initialize logging filters
   m_MeasurementLoggingFilterXML = mitk::NavigationDataRecorderDeprecated::New();
   m_MeasurementLoggingFilterXML->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
   m_MeasurementLoggingFilterCSV = mitk::NavigationDataRecorderDeprecated::New();
   m_MeasurementLoggingFilterCSV->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
   m_MeasurementLoggingFilterXML->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::xml);
   m_MeasurementLoggingFilterCSV->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::csv);
   QString MeasurementFilenameXML = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".xml";
   QString MeasurementFilenameCSV = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".csv";
   m_MeasurementLoggingFilterXML->SetFileName(MeasurementFilenameXML.toStdString());
   m_MeasurementLoggingFilterCSV->SetFileName(MeasurementFilenameCSV.toStdString());
   m_MeasurementLoggingFilterXML->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
   m_MeasurementLoggingFilterCSV->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
 
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     m_ReferenceLoggingFilterXML = mitk::NavigationDataRecorderDeprecated::New();
     m_ReferenceLoggingFilterXML->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
     m_ReferenceLoggingFilterCSV = mitk::NavigationDataRecorderDeprecated::New();
     m_ReferenceLoggingFilterCSV->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
     m_ReferenceLoggingFilterXML->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::xml);
     m_ReferenceLoggingFilterCSV->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::csv);
     QString ReferenceFilenameXML = m_Controls->m_OutputPath->text() + "Reference_" + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".xml";
     QString ReferenceFilenameCSV = m_Controls->m_OutputPath->text() + "Reference_" + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".csv";
     m_ReferenceLoggingFilterXML->SetFileName(ReferenceFilenameXML.toStdString());
     m_ReferenceLoggingFilterCSV->SetFileName(ReferenceFilenameCSV.toStdString());
     m_ReferenceLoggingFilterXML->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
     m_ReferenceLoggingFilterCSV->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
   }
 
   //start additional csv logging
   StartLoggingAdditionalCSVFile(m_FilenameVector.at(m_NextFile));
 
   //connect filter
   for (unsigned int i = 0; i < m_MeasurementToolVisualizationFilter->GetNumberOfOutputs(); ++i)
   {
     m_MeasurementLoggingFilterXML->AddNavigationData(m_MeasurementToolVisualizationFilter->GetOutput(i));
     m_MeasurementLoggingFilterCSV->AddNavigationData(m_MeasurementToolVisualizationFilter->GetOutput(i));
   }
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked()) for (unsigned int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); ++i)
   {
     m_ReferenceLoggingFilterXML->AddNavigationData(m_ReferenceTrackingDeviceSource->GetOutput(i));
     m_ReferenceLoggingFilterCSV->AddNavigationData(m_ReferenceTrackingDeviceSource->GetOutput(i));
   }
 
   //start filter
   m_MeasurementLoggingFilterXML->StartRecording();
   m_MeasurementLoggingFilterCSV->StartRecording();
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     m_ReferenceLoggingFilterXML->StartRecording();
     m_ReferenceLoggingFilterCSV->StartRecording();
   }
 
   //disable all buttons
   DisableAllButtons();
 
   //update label next measurement
   std::stringstream label;
   if ((m_NextFile + 1) >= static_cast<int>(m_FilenameVector.size())) label << "Next Measurement: <none>";
   else label << "Next Measurement: " << m_FilenameVector.at(m_NextFile + 1);
   m_Controls->m_NextMeasurement->setText(label.str().c_str());
 
   //update label last measurement
   std::stringstream label2;
   label2 << "Last Measurement: " << m_FilenameVector.at(m_NextFile);
   m_Controls->m_LastMeasurement->setText(label2.str().c_str());
 
   m_NextFile++;
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::RepeatLastMeasurement()
 {
   m_NextFile--;
   StartNextMeasurement();
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::MessageBox(std::string s)
 {
   QMessageBox msgBox;
   msgBox.setText(s.c_str());
   msgBox.exec();
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::DisableAllButtons()
 {
   m_Controls->m_LoadList->setEnabled(false);
   m_Controls->m_StartNextMeasurement->setEnabled(false);
   m_Controls->m_ReapeatLastMeasurement->setEnabled(false);
   m_Controls->m_SamplingRate->setEnabled(false);
   m_Controls->m_SamplesPerMeasurement->setEnabled(false);
   m_Controls->m_ReferenceThreshold->setEnabled(false);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::EnableAllButtons()
 {
   m_Controls->m_LoadList->setEnabled(true);
   m_Controls->m_StartNextMeasurement->setEnabled(true);
   m_Controls->m_ReapeatLastMeasurement->setEnabled(true);
   m_Controls->m_SamplingRate->setEnabled(true);
   m_Controls->m_SamplesPerMeasurement->setEnabled(true);
   m_Controls->m_ReferenceThreshold->setEnabled(true);
 }
 
 void QmitkIGTTrackingSemiAutomaticMeasurementView::FinishMeasurement()
 {
   m_logging = false;
 
   m_MeasurementLoggingFilterXML->StopRecording();
   m_MeasurementLoggingFilterCSV->StopRecording();
   if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
   {
     m_ReferenceLoggingFilterXML->StopRecording();
     m_ReferenceLoggingFilterCSV->StopRecording();
   }
   StopLoggingAdditionalCSVFile();
 
   int id = m_NextFile - 1;
   mitk::Point3D positionMean = m_EvaluationFilter->GetPositionMean(0);
   MITK_INFO << "Evaluated " << m_EvaluationFilter->GetNumberOfAnalysedNavigationData(0) << " samples.";
   double rms = m_EvaluationFilter->GetPositionErrorRMS(0);
   MITK_INFO << "RMS: " << rms;
   MITK_INFO << "Position Mean: " << positionMean;
   m_MeanPoints->SetPoint(id, positionMean);
   if (static_cast<int>(m_RMSValues.size()) <= id) m_RMSValues.push_back(rms);
   else m_RMSValues[id] = rms;
 
   m_EvaluationFilter->ResetStatistic();
 
   EnableAllButtons();
 }
 
 void  QmitkIGTTrackingSemiAutomaticMeasurementView::StartLoggingAdditionalCSVFile(std::string filePostfix)
 {
   //write logfile header
   QString header = "Nr;MITK_Time;Valid_Reference;";
   QString tool = QString("MeasureTool_") + QString(m_MeasurementTrackingDeviceSource->GetOutput(0)->GetName());
   header = header + tool + "[x];" + tool + "[y];" + tool + "[z];" + tool + "[qx];" + tool + "[qy];" + tool + "[qz];" + tool + "[qr]\n";
 
   //open logfile and write header
   m_logFileCSV.open(std::string(m_Controls->m_OutputPath->text().toUtf8()).append("/LogFileCombined").append(filePostfix.c_str()).append(".csv").c_str(), std::ios::out);
   m_logFileCSV << header.toStdString().c_str();
 }
 
 void  QmitkIGTTrackingSemiAutomaticMeasurementView::LogAdditionalCSVFile()
 {
   mitk::Point3D pos = m_MeasurementTrackingDeviceSource->GetOutput(0)->GetPosition();
   mitk::Quaternion rot = m_MeasurementTrackingDeviceSource->GetOutput(0)->GetOrientation();
   std::string valid = "";
   if (m_referenceValid) valid = "true";
   else valid = "false";
   std::stringstream timestamp;
   timestamp << m_MeasurementTrackingDeviceSource->GetOutput(0)->GetTimeStamp();
   QString dataSet = QString::number(m_loggedFrames) + ";" + QString(timestamp.str().c_str()) + ";" + QString(valid.c_str()) + ";" + QString::number(pos[0]) + ";" + QString::number(pos[1]) + ";" + QString::number(pos[2]) + ";" + QString::number(rot.x()) + ";" + QString::number(rot.y()) + ";" + QString::number(rot.z()) + ";" + QString::number(rot.r()) + "\n";
   m_logFileCSV << dataSet.toStdString();
 }
 
 void  QmitkIGTTrackingSemiAutomaticMeasurementView::StopLoggingAdditionalCSVFile()
 {
   m_logFileCSV.close();
 }
 
 bool QmitkIGTTrackingSemiAutomaticMeasurementView::eventFilter(QObject *, QEvent *ev)
 {
   if (ev->type() == QEvent::KeyPress)
   {
     QKeyEvent *k = (QKeyEvent *)ev;
     bool down = k->key() == 16777239;
 
     if (down && m_tracking && !m_logging)
       StartNextMeasurement();
   }
 
   return false;
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
index 8e687e471c..2130bafbe9 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.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 QmitkIGTTrackingSemiAutomaticMeasurementView_h
 #define QmitkIGTTrackingSemiAutomaticMeasurementView_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 //QT
 #include <QTimer>
 
 //MITK
 #include <mitkNavigationToolStorage.h>
 #include <mitkTrackingDeviceSource.h>
 #include <mitkNavigationDataObjectVisualizationFilter.h>
 #include <mitkNavigationDataRecorderDeprecated.h>
 #include <mitkNavigationDataEvaluationFilter.h>
 
 #include "ui_QmitkIGTTrackingSemiAutomaticMeasurementViewControls.h"
 
 /*!
   \brief QmitkIGTTrackingSemiAutomaticMeasurementView
 
   \warning  This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
 
   */
 class QmitkIGTTrackingSemiAutomaticMeasurementView : public QmitkAbstractView
 {
   Q_OBJECT
 
 public:
 
   static const std::string VIEW_ID;
 
   QmitkIGTTrackingSemiAutomaticMeasurementView();
   ~QmitkIGTTrackingSemiAutomaticMeasurementView() override;
 
   void CreateQtPartControl(QWidget *parent) override;
   void SetFocus() override {}
 
 protected slots:
 
   void OnLoadMeasurementStorage();
   void OnLoadReferenceStorage();
   void OnStartTracking();
   void OnStopTracking();
   void OnMeasurementLoadFile();
   void OnSetReference();
   void StartNextMeasurement();
   void RepeatLastMeasurement();
   void UpdateTimer();
   void CreateResults();
   void OnUseReferenceToggled(bool state);
 
 protected:
 
   Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls* m_Controls;
 
   //the tool storages
   mitk::NavigationToolStorage::Pointer m_MeasurementStorage;
   mitk::NavigationToolStorage::Pointer m_ReferenceStorage;
 
   //members for the filter pipeline
   mitk::TrackingDeviceSource::Pointer m_MeasurementTrackingDeviceSource;
   mitk::NavigationDataObjectVisualizationFilter::Pointer m_MeasurementToolVisualizationFilter;
   mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterXML;
   mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterCSV;
   mitk::TrackingDeviceSource::Pointer m_ReferenceTrackingDeviceSource;
   mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterXML;
   mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterCSV;
 
   //members for file name list
   std::vector<std::string> m_FilenameVector;
   int m_NextFile;
 
   //help methods
   mitk::NavigationToolStorage::Pointer ReadStorage(std::string file);
   void MessageBox(std::string s);
   void DisableAllButtons();
   void EnableAllButtons();
   void FinishMeasurement();
   void StartLoggingAdditionalCSVFile(std::string filePostfix);
   void LogAdditionalCSVFile();
   void StopLoggingAdditionalCSVFile();
 
   //timer
   QTimer* m_Timer;
 
-  //memebers for reference checking
+  //members for reference checking
   std::vector<mitk::Point3D> m_ReferenceStartPositions;
   bool m_referenceValid;
 
   //logging members
   int m_loggedFrames;
   bool m_logging;
   std::fstream m_logFileCSV;
 
   //event filter for key presses
   bool eventFilter(QObject *obj, QEvent *ev) override;
 
   //results members
   mitk::PointSet::Pointer m_MeanPoints;
   std::vector<double> m_RMSValues;
   mitk::NavigationDataEvaluationFilter::Pointer m_EvaluationFilter;
 
   bool m_tracking;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui
index b85fd511cb..431fe62b9e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui
@@ -1,588 +1,588 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkIGTTrackingSemiAutomaticMeasurementViewControls</class>
  <widget class="QWidget" name="QmitkIGTTrackingSemiAutomaticMeasurementViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>419</width>
     <height>931</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">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="tab">
       <attribute name="title">
        <string>Tracking Initialization</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_4">
        <item>
         <widget class="QGroupBox" name="groupBox">
          <property name="title">
           <string>Measurement Tracking System</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_2">
           <item>
            <widget class="QmitkTrackingDeviceConfigurationWidget" name="m_MeasurementTrackingDeviceConfigurationWidget" native="true"/>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_2">
             <item>
              <widget class="QLabel" name="m_MeasurementToolStorageLabel">
               <property name="text">
                <string>Tool Storage: &lt;none&gt;</string>
               </property>
              </widget>
             </item>
             <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="QPushButton" name="m_LoadMeasurementToolStorage">
               <property name="text">
                <string>Load Tool Storage</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="m_ReferenceBox">
          <property name="title">
           <string>Reference Trackingsystem</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_3">
           <item>
            <widget class="QmitkTrackingDeviceConfigurationWidget" name="m_ReferenceDeviceConfigurationWidget" native="true"/>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout">
             <item>
              <widget class="QLabel" name="m_ReferenceToolStorageLabel">
               <property name="text">
                <string>Tool Storage: &lt;none&gt;</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="horizontalSpacer_2">
               <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="QPushButton" name="m_LoadReferenceToolStorage">
               <property name="text">
                <string>Load Tool Storage</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="m_StartTracking">
          <property name="text">
           <string>Start Tracking</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="m_StopTracking">
          <property name="text">
           <string>Stop Tracking</string>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>40</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab_2">
       <attribute name="title">
        <string>Measurement</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_6">
        <item>
         <widget class="QLabel" name="label">
          <property name="text">
           <string>Measurement List:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QListWidget" name="m_MeasurementList"/>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_3">
          <item>
           <spacer name="horizontalSpacer_3">
            <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="QPushButton" name="m_LoadList">
            <property name="text">
             <string>Load List</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_4">
          <item>
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Output Path:</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QLineEdit" name="m_OutputPath">
            <property name="text">
             <string>C:/temp/</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <widget class="QLabel" name="m_LastMeasurement">
          <property name="text">
           <string>Last Measurement: &lt;none&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="m_NextMeasurement">
          <property name="text">
           <string>Next Measurement: &lt;none&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="m_CollectedSamples">
          <property name="text">
           <string>Collected Samples: &lt;none&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_7">
          <item>
           <spacer name="horizontalSpacer_6">
            <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="QPushButton" name="m_StartNextMeasurement">
            <property name="minimumSize">
             <size>
              <width>200</width>
              <height>0</height>
             </size>
            </property>
            <property name="text">
             <string>Start Next Measurement</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_8">
          <item>
           <spacer name="horizontalSpacer_7">
            <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="QPushButton" name="m_ReapeatLastMeasurement">
            <property name="minimumSize">
             <size>
              <width>200</width>
              <height>0</height>
             </size>
            </property>
            <property name="text">
             <string>Repeat Last Measurement</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_10">
          <item>
           <spacer name="horizontalSpacer_9">
            <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="QPushButton" name="m_CreateResults">
            <property name="minimumSize">
             <size>
              <width>200</width>
              <height>0</height>
             </size>
            </property>
            <property name="text">
             <string>Create Results</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <spacer name="verticalSpacer_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>281</height>
           </size>
          </property>
         </spacer>
        </item>
        <item>
         <widget class="Line" name="line_2">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_7">
          <property name="text">
           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;Measurement Sensors:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QmitkToolTrackingStatusWidget" name="m_ToolStatusWidget" native="true"/>
        </item>
        <item>
         <widget class="Line" name="line">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_3">
          <property name="text">
           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600; text-decoration: underline;&quot;&gt;Reference Sensors:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="m_SetReference">
          <property name="text">
           <string>Set Reference</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="m_ReferencePosAtStart">
          <property name="text">
-          <string>Reference Postion: &lt;none&gt;</string>
+          <string>Reference Position: &lt;none&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="m_ReferenceCurrentPos">
          <property name="text">
           <string>Current Positions: &lt;none&gt;</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="m_ReferenceOK">
          <property name="text">
           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:28pt; font-weight:600;&quot;&gt;OK&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignCenter</set>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab_3">
       <attribute name="title">
        <string>Settings</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_7">
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_5">
          <item>
           <widget class="QLabel" name="label_4">
            <property name="text">
             <string>Sampling Rate (Times Per Second):</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_4">
            <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="QDoubleSpinBox" name="m_SamplingRate">
            <property name="maximum">
             <double>999.000000000000000</double>
            </property>
            <property name="value">
             <double>15.000000000000000</double>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_6">
          <item>
           <widget class="QLabel" name="label_5">
            <property name="text">
             <string>Samples Per Measurement:</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_5">
            <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="QSpinBox" name="m_SamplesPerMeasurement">
            <property name="maximum">
             <number>1000</number>
            </property>
            <property name="value">
             <number>150</number>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_9">
          <item>
           <widget class="QLabel" name="label_6">
            <property name="text">
             <string>Threshold For Reference Tools:</string>
            </property>
           </widget>
          </item>
          <item>
           <spacer name="horizontalSpacer_8">
            <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="QDoubleSpinBox" name="m_ReferenceThreshold">
            <property name="value">
             <double>1.000000000000000</double>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <widget class="QCheckBox" name="m_UseReferenceTrackingSystem">
          <property name="text">
           <string>Use Reference Tracking System</string>
          </property>
          <property name="checked">
           <bool>true</bool>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="groupBox_2">
          <property name="title">
           <string>Tracking Volume</string>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_5">
           <item>
            <widget class="QRadioButton" name="m_smallVolume">
             <property name="text">
              <string>Small Volume (3 X 4 Positions)</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="m_mediumVolume">
             <property name="text">
              <string>Medium Volume (5 X 5 Positions)</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QRadioButton" name="m_standardVolume">
             <property name="text">
              <string>Standard Volume (10 X 9 Positions)</string>
             </property>
            </widget>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_2">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>40</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkToolTrackingStatusWidget</class>
    <extends>QWidget</extends>
    <header>QmitkToolTrackingStatusWidget.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkTrackingDeviceConfigurationWidget</class>
    <extends>QWidget</extends>
    <header>QmitkTrackingDeviceConfigurationWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
index 3c8c7a6f61..14c5fcda60 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
@@ -1,92 +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 mitkHummelProtocolEvaluation_h
 #define mitkHummelProtocolEvaluation_h
 
 #include <mitkPointSet.h>
 #include <array>
 
 
 
 
 namespace mitk
 {
 
   /**Documentation
   * \brief Static methods for evaluations according to the assessment protocol
   * for EM trackers published by Hummel et al. 2005 [1].
   *
   * [1] Hummel, J. et al. - Design and application of an assessment protocol for electromagnetic tracking systems. Med Phys 32(7), July 2005
   *
   * \ingroup IGT
   */
   class HummelProtocolEvaluation
 
   {
   public:
 
     /** Distance error with description. */
     struct HummelProtocolDistanceError {double distanceError; std::string description;};
     /** Tracking volumes for evaluation.
-     *  standard: The standard volume of 9 x 10 measurment points as described in [1]
+     *  standard: The standard volume of 9 x 10 measurement points as described in [1]
      *  small: A small volume in the center 3 x 4 measurement points, for smaller field generators [2]
      *  [2] Maier-Hein, L. et al. - Standardized assessment of new electromagnetic field generators in an interventional radiology setting. Med Phys 39(6), June 2012
      */
     enum HummelProtocolMeasurementVolume { small, medium, standard };
     /** Evaluates the 5 cm distances as defined by the Hummel protocol [1,2].
-     * @return Returns true if evaluation was successfull, false if not.
+     * @return Returns true if evaluation was successful, false if not.
      * @param[out] Results Please give an empty vector. The results will be added to this vector.
      */
     static bool Evaluate5cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
 
     /** Evaluates the 15 cm distances as defined by the Hummel protocol [1,2].
-    * @return Returns true if evaluation was successfull, false if not.
+    * @return Returns true if evaluation was successful, false if not.
     * @param[out] Results Please give an empty vector. The results will be added to this vector.
     */
     static bool Evaluate15cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
 
     /** Evaluates the 30 cm distances as defined by the Hummel protocol [1,2].
-    * @return Returns true if evaluation was successfull, false if not.
+    * @return Returns true if evaluation was successful, false if not.
     * @param[out] Results Please give an empty vector. The results will be added to this vector.
     */
     static bool Evaluate30cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
 
     /** Evaluates the accumulated distances as defined by the Hummel protocol [1,2].
-    * @return Returns true if evaluation was successfull, false if not.
+    * @return Returns true if evaluation was successful, false if not.
     * @param[out] Results Please give an empty vector. The results will be added to this vector.
     */
     static bool EvaluateAccumulatedDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
 
     /** Computes statistics (as mean, standard deviation, quantiles, min, max, etc.) on the given values.
     *  The results are stored inside the return value.
     */
     static std::vector<HummelProtocolDistanceError> ComputeStatistics(std::vector<HummelProtocolDistanceError> values);
 
   protected:
     /** Converts a pointset holding all measurement points of the hummel protocol in line-by-line order
      *  to an array representing the hummel board.
      */
     static std::array<std::array<mitk::Point3D, 10> ,9> ParseMatrixStandardVolume(mitk::PointSet::Pointer p);
-    //It would be really wonderfull if we could replace std::array<std::array<mitk::Point3D, 10> ,9> by  mitk::Matrix< mitk::Point3D, 9, 10 > but
-    //unfortunatly this version does not compile under Linux. To be precise under Linux only matrices like this: mitk::Matriy<double, 9, 10> compile
+    //It would be really wonderful if we could replace std::array<std::array<mitk::Point3D, 10> ,9> by  mitk::Matrix< mitk::Point3D, 9, 10 > but
+    //unfortunately this version does not compile under Linux. To be precise under Linux only matrices like this: mitk::Matriy<double, 9, 10> compile
     //even the usage of a double pointer (eg mitk::Matrix<double* , 9, 10>) does not compile. We always got an error message saying:
     //vnl_c_vector.h:42:49: error: invalid use of incomplete type ‘class vnl_numeric_traits<itk::Point<double, 3u> >’
     //Under Windows this error does not appear there everything compiles fine.
 
     static std::array<std::array<mitk::Point3D, 5>, 5> ParseMatrixMediumVolume(mitk::PointSet::Pointer p);
 
   };
 } // namespace mitk
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
index 308fb486f2..31c35eea24 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.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 mitkNavigationDataCSVSequentialPlayer_h
 #define mitkNavigationDataCSVSequentialPlayer_h
 
 #include <mitkNavigationDataPlayerBase.h>
 
 namespace mitk
 {
 
   /**Documentation
   * \brief This class is a NavigationDataPlayer which can play CSV formatted
   * files in sequential order, which means it doesn't care about timestamps and just
   * outputs the navigationdatas in their sequential order.
   *
   * It is thought to interpret custom csv files. To do so please adapt the column
   * numbers of position and orientation in the internal method GetNavigationDataOutOfOneLine().
   *
   * So far only one (the first) tool is read in as required for the hummel protocol measurements.
   *
   * This class can also interpret MITK style csv files (set filetype to NavigationDataCSV), but
   * you can also use the MITK navigation data player class inside the MITK-IGT module which
   * is newer and better maintained.
   *
   * \ingroup IGT
   */
   class NavigationDataCSVSequentialPlayer
     : public NavigationDataPlayerBase
   {
   public:
 
     mitkClassMacro(NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase);
     itkNewMacro(Self);
 
     /**
     * \brief sets the file name and path (if XMLString is set, this is neglected)
     */
     void SetFileName(const std::string& _FileName);
 
     /**
-     * @brief SetOptions    sets the options for reading out the data out of the correct postions of the file. They need to be set before using the player
+     * @brief SetOptions    sets the options for reading out the data out of the correct positions of the file. They need to be set before using the player
      * @param rightHanded   true if the used coordinate System is right handed, false if it is left handed
      * @param seperatorSign symbol that is used to separate the values in the .csv file
      * @param sampleCount   every n-th sample in the file that should be used
      * @param headerRow     true if the .csv file has a header row otherwise false
-     * @param xPos          number of the colum in the .csv file for the x-coordinates of the position
-     * @param yPos          number of the colum in the .csv file for the y-coordinates of the position
-     * @param zPos          number of the colum in the .csv file for the z-coordinates of the position
+     * @param xPos          number of the column in the .csv file for the x-coordinates of the position
+     * @param yPos          number of the column in the .csv file for the y-coordinates of the position
+     * @param zPos          number of the column in the .csv file for the z-coordinates of the position
      * @param useQuats      true if Quaternions are used to construct the orientation, false if Euler Angles are used
      * @param qx            number of the column in the .csv file for the x component of the quaternion
      * @param qy            number of the column in the .csv file for the y component of the quaternion
      * @param qz            number of the column in the .csv file for the z component of the quaternion
      * @param qr            number of the column in the .csv file for the r component of the quaternion
-     * @param azimuth       number of the colum in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined
-     * @param elevatino     number of the colum in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined
-     * @param roll          number of the colum in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined
+     * @param azimuth       number of the column in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined
+     * @param elevatino     number of the column in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined
+     * @param roll          number of the column in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined
      * @param eulerInRadiants   true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
      * @param minNumberOfColumns
      */
     void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats,
                     int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums);
 
     /**
     * \brief returns the file name and path
     */
     itkGetStringMacro(FileName);
 
     enum Filetype
     {
       NavigationDataCSV, //for csv files from the MITK navigation data player
-      ManualLoggingCSV //for custum csv files
+      ManualLoggingCSV //for custom csv files
     };
     /**
     * \brief Sets the file type. ManualLoggingCSV is default and is thought for your
     *        custom csv files. You can also set it to NavigationDataCSV, then this
     *        player interprets MITK style csv files.
     */
     itkSetMacro(Filetype, Filetype);
 
     /**
     * \return Returns true if the player reached the end of the file.
     */
     bool IsAtEnd();
 
     /**
     * \brief Used for pipeline update just to tell the pipeline
     * that we always have to update
     */
     void UpdateOutputInformation() override;
 
     int GetNumberOfSnapshots();
 
   protected:
     NavigationDataCSVSequentialPlayer();
     ~NavigationDataCSVSequentialPlayer() override;
 
     ///
     /// do the work here
     ///
     void GenerateData() override;
 
     std::string m_FileName;
 
     int m_CurrentPos;
     Filetype m_Filetype;
 
     //member for the navigation datas which were read (only one output is supported at the moment)
     std::vector<mitk::NavigationData::Pointer> m_NavigationDatas;
 
     std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
     std::vector<std::string> GetFileContentLineByLine(std::string filename);
     mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
 
     void FillOutputEmpty(int number);
     mitk::NavigationData::Pointer GetEmptyNavigationData();
 
     bool m_RightHanded; //true if the used coordinate System is right handed, false if it is left handed
     char m_SeparatorSign; //symbol that is used to separate the values in the .csv file
     int m_SampleCount; //every n-th sample in the file that should be used
     bool m_HeaderRow; //true if the .csv file has a header row otherwise false
-    int m_XPos; //number of the colum in the .csv file for the x-coordinates of the position
-    int m_YPos; //number of the colum in the .csv file for the y-coordinates of the position
-    int m_ZPos; //number of the colum in the .csv file for the z-coordinates of the position
+    int m_XPos; //number of the column in the .csv file for the x-coordinates of the position
+    int m_YPos; //number of the column in the .csv file for the y-coordinates of the position
+    int m_ZPos; //number of the column in the .csv file for the z-coordinates of the position
     bool m_UseQuats; //true if Quaternions are used to construct the orientation, false if Euler Angles are used
     int m_Qx; //number of the column in the .csv file for the x component of the quaternion
     int m_Qy; //number of the column in the .csv file for the y component of the quaternion
     int m_Qz; //number of the column in the .csv file for the z component of the quaternion
     int m_Qr; //number of the column in the .csv file for the r component of the quaternion
-    int m_Azimuth; //number of the colum in the .csv file for Azimuth (Euler Angles)
-    int m_Elevation; //number of the colum in the .csv file for Elevation (Euler Angles)
-    int m_Roll; //number of the colum in the .csv file for Roll (Euler Angles)
+    int m_Azimuth; //number of the column in the .csv file for Azimuth (Euler Angles)
+    int m_Elevation; //number of the column in the .csv file for Elevation (Euler Angles)
+    int m_Roll; //number of the column in the .csv file for Roll (Euler Angles)
     bool m_EulersInRadiants; // true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
     int m_MinNumberOfColumns; //minimal number of columns the file has to have (e.g. if you read data from column 8 the file has to have at least 8 columns)
   };
 } // namespace mitk
 
 #endif
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 b29cde2d78..4bf3e852bc 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>);
   void SetLine(itk::SmartPointer<mitk::PointSet> line);
 
   /**
    * \return if line and surface are intersecting
    */
   itkGetMacro(IsIntersecting, bool);
 
   /**
-   * \return the position where the intersection occured, the result is not defined if no intersection occured
+   * \return the position where the intersection occurred, the result is not defined if no intersection occurred
    */
   mitk::Point3D GetIntersectionPoint();
 
   /**
-   * \return id of the nearest vertex of the target to the interseciont, the result is not defined if no intersection occured
+   * \return id of the nearest vertex of the target to the interseciont, the result is not defined if no intersection occurred
    */
   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
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.cpp
index 443d255018..7e66bdde6e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.cpp
@@ -1,189 +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.
 
 ============================================================================*/
 
 // MITK
 #include "mitkUSNavigationTargetOcclusionFilter.h"
 #include "mitkDataNode.h"
 #include "mitkSurface.h"
 
 // VTK
 #include "vtkSmartPointer.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
 #include "vtkOBBTree.h"
 #include "vtkFloatArray.h"
 #include "vtkTransform.h"
 #include "vtkTransformPolyDataFilter.h"
 
 
 mitk::USNavigationTargetOcclusionFilter::USNavigationTargetOcclusionFilter()
   : m_StartPositionInput(0)
 {
 }
 
 mitk::USNavigationTargetOcclusionFilter::~USNavigationTargetOcclusionFilter()
 {
 }
 
 void mitk::USNavigationTargetOcclusionFilter::SetTargetStructure(itk::SmartPointer<DataNode> targetStructure)
 {
   m_TargetStructure = targetStructure;
 }
 
 void mitk::USNavigationTargetOcclusionFilter::SetObstacleStructures(DataStorage::SetOfObjects::ConstPointer obstacleStructures)
 {
   m_ObstacleStructures = obstacleStructures;
 }
 
 void mitk::USNavigationTargetOcclusionFilter::SelectStartPositionInput(unsigned int n)
 {
   m_StartPositionInput = n;
 }
 
 void mitk::USNavigationTargetOcclusionFilter::GenerateData()
 {
   mitk::NavigationDataPassThroughFilter::GenerateData();
 
   // get vtk surface an the points
   vtkSmartPointer<vtkPolyData> targetSurfaceVtk = this->GetVtkPolyDataOfTarget();
   if ( ! targetSurfaceVtk ) { return; } // cannot do anything without a target surface
 
   vtkIdType numberOfPoints = targetSurfaceVtk->GetNumberOfPoints();
 
   // create array for scalar values
   vtkSmartPointer<vtkFloatArray> colors =
       vtkSmartPointer<vtkFloatArray>::New();
   colors->SetNumberOfComponents(1);
   colors->SetName("USNavigation::Occlusion");
 
   const mitk::NavigationData* nd = this->GetInput(m_StartPositionInput);
 
   // set every value to -1 if there is no (valid) navigation data
   if ( nd == nullptr || ! nd->IsDataValid() )
   {
     float intersection = -1;
     for ( vtkIdType n = 0; n < numberOfPoints; n++ )
     {
       colors->InsertNextTuple1(intersection);
     }
 
     if ( numberOfPoints > 0 )
     {
       targetSurfaceVtk->GetPointData()->AddArray(colors);
       targetSurfaceVtk->GetPointData()->Update();
     }
 
     return;
   }
 
   // initialize values with 0 (no intersection) if there is valid navigation
   // data and there are some obstacle structures defined
   else if ( m_ObstacleStructures.IsNull() )
   {
     float intersection = 0;
     for ( vtkIdType n = 0; n < numberOfPoints; n++ )
     {
       colors->InsertNextTuple1(intersection);
     }
 
     if ( numberOfPoints > 0 )
     {
       targetSurfaceVtk->GetPointData()->AddArray(colors);
       targetSurfaceVtk->GetPointData()->Update();
     }
 
     return;
   }
 
   // get the current position from the navigation data
   mitk::Point3D position = nd->GetPosition();
   double point1[3];
   point1[0] = position[0]; point1[1] = position[1]; point1[2] = position[2];
 
   // transform vtk polydata according to mitk geometry
   vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter =
     vtkSmartPointer<vtkTransformPolyDataFilter>::New();
   transformFilter->SetInputData(0, targetSurfaceVtk);
   transformFilter->SetTransform(m_TargetStructure->GetData()->GetGeometry()->GetVtkTransform());
   transformFilter->Update();
   vtkSmartPointer<vtkPolyData> targetSurfaceVtkTransformed = transformFilter->GetOutput();
 
   std::vector<bool> occlusion(numberOfPoints, false);
 
   // calculate occlusion for every obstacle structure
   for (mitk::DataStorage::SetOfObjects::ConstIterator it = m_ObstacleStructures->Begin();
     it != m_ObstacleStructures->End(); ++it)
   {
     vtkSmartPointer<vtkPolyData> polyData = dynamic_cast<mitk::Surface*>(it->Value()->GetData())->GetVtkPolyData();
 
-    // transform the obstacle strucutre according to the mitk geometry
+    // transform the obstacle structure according to the mitk geometry
     vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter =
       vtkSmartPointer<vtkTransformPolyDataFilter>::New();
     transformFilter->SetInputData(0, polyData);
     transformFilter->SetTransform(it->Value()->GetData()->GetGeometry()->GetVtkTransform());
     transformFilter->Update();
     polyData = transformFilter->GetOutput();
 
     // build an obb tree locator
     vtkSmartPointer<vtkOBBTree> cellLocator = vtkSmartPointer<vtkOBBTree>::New();
     cellLocator->SetDataSet(polyData);
     cellLocator->BuildLocator();
 
     // test for intersection with every point on the surface
     for ( vtkIdType n = 0; n < numberOfPoints; n++ )
     {
       vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
       if ( cellLocator->IntersectWithLine(point1, targetSurfaceVtkTransformed->GetPoint(n), points, nullptr) != 0 )
       {
         occlusion.at(n) = true;
       }
     }
   }
 
   if ( numberOfPoints > 0 )
   {
     // set the occlusion values as scalar array to the vtkPolyData
     float one = 1.0f; float zero = 0.0f;
     for ( std::vector<bool>::iterator it = occlusion.begin(); it != occlusion.end(); ++it )
     {
       colors->InsertNextTuple1(*it ? one : zero);
     }
 
     targetSurfaceVtk->GetPointData()->AddArray(colors);
     targetSurfaceVtk->GetPointData()->Update();
   }
 }
 
 vtkSmartPointer<vtkPolyData> mitk::USNavigationTargetOcclusionFilter::GetVtkPolyDataOfTarget()
 {
   if ( m_TargetStructure.IsNull() )
   {
     MITK_WARN("USNavigationTargetOcclusionFilter") << "Target structure must not be null.";
     return nullptr;
   }
 
   mitk::Surface::Pointer targetSurface = dynamic_cast<mitk::Surface*>(m_TargetStructure->GetData());
   if ( targetSurface.IsNull() )
   {
     MITK_WARN("USNavigationTargetOcclusionFilter") << "A mitk::Surface has to be set to the data node.";
     return nullptr;
   }
 
   vtkSmartPointer<vtkPolyData> targetSurfaceVtk = targetSurface->GetVtkPolyData();
   if( targetSurfaceVtk == nullptr )
   {
     MITK_WARN("USNavigationTargetOcclusionFilter") << "VtkPolyData of the mitk::Surface of the data node must not be null.";
     return nullptr;
   }
 
   return targetSurfaceVtk;
 }
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 9de23a22c5..bc3d042bcb 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 mitkUSNavigationTargetOcclusionFilter_h
 #define mitkUSNavigationTargetOcclusionFilter_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);
 
   /**
    * \brief Sets the target structure for which the occluded positions should be calculated.
-   * \param targetStructure DataNode conatining a mitk::Surface
+   * \param targetStructure DataNode containing 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
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.cpp
index 344f0f25de..9634e91b55 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkUSNavigationCombinedModalityPersistence.h"
 #include "mitkUSCombinedModality.h"
 
 // Microservices
 #include <usServiceReference.h>
 #include <usModuleContext.h>
 #include <usGetModuleContext.h>
 #include <usModuleContext.h>
 
 // Qt
 #include <QSettings>
 #include <QVector>
 #include <QHash>
 #include <QStringList>
 
 #include "internal/org_mbi_gui_qt_usnavigation_Activator.h"
 
 mitk::USNavigationCombinedModalityPersistence::USNavigationCombinedModalityPersistence()
 {
   us::ModuleContext* context = us::GetModuleContext();
 
   this->LoadStoredDevices();
 
   // to be notified about every register and unregister of an USDevice
   std::string filterExcludeCombinedModalities = "(&(" + us::ServiceConstants::OBJECTCLASS() + "="
       + "org.mitk.services.UltrasoundDevice)(!(" + mitk::USDevice::GetPropertyKeys().US_PROPKEY_CLASS + "="
       + mitk::USCombinedModality::DeviceClassIdentifier + ")))";
   context->AddServiceListener(this, &mitk::USNavigationCombinedModalityPersistence::OnServiceEvent,
     filterExcludeCombinedModalities);
 
   // to be notified about every register and unregister of an NavigationDataSource
   context->AddServiceListener(this, &mitk::USNavigationCombinedModalityPersistence::OnServiceEvent,
     "(" + us::ServiceConstants::OBJECTCLASS() + "=" + us_service_interface_iid<mitk::NavigationDataSource>() + ")");
 }
 
 mitk::USNavigationCombinedModalityPersistence::~USNavigationCombinedModalityPersistence()
 {
   //this->StoreCurrentDevices(); //disabled because persistence is buggy
 }
 
 void mitk::USNavigationCombinedModalityPersistence::OnServiceEvent(const us::ServiceEvent event)
 {
   if ( event.GetType() == event.REGISTERED )
   {
     //this->LoadStoredDevices(); //disabled because persistence is buggy
   }
 }
 
 void mitk::USNavigationCombinedModalityPersistence::StoreCurrentDevices()
 {
   QList<QVariant> devices;
 
   us::ModuleContext* context = us::GetModuleContext();
 
   // get all combined modality from the service registry
   std::string filterOnlyCombinedModalities = "(&(" + us::ServiceConstants::OBJECTCLASS() + "=" + "org.mitk.services.UltrasoundDevice)(" + mitk::USDevice::GetPropertyKeys().US_PROPKEY_CLASS + "=" + mitk::USCombinedModality::DeviceClassIdentifier + "))";
   std::vector<us::ServiceReference<USDevice> > services = context->GetServiceReferences<USDevice>(filterOnlyCombinedModalities);
 
   for ( std::vector<us::ServiceReference<USDevice> >::iterator it = services.begin();
         it != services.end(); ++it )
   {
     QStringList deviceStrings;
     mitk::USCombinedModality::Pointer currentDevice = dynamic_cast<mitk::USCombinedModality*>(context->GetService(*it));
     if ( currentDevice.IsNotNull() )
     {
-      // save manufacturer and model strig of the combined modality
+      // save manufacturer and model string of the combined modality
       deviceStrings.push_back(QString::fromStdString(currentDevice->GetUltrasoundDevice()->GetManufacturer()));
       deviceStrings.push_back(QString::fromStdString(currentDevice->GetUltrasoundDevice()->GetName()));
 
       // save name of the navigation data source
       mitk::NavigationDataSource::Pointer navigationDataSource = currentDevice->GetNavigationDataSource();
       if ( currentDevice.IsNull() ) { continue; }
       deviceStrings.push_back(QString::fromStdString(navigationDataSource->GetName()));
 
       // save manufacturer, model and comment of the ultrasound device
       mitk::USDevice::Pointer ultrasoundDevice = currentDevice->GetUltrasoundDevice();
       if ( ultrasoundDevice.IsNull() ) { continue; }
       deviceStrings.push_back(QString::fromStdString(ultrasoundDevice->GetManufacturer()));
       deviceStrings.push_back(QString::fromStdString(ultrasoundDevice->GetName()));
       deviceStrings.push_back(QString::fromStdString(ultrasoundDevice->GetComment()));
 
       // save calibration of the combined modality
       deviceStrings.push_back(QString::fromStdString(currentDevice->SerializeCalibration()));
     }
 
     devices.push_back(deviceStrings);
   }
 
   // store everything in QSettings
   QSettings settings;
   settings.setValue("combined-modalities", devices);
 }
 
 void mitk::USNavigationCombinedModalityPersistence::LoadStoredDevices()
 {
   // load everything from QSettings
   QSettings settings;
   QList<QVariant> devices = settings.value("combined-modalities").value< QList<QVariant> >();
 
   for ( QList<QVariant>::iterator it = devices.begin();
         it != devices.end(); ++it )
   {
     // get the saved strings for the combined modality (there must be at least
     // the seven strings, which where saved before)
     QStringList stringList = it->toStringList();
 
     // test if the combined modality wasn't restored before
     if (stringList.size() >= 7 && this->GetCombinedModality(stringList.at(0).toStdString(), stringList.at(1).toStdString()).IsNull())
     {
       // try to get matching navigation data source and ultrasound device
       mitk::NavigationDataSource::Pointer navigationDataSource = this->GetNavigationDataSource(stringList.at(2).toStdString());
       mitk::USDevice::Pointer usDevice = this->GetUSDevice(stringList.at(3).toStdString(), stringList.at(4).toStdString(), stringList.at(5).toStdString());
 
       // create the combined modality if matching navigation data source and
       // ultrasound device werde found
       if ( navigationDataSource.IsNotNull() && usDevice.IsNotNull() )
       {
         mitk::USCombinedModality::Pointer combinedModality = mitk::USCombinedModality::New(usDevice, navigationDataSource, false);
         combinedModality->DeserializeCalibration(stringList.at(6).toStdString());
         combinedModality->GetUltrasoundDevice()->Initialize();
       }
     }
   }
 }
 
 mitk::USCombinedModality::Pointer mitk::USNavigationCombinedModalityPersistence::GetCombinedModality(std::string manufacturer, std::string model)
 {
   us::ModuleContext* context = us::GetModuleContext();
 
   std::string filterOnlyCombinedModalities = "(&(" + us::ServiceConstants::OBJECTCLASS() + "="
       + "org.mitk.services.UltrasoundDevice)(" + mitk::USDevice::GetPropertyKeys().US_PROPKEY_CLASS + "="
       + mitk::USCombinedModality::DeviceClassIdentifier + "))";
   std::vector<us::ServiceReference<USDevice> > services = context->GetServiceReferences<USDevice>(filterOnlyCombinedModalities);
 
   for ( std::vector<us::ServiceReference<USDevice> >::iterator it = services.begin();
         it != services.end(); ++it )
   {
     mitk::USCombinedModality::Pointer currentDevice = dynamic_cast<mitk::USCombinedModality*>(context->GetService(*it));
     if ( currentDevice.IsNotNull() )
     {
       if ( currentDevice->GetUltrasoundDevice()->GetManufacturer() == manufacturer && currentDevice->GetUltrasoundDevice()->GetName() == model )
       {
         return currentDevice;
       }
     }
   }
 
   return nullptr;
 }
 
 mitk::USDevice::Pointer mitk::USNavigationCombinedModalityPersistence::GetUSDevice(std::string manufacturer, std::string model, std::string comment)
 {
   us::ModuleContext* context = us::GetModuleContext();
 
   std::string filterExcludeCombinedModalities = "(&(" + us::ServiceConstants::OBJECTCLASS() + "="
       + "org.mitk.services.UltrasoundDevice)(!(" + mitk::USDevice::GetPropertyKeys().US_PROPKEY_CLASS + "="
       + mitk::USCombinedModality::DeviceClassIdentifier + ")))";
   std::vector<us::ServiceReference<USDevice> > services = context->GetServiceReferences<USDevice>(filterExcludeCombinedModalities);
 
   for ( std::vector<us::ServiceReference<USDevice> >::iterator it = services.begin();
         it != services.end(); ++it )
   {
     mitk::USDevice::Pointer currentDevice = dynamic_cast<mitk::USDevice*>(context->GetService(*it));
     if ( currentDevice.IsNotNull() )
     {
       if ( currentDevice->GetManufacturer() == manufacturer && currentDevice->GetName() == model
            && currentDevice->GetComment() == comment )
       {
         return currentDevice;
       }
     }
   }
 
   return nullptr;
 }
 
 mitk::NavigationDataSource::Pointer mitk::USNavigationCombinedModalityPersistence::GetNavigationDataSource(std::string name)
 {
   us::ModuleContext* context = us::GetModuleContext();
 
   std::vector<us::ServiceReference<mitk::NavigationDataSource> > services = context->GetServiceReferences<mitk::NavigationDataSource>();
 
   for ( std::vector<us::ServiceReference<mitk::NavigationDataSource> >::iterator it = services.begin();
         it != services.end(); ++it )
   {
     mitk::NavigationDataSource::Pointer currentDevice = dynamic_cast<mitk::NavigationDataSource*>(context->GetService(*it));
     if ( currentDevice.IsNotNull() )
     {
       if ( currentDevice->GetName() == name )
       {
         return currentDevice;
       }
     }
   }
 
   return nullptr;
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.cpp
index e58df0d54b..67714b7b70 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "mitkUSNavigationExperimentLogging.h"
 #include "mitkDataNode.h"
 
 #include "itkRealTimeClock.h"
 
 #include "Poco/DOM/Document.h"
 #include "Poco/DOM/Element.h"
 #include "Poco/DOM/Text.h"
 #include "Poco/DOM/NodeList.h"
 #include "Poco/DOM/DOMWriter.h"
 #include "Poco/XML/XMLWriter.h"
 
 mitk::USNavigationExperimentLogging::USNavigationExperimentLogging()
   : m_CurrentResultNumber(0),
     m_RealTimeClock(itk::RealTimeClock::New())
 {
   this->Reset();
 }
 
 mitk::USNavigationExperimentLogging::~USNavigationExperimentLogging()
 {
 }
 
 void mitk::USNavigationExperimentLogging::Reset()
 {
   m_StartTime = m_RealTimeClock->GetTimeInSeconds();
 
   m_OutputXML = new Poco::XML::Document();
   m_OutputXMLRoot = m_OutputXML->createElement("ExperimentResults");
   m_OutputXML->appendChild(m_OutputXMLRoot);
 }
 
 void mitk::USNavigationExperimentLogging::SetFileName(const std::string& fileName)
 {
   m_FileName = fileName;
 }
 
 void mitk::USNavigationExperimentLogging::SetResult(const itk::SmartPointer<mitk::DataNode> resultNode)
 {
   Poco::AutoPtr<Poco::XML::Element> currentResultElement = m_OutputXML->createElement(resultNode->GetName());
   m_OutputXMLRoot->appendChild(currentResultElement);
 
   this->AddCurrentTimeAttributes(currentResultElement);
 
   const mitk::PropertyList::PropertyMap* propertyMap = resultNode->GetPropertyList()->GetMap();
 
   for ( mitk::PropertyList::PropertyMap::const_iterator it = propertyMap->begin();
     it != propertyMap->end(); ++it )
   {
     size_t prefixSize = m_KeyPrefix.size();
 
-    // only write properties with keys begining with the prefix (if a prefix was set)
+    // only write properties with keys beginning with the prefix (if a prefix was set)
     if ( ! m_KeyPrefix.empty() && it->first.substr(0, prefixSize) != m_KeyPrefix ) { continue; }
 
     if ( prefixSize >= it->first.size() )
     {
       MITK_ERROR("USNavigationExperimentLogging") << "Property key must contain more characters then the key prefix.";
       mitkThrow() << "Property key must contain more characters then the key prefix.";
     }
 
     // create a xml element named like the key but without the prefix and
     // append it into the xml tree
     Poco::AutoPtr<Poco::XML::Element> mapElement = m_OutputXML->createElement(it->first.substr(prefixSize, it->first.size() - prefixSize));
     currentResultElement->appendChild(mapElement);
 
     // get the class of the property and save it in the tree
     mapElement->setAttribute("class", it->second->GetNameOfClass());
 
     // convert the value of the property to a string and save it in the tree
     Poco::AutoPtr<Poco::XML::Text> value = m_OutputXML->createTextNode(it->second->GetValueAsString());
     mapElement->appendChild(value);
   }
 
   this->WriteXmlToFile();
 }
 
 void mitk::USNavigationExperimentLogging::AddCurrentTimeAttributes(Poco::AutoPtr<Poco::XML::Element> element)
 {
   // get the current time and add it as attribute to the xml
   std::stringstream stringStreamTime;
   stringStreamTime.precision(2);
   stringStreamTime << std::fixed << m_RealTimeClock->GetTimeInSeconds();
   element->setAttribute("time", stringStreamTime.str());
 
   // get the duration since the start time and add it as attribute to the xml
   std::stringstream stringStreamExperimentTime;
   stringStreamExperimentTime.precision(2);
   stringStreamExperimentTime << std::fixed << m_RealTimeClock->GetTimeInSeconds() - m_StartTime;
   element->setAttribute("duration", stringStreamExperimentTime.str());
 }
 
 void mitk::USNavigationExperimentLogging::WriteXmlToFile()
 {
-  // open file and write tree if successfull
+  // open file and write tree if successful
   std::ofstream filestream(m_FileName.c_str());
   if ( filestream.is_open() )
   {
     // print xml tree to the file
     Poco::XML::DOMWriter domWriter;
     domWriter.setNewLine("\n");
     domWriter.setOptions(Poco::XML::XMLWriter::PRETTY_PRINT);
 
     try
     {
       domWriter.writeNode(filestream, m_OutputXML);
     }
     catch (const Poco::Exception &e)
     {
       MITK_ERROR("USNavigationExperimentLogging") << "Cannot write XML tree (" << e.displayText() << ").";
       mitkThrow() << "Cannot write XML tree (" << e.displayText() << ").";
     }
 
     filestream.close();
   }
   else
   {
     MITK_ERROR("USNavigationExperimentLogging") << "Cannot open output file (" << m_FileName << "). Nothing will be stored at the file system.";
     mitkThrow() << "Cannot open output file (" << m_FileName << "). Nothing will be stored at the file system.";
   }
 }
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 52abbd4908..00cf07203c 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,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 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);
 
       /**
        * \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
+     * event and updates the data node attribute "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
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
index 408c33bfc9..da23ff2e31 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
@@ -1,307 +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 QmitkUSAbstractNavigationStep_h
 #define QmitkUSAbstractNavigationStep_h
 
 #include <QWidget>
 
 #include "mitkDataStorage.h"
 #include "mitkAbstractUltrasoundTrackerDevice.h"
 
 namespace itk {
 template<class T> class SmartPointer;
 }
 
 namespace mitk {
 class NavigationDataToNavigationDataFilter;
 }
 
 /**
  * \brief Abstract base class for navigation step widgets.
  *
  * This class defines a life cycle for navigation steps. Steps can be activated
  * and deactivated. The first time a step is activated, it is started before
  * the activation. Steps can be stopped, finished and restarted, too.
  *
  * On every state change, the corresponding virtual On... method is called
  * (OnStartStep(), OnActivateStep(), OnFinishStep(), ...). These methods are
  * to implement by concrete navigation step widgets. While a step is in the
  * "active" state, its OnUpdate() method is called periodically.
  */
 class QmitkUSAbstractNavigationStep : public QWidget
 {
   Q_OBJECT
 
 signals:
   /**
    * \brief Signals that all necessary actions where done.
    * The user can proceed with the next stept after this was signaled.
    */
   void SignalReadyForNextStep();
 
   /**
    * \brief Signals that it is no longer possible to proceed with following steps.
-   * This signal is emmited when the result data of the step was removed or
+   * This signal is emitted when the result data of the step was removed or
    * changed, so that the old results are invalid for following steps.
    */
   void SignalNoLongerReadyForNextStep();
 
   /**
    * \brief Signals that the combined modality was changed by this step.
    * This signal is mainly for steps which creates the combined modality. The
    * new combined modality is given as a parameter.
    */
   void SignalCombinedModalityChanged(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice>);
 
   /**
    * \brief Signals that an intermediate result was produced.
    * The properties of the given data node must contain the results. This signal
    * can be used to log the intermediate results of an experiment, for example
    * by using the mitk::USNavigationExperimentLogging.
    */
   void SignalIntermediateResult(const itk::SmartPointer<mitk::DataNode>);
 
   /**
    * \brief Signals that the settings node was changed.
-   * This signal must not be emited in an OnSettingsChanged() method.
+   * This signal must not be emitted in an OnSettingsChanged() method.
    */
   void SignalSettingsNodeChanged(itk::SmartPointer<mitk::DataNode>);
 
 public:
   typedef std::vector< itk::SmartPointer<mitk::NavigationDataToNavigationDataFilter> > FilterVector;
 
   enum NavigationStepState { State_Stopped, State_Started, State_Active };
 
   static const char* DATANAME_SETTINGS;
   static const char* DATANAME_IMAGESTREAM;
   static const char* DATANAME_BASENODE;
 
   explicit QmitkUSAbstractNavigationStep(QWidget *parent = nullptr);
   ~QmitkUSAbstractNavigationStep() override;
 
   /**
    * \brief Getter for the title of the navigation step.
    * This title should be human readable and can be used to display the
    * available steps and the currently active step to the user.
    * The method has to be implemented by a concrete subclass.
    */
   virtual QString GetTitle() = 0;
 
   /**
    * \brief Indicates if it makes sense to be able to restart the step.
    * This method must be implemented by concrete subclasses if it should not be
    * possible to restart them.
    *
    * \return true for the default implementation
    */
   virtual bool GetIsRestartable();
 
   /**
    * \brief Called every time the settings for the navigation process where changed.
    * This method may be implemented by a concrete subclass. The default
    * implementation does nothing.
    */
   virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> /*settingsNode*/) { }
 
   /**
    * \brief Getter for navigation data filters of the navigation step.
    * This method may be implemented by a concrete subclass. The default
    * implementation returns an empty vector.
    *
    * \return all navigation data filters that should be updated during the navigation process
    */
   virtual FilterVector GetFilter();
 
   /**
    * \brief Sets the data storage for the exchange of results between navigation steps.
    */
   void SetDataStorage(itk::SmartPointer<mitk::DataStorage> dataStorage);
 
   /**
    * \brief Sets the combined modality for the navigation step.
    * OnSetCombinedModality() is called internal.
    */
   void SetCombinedModality(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> combinedModality);
 
   /**
    * \brief Should be called to start the navigation step.
    * \return true if the state was 'stopped' before and OnStartStep() returns true
    */
   bool StartStep();
 
   /**
    * \brief Should be called to stop the navigation step.
    * \return true if the state was 'started' (or 'active') and OnStopStep() (and OnDeactivateStep()) return true
    */
   bool StopStep();
 
   /**
    * \brief Should be called to restart the navigation step.
    * \return true if OnRestartStep() returns true
    */
   bool RestartStep();
 
   /**
    * \brief Should be called to finish the navigation step.
    * The state has to be 'active' before and is 'started' afterwards.
    *
    * \return true if the state was 'active' and DeactivateStep() and OnFinishStep() return true
    */
   bool FinishStep();
 
   /**
    * \brief Should be called to activate the navigation step.
    * The step gets started before if it was stopped.
    *
    * \return true if the state wasn't 'activated' and OnActivateStep() returns true
    */
   bool ActivateStep();
 
   /**
    * \brief Should be called to deactivate the navigation step.
    * \return true if the state was 'activated' and OnDeactivateStep() returns true
    */
   bool DeactivateStep();
 
   /**
    * \brief Should be called periodically while the navigation step is active.
    * Internal, the method OnUpdate() is called.
    */
   void Update();
 
   /**
    * \brief Get the current state of the navigation step.
    * \return State_Stopped, State_Started or State_Active
    */
   NavigationStepState GetNavigationStepState();
 
 protected:
   /**
    * \brief Called when the navigation step gets started.
    * This method has to be implemented by a concrete subclass to handle actions
    * necessary for starting the step (e.g. initializing that has only to be done
    * once).
    *
    * \return if the actions were done successfully
    */
   virtual bool OnStartStep() = 0;
 
   /**
    * \brief Callen when the navigation step gets stopped.
    * This method may be implemented by a concrete subclass to handle actions
    * necessary for stopping the step (e.g. cleanup). The default implementation
    * does nothing.
    *
    * \return if the actions were done successfully; true on every call for the default implementation
    */
   virtual bool OnStopStep() { return true; }
 
   /**
    * \brief Called when restarting a navigation step.
    * This method may be implemented by a concrete subclass to handle actions
    * necessary for restarting the navigation step. The default implementations
    * calls OnStopStep() followed by OnStartStep().
    *
    * \return if the actions were done successfully
    */
   virtual bool OnRestartStep();
 
   /**
    * \brief Called when all necessary actions for the step where done.
    * This method has to be implemented by a concrete subclass to handle actions
    * necessary for finishing the navigation step.
    *
    * \return if the actions were done successfully
    */
   virtual bool OnFinishStep() = 0;
 
   /**
    * \brief Called when the navigation step gets activated.
    * This method has to be implemented by a concrete subclass to handle actions
    * necessary on activating the navigation step.
    *
    * \return if the actions were done successfully
    */
   virtual bool OnActivateStep() = 0;
 
   /**
    * \brief Called when the navigation step gets deactivated (-> state started).
    * This method may be implemented by a concrete subclass to handle actions
    * necessary on deactivating the navigation step, which means switching to
    * another step.
    *
    * \return if the actions were done successfully; true on every call for the default implementation
    */
   virtual bool OnDeactivateStep() { return true; }
 
   /**
    * \brief Called periodically while a navigation step is active.
    * This method has to be implemented by a concrete subclass to handle all
    * periodic actions during the navigation step.
    */
   virtual void OnUpdate() = 0;
 
   /**
    * \brief Called every time SetCombinedModality() was called.
    * This method may be implemented by a concrete subclass to handle this event.
    * The default implementation does nothing.
    */
   virtual void OnSetCombinedModality() { }
 
   /**
    * \brief Returns the data storage set for the navigation step.
    *
    * \param throwNull if this method should throw an exception when the data storage is null (default: true)
    * \return the data storage set by SetDataStorage(); can only be null if the parameter throwNull is set to false
    * \throws mitk::Exception if the data storage is null and the parameter throwNull is set to true
    */
   itk::SmartPointer<mitk::DataStorage> GetDataStorage(bool throwNull = true);
 
   /**
    * \brief Returns the combined modality set for the navigation step.
    *
    * \param throwNull if this method should throw an exception when the combined modality is null (default: true)
    * \return the combined modality set by SetCombinedModality(); can only be null if the parameter throwNull is set to false
    * \throws mitk::Exception if the combined modality is null and the parameter throwNull is set to true
    */
   itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> GetCombinedModality(bool throwNull = true);
 
   /**
    * \brief Returns node with the given name and the given source node (parent) from the data storage.
    *
    * \param name the name of the node which should be got from the data storage
    * \param sourceName name of the source node under which the node should be searched
    * \return node with the given name or null if no node with the given name and source node could be found
    * \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null
    */
   itk::SmartPointer<mitk::DataNode> GetNamedDerivedNode(const char* name, const char* sourceName);
 
   /**
    * \brief Returns node with the given name and the given source node (parent) from the data storage.
    * The node is created if no matching node was found.
    *
    * \param name the name of the node which should be got from the data storage
    * \param sourceName name of the source node under which the node should be searched
    * \return node with the given name
    * \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null
    */
   itk::SmartPointer<mitk::DataNode> GetNamedDerivedNodeAndCreate(const char* name, const char* sourceName);
 
 private:
   itk::SmartPointer<mitk::DataStorage>        m_DataStorage;
   itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
 
   NavigationStepState                         m_NavigationStepState;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.cpp
index 16b5a9a3b8..a2bac7f3d3 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.cpp
@@ -1,2014 +1,2014 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkUSNavigationStepCtUsRegistration.h"
 #include "ui_QmitkUSNavigationStepCtUsRegistration.h"
 
 #include <QMessageBox>
 
 #include "mitkNodeDisplacementFilter.h"
 #include "../Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h"
 #include "../QmitkUSNavigationMarkerPlacement.h"
 
 
 
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkLabelSetImage.h>
 #include "mitkProperties.h"
 #include <mitkImage.h>
 #include <mitkImageCast.h>
 
 #include <mitkRenderingManager.h>
 #include <mitkStaticIGTHelperFunctions.h>
 
 #include <vtkLandmarkTransform.h>
 #include <vtkPoints.h>
 
 #include <itkImageRegionIterator.h>
 #include <itkGeometryUtilities.h>
 #include <mitkImagePixelReadAccessor.h>
 
 #include <itkZeroCrossingImageFilter.h>
 #include <itkSimpleContourExtractorImageFilter.h>
 #include <itkCannyEdgeDetectionImageFilter.h>
 
 static const int NUMBER_FIDUCIALS_NEEDED = 8;
 
 QmitkUSNavigationStepCtUsRegistration::QmitkUSNavigationStepCtUsRegistration(QWidget *parent) :
   QmitkUSAbstractNavigationStep(parent),
   ui(new Ui::QmitkUSNavigationStepCtUsRegistration),
   m_PerformingGroundTruthProtocolEvaluation(false),
   m_FloatingImageToUltrasoundRegistrationFilter(nullptr),
   m_FreezeCombinedModality(false)
 {
   this->UnsetFloatingImageGeometry();
   this->DefineDataStorageImageFilter();
   this->CreateQtPartControl(this);
 }
 
 
 QmitkUSNavigationStepCtUsRegistration::~QmitkUSNavigationStepCtUsRegistration()
 {
   delete ui;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::OnStartStep()
 {
   MITK_INFO << "OnStartStep()";
   return true;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::OnStopStep()
 {
   MITK_INFO << "OnStopStep()";
   return true;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::OnFinishStep()
 {
   MITK_INFO << "OnFinishStep()";
   return true;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::OnActivateStep()
 {
   MITK_INFO << "OnActivateStep()";
   ui->floatingImageComboBox->SetDataStorage(this->GetDataStorage());
   ui->ctImagesToChooseComboBox->SetDataStorage(this->GetDataStorage());
   ui->segmentationComboBox->SetDataStorage(this->GetDataStorage());
   ui->selectedSurfaceComboBox->SetDataStorage(this->GetDataStorage());
   ui->pointSetComboBox->SetDataStorage(this->GetDataStorage());
   m_FloatingImageToUltrasoundRegistrationFilter =
     mitk::FloatingImageToUltrasoundRegistrationFilter::New();
   return true;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::OnDeactivateStep()
 {
   MITK_INFO << "OnDeactivateStep()";
   return true;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnUpdate()
 {
   if (m_NavigationDataSource.IsNull()) { return; }
 
   m_NavigationDataSource->Update();
   m_FloatingImageToUltrasoundRegistrationFilter->Update();
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode)
 {
   Q_UNUSED(settingsNode);
 }
 
 QString QmitkUSNavigationStepCtUsRegistration::GetTitle()
 {
   return "CT-to-US registration";
 }
 
 QmitkUSAbstractNavigationStep::FilterVector QmitkUSNavigationStepCtUsRegistration::GetFilter()
 {
   return FilterVector();
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnSetCombinedModality()
 {
   mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality = this->GetCombinedModality(false);
   if (combinedModality.IsNotNull())
   {
     m_NavigationDataSource = combinedModality->GetNavigationDataSource();
   }
 
 }
 
 void QmitkUSNavigationStepCtUsRegistration::UnsetFloatingImageGeometry()
 {
   m_ImageDimension[0] = 0;
   m_ImageDimension[1] = 0;
   m_ImageDimension[2] = 0;
 
   m_ImageSpacing[0] = 1;
   m_ImageSpacing[1] = 1;
   m_ImageSpacing[2] = 1;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::SetFloatingImageGeometryInformation(mitk::Image * image)
 {
   m_ImageDimension[0] = image->GetDimension(0);
   m_ImageDimension[1] = image->GetDimension(1);
   m_ImageDimension[2] = image->GetDimension(2);
 
   m_ImageSpacing[0] = image->GetGeometry()->GetSpacing()[0];
   m_ImageSpacing[1] = image->GetGeometry()->GetSpacing()[1];
   m_ImageSpacing[2] = image->GetGeometry()->GetSpacing()[2];
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetVoxelVolume()
 {
   if (m_FloatingImage.IsNull())
   {
     return 0.0;
   }
 
   MITK_INFO << "ImageSpacing = " << m_ImageSpacing;
   return m_ImageSpacing[0] * m_ImageSpacing[1] * m_ImageSpacing[2];
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetFiducialVolume(double radius)
 {
   return 1.333333333 * 3.141592 * (radius * radius * radius);
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FilterFloatingImage()
 {
   if (m_FloatingImage.IsNull())
   {
     return false;
   }
 
   ImageType::Pointer itkImage1 = ImageType::New();
   mitk::CastToItkImage(m_FloatingImage, itkImage1);
 
   this->InitializeImageFilters();
 
   m_ThresholdFilter->SetInput(itkImage1);
   m_LaplacianFilter1->SetInput(m_ThresholdFilter->GetOutput());
   m_LaplacianFilter2->SetInput(m_LaplacianFilter1->GetOutput());
   m_BinaryThresholdFilter->SetInput(m_LaplacianFilter2->GetOutput());
   m_HoleFillingFilter->SetInput(m_BinaryThresholdFilter->GetOutput());
   m_BinaryImageToShapeLabelMapFilter->SetInput(m_HoleFillingFilter->GetOutput());
   m_BinaryImageToShapeLabelMapFilter->Update();
 
   ImageType::Pointer binaryImage = ImageType::New();
   binaryImage = m_HoleFillingFilter->GetOutput();
 
   this->EliminateTooSmallLabeledObjects(binaryImage);
   //mitk::CastToMitkImage(binaryImage, m_FloatingImage);
   return true;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::InitializeImageFilters()
 {
   //Initialize threshold filters
   m_ThresholdFilter = itk::ThresholdImageFilter<ImageType>::New();
   m_ThresholdFilter->SetOutsideValue(0);
   m_ThresholdFilter->SetLower(500);
   m_ThresholdFilter->SetUpper(3200);
 
   //Initialize binary threshold filter 1
   m_BinaryThresholdFilter = BinaryThresholdImageFilterType::New();
   m_BinaryThresholdFilter->SetOutsideValue(0);
   m_BinaryThresholdFilter->SetInsideValue(1);
   m_BinaryThresholdFilter->SetLowerThreshold(350);
   m_BinaryThresholdFilter->SetUpperThreshold(10000);
 
   //Initialize laplacian recursive gaussian image filter
   m_LaplacianFilter1 = LaplacianRecursiveGaussianImageFilterType::New();
   m_LaplacianFilter2 = LaplacianRecursiveGaussianImageFilterType::New();
 
   //Initialize binary hole filling filter
   m_HoleFillingFilter = VotingBinaryIterativeHoleFillingImageFilterType::New();
   VotingBinaryIterativeHoleFillingImageFilterType::InputSizeType radius;
   radius.Fill(1);
   m_HoleFillingFilter->SetRadius(radius);
   m_HoleFillingFilter->SetBackgroundValue(0);
   m_HoleFillingFilter->SetForegroundValue(1);
   m_HoleFillingFilter->SetMaximumNumberOfIterations(5);
 
   //Initialize binary image to shape label map filter
   m_BinaryImageToShapeLabelMapFilter = BinaryImageToShapeLabelMapFilterType::New();
   m_BinaryImageToShapeLabelMapFilter->SetInputForegroundValue(1);
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetCharacteristicDistanceAWithUpperMargin()
 {
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
     case 0:
       return 12.07;
 
     // case 1 is equal to fiducial marker configuration B (15mm distance)
     case 1:
       return 18.105;
 
     // case 2 is equal to fiducial marker configuration C (20mm distance)
     case 2:
       return 24.14;
   }
   return 0.0;
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetCharacteristicDistanceBWithLowerMargin()
 {
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
   case 0:
     return 12.07;
 
     // case 1 is equal to fiducial marker configuration B (15mm distance)
   case 1:
     return 18.105;
 
     // case 2 is equal to fiducial marker configuration C (20mm distance)
   case 2:
     return 24.14;
   }
   return 0.0;
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetCharacteristicDistanceBWithUpperMargin()
 {
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
   case 0:
     return 15.73;
 
     // case 1 is equal to fiducial marker configuration B (15mm distance)
   case 1:
     return 23.595;
 
     // case 2 is equal to fiducial marker configuration C (20mm distance)
   case 2:
     return 31.46;
   }
   return 0.0;
 }
 
 double QmitkUSNavigationStepCtUsRegistration::GetMinimalFiducialConfigurationDistance()
 {
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
   case 0:
     return 10.0;
 
     // case 1 is equal to fiducial marker configuration B (15mm distance)
   case 1:
     return 15.0;
 
     // case 2 is equal to fiducial marker configuration C (20mm distance)
   case 2:
     return 20.0;
   }
   return 0.0;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::CreateMarkerModelCoordinateSystemPointSet()
 {
   if (m_MarkerModelCoordinateSystemPointSet.IsNull())
   {
     m_MarkerModelCoordinateSystemPointSet = mitk::PointSet::New();
   }
   else
   {
     m_MarkerModelCoordinateSystemPointSet->Clear();
   }
 
   mitk::Point3D fiducial1;
   mitk::Point3D fiducial2;
   mitk::Point3D fiducial3;
   mitk::Point3D fiducial4;
   mitk::Point3D fiducial5;
   mitk::Point3D fiducial6;
   mitk::Point3D fiducial7;
   mitk::Point3D fiducial8;
 
 
 
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
   case 0:
     fiducial1[0] = 0;
     fiducial1[1] = 0;
     fiducial1[2] = 0;
 
     fiducial2[0] = 0;
     fiducial2[1] = 10;
     fiducial2[2] = 0;
 
     fiducial3[0] = 10;
     fiducial3[1] = 0;
     fiducial3[2] = 0;
 
     fiducial4[0] = 20;
     fiducial4[1] = 20;
     fiducial4[2] = 0;
 
     fiducial5[0] = 0;
     fiducial5[1] = 20;
     fiducial5[2] = 10;
 
     fiducial6[0] = 10;
     fiducial6[1] = 20;
     fiducial6[2] = 10;
 
     fiducial7[0] = 20;
     fiducial7[1] = 10;
     fiducial7[2] = 10;
 
     fiducial8[0] = 20;
     fiducial8[1] = 0;
     fiducial8[2] = 10;
     break;
     // case 1 is equal to fiducial marker configuration B (15mm distance)
   case 1:
     fiducial1[0] = 0;
     fiducial1[1] = 0;
     fiducial1[2] = 0;
 
     fiducial2[0] = 0;
     fiducial2[1] = 15;
     fiducial2[2] = 0;
 
     fiducial3[0] = 15;
     fiducial3[1] = 0;
     fiducial3[2] = 0;
 
     fiducial4[0] = 30;
     fiducial4[1] = 30;
     fiducial4[2] = 0;
 
     fiducial5[0] = 0;
     fiducial5[1] = 30;
     fiducial5[2] = 15;
 
     fiducial6[0] = 15;
     fiducial6[1] = 30;
     fiducial6[2] = 15;
 
     fiducial7[0] = 30;
     fiducial7[1] = 15;
     fiducial7[2] = 15;
 
     fiducial8[0] = 30;
     fiducial8[1] = 0;
     fiducial8[2] = 15;
     break;
     // case 2 is equal to fiducial marker configuration C (20mm distance)
   case 2:
     fiducial1[0] = 0;
     fiducial1[1] = 0;
     fiducial1[2] = 0;
 
     fiducial2[0] = 0;
     fiducial2[1] = 20;
     fiducial2[2] = 0;
 
     fiducial3[0] = 20;
     fiducial3[1] = 0;
     fiducial3[2] = 0;
 
     fiducial4[0] = 40;
     fiducial4[1] = 40;
     fiducial4[2] = 0;
 
     fiducial5[0] = 0;
     fiducial5[1] = 40;
     fiducial5[2] = 20;
 
     fiducial6[0] = 20;
     fiducial6[1] = 40;
     fiducial6[2] = 20;
 
     fiducial7[0] = 40;
     fiducial7[1] = 20;
     fiducial7[2] = 20;
 
     fiducial8[0] = 40;
     fiducial8[1] = 0;
     fiducial8[2] = 20;
     break;
   }
 
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(0, fiducial1);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(1, fiducial2);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(2, fiducial3);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(3, fiducial4);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(4, fiducial5);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(5, fiducial6);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(6, fiducial7);
   m_MarkerModelCoordinateSystemPointSet->InsertPoint(7, fiducial8);
 
   /*mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode("Marker Model Coordinate System Point Set");
   if (node == nullptr)
   {
     node = mitk::DataNode::New();
     node->SetName("Marker Model Coordinate System Point Set");
     node->SetData(m_MarkerModelCoordinateSystemPointSet);
     this->GetDataStorage()->Add(node);
   }
   else
   {
     node->SetData(m_MarkerModelCoordinateSystemPointSet);
     this->GetDataStorage()->Modified();
   }*/
 }
 
 void QmitkUSNavigationStepCtUsRegistration::InitializePointsToTransformForGroundTruthProtocol()
 {
 
   m_PointsToTransformGroundTruthProtocol.clear();
 
   mitk::Point3D point0mm;
   mitk::Point3D point20mm;
   mitk::Point3D point40mm;
   mitk::Point3D point60mm;
   mitk::Point3D point80mm;
   mitk::Point3D point100mm;
 
   point0mm[0] = 0.0;
   point0mm[1] = 0.0;
   point0mm[2] = 0.0;
 
   point20mm[0] = 0.0;
   point20mm[1] = 0.0;
   point20mm[2] = 0.0;
 
   point40mm[0] = 0.0;
   point40mm[1] = 0.0;
   point40mm[2] = 0.0;
 
   point60mm[0] = 0.0;
   point60mm[1] = 0.0;
   point60mm[2] = 0.0;
 
   point80mm[0] = 0.0;
   point80mm[1] = 0.0;
   point80mm[2] = 0.0;
 
   point100mm[0] = 0.0;
   point100mm[1] = 0.0;
   point100mm[2] = 0.0;
 
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(0, point0mm));
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(20, point20mm));
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(40, point40mm));
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(60, point60mm));
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(80, point80mm));
   m_PointsToTransformGroundTruthProtocol.insert(std::pair<int, mitk::Point3D>(100, point100mm));
 }
 
 void QmitkUSNavigationStepCtUsRegistration::CreatePointsToTransformForGroundTruthProtocol()
 {
   this->InitializePointsToTransformForGroundTruthProtocol();
 
   switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
   {
     // case 0 is equal to fiducial marker configuration A (10mm distance)
   case 0:
     MITK_WARN << "For this marker configuration (10mm) there does not exist a point to transform.";
     break;
     // case 1 is equal to fiducial marker configuration B (15mm distance)
   case 1:
     m_PointsToTransformGroundTruthProtocol.at(0)[0] = 130;  // = 30mm to end of clipping plate + 100 mm to middle axis of measurement plate
     m_PointsToTransformGroundTruthProtocol.at(0)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(0)[2] = -7;  // = 5mm distance to clipping plate + 2mm to base
 
     m_PointsToTransformGroundTruthProtocol.at(20)[0] = 130;
     m_PointsToTransformGroundTruthProtocol.at(20)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(20)[2] = -27;  // = 5mm distance to clipping plate + 2mm to base + 20mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(40)[0] = 130;
     m_PointsToTransformGroundTruthProtocol.at(40)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(40)[2] = -47;  // = 5mm distance to clipping plate + 2mm to base + 40mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(60)[0] = 130;
     m_PointsToTransformGroundTruthProtocol.at(60)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(60)[2] = -67;  // = 5mm distance to clipping plate + 2mm to base + 60mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(80)[0] = 130;
     m_PointsToTransformGroundTruthProtocol.at(80)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(80)[2] = -87;  // = 5mm distance to clipping plate + 2mm to base + 80mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(100)[0] = 130;
     m_PointsToTransformGroundTruthProtocol.at(100)[1] = 15;
     m_PointsToTransformGroundTruthProtocol.at(100)[2] = -107;  // = 5mm distance to clipping plate + 2mm to base + 100mm depth
 
     break;
     // case 2 is equal to fiducial marker configuration C (20mm distance)
   case 2:
     m_PointsToTransformGroundTruthProtocol.at(0)[0] = 135;  // = 20 + 15mm to end of clipping plate + 100 mm to middle axis of measurement plate
     m_PointsToTransformGroundTruthProtocol.at(0)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(0)[2] = -9;  // = 7mm distance to clipping plate + 2mm to base
 
     m_PointsToTransformGroundTruthProtocol.at(20)[0] = 135;
     m_PointsToTransformGroundTruthProtocol.at(20)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(20)[2] = -29;  // = 7mm distance to clipping plate + 2mm to base + 20mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(40)[0] = 135;
     m_PointsToTransformGroundTruthProtocol.at(40)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(40)[2] = -49;  // = 7mm distance to clipping plate + 2mm to base + 40mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(60)[0] = 135;
     m_PointsToTransformGroundTruthProtocol.at(60)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(60)[2] = -69;  // = 7mm distance to clipping plate + 2mm to base + 60mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(80)[0] = 135;
     m_PointsToTransformGroundTruthProtocol.at(80)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(80)[2] = -89;  // = 7mm distance to clipping plate + 2mm to base + 80mm depth
 
     m_PointsToTransformGroundTruthProtocol.at(100)[0] = 135;
     m_PointsToTransformGroundTruthProtocol.at(100)[1] = 20;
     m_PointsToTransformGroundTruthProtocol.at(100)[2] = -109;  // = 7mm distance to clipping plate + 2mm to base + 100mm depth
     break;
   }
 }
 
 void QmitkUSNavigationStepCtUsRegistration::TransformPointsGroundTruthProtocol()
 {
   if (m_GroundTruthProtocolTransformedPoints.find(0) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(0)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(0, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(0)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(0)));
   }
 
   if (m_GroundTruthProtocolTransformedPoints.find(20) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(20)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(20, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(20)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(20)));
   }
 
   if (m_GroundTruthProtocolTransformedPoints.find(40) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(40)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(40, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(40)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(40)));
   }
 
   if (m_GroundTruthProtocolTransformedPoints.find(60) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(60)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(60, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(60)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(60)));
   }
 
   if (m_GroundTruthProtocolTransformedPoints.find(80) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(80)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(80, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(80)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(80)));
   }
 
   if (m_GroundTruthProtocolTransformedPoints.find(100) == m_GroundTruthProtocolTransformedPoints.end())
   {
     mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
     pointSet->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(100)));
     m_GroundTruthProtocolTransformedPoints.insert(std::pair<int, mitk::PointSet::Pointer>(100, pointSet));
   }
   else
   {
     m_GroundTruthProtocolTransformedPoints.at(100)->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(m_PointsToTransformGroundTruthProtocol.at(100)));
   }
 
 }
 
 void QmitkUSNavigationStepCtUsRegistration::AddTransformedPointsToDataStorage()
 {
   if (m_GroundTruthProtocolTransformedPoints.find(0) == m_GroundTruthProtocolTransformedPoints.end() ||
       m_GroundTruthProtocolTransformedPoints.find(20) == m_GroundTruthProtocolTransformedPoints.end() ||
       m_GroundTruthProtocolTransformedPoints.find(40) == m_GroundTruthProtocolTransformedPoints.end() ||
       m_GroundTruthProtocolTransformedPoints.find(60) == m_GroundTruthProtocolTransformedPoints.end() ||
       m_GroundTruthProtocolTransformedPoints.find(80) == m_GroundTruthProtocolTransformedPoints.end() ||
       m_GroundTruthProtocolTransformedPoints.find(100) == m_GroundTruthProtocolTransformedPoints.end())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot add transformed Points to DataStorage because they do not exist.\
       Stopping evaluation the protocol.");
     msgBox.exec();
     return;
   }
 
   std::string nameNode0mm = "GroundTruthProt-Depth0mm";
   std::string nameNode20mm = "GroundTruthProt-Depth20mm";
   std::string nameNode40mm = "GroundTruthProt-Depth40mm";
   std::string nameNode60mm = "GroundTruthProt-Depth60mm";
   std::string nameNode80mm = "GroundTruthProt-Depth80mm";
   std::string nameNode100mm = "GroundTruthProt-Depth100mm";
 
   //Add transformed points of depth 0mm to the data storage
   mitk::DataNode::Pointer node0mm = this->GetDataStorage()->GetNamedNode(nameNode0mm);
   if (node0mm.IsNull())
   {
     node0mm = mitk::DataNode::New();
     node0mm->SetName(nameNode0mm);
     node0mm->SetData(m_GroundTruthProtocolTransformedPoints.at(0));
     this->GetDataStorage()->Add(node0mm);
   }
   else
   {
     node0mm->SetData(m_GroundTruthProtocolTransformedPoints.at(0));
     this->GetDataStorage()->Modified();
   }
 
   if(ui->protocolEvaluationTypeComboBox->currentText().compare("PLANE") == 0 )
   {
     //Add transformed points of depth 20mm to the data storage
     mitk::DataNode::Pointer node20mm = this->GetDataStorage()->GetNamedNode(nameNode20mm);
     if (node20mm.IsNull())
     {
       node20mm = mitk::DataNode::New();
       node20mm->SetName(nameNode20mm);
       node20mm->SetData(m_GroundTruthProtocolTransformedPoints.at(20));
       this->GetDataStorage()->Add(node20mm);
     }
     else
     {
       node20mm->SetData(m_GroundTruthProtocolTransformedPoints.at(20));
       this->GetDataStorage()->Modified();
     }
 
     //Add transformed points of depth 40mm to the data storage
     mitk::DataNode::Pointer node40mm = this->GetDataStorage()->GetNamedNode(nameNode40mm);
     if (node40mm.IsNull())
     {
       node40mm = mitk::DataNode::New();
       node40mm->SetName(nameNode40mm);
       node40mm->SetData(m_GroundTruthProtocolTransformedPoints.at(40));
       this->GetDataStorage()->Add(node40mm);
     }
     else
     {
       node40mm->SetData(m_GroundTruthProtocolTransformedPoints.at(40));
       this->GetDataStorage()->Modified();
     }
 
     //Add transformed points of depth 60mm to the data storage
     mitk::DataNode::Pointer node60mm = this->GetDataStorage()->GetNamedNode(nameNode60mm);
     if (node60mm.IsNull())
     {
       node60mm = mitk::DataNode::New();
       node60mm->SetName(nameNode60mm);
       node60mm->SetData(m_GroundTruthProtocolTransformedPoints.at(60));
       this->GetDataStorage()->Add(node60mm);
     }
     else
     {
       node60mm->SetData(m_GroundTruthProtocolTransformedPoints.at(60));
       this->GetDataStorage()->Modified();
     }
 
     //Add transformed points of depth 80mm to the data storage
     mitk::DataNode::Pointer node80mm = this->GetDataStorage()->GetNamedNode(nameNode80mm);
     if (node80mm.IsNull())
     {
       node80mm = mitk::DataNode::New();
       node80mm->SetName(nameNode80mm);
       node80mm->SetData(m_GroundTruthProtocolTransformedPoints.at(80));
       this->GetDataStorage()->Add(node80mm);
     }
     else
     {
       node80mm->SetData(m_GroundTruthProtocolTransformedPoints.at(80));
       this->GetDataStorage()->Modified();
     }
 
     //Add transformed points of depth 100mm to the data storage
     mitk::DataNode::Pointer node100mm = this->GetDataStorage()->GetNamedNode(nameNode100mm);
     if (node100mm.IsNull())
     {
       node100mm = mitk::DataNode::New();
       node100mm->SetName(nameNode100mm);
       node100mm->SetData(m_GroundTruthProtocolTransformedPoints.at(100));
       this->GetDataStorage()->Add(node100mm);
     }
     else
     {
       node100mm->SetData(m_GroundTruthProtocolTransformedPoints.at(100));
       this->GetDataStorage()->Modified();
     }
   }
   //Do a global reinit
   mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(this->GetDataStorage());
 }
 
 double QmitkUSNavigationStepCtUsRegistration::CalculateMeanFRE()
 {
   double meanFRE = 0.0;
   for (unsigned int counter = 0; counter < m_GroundTruthProtocolFRE.size(); ++counter)
   {
     meanFRE += m_GroundTruthProtocolFRE[counter];
   }
 
   return meanFRE / m_GroundTruthProtocolFRE.size();
 }
 
 double QmitkUSNavigationStepCtUsRegistration::CalculateStandardDeviationOfFRE(double meanFRE)
 {
   double variance = 0.0;
 
   for (unsigned int counter = 0; counter < m_GroundTruthProtocolFRE.size(); ++counter)
   {
     variance += ((meanFRE - m_GroundTruthProtocolFRE[counter]) * (meanFRE - m_GroundTruthProtocolFRE[counter]));
   }
   variance /= m_GroundTruthProtocolFRE.size(); // calculate the empirical variance (n) and not the sampling variance (n-1)
 
   return sqrt(variance);
 }
 
 void QmitkUSNavigationStepCtUsRegistration::CalculateGroundTruthProtocolTRE()
 {
   if (m_GroundTruthProtocolTransformedPoints.find(0) == m_GroundTruthProtocolTransformedPoints.end() ||
     m_GroundTruthProtocolTransformedPoints.find(20) == m_GroundTruthProtocolTransformedPoints.end() ||
     m_GroundTruthProtocolTransformedPoints.find(40) == m_GroundTruthProtocolTransformedPoints.end() ||
     m_GroundTruthProtocolTransformedPoints.find(60) == m_GroundTruthProtocolTransformedPoints.end() ||
     m_GroundTruthProtocolTransformedPoints.find(80) == m_GroundTruthProtocolTransformedPoints.end() ||
     m_GroundTruthProtocolTransformedPoints.find(100) == m_GroundTruthProtocolTransformedPoints.end())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot calculate TRE of Ground-Truth-Protocol because points were not transformed.");
     msgBox.exec();
     return;
   }
 
   // clear the std::map containing possibly data of earlier TRE calculations
   m_GroundTruthProtocolTRE.clear();
   // loop through all existing point sets containing the transformed points
   for (int counter = 0;
        m_GroundTruthProtocolTransformedPoints.find(counter) != m_GroundTruthProtocolTransformedPoints.end();
        counter += 20)
   {
     //calculate the middle point of  the point set
     mitk::PointSet::Pointer pointSet = m_GroundTruthProtocolTransformedPoints.at(counter);
     mitk::Point3D middlePoint;
     middlePoint[0] = 0.0;
     middlePoint[1] = 0.0;
     middlePoint[2] = 0.0;
 
     for (int position = 0; position < pointSet->GetSize(); ++position)
     {
       middlePoint[0] += pointSet->GetPoint(position)[0];
       middlePoint[1] += pointSet->GetPoint(position)[1];
       middlePoint[2] += pointSet->GetPoint(position)[2];
     }
     middlePoint[0] /= pointSet->GetSize();
     middlePoint[1] /= pointSet->GetSize();
     middlePoint[2] /= pointSet->GetSize();
     MITK_INFO << "Calculated MiddlePoint: " << middlePoint;
 
     //sum up the euclidean distances between the middle point and each transformed point
     double meanDistance = 0.0;
     for (int position = 0; position < pointSet->GetSize(); ++position)
     {
       meanDistance += middlePoint.SquaredEuclideanDistanceTo(pointSet->GetPoint(position));
       MITK_INFO << "SquaredEuclideanDistance: " << middlePoint.SquaredEuclideanDistanceTo(pointSet->GetPoint(position));
     }
 
     meanDistance /= pointSet->GetSize(); // this can be interpreted as empirical variance
     // the root of the empirical variance can be interpreted as the protocols registration TRE
     m_GroundTruthProtocolTRE.insert(std::pair<int, double>(counter, sqrt(meanDistance)));
     MITK_INFO << "Ground-Truth-Protocol TRE: " << sqrt(meanDistance);
   }
 
 }
 
 void QmitkUSNavigationStepCtUsRegistration::EliminateTooSmallLabeledObjects(
   ImageType::Pointer binaryImage)
 {
   BinaryImageToShapeLabelMapFilterType::OutputImageType::Pointer labelMap =
     m_BinaryImageToShapeLabelMapFilter->GetOutput();
   double voxelVolume = this->GetVoxelVolume();
   double fiducialVolume;
   unsigned int numberOfPixels;
 
   if (ui->fiducialDiameter3mmRadioButton->isChecked())
   {
     fiducialVolume = this->GetFiducialVolume(1.5);
     numberOfPixels = ceil(fiducialVolume / voxelVolume);
   }
   else
   {
     fiducialVolume = this->GetFiducialVolume(2.5);
     numberOfPixels = ceil(fiducialVolume / voxelVolume);
   }
 
   MITK_INFO << "Voxel Volume = " << voxelVolume << "; Fiducial Volume = " << fiducialVolume;
   MITK_INFO << "Number of pixels = " << numberOfPixels;
 
   labelMap = m_BinaryImageToShapeLabelMapFilter->GetOutput();
   // The output of this filter is an itk::LabelMap, which contains itk::LabelObject's
   MITK_INFO << "There are " << labelMap->GetNumberOfLabelObjects() << " objects.";
 
   // Loop over each region
   for (int i = labelMap->GetNumberOfLabelObjects() - 1; i >= 0; --i)
   {
     // Get the ith region
     BinaryImageToShapeLabelMapFilterType::OutputImageType::LabelObjectType* labelObject = labelMap->GetNthLabelObject(i);
     MITK_INFO << "Object " << i << " contains " << labelObject->Size() << " pixel";
 
     //TODO: Threshold-Wert evtl. experimentell besser abstimmen,
     //      um zu verhindern, dass durch Threshold wahre Fiducial-Kandidaten elimiert werden.
     if (labelObject->Size() < numberOfPixels * 0.8)
     {
       for (unsigned int pixelId = 0; pixelId < labelObject->Size(); pixelId++)
       {
         binaryImage->SetPixel(labelObject->GetIndex(pixelId), 0);
       }
       labelMap->RemoveLabelObject(labelObject);
     }
   }
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::EliminateFiducialCandidatesByEuclideanDistances()
 {
   if (m_CentroidsOfFiducialCandidates.size() < NUMBER_FIDUCIALS_NEEDED)
   {
     return false;
   }
 
   for (unsigned int counter = 0; counter < m_CentroidsOfFiducialCandidates.size(); ++counter)
   {
     int amountOfAcceptedFiducials = 0;
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(counter));
     //Loop through all fiducial candidates and calculate the distance between the chosen fiducial
     // candidate and the other candidates. For each candidate with a right distance between
     // Configuration A: 7.93mm and 31.0mm (10 mm distance between fiducial centers) or
     // Configuration B: 11.895mm and 45.0mm (15 mm distance between fiducial centers) or
     // Configuration C: 15.86mm and 59.0mm (20 mm distance between fiducial centers)
     //
     // increase the amountOfAcceptedFiducials.
     for (unsigned int position = 0; position < m_CentroidsOfFiducialCandidates.size(); ++position)
     {
       if (position == counter)
       {
         continue;
       }
       mitk::Point3D otherCentroid(m_CentroidsOfFiducialCandidates.at(position));
       double distance = fiducialCentroid.EuclideanDistanceTo(otherCentroid);
 
       switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
       {
         // case 0 is equal to fiducial marker configuration A (10mm distance)
         case 0:
           if (distance > 7.93 && distance < 31.0)
           {
             ++amountOfAcceptedFiducials;
           }
           break;
         // case 1 is equal to fiducial marker configuration B (15mm distance)
         case 1:
           if (distance > 11.895 && distance < 45.0)
           {
             ++amountOfAcceptedFiducials;
           }
           break;
         // case 2 is equal to fiducial marker configuration C (20mm distance)
         case 2:
           if (distance > 15.86 && distance < 59.0)
           {
             ++amountOfAcceptedFiducials;
           }
           break;
       }
     }
     //The amountOfAcceptedFiducials must be at least 7. Otherwise delete the fiducial candidate
     // from the list of candidates.
     if (amountOfAcceptedFiducials < NUMBER_FIDUCIALS_NEEDED - 1)
     {
       MITK_INFO << "Deleting fiducial candidate at position: " <<
         m_CentroidsOfFiducialCandidates.at(counter);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + counter);
       if (m_CentroidsOfFiducialCandidates.size() < NUMBER_FIDUCIALS_NEEDED )
       {
         return false;
       }
       counter = -1;
     }
   }
 
   //Classify the rested fiducial candidates by its characteristic Euclidean distances
-  // between the canidates and remove all candidates with a false distance configuration:
+  // between the candidates and remove all candidates with a false distance configuration:
   this->ClassifyFiducialCandidates();
   return true;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::ClassifyFiducialCandidates()
 {
   MITK_INFO << "ClassifyFiducialCandidates()";
   std::vector<int> fiducialCandidatesToBeRemoved;
   std::vector<std::vector<double>> distanceVectorsFiducials;
   this->CalculateDistancesBetweenFiducials(distanceVectorsFiducials);
 
   for (unsigned int counter = 0; counter < distanceVectorsFiducials.size(); ++counter)
   {
     int distanceA = 0;      // => 10,00mm distance
     int distanceB = 0;      // => 14,14mm distance
     int distanceC = 0;      // => 17,32mm distance
     int distanceD = 0;      // => 22,36mm distance
     int distanceE = 0;      // => 24,49mm distance
     int distanceF = 0;      // => 28,28mm distance
 
     std::vector<double> &distances = distanceVectorsFiducials.at(counter);
     for (unsigned int number = 0; number < distances.size(); ++number)
     {
       double &distance = distances.at(number);
       switch (ui->fiducialMarkerConfigurationComboBox->currentIndex())
       {
         // case 0 is equal to fiducial marker configuration A (10mm distance)
         case 0:
           if (distance > 7.93 && distance <= 12.07)
           {
             ++distanceA;
           }
           else if (distance > 12.07 && distance <= 15.73)
           {
             ++distanceB;
           }
           else if (distance > 15.73 && distance <= 19.84)
           {
             ++distanceC;
           }
           else if (distance > 19.84 && distance <= 23.425)
           {
             ++distanceD;
           }
           else if (distance > 23.425 && distance <= 26.385)
           {
             ++distanceE;
           }
           else if (distance > 26.385 && distance <= 31.00)
           {
             ++distanceF;
           }
         break;
 
         // case 1 is equal to fiducial marker configuration B (15mm distance)
         case 1:
           if (distance > 11.895 && distance <= 18.105)
           {
             ++distanceA;
           }
           else if (distance > 18.105 && distance <= 23.595)
           {
             ++distanceB;
           }
           else if (distance > 23.595 && distance <= 29.76)
           {
             ++distanceC;
           }
           else if (distance > 29.76 && distance <= 35.1375)
           {
             ++distanceD;
             if (distance > 33.54)
             {
               ++distanceE;
             }
           }
           else if (distance > 35.1375 && distance <= 39.5775)
           {
             ++distanceE;
             if (distance < 36.735)
             {
               ++distanceD;
             }
           }
           else if (distance > 39.5775 && distance <= 45.00)
           {
             ++distanceF;
           }
         break;
 
         // case 2 is equal to fiducial marker configuration C (20mm distance)
         case 2:
           if (distance > 15.86 && distance <= 24.14)
           {
             ++distanceA;
           }
           else if (distance > 24.14 && distance <= 31.46)
           {
             ++distanceB;
           }
           else if (distance > 31.46 && distance <= 39.68)
           {
             ++distanceC;
           }
           else if (distance > 39.68 && distance <= 46.85)
           {
             ++distanceD;
           }
           else if (distance > 46.85 && distance <= 52.77)
           {
             ++distanceE;
           }
           else if (distance > 52.77 && distance <= 59.00)
           {
             ++distanceF;
           }
         break;
       }
     }// End for-loop distances-vector
 
     //Now, having looped through all distances of one fiducial candidate, check
     // if the combination of different distances is known. The >= is due to the
     // possible occurrence of other fiducial candidates that have an distance equal to
     // one of the distances A - E. However, false fiducial candidates outside
     // the fiducial marker does not have the right distance configuration:
     if (((distanceA >= 2 && distanceD >= 2 && distanceE >= 2 && distanceF >= 1) ||
       (distanceA >= 1 && distanceB >= 2 && distanceC >= 1 && distanceD >= 2 && distanceE >= 1) ||
       (distanceB >= 2 && distanceD >= 4 && distanceF >= 1) ||
       (distanceA >= 1 && distanceB >= 1 && distanceD >= 3 && distanceE >= 1 && distanceF >= 1)) == false)
     {
       MITK_INFO << "Detected fiducial candidate with unknown distance configuration.";
       fiducialCandidatesToBeRemoved.push_back(counter);
     }
   }
   for (int count = fiducialCandidatesToBeRemoved.size() - 1; count >= 0; --count)
   {
     MITK_INFO << "Removing fiducial candidate " << fiducialCandidatesToBeRemoved.at(count);
     m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin()
                                           + fiducialCandidatesToBeRemoved.at(count));
   }
 }
 
 void QmitkUSNavigationStepCtUsRegistration::GetCentroidsOfLabeledObjects()
 {
   MITK_INFO << "GetCentroidsOfLabeledObjects()";
   BinaryImageToShapeLabelMapFilterType::OutputImageType::Pointer labelMap =
     m_BinaryImageToShapeLabelMapFilter->GetOutput();
   for (int i = labelMap->GetNumberOfLabelObjects() - 1; i >= 0; --i)
   {
     // Get the ith region
     BinaryImageToShapeLabelMapFilterType::OutputImageType::LabelObjectType* labelObject = labelMap->GetNthLabelObject(i);
     MITK_INFO << "Object " << i << " contains " << labelObject->Size() << " pixel";
 
     mitk::Vector3D centroid;
     centroid[0] = labelObject->GetCentroid()[0];
     centroid[1] = labelObject->GetCentroid()[1];
     centroid[2] = labelObject->GetCentroid()[2];
     m_CentroidsOfFiducialCandidates.push_back(centroid);
   }
   //evtl. for later: itk::LabelMapOverlayImageFilter
 }
 
 void QmitkUSNavigationStepCtUsRegistration::NumerateFiducialMarks()
 {
   MITK_INFO << "NumerateFiducialMarks()";
   bool successFiducialNo1;
   bool successFiducialNo4;
   bool successFiducialNo2And3;
   bool successFiducialNo5;
   bool successFiducialNo8;
   bool successFiducialNo6;
   bool successFiducialNo7;
 
   std::vector<std::vector<double>> distanceVectorsFiducials;
   this->CalculateDistancesBetweenFiducials(distanceVectorsFiducials);
   successFiducialNo1 = this->FindFiducialNo1(distanceVectorsFiducials);
   successFiducialNo4 = this->FindFiducialNo4(distanceVectorsFiducials);
   successFiducialNo2And3 = this->FindFiducialNo2And3();
   successFiducialNo5 = this->FindFiducialNo5();
   successFiducialNo8 = this->FindFiducialNo8();
   successFiducialNo6 = this->FindFiducialNo6();
   successFiducialNo7 = this->FindFiducialNo7();
 
   if (!successFiducialNo1 || !successFiducialNo4 || !successFiducialNo2And3 ||
     !successFiducialNo5 || !successFiducialNo8 || !successFiducialNo6 || !successFiducialNo7)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot numerate/localize all fiducials successfully.");
     msgBox.exec();
     return;
   }
 
   if (m_MarkerFloatingImageCoordinateSystemPointSet.IsNull())
   {
     m_MarkerFloatingImageCoordinateSystemPointSet = mitk::PointSet::New();
   }
   else if (m_MarkerFloatingImageCoordinateSystemPointSet->GetSize() != 0)
   {
     m_MarkerFloatingImageCoordinateSystemPointSet->Clear();
   }
 
   for (unsigned int counter = 1; counter <= m_FiducialMarkerCentroids.size(); ++counter)
   {
     m_MarkerFloatingImageCoordinateSystemPointSet->InsertPoint(counter - 1, mitk::Point3D(m_FiducialMarkerCentroids.at(counter)));
   }
   if( !m_PerformingGroundTruthProtocolEvaluation )
   {
     mitk::DataNode::Pointer node = mitk::DataNode::New();
     node->SetData(m_MarkerFloatingImageCoordinateSystemPointSet);
     node->SetName("MarkerFloatingImageCSPointSet");
     //node->SetFloatProperty("pointsize", 5.0);
     this->GetDataStorage()->Add(node);
   }
 }
 
 void QmitkUSNavigationStepCtUsRegistration::CalculateDistancesBetweenFiducials(std::vector<std::vector<double>>& distanceVectorsFiducials)
 {
   std::vector<double> distancesBetweenFiducials;
 
   for (unsigned int i = 0; i < m_CentroidsOfFiducialCandidates.size(); ++i)
   {
     distancesBetweenFiducials.clear();
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(i));
     for (unsigned int n = 0; n < m_CentroidsOfFiducialCandidates.size(); ++n)
     {
       mitk::Point3D otherCentroid(m_CentroidsOfFiducialCandidates.at(n));
       distancesBetweenFiducials.push_back(fiducialCentroid.EuclideanDistanceTo(otherCentroid));
     }
     //Sort the distances from low to big numbers
     std::sort(distancesBetweenFiducials.begin(), distancesBetweenFiducials.end());
     //First entry of the distance vector must be 0, so erase it
     if (distancesBetweenFiducials.at(0) == 0.0)
     {
       distancesBetweenFiducials.erase(distancesBetweenFiducials.begin());
     }
     //Add the distance vector to the collecting distances vector
     distanceVectorsFiducials.push_back(distancesBetweenFiducials);
   }
 
   for (unsigned int i = 0; i < distanceVectorsFiducials.size(); ++i)
   {
     MITK_INFO << "Vector " << i << ":";
     for (unsigned int k = 0; k < distanceVectorsFiducials.at(i).size(); ++k)
     {
       MITK_INFO << distanceVectorsFiducials.at(i).at(k);
     }
   }
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo1(std::vector<std::vector<double>>& distanceVectorsFiducials)
 {
   for (unsigned int i = 0; i < distanceVectorsFiducials.size(); ++i)
   {
     std::vector<double> &distances = distanceVectorsFiducials.at(i);
     if (distances.size() < NUMBER_FIDUCIALS_NEEDED - 1 )
     {
       MITK_WARN << "Cannot find fiducial 1, there aren't found enough fiducial candidates.";
       return false;
     }
     double characteristicDistanceAWithUpperMargin = this->GetCharacteristicDistanceAWithUpperMargin();
 
     if (distances.at(0) <= characteristicDistanceAWithUpperMargin &&
         distances.at(1) <= characteristicDistanceAWithUpperMargin)
     {
       MITK_INFO << "Found Fiducial 1 (PointSet number " << i << ")";
       m_FiducialMarkerCentroids.insert( std::pair<int,mitk::Vector3D>(1, m_CentroidsOfFiducialCandidates.at(i)));
       distanceVectorsFiducials.erase(distanceVectorsFiducials.begin() + i);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + i);
       return true;
     }
   }
   return false;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo2And3()
 {
   if (m_FiducialMarkerCentroids.find(1) == m_FiducialMarkerCentroids.end() )
   {
     MITK_WARN << "Cannot find fiducial No 2 and 3. Before must be found fiducial No 1.";
     return false;
   }
 
   mitk::Point3D fiducialNo1(m_FiducialMarkerCentroids.at(1));
   mitk::Vector3D fiducialVectorA;
   mitk::Vector3D fiducialVectorB;
   mitk::Point3D fiducialPointA;
   mitk::Point3D fiducialPointB;
   bool foundFiducialA = false;
   bool foundFiducialB = false;
   mitk::Vector3D vectorFiducial1ToFiducialA;
   mitk::Vector3D vectorFiducial1ToFiducialB;
 
   for (unsigned int i = 0; i < m_CentroidsOfFiducialCandidates.size(); ++i)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(i));
     double distance = fiducialNo1.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= this->GetCharacteristicDistanceAWithUpperMargin())
     {
       fiducialVectorA = m_CentroidsOfFiducialCandidates.at(i);
       fiducialPointA = fiducialCentroid;
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + i);
       foundFiducialA = true;
       break;
     }
   }
 
   for (unsigned int i = 0; i < m_CentroidsOfFiducialCandidates.size(); ++i)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(i));
     double distance = fiducialNo1.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= this->GetCharacteristicDistanceAWithUpperMargin())
     {
       fiducialVectorB = m_CentroidsOfFiducialCandidates.at(i);
       fiducialPointB = fiducialCentroid;
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + i);
       foundFiducialB = true;
       break;
     }
   }
 
   if (!foundFiducialA || !foundFiducialB)
   {
     MITK_WARN << "Cannot identify fiducial candidates 2 and 3";
     return false;
   }
   else if (m_CentroidsOfFiducialCandidates.size() == 0)
   {
     MITK_WARN << "Too less fiducials detected. Cannot identify fiducial candidates 2 and 3";
     return false;
   }
 
   vectorFiducial1ToFiducialA = fiducialVectorA - m_FiducialMarkerCentroids.at(1);
   vectorFiducial1ToFiducialB = fiducialVectorB - m_FiducialMarkerCentroids.at(1);
 
   vnl_vector<double> crossProductVnl = vnl_cross_3d(vectorFiducial1ToFiducialA.GetVnlVector(), vectorFiducial1ToFiducialB.GetVnlVector());
   mitk::Vector3D crossProduct;
   crossProduct.SetVnlVector(crossProductVnl);
 
   mitk::Vector3D vectorFiducial1ToRandomLeftFiducial = m_CentroidsOfFiducialCandidates.at(0) - m_FiducialMarkerCentroids.at(1);
 
   double scalarProduct = (crossProduct * vectorFiducial1ToRandomLeftFiducial) /
                          (crossProduct.GetNorm() * vectorFiducial1ToRandomLeftFiducial.GetNorm());
 
   double alpha = acos(scalarProduct) * 57.29578; //Transform into degree
   MITK_INFO << "Scalar Product = " << alpha;
 
   if (alpha <= 90)
   {
     m_FiducialMarkerCentroids[3] = fiducialVectorA;
     m_FiducialMarkerCentroids[2] = fiducialVectorB;
   }
   else
   {
     m_FiducialMarkerCentroids[2] = fiducialVectorA;
     m_FiducialMarkerCentroids[3] = fiducialVectorB;
   }
 
   MITK_INFO << "Found Fiducial 2, PointSet: " << m_FiducialMarkerCentroids.at(2);
   MITK_INFO << "Found Fiducial 3, PointSet: " << m_FiducialMarkerCentroids.at(3);
 
   return true;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo4(std::vector<std::vector<double>>& distanceVectorsFiducials)
 {
   double characteristicDistanceBWithLowerMargin = this->GetCharacteristicDistanceBWithLowerMargin();
   double characteristicDistanceBWithUpperMargin = this->GetCharacteristicDistanceBWithUpperMargin();
 
   for (unsigned int i = 0; i < distanceVectorsFiducials.size(); ++i)
   {
     std::vector<double> &distances = distanceVectorsFiducials.at(i);
     if (distances.size() < NUMBER_FIDUCIALS_NEEDED - 1)
     {
       MITK_WARN << "Cannot find fiducial 4, there aren't found enough fiducial candidates.";
       return false;
     }
 
     if (distances.at(0) > characteristicDistanceBWithLowerMargin &&
         distances.at(0) <= characteristicDistanceBWithUpperMargin &&
         distances.at(1) > characteristicDistanceBWithLowerMargin &&
         distances.at(1) <= characteristicDistanceBWithUpperMargin)
     {
       MITK_INFO << "Found Fiducial 4 (PointSet number " << i << ")";
       m_FiducialMarkerCentroids.insert(std::pair<int, mitk::Vector3D>(4, m_CentroidsOfFiducialCandidates.at(i)));
       distanceVectorsFiducials.erase(distanceVectorsFiducials.begin() + i);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + i);
       return true;
     }
   }
   return false;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo5()
 {
   if (m_FiducialMarkerCentroids.find(2) == m_FiducialMarkerCentroids.end())
   {
     MITK_WARN << "To find fiducial No 5, fiducial No 2 has to be found before.";
     return false;
   }
 
   double characteristicDistanceBWithUpperMargin = this->GetCharacteristicDistanceBWithUpperMargin();
 
   mitk::Point3D fiducialNo2(m_FiducialMarkerCentroids.at(2));
 
   for (unsigned int counter = 0; counter < m_CentroidsOfFiducialCandidates.size(); ++counter)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(counter));
     double distance = fiducialNo2.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= characteristicDistanceBWithUpperMargin)
     {
       m_FiducialMarkerCentroids[5] = m_CentroidsOfFiducialCandidates.at(counter);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + counter);
       MITK_INFO << "Found Fiducial No 5, PointSet: " << m_FiducialMarkerCentroids[5];
       return true;
     }
   }
 
   MITK_WARN << "Cannot find fiducial No 5.";
   return false;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo6()
 {
   if (m_FiducialMarkerCentroids.find(5) == m_FiducialMarkerCentroids.end())
   {
     MITK_WARN << "To find fiducial No 6, fiducial No 5 has to be found before.";
     return false;
   }
 
   double characteristicDistanceAWithUpperMargin = this->GetCharacteristicDistanceAWithUpperMargin();
 
   mitk::Point3D fiducialNo5(m_FiducialMarkerCentroids.at(5));
 
   for (unsigned int counter = 0; counter < m_CentroidsOfFiducialCandidates.size(); ++counter)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(counter));
     double distance = fiducialNo5.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= characteristicDistanceAWithUpperMargin)
     {
       m_FiducialMarkerCentroids[6] = m_CentroidsOfFiducialCandidates.at(counter);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + counter);
       MITK_INFO << "Found Fiducial No 6, PointSet: " << m_FiducialMarkerCentroids[6];
       return true;
     }
   }
 
   MITK_WARN << "Cannot find fiducial No 6.";
   return false;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo7()
 {
   if (m_FiducialMarkerCentroids.find(8) == m_FiducialMarkerCentroids.end())
   {
     MITK_WARN << "To find fiducial No 7, fiducial No 8 has to be found before.";
     return false;
   }
 
   double characteristicDistanceAWithUpperMargin = this->GetCharacteristicDistanceAWithUpperMargin();
 
   mitk::Point3D fiducialNo8(m_FiducialMarkerCentroids.at(8));
 
   for (unsigned int counter = 0; counter < m_CentroidsOfFiducialCandidates.size(); ++counter)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(counter));
     double distance = fiducialNo8.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= characteristicDistanceAWithUpperMargin)
     {
       m_FiducialMarkerCentroids[7] = m_CentroidsOfFiducialCandidates.at(counter);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + counter);
       MITK_INFO << "Found Fiducial No 7, PointSet: " << m_FiducialMarkerCentroids[7];
       return true;
     }
   }
 
   MITK_WARN << "Cannot find fiducial No 7.";
   return false;
 }
 
 bool QmitkUSNavigationStepCtUsRegistration::FindFiducialNo8()
 {
   if (m_FiducialMarkerCentroids.find(3) == m_FiducialMarkerCentroids.end())
   {
     MITK_WARN << "To find fiducial No 8, fiducial No 3 has to be found before.";
     return false;
   }
 
   double characteristicDistanceBWithUpperMargin = this->GetCharacteristicDistanceBWithUpperMargin();
 
   mitk::Point3D fiducialNo3(m_FiducialMarkerCentroids.at(3));
 
   for (unsigned int counter = 0; counter < m_CentroidsOfFiducialCandidates.size(); ++counter)
   {
     mitk::Point3D fiducialCentroid(m_CentroidsOfFiducialCandidates.at(counter));
     double distance = fiducialNo3.EuclideanDistanceTo(fiducialCentroid);
     if (distance <= characteristicDistanceBWithUpperMargin)
     {
       m_FiducialMarkerCentroids[8] = m_CentroidsOfFiducialCandidates.at(counter);
       m_CentroidsOfFiducialCandidates.erase(m_CentroidsOfFiducialCandidates.begin() + counter);
       MITK_INFO << "Found Fiducial No 8, PointSet: " << m_FiducialMarkerCentroids[8];
       return true;
     }
   }
 
   MITK_WARN << "Cannot find fiducial No 8.";
   return false;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::DefineDataStorageImageFilter()
 {
   m_IsAPointSetPredicate = mitk::TNodePredicateDataType<mitk::PointSet>::New();
   mitk::TNodePredicateDataType<mitk::Image>::Pointer isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
 
   auto isSegmentation = mitk::NodePredicateDataType::New("Segment");
   m_IsASurfacePredicate = mitk::NodePredicateDataType::New("Surface");
 
   mitk::NodePredicateOr::Pointer validImages = mitk::NodePredicateOr::New();
   validImages->AddPredicate(mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isSegmentation)));
 
   mitk::NodePredicateNot::Pointer isNotAHelperObject = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)));
 
   m_IsOfTypeImagePredicate = mitk::NodePredicateAnd::New(validImages, isNotAHelperObject);
 
   mitk::NodePredicateProperty::Pointer isBinaryPredicate = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
   mitk::NodePredicateNot::Pointer isNotBinaryPredicate = mitk::NodePredicateNot::New(isBinaryPredicate);
 
   mitk::NodePredicateAnd::Pointer isABinaryImagePredicate = mitk::NodePredicateAnd::New(m_IsOfTypeImagePredicate, isBinaryPredicate);
   mitk::NodePredicateAnd::Pointer isNotABinaryImagePredicate = mitk::NodePredicateAnd::New(m_IsOfTypeImagePredicate, isNotBinaryPredicate);
 
   m_IsASegmentationImagePredicate = mitk::NodePredicateOr::New(isABinaryImagePredicate, mitk::TNodePredicateDataType<mitk::LabelSetImage>::New());
   m_IsAPatientImagePredicate = mitk::NodePredicateAnd::New(isNotABinaryImagePredicate, mitk::NodePredicateNot::New(mitk::TNodePredicateDataType<mitk::LabelSetImage>::New()));
 }
 
 void QmitkUSNavigationStepCtUsRegistration::CreateQtPartControl(QWidget *parent)
 {
   ui->setupUi(parent);
   ui->floatingImageComboBox->SetPredicate(m_IsAPatientImagePredicate);
   ui->ctImagesToChooseComboBox->SetPredicate(m_IsAPatientImagePredicate);
   ui->segmentationComboBox->SetPredicate(m_IsASegmentationImagePredicate);
   ui->selectedSurfaceComboBox->SetPredicate(m_IsASurfacePredicate);
   ui->pointSetComboBox->SetPredicate(m_IsAPointSetPredicate);
 
   // create signal/slot connections
   connect(ui->floatingImageComboBox, SIGNAL(OnSelectionChanged(const mitk::DataNode*)),
     this, SLOT(OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode*)));
   connect(ui->doRegistrationMarkerToImagePushButton, SIGNAL(clicked()),
     this, SLOT(OnRegisterMarkerToFloatingImageCS()));
   connect(ui->localizeFiducialMarkerPushButton, SIGNAL(clicked()),
     this, SLOT(OnLocalizeFiducials()));
   connect(ui->visualizeCTtoUSregistrationPushButton, SIGNAL(clicked()),
     this, SLOT(OnVisualizeCTtoUSregistration()));
   connect(ui->freezeUnfreezePushButton, SIGNAL(clicked()),
     this, SLOT(OnFreeze()));
   connect(ui->addCtImagePushButton, SIGNAL(clicked()),
     this, SLOT(OnAddCtImageClicked()));
   connect(ui->removeCtImagePushButton, SIGNAL(clicked()),
     this, SLOT(OnRemoveCtImageClicked()));
   connect(ui->evaluateProtocolPushButton, SIGNAL(clicked()),
     this, SLOT(OnEvaluateGroundTruthFiducialLocalizationProtocol()));
   connect(ui->actualizeSegmentationSurfacePSetDataPushButton, SIGNAL(clicked()),
     this, SLOT(OnActualizeSegmentationSurfacePointSetData()));
   connect(ui->calculateTREPushButton, SIGNAL(clicked()),
     this, SLOT(OnGetCursorPosition()));
   connect(ui->calculateCenterPushButton, SIGNAL(clicked()),
     this, SLOT(OnCalculateCenter()));
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode* node)
 {
   MITK_INFO << "OnFloatingImageComboBoxSelectionChanged()";
 
   if (m_FloatingImage.IsNotNull())
   {
     //TODO: Define, what will happen if the imageCT is not null...
   }
 
   if (node == nullptr)
   {
     this->UnsetFloatingImageGeometry();
     m_FloatingImage = nullptr;
     return;
   }
 
   mitk::DataNode* selectedFloatingImage = ui->floatingImageComboBox->GetSelectedNode();
   if (selectedFloatingImage == nullptr)
   {
     this->UnsetFloatingImageGeometry();
     m_FloatingImage = nullptr;
     return;
   }
 
   mitk::Image::Pointer floatingImage = dynamic_cast<mitk::Image*>(selectedFloatingImage->GetData());
   if (floatingImage.IsNull())
   {
     MITK_WARN << "Failed to cast selected segmentation node to mitk::Image*";
     this->UnsetFloatingImageGeometry();
     m_FloatingImage = nullptr;
     return;
   }
 
   m_FloatingImage = floatingImage;
   this->SetFloatingImageGeometryInformation(floatingImage.GetPointer());
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnRegisterMarkerToFloatingImageCS()
 {
   this->CreateMarkerModelCoordinateSystemPointSet();
 
   //Check for initialization
   if( m_MarkerModelCoordinateSystemPointSet.IsNull() ||
       m_MarkerFloatingImageCoordinateSystemPointSet.IsNull() )
   {
     MITK_WARN << "Fiducial Landmarks are not initialized yet, cannot register";
     return;
   }
 
   //Retrieve fiducials
   if (m_MarkerFloatingImageCoordinateSystemPointSet->GetSize() != m_MarkerModelCoordinateSystemPointSet->GetSize())
   {
     MITK_WARN << "Not the same number of fiducials, cannot register";
     return;
   }
   else if (m_MarkerFloatingImageCoordinateSystemPointSet->GetSize() < 3)
   {
     MITK_WARN << "Need at least 3 fiducials, cannot register";
     return;
   }
 
   //############### conversion to vtk data types (we will use the vtk landmark based transform) ##########################
   //convert point sets to vtk poly data
   vtkSmartPointer<vtkPoints> sourcePoints = vtkSmartPointer<vtkPoints>::New();
   vtkSmartPointer<vtkPoints> targetPoints = vtkSmartPointer<vtkPoints>::New();
   for (int i = 0; i<m_MarkerModelCoordinateSystemPointSet->GetSize(); i++)
   {
     double point[3] = { m_MarkerModelCoordinateSystemPointSet->GetPoint(i)[0],
                         m_MarkerModelCoordinateSystemPointSet->GetPoint(i)[1],
                         m_MarkerModelCoordinateSystemPointSet->GetPoint(i)[2] };
     sourcePoints->InsertNextPoint(point);
 
     double point_targets[3] = { m_MarkerFloatingImageCoordinateSystemPointSet->GetPoint(i)[0],
                                 m_MarkerFloatingImageCoordinateSystemPointSet->GetPoint(i)[1],
                                 m_MarkerFloatingImageCoordinateSystemPointSet->GetPoint(i)[2] };
     targetPoints->InsertNextPoint(point_targets);
   }
 
   //########################### here, the actual transform is computed ##########################
   //compute transform
   vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
   transform->SetSourceLandmarks(sourcePoints);
   transform->SetTargetLandmarks(targetPoints);
   transform->SetModeToRigidBody();
   transform->Modified();
   transform->Update();
   //compute FRE of transform
 
   double FRE = mitk::StaticIGTHelperFunctions::ComputeFRE(m_MarkerModelCoordinateSystemPointSet, m_MarkerFloatingImageCoordinateSystemPointSet, transform);
   MITK_INFO << "FRE: " << FRE << " mm";
   if (m_PerformingGroundTruthProtocolEvaluation)
   {
     m_GroundTruthProtocolFRE.push_back(FRE);
   }
   //#############################################################################################
 
   //############### conversion back to itk/mitk data types ##########################
   //convert from vtk to itk data types
   itk::Matrix<float, 3, 3> rotationFloat = itk::Matrix<float, 3, 3>();
   itk::Vector<float, 3> translationFloat = itk::Vector<float, 3>();
   itk::Matrix<double, 3, 3> rotationDouble = itk::Matrix<double, 3, 3>();
   itk::Vector<double, 3> translationDouble = itk::Vector<double, 3>();
 
   vtkSmartPointer<vtkMatrix4x4> m = transform->GetMatrix();
   for (int k = 0; k<3; k++) for (int l = 0; l<3; l++)
   {
     rotationFloat[k][l] = m->GetElement(k, l);
     rotationDouble[k][l] = m->GetElement(k, l);
 
   }
   for (int k = 0; k<3; k++)
   {
     translationFloat[k] = m->GetElement(k, 3);
     translationDouble[k] = m->GetElement(k, 3);
   }
   //create mitk affine transform 3D and save it to the class member
   m_TransformMarkerCSToFloatingImageCS = mitk::AffineTransform3D::New();
   m_TransformMarkerCSToFloatingImageCS->SetMatrix(rotationDouble);
   m_TransformMarkerCSToFloatingImageCS->SetOffset(translationDouble);
   MITK_INFO << m_TransformMarkerCSToFloatingImageCS;
   //################################################################
 
   //############### object is transformed ##########################
   //transform surface/image
   //only move image if we have one. Sometimes, this widget is used just to register point sets without images.
 
   /*if (m_ImageNode.IsNotNull())
   {
     //first we have to store the original ct image transform to compose it with the new transform later
     mitk::AffineTransform3D::Pointer imageTransform = m_ImageNode->GetData()->GetGeometry()->GetIndexToWorldTransform();
     imageTransform->Compose(mitkTransform);
     mitk::AffineTransform3D::Pointer newImageTransform = mitk::AffineTransform3D::New(); //create new image transform... setting the composed directly leads to an error
     itk::Matrix<mitk::ScalarType, 3, 3> rotationFloatNew = imageTransform->GetMatrix();
     itk::Vector<mitk::ScalarType, 3> translationFloatNew = imageTransform->GetOffset();
     newImageTransform->SetMatrix(rotationFloatNew);
     newImageTransform->SetOffset(translationFloatNew);
     m_ImageNode->GetData()->GetGeometry()->SetIndexToWorldTransform(newImageTransform);
   }*/
 
-  //If this option is set, each point will be transformed and the acutal coordinates of the points change.
+  //If this option is set, each point will be transformed and the actual coordinates of the points change.
 
   if( !m_PerformingGroundTruthProtocolEvaluation )
   {
     mitk::PointSet* pointSet_orig = m_MarkerModelCoordinateSystemPointSet;
     mitk::PointSet::Pointer pointSet_moved = mitk::PointSet::New();
 
     for (int i = 0; i < pointSet_orig->GetSize(); i++)
     {
       pointSet_moved->InsertPoint(m_TransformMarkerCSToFloatingImageCS->TransformPoint(pointSet_orig->GetPoint(i)));
     }
 
     pointSet_orig->Clear();
     for (int i = 0; i < pointSet_moved->GetSize(); i++)
       pointSet_orig->InsertPoint(pointSet_moved->GetPoint(i));
 
     //Do a global reinit
     mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(this->GetDataStorage());
   }
 
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnLocalizeFiducials()
 {
   m_FiducialMarkerCentroids.clear();
   m_CentroidsOfFiducialCandidates.clear();
   if (m_MarkerFloatingImageCoordinateSystemPointSet.IsNotNull())
   {
     m_MarkerFloatingImageCoordinateSystemPointSet->Clear();
   }
 
   if (!this->FilterFloatingImage())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot perform filtering of the image. The floating image = nullptr.");
     msgBox.exec();
     return;
   }
   mitk::AffineTransform3D::Pointer transform = m_FloatingImage->GetGeometry()->GetIndexToWorldTransform();
   MITK_WARN << "IndexToWorldTransform_CTimage = " << transform;
 
   this->GetCentroidsOfLabeledObjects();
 
   if (!this->EliminateFiducialCandidatesByEuclideanDistances() ||
       m_CentroidsOfFiducialCandidates.size() != NUMBER_FIDUCIALS_NEEDED)
   {
     QMessageBox msgBox;
     QString text = QString("Have found %1 instead of 8 fiducial candidates.\
       Cannot perform fiducial localization procedure.").arg(m_CentroidsOfFiducialCandidates.size());
     msgBox.setText(text);
     msgBox.exec();
     return;
   }
 
   //Before calling NumerateFiducialMarks it must be sure,
   // that there rested only 8 fiducial candidates.
   this->NumerateFiducialMarks();
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnVisualizeCTtoUSregistration()
 {
   emit this->ActualizeCtToUsRegistrationWidget();
 
   mitk::DataNode* segmentationNode = ui->segmentationComboBox->GetSelectedNode();
   if (segmentationNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot visualize CT-to-US registration. There is no segmentation selected.");
     msgBox.exec();
     return;
   }
   mitk::AffineTransform3D::Pointer transform = segmentationNode->GetData()->GetGeometry()->GetIndexToWorldTransform();
   MITK_WARN << "IndexToWorldTransform_segmentation = " << transform;
 
   mitk::DataNode* surfaceNode = ui->selectedSurfaceComboBox->GetSelectedNode();
   if (surfaceNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot visualize CT-to-US registration. There is no surface selected.");
     msgBox.exec();
     return;
   }
 
   mitk::DataNode* pointSetNode = ui->pointSetComboBox->GetSelectedNode();
   if (pointSetNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot visualize CT-to-US registration. There is no pointSet selected.");
     msgBox.exec();
     return;
   }
 
   if (this->GetCombinedModality(false).IsNull())
   {
     QMessageBox msgBox;
     msgBox.setText("CombinedModality not yet set.\nPlease try again and click on the button.");
     msgBox.exec();
     return;
   }
 
   if (m_FloatingImageToUltrasoundRegistrationFilter.IsNull())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot visualize CT-to-US registration.\
                     The FloatingImageToUltrasoundRegistrationFilter is not initialized.");
     msgBox.exec();
     return;
   }
   //Set the transformation from  marker-CS to the sensor-CS accordingly to the chosen user-option
   m_FloatingImageToUltrasoundRegistrationFilter
     ->InitializeTransformationMarkerCSToSensorCS(ui->useNdiTrackerCheckBox->isChecked());
   m_FloatingImageToUltrasoundRegistrationFilter->SetPointSet(pointSetNode);
   m_FloatingImageToUltrasoundRegistrationFilter->SetSegmentation(segmentationNode, m_FloatingImage);
   m_FloatingImageToUltrasoundRegistrationFilter->SetSurface(surfaceNode);
   m_FloatingImageToUltrasoundRegistrationFilter
     ->SetTransformMarkerCSToFloatingImageCS(m_TransformMarkerCSToFloatingImageCS);
   m_FloatingImageToUltrasoundRegistrationFilter
     ->SetTransformUSimageCSToTrackingCS(this->GetCombinedModality()->GetCalibration());
   m_FloatingImageToUltrasoundRegistrationFilter
     ->ConnectTo(this->GetCombinedModality()->GetNavigationDataSource());
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnFreeze()
 {
   if (this->GetCombinedModality(false).IsNull())
   {
     return;
   }
 
   if (!m_FreezeCombinedModality)
   {
     m_FreezeCombinedModality = true;
     ui->freezeUnfreezePushButton->setText("Unfreeze");
     this->GetCombinedModality()->SetIsFreezed(true);
   }
   else
   {
     m_FreezeCombinedModality = false;
     ui->freezeUnfreezePushButton->setText("Freeze");
     this->GetCombinedModality()->SetIsFreezed(false);
   }
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnActualizeSegmentationSurfacePointSetData()
 {
   mitk::DataNode* segmentationNode = ui->segmentationComboBox->GetSelectedNode();
   if (segmentationNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot actualize segmentation + surface + pointset data. There is no segmentation selected.");
     msgBox.exec();
     return;
   }
 
   mitk::DataNode* surfaceNode = ui->selectedSurfaceComboBox->GetSelectedNode();
   if (surfaceNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot actualize segmentation + surface + pointset data. There is no surface selected.");
     msgBox.exec();
     return;
   }
 
   mitk::DataNode* pointSetNode = ui->pointSetComboBox->GetSelectedNode();
   if (pointSetNode == nullptr)
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot actualize segmentation + surface + pointset data. There is no pointSet selected.");
     msgBox.exec();
     return;
   }
 
   m_FloatingImageToUltrasoundRegistrationFilter->SetPointSet(pointSetNode);
   m_FloatingImageToUltrasoundRegistrationFilter->SetSegmentation(segmentationNode, m_FloatingImage);
   m_FloatingImageToUltrasoundRegistrationFilter->SetSurface(surfaceNode);
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnGetCursorPosition()
 {
   emit GetCursorPosition();
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnCalculateTRE(mitk::Point3D centroidOfTargetInUSImage)
 {
   mitk::DataNode::Pointer pointSetNode = ui->pointSetComboBox->GetSelectedNode();
   if (pointSetNode.IsNull())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot calculate TRE. The pointSetComboBox node returned a nullptr.");
     msgBox.exec();
     return;
   }
 
   mitk::PointSet::Pointer pointSet = dynamic_cast<mitk::PointSet*>(pointSetNode->GetData());
   if (pointSet.IsNull())
   {
     ui->distanceTREValue->setText(QString("Unknown"));
     return;
   }
   double distance = pointSet->GetPoint(0).EuclideanDistanceTo(centroidOfTargetInUSImage);
   ui->distanceTREValue->setText(QString("%1").arg(distance));
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnCalculateCenter()
 {
   mitk::DataNode::Pointer node = ui->segmentationComboBox->GetSelectedNode();
   if (node.IsNull())
   {
     QMessageBox msgBox;
     msgBox.setText("Cannot calculate the centroid of the segmentation."\
                     "The segmentationComboBox node returned a nullptr.");
     msgBox.exec();
     return;
   }
 
   mitk::LabelSetImage::Pointer image = dynamic_cast<mitk::LabelSetImage*>(node->GetData());
   if (image.IsNull())
   {
     MITK_WARN << "Cannot CalculateCenter - the segmentation cannot be converted to mitk::Image";
     return;
   }
 
   ImageType::Pointer itkImage = ImageType::New();
   mitk::CastToItkImage(image, itkImage);
 
   //Initialize binary image to shape label map filter
   BinaryImageToShapeLabelMapFilterType::Pointer shapeLabelMapFilter = BinaryImageToShapeLabelMapFilterType::New();
   shapeLabelMapFilter->SetInputForegroundValue(1);
 
   shapeLabelMapFilter->SetInput(itkImage);
   shapeLabelMapFilter->Update();
 
   BinaryImageToShapeLabelMapFilterType::OutputImageType::Pointer labelMap =
     shapeLabelMapFilter->GetOutput();
   for (int i = labelMap->GetNumberOfLabelObjects() - 1; i >= 0; --i)
   {
     // Get the ith region
     BinaryImageToShapeLabelMapFilterType::OutputImageType::LabelObjectType* labelObject = labelMap->GetNthLabelObject(i);
 
     mitk::Vector3D centroid;
     centroid[0] = labelObject->GetCentroid()[0];
     centroid[1] = labelObject->GetCentroid()[1];
     centroid[2] = labelObject->GetCentroid()[2];
     MITK_INFO << "Centroid of segmentation = " << centroid;
   }
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnAddCtImageClicked()
 {
   mitk::DataNode* selectedCtImage = ui->ctImagesToChooseComboBox->GetSelectedNode();
   if (selectedCtImage == nullptr)
   {
     return;
   }
 
   mitk::Image::Pointer ctImage = dynamic_cast<mitk::Image*>(selectedCtImage->GetData());
   if (ctImage.IsNull())
   {
     MITK_WARN << "Failed to cast selected segmentation node to mitk::Image*";
     return;
   }
   QString name = QString::fromStdString(selectedCtImage->GetName());
 
   for( int counter = 0; counter < ui->chosenCtImagesListWidget->count(); ++counter)
   {
     MITK_INFO << ui->chosenCtImagesListWidget->item(counter)->text() << " - " << counter;
     MITK_INFO << m_ImagesGroundTruthProtocol.at(counter).GetPointer();
     if (ui->chosenCtImagesListWidget->item(counter)->text().compare(name) == 0)
     {
       MITK_INFO << "CT image already exist in list of chosen CT images. Do not add the image.";
       return;
     }
   }
 
   ui->chosenCtImagesListWidget->addItem(name);
   m_ImagesGroundTruthProtocol.push_back(ctImage);
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnRemoveCtImageClicked()
 {
   int position = ui->chosenCtImagesListWidget->currentRow();
   if (ui->chosenCtImagesListWidget->count() == 0 || position < 0)
   {
     return;
   }
 
   m_ImagesGroundTruthProtocol.erase(m_ImagesGroundTruthProtocol.begin() + position);
   QListWidgetItem *item = ui->chosenCtImagesListWidget->currentItem();
   ui->chosenCtImagesListWidget->removeItemWidget(item);
   delete item;
 }
 
 void QmitkUSNavigationStepCtUsRegistration::OnEvaluateGroundTruthFiducialLocalizationProtocol()
 {
   m_GroundTruthProtocolFRE.clear();
   if (m_ImagesGroundTruthProtocol.size() != 6)
   {
     QMessageBox msgBox;
     msgBox.setText("For evaluating the Ground-Truth-Fiducial-Localization-Protocol there must be loaded 6 different CT images.");
     msgBox.exec();
     return;
   }
 
   m_PerformingGroundTruthProtocolEvaluation = true;
   this->CreatePointsToTransformForGroundTruthProtocol();
   m_GroundTruthProtocolTransformedPoints.clear();
 
   for (unsigned int cycleNo = 0; cycleNo < m_ImagesGroundTruthProtocol.size(); ++cycleNo)
   {
     m_FloatingImage = m_ImagesGroundTruthProtocol.at(cycleNo);
     this->SetFloatingImageGeometryInformation(m_FloatingImage.GetPointer());
 
     this->OnLocalizeFiducials();
     this->OnRegisterMarkerToFloatingImageCS();
     this->TransformPointsGroundTruthProtocol();
   }
   this->AddTransformedPointsToDataStorage();
   double meanFRE = this->CalculateMeanFRE();
   double sdOfFRE = this->CalculateStandardDeviationOfFRE(meanFRE);
   this->CalculateGroundTruthProtocolTRE();
 
   ui->meanFREValue->setText(QString("%1").arg(meanFRE));
   ui->sdFREValue->setText(QString("%1").arg(sdOfFRE));
   if (ui->protocolEvaluationTypeComboBox->currentText().compare("ANGLE") == 0)
   {
     if (m_GroundTruthProtocolTRE.find(0) != m_GroundTruthProtocolTRE.end())
     {
       ui->TREValue->setText(QString("%1").arg(m_GroundTruthProtocolTRE.at(0)));
     }
   }
   else if (ui->protocolEvaluationTypeComboBox->currentText().compare("PLANE") == 0)
   {
     if (m_GroundTruthProtocolTRE.find(0) != m_GroundTruthProtocolTRE.end() &&
       m_GroundTruthProtocolTRE.find(20) != m_GroundTruthProtocolTRE.end() &&
       m_GroundTruthProtocolTRE.find(40) != m_GroundTruthProtocolTRE.end() &&
       m_GroundTruthProtocolTRE.find(60) != m_GroundTruthProtocolTRE.end() &&
       m_GroundTruthProtocolTRE.find(80) != m_GroundTruthProtocolTRE.end() &&
       m_GroundTruthProtocolTRE.find(100) != m_GroundTruthProtocolTRE.end())
     {
       ui->TREValue->setText(QString("Depth 0mm: %1\nDepth 20mm: %2\nDepth 40mm: %3\
                                     \nDepth 60mm: %4\nDepth 80mm: %5\nDepth 100mm: %6")
                                     .arg(m_GroundTruthProtocolTRE.at(0))
                                     .arg(m_GroundTruthProtocolTRE.at(20))
                                     .arg(m_GroundTruthProtocolTRE.at(40))
                                     .arg(m_GroundTruthProtocolTRE.at(60))
                                     .arg(m_GroundTruthProtocolTRE.at(80))
                                     .arg(m_GroundTruthProtocolTRE.at(100)));
     }
   }
 
   m_PerformingGroundTruthProtocolEvaluation = false;
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.ui b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.ui
index 48e011bcf9..1df2b219c0 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.ui
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.ui
@@ -1,352 +1,352 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkUSNavigationStepPlacementPlanning</class>
  <widget class="QWidget" name="QmitkUSNavigationStepPlacementPlanning">
   <property name="enabled">
    <bool>true</bool>
   </property>
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>396</width>
     <height>448</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QLabel" name="bodyMarkerTrackingStatusLabel">
      <property name="styleSheet">
       <string notr="true">
               background-color: #ff7878; margin-right: 1em; margin-left: 1em;
               border: 1px solid grey
             </string>
      </property>
      <property name="text">
       <string>Body marker is not inside the tracking volume.</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="currentTargetLabel">
      <property name="font">
       <font>
        <pointsize>10</pointsize>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="text">
       <string>Planning Target %1 of %2</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="label_4">
      <property name="text">
       <string>Placement planning can be done either by using the tracked needle or by clicking with the mouse. Correcting the position is always possible by selecting the target with the &quot;Previous&quot; and &quot;Next&quot; buttons and placing it just again the.</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer_3">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeType">
       <enum>QSizePolicy::Fixed</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>20</height>
       </size>
      </property>
     </spacer>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
       <string>Placement by Needle Path</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <widget class="QLabel" name="label_3">
         <property name="text">
          <string>A target can be placed (or replaced) by pointing the needle to the desired position on the target surface and hitting the button below.</string>
         </property>
         <property name="wordWrap">
          <bool>true</bool>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QPushButton" name="placeTargetButton">
         <property name="enabled">
          <bool>false</bool>
         </property>
         <property name="text">
          <string>Place Target on Current Needle Path</string>
         </property>
         <property name="icon">
          <iconset resource="../../../resources/USNavigation.qrc">
           <normaloff>:/USNavigation/accept.png</normaloff>:/USNavigation/accept.png</iconset>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox_2">
      <property name="title">
       <string>Placment by Mouse Click</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QLabel" name="label_2">
         <property name="text">
-         <string>A target can be placed (or replaced) by freezing the imaging and then left clicking into the render window at the desired positon.</string>
+         <string>A target can be placed (or replaced) by freezing the imaging and then left clicking into the render window at the desired position.</string>
         </property>
         <property name="wordWrap">
          <bool>true</bool>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QmitkUSNavigationFreezeButton" name="freezeImageButton">
         <property name="enabled">
          <bool>false</bool>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeType">
       <enum>QSizePolicy::Fixed</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>20</height>
       </size>
      </property>
     </spacer>
    </item>
    <item>
     <widget class="QLabel" name="allTargetsPlannedLabel">
      <property name="enabled">
       <bool>false</bool>
      </property>
      <property name="text">
       <string>All Targets are planned. You can proceed with the next step if the planning result is satisfactory. Otherwise you can replace a target by switching to it witch the &quot;Previous&quot; and &quot;Next&quot; buttons and replace it as it was placed before.</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QFormLayout" name="formLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="centersOfMassLabel">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string>Centers of Mass Distances:</string>
        </property>
       </widget>
      </item>
      <item row="1" column="0">
       <widget class="QLabel" name="angleDifferenceLabel">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string>Mean Angle Difference:</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1">
       <widget class="QLabel" name="centersOfMassValue">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
      <item row="1" column="1">
       <widget class="QLabel" name="angleDifferenceValue">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
       <widget class="QPushButton" name="removeButton">
        <property name="text">
         <string>Remove Current</string>
        </property>
        <property name="icon">
         <iconset resource="../../../resources/USNavigation.qrc">
          <normaloff>:/USNavigation/minus.png</normaloff>:/USNavigation/minus.png</iconset>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="previousButton">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string>Previous</string>
        </property>
        <property name="icon">
         <iconset resource="../../../resources/USNavigation.qrc">
          <normaloff>:/USNavigation/go-previous.png</normaloff>:/USNavigation/go-previous.png</iconset>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="nextButton">
        <property name="text">
         <string>Next</string>
        </property>
        <property name="icon">
         <iconset resource="../../../resources/USNavigation.qrc">
          <normaloff>:/USNavigation/go-next.png</normaloff>:/USNavigation/go-next.png</iconset>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkUSNavigationFreezeButton</class>
    <extends>QPushButton</extends>
    <header>src/internal/Widgets/QmitkUSNavigationFreezeButton.h</header>
   </customwidget>
  </customwidgets>
  <resources>
   <include location="../../../resources/USNavigation.qrc"/>
  </resources>
  <connections>
   <connection>
    <sender>previousButton</sender>
    <signal>clicked()</signal>
    <receiver>QmitkUSNavigationStepPlacementPlanning</receiver>
    <slot>OnGoToPreviousTarget()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>71</x>
      <y>40</y>
     </hint>
     <hint type="destinationlabel">
      <x>199</x>
      <y>65</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>nextButton</sender>
    <signal>clicked()</signal>
    <receiver>QmitkUSNavigationStepPlacementPlanning</receiver>
    <slot>OnGoToNextTarget()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>328</x>
      <y>40</y>
     </hint>
     <hint type="destinationlabel">
      <x>199</x>
      <y>65</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>placeTargetButton</sender>
    <signal>clicked()</signal>
    <receiver>QmitkUSNavigationStepPlacementPlanning</receiver>
    <slot>OnPlaceTargetButtonClicked()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>199</x>
      <y>119</y>
     </hint>
     <hint type="destinationlabel">
      <x>199</x>
      <y>72</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>removeButton</sender>
    <signal>clicked()</signal>
    <receiver>QmitkUSNavigationStepPlacementPlanning</receiver>
    <slot>OnRemoveCurrentTargetClicked()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>71</x>
      <y>59</y>
     </hint>
     <hint type="destinationlabel">
      <x>199</x>
      <y>83</y>
     </hint>
    </hints>
   </connection>
  </connections>
  <slots>
   <slot>OnGoToPreviousTarget()</slot>
   <slot>OnGoToNextTarget()</slot>
   <slot>OnPlaceTargetButtonClicked()</slot>
   <slot>OnRemoveCurrentTargetClicked()</slot>
   <slot>OnFreeze(bool)</slot>
  </slots>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h
index 24c340a4fb..e322ed1590 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.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 QmitkUSNavigationStepPunctuationIntervention_h
 #define QmitkUSNavigationStepPunctuationIntervention_h
 
 #include "QmitkUSAbstractNavigationStep.h"
 #include <mitkPointSet.h>
 #include <mitkNavigationTool.h>
 #include <vtkSmartPointer.h>
 #include <vtkSphereSource.h>
 #include <vtkLine.h>
 #include <vtkOBBTree.h>
 
 namespace mitk {
 class DataNode;
 class NeedleProjectionFilter;
 class NodeDisplacementFilter;
 class USNavigationGrabCutSegmentationUpdateFilter;
 class USNavigationTargetUpdateFilter;
 class USNavigationTargetOcclusionFilter;
 class USPointMarkInteractor;
 class LookupTableProperty;
 class Surface;
 }
 
 namespace Ui {
 class QmitkUSNavigationStepPunctuationIntervention;
 }
 
 class QmitkZoneProgressBar;
 
 /**
  * \brief Navigations step for the actual punctuation intervention.
  * The needle path is projected onto the image plane and the distances to all
  * risk structures are displayed in the widget.
  *
  * The risk structures are expected to be in the data storage under
  * DATANAME_BASENODE -> DATANAME_ZONES. They should contain a property named
  * "zone.size" and it is assumed that they are spherical.
  */
 class QmitkUSNavigationStepPunctuationIntervention : public QmitkUSAbstractNavigationStep
 {
   Q_OBJECT
 
 public:
 
   /** Sets the navigation tool of the needle for the meta data (tool axis etc.)*/
   void SetNeedleMetaData(mitk::NavigationTool::Pointer needleNavigationTool);
   explicit QmitkUSNavigationStepPunctuationIntervention(QWidget *parent = nullptr);
   ~QmitkUSNavigationStepPunctuationIntervention() override;
 
   bool OnStartStep() override;
   bool OnRestartStep() override;
   bool OnFinishStep() override;
 
   bool OnActivateStep() override;
   void OnUpdate() override;
 
   void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode>) override;
 
   QString GetTitle() override;
   bool GetIsRestartable() override;
 
   FilterVector GetFilter() override;
 
 signals:
 
   void AddAblationZoneClicked(int);
 
   void AblationZoneChanged(int,int);
 
 protected slots:
 
   void OnAddAblationZoneClicked();
   void OnEnableAblationZoneMarkingClicked();
   void OnAblationZoneSizeSliderChanged(int size);
   void OnShowToolAxisEnabled(int enabled);
 
 protected:
   void OnSetCombinedModality() override;
 
   void ClearZones();
   void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker);
   /** Updates the critical structures which means that the distance to the needle tip is updated
       and also the color changes to red if the path projection intersects the critical structure. */
   void UpdateCriticalStructures(mitk::NavigationData::Pointer needle, mitk::PointSet::Pointer path);
   /** Checks if the given line intersects the given sphere. */
   bool CheckSphereLineIntersection(mitk::Point3D& sphereOrigin, float& sphereRadius, mitk::Point3D& lineStart, mitk::Point3D& lineEnd);
 
 private:
   Ui::QmitkUSNavigationStepPunctuationIntervention *m_Ui;
 
   mitk::DataStorage::SetOfObjects::ConstPointer m_ZoneNodes;
 
   /** \brief Creates a Pointset that projects the needle's path */
   itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter;
 
   /** holds the navigation tool of the needle for the meta data (tool axis etc.)*/
   mitk::NavigationTool::Pointer m_NeedleNavigationTool;
 
-  std::map<mitk::DataNode::Pointer,mitk::Color> m_OldColors; //stores the original color of the critical structrue nodes
+  std::map<mitk::DataNode::Pointer,mitk::Color> m_OldColors; //stores the original color of the critical structure nodes
 
   //some help variables for the CheckSphereLineIntersection()-Method
   vtkSmartPointer<vtkSphereSource> m_SphereSource;
   vtkSmartPointer<vtkOBBTree> m_OBBTree;
   vtkSmartPointer<vtkPoints> m_IntersectPoints;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h
index e443cb43b5..66ac77a026 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.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 QmitkUSNavigationStepTumourSelection_h
 #define QmitkUSNavigationStepTumourSelection_h
 
 #include "QmitkUSAbstractNavigationStep.h"
 
 namespace itk {
 template<class T> class SmartPointer;
 }
 
 namespace mitk {
 class NavigationDataSource;
 class DataStorage;
 class DataNode;
 class USZonesInteractor;
 class NodeDisplacementFilter;
 class Surface;
 }
 
 namespace Ui {
 class QmitkUSNavigationStepTumourSelection;
 }
 
 class USNavigationMarkerPlacement;
 class QmitkUSNavigationStepCombinedModality;
 
 /**
  * \brief Navigation step for marking the tumor position and extent.
  * The user can mark the position by interacting with the render windows. The
  * tumor size can be changed afterwards and the tumor can be removed.
  */
 class QmitkUSNavigationStepTumourSelection : public QmitkUSAbstractNavigationStep
 {
   Q_OBJECT
 
 protected slots:
   /**
    * \brief Activates or deactivates the ineractor for tumour creation.
    */
   void OnFreeze(bool freezed);
 
   /**
    * \brief Updates the surface of the tumor node according to the new size.
    */
   void OnTumourSizeChanged(int);
 
   /**
    * \brief Just restarts the navigation step for deleting the tumour.
    */
   void OnDeleteButtonClicked();
 
 public:
   explicit QmitkUSNavigationStepTumourSelection(QWidget* parent = nullptr);
   ~QmitkUSNavigationStepTumourSelection() override;
 
   void SetTargetSelectionOptional (bool t);
 
   /**
    * \brief Initializes tumour and target surface.
    * \return always true
    */
   bool OnStartStep() override;
 
   /**
    * \brief Removes target surface and tumour node from the data storage.
    * Additionally an unfreeze is done and the node displacement filter is
-   * resetted.
+   * reset.
    * \return always true
    */
   bool OnStopStep() override;
 
   /**
    * \brief Reinitializes buttons and sliders in addition of calling the default implementation.
    * \return result of the superclass implementation
    */
   bool OnRestartStep() override;
 
   /**
    * \brief (Re)creates the target surface.
    * \return always true
    */
   bool OnFinishStep() override;
 
   /**
    * \brief Initializes (but not activates) the interactor for tumour selection.
    * \return always true
    */
   bool OnActivateStep() override;
 
   /**
    * \brief Deactivates the interactor for tumour selection
    * and removes data of the tumour node if selection wasn't finished yet.
    *
    * \return always true
    */
   bool OnDeactivateStep() override;
 
   /**
    * \brief Updates tracking validity status and checks tumour node for the end of tumour creation.
    */
   void OnUpdate() override;
 
   /**
    * The properties "settings.security-distance" and
    * "settings.interaction-concept" are used.
    */
   void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
 
   QString GetTitle() override;
 
   /**
    * @return a node displacement filter for tumour and target surfaces
    */
   FilterVector GetFilter() override;
 
   void SetTumorColor(mitk::Color c);
 
-  /** @return Returns the current NodeDisplacementFilter which ist used for updating the targets pose. */
+  /** @return Returns the current NodeDisplacementFilter which is used for updating the targets pose. */
   itk::SmartPointer<mitk::NodeDisplacementFilter> GetTumourNodeDisplacementFilter();
 
 protected:
   void OnSetCombinedModality() override;
 
   void TumourNodeChanged(const mitk::DataNode*);
   itk::SmartPointer<mitk::Surface> CreateTargetSurface();
 
   void UpdateReferenceSensorName();
 
   itk::SmartPointer<mitk::NavigationDataSource>   m_NavigationDataSource;
 
   bool m_targetSelectionOptional;
 
   float                                           m_SecurityDistance;
 
   itk::SmartPointer<mitk::USZonesInteractor>      m_Interactor;
   itk::SmartPointer<mitk::DataNode>               m_TumourNode;
   itk::SmartPointer<mitk::DataNode>               m_TargetSurfaceNode;
 
   itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter;
 
   std::string                                     m_StateMachineFilename;
   std::string                                     m_ReferenceSensorName;
   unsigned int                                    m_ReferenceSensorIndex;
 
   mitk::Color                                     m_SphereColor;
 
 private:
   mitk::MessageDelegate1<QmitkUSNavigationStepTumourSelection, const mitk::DataNode*> m_ListenerChangeNode;
 
   Ui::QmitkUSNavigationStepTumourSelection *ui;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.cpp
index 2842412f7e..90ffb1f02e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.cpp
@@ -1,800 +1,800 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkUSNavigationMarkerPlacement.h"
 #include "ui_QmitkUSNavigationMarkerPlacement.h"
 
 #include "NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h"
 #include "NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h"
 #include "NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h"
 #include "NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h"
 #include "NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h"
 #include "NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h"
 
 #include "SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h"
 
 #include "mitkAbstractUltrasoundTrackerDevice.h"
 #include "mitkIRenderingManager.h"
 #include "mitkNodeDisplacementFilter.h"
 #include "mitkTrackedUltrasound.h"
 #include <mitkIOUtil.h>
 
 #include "IO/mitkUSNavigationStepTimer.h"
 
 #include <QDateTime>
 #include <QDir>
 #include <QInputDialog>
 #include <QMessageBox>
 #include <QSignalMapper>
 #include <QTimer>
 
 #include "QmitkRenderWindow.h"
 #include "QmitkStdMultiWidget.h"
 #include "QmitkStdMultiWidgetEditor.h"
 #include "mitkCameraController.h"
 #include "mitkLayoutAnnotationRenderer.h"
 #include <vtkSmartPointer.h>
 
 // scene serialization
 #include <mitkConvert2Dto3DImageFilter.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkSceneIO.h>
 #include <mitkSurface.h>
 
 const std::string QmitkUSNavigationMarkerPlacement::VIEW_ID = "org.mitk.views.usmarkerplacement";
 
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_TUMOUR = "Tumour";
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_TARGETSURFACE = "Target Surface";
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_ZONES = "Zones";
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_TARGETS = "Targets";
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_TARGETS_PATHS = "Target Paths";
 const char *QmitkUSNavigationMarkerPlacement::DATANAME_REACHED_TARGETS = "Reached Targets";
 
 QmitkUSNavigationMarkerPlacement::QmitkUSNavigationMarkerPlacement()
   : m_Parent(nullptr),
     m_UpdateTimer(new QTimer(this)),
     m_ImageAndNavigationDataLoggingTimer(new QTimer(this)),
     m_StdMultiWidget(nullptr),
     m_CombinedModality(nullptr),
     m_ReinitAlreadyDone(false),
     m_IsExperimentRunning(false),
     m_CurrentApplicationName(),
     m_NavigationStepTimer(mitk::USNavigationStepTimer::New()),
     m_IconRunning(QPixmap(":/USNavigation/record.png")),
     m_IconNotRunning(QPixmap(":/USNavigation/record-gray.png")),
     m_ResultsDirectory(),
     m_ExperimentName(),
     m_ExperimentResultsSubDirectory(),
     m_NavigationStepNames(),
     m_LoggingBackend(),
     m_USImageLoggingFilter(mitk::USImageLoggingFilter::New()),
     m_NavigationDataRecorder(mitk::NavigationDataRecorder::New()),
     m_TargetNodeDisplacementFilter(nullptr),
     m_AblationZonesDisplacementFilter(mitk::NodeDisplacementFilter::New()),
     m_ToolVisualizationFilter(nullptr),
     m_AblationZonesVector(),
     m_NeedleIndex(0),
     m_MarkerIndex(1),
     m_SceneNumber(1),
     m_WarnOverlay(mitk::TextAnnotation2D::New()),
     m_NavigationDataSource(nullptr),
     m_CurrentStorage(nullptr),
     m_ImageStreamNode(nullptr),
     ui(new Ui::QmitkUSNavigationMarkerPlacement)
 {
   connect(m_UpdateTimer, SIGNAL(timeout()), this, SLOT(OnTimeout()));
   connect(
     m_ImageAndNavigationDataLoggingTimer, SIGNAL(timeout()), this, SLOT(OnImageAndNavigationDataLoggingTimeout()));
 
   // scale running (and not running) icon the specific height
   m_IconRunning = m_IconRunning.scaledToHeight(20, Qt::SmoothTransformation);
   m_IconNotRunning = m_IconNotRunning.scaledToHeight(20, Qt::SmoothTransformation);
 
 
 }
 
 QmitkUSNavigationMarkerPlacement::~QmitkUSNavigationMarkerPlacement()
 {
   this->GetDataStorage()->Remove(m_InstrumentNode);
   delete ui;
 }
 
 void QmitkUSNavigationMarkerPlacement::OnChangeAblationZone(int id, int newSize)
 {
   if ((static_cast<int>(m_AblationZonesVector.size()) < id) || (id < 0))
   {
     return;
   }
 
   MITK_INFO << "Ablation Zone " << id << " changed, new size: " << newSize;
 
   // create a vtk sphere with given radius
   vtkSmartPointer<vtkSphereSource> vtkSphere = vtkSmartPointer<vtkSphereSource>::New();
   vtkSphere->SetRadius(newSize / 2);
   vtkSphere->SetCenter(0, 0, 0);
   vtkSphere->SetPhiResolution(20);
   vtkSphere->SetThetaResolution(20);
   vtkSphere->Update();
 
   mitk::Surface::Pointer zoneSurface = dynamic_cast<mitk::Surface *>(m_AblationZonesVector.at(id)->GetData());
   zoneSurface->SetVtkPolyData(vtkSphere->GetOutput());
 }
 
 void QmitkUSNavigationMarkerPlacement::OnAddAblationZone(int size)
 {
   m_AblationZonesDisplacementFilter->SetInitialReferencePose(
     m_CombinedModality->GetNavigationDataSource()->GetOutput(m_MarkerIndex));
   mitk::DataNode::Pointer NewAblationZone = mitk::DataNode::New();
 
   mitk::Point3D origin = m_CombinedModality->GetNavigationDataSource()->GetOutput(m_NeedleIndex)->GetPosition();
 
   MITK_INFO("USNavigationLogging") << "Ablation Zone Added, initial size: " << size << ", origin: " << origin;
 
   mitk::Surface::Pointer zone = mitk::Surface::New();
 
   // create a vtk sphere with given radius
   vtkSmartPointer<vtkSphereSource> vtkSphere = vtkSmartPointer<vtkSphereSource>::New();
   vtkSphere->SetRadius(size / 2);
   vtkSphere->SetCenter(0, 0, 0);
   vtkSphere->SetPhiResolution(20);
   vtkSphere->SetThetaResolution(20);
   vtkSphere->Update();
   zone->SetVtkPolyData(vtkSphere->GetOutput());
 
   // set vtk sphere and origin to data node (origin must be set
   // again, because of the new sphere set as data)
   NewAblationZone->SetData(zone);
   NewAblationZone->GetData()->GetGeometry()->SetOrigin(origin);
   mitk::Color SphereColor = mitk::Color();
   // default color
   SphereColor[0] = 102;
   SphereColor[1] = 0;
   SphereColor[2] = 204;
   NewAblationZone->SetColor(SphereColor);
   NewAblationZone->SetOpacity(0.3);
 
   // set name of zone
   std::stringstream name;
   name << "Ablation Zone" << m_AblationZonesVector.size();
   NewAblationZone->SetName(name.str());
 
   // add zone to filter
   m_AblationZonesDisplacementFilter->AddNode(NewAblationZone);
   m_AblationZonesVector.push_back(NewAblationZone);
   this->GetDataStorage()->Add(NewAblationZone);
 }
 
 void QmitkUSNavigationMarkerPlacement::CreateQtPartControl(QWidget *parent)
 {
   m_Parent = parent;
   ui->setupUi(parent);
 
   connect(ui->startExperimentButton, SIGNAL(clicked()), this, SLOT(OnStartExperiment()));
   connect(ui->finishExperimentButton, SIGNAL(clicked()), this, SLOT(OnFinishExperiment()));
   connect(ui->m_enableNavigationLayout, SIGNAL(clicked()), this, SLOT(OnChangeLayoutClicked()));
   connect(ui->m_RenderWindowSelection, SIGNAL(valueChanged(int)), this, SLOT(OnRenderWindowSelection()));
   connect(ui->m_RefreshView, SIGNAL(clicked()), this, SLOT(OnRefreshView()));
 
   m_BaseNode = this->GetDataStorage()->GetNamedNode(QmitkUSAbstractNavigationStep::DATANAME_BASENODE);
   if (m_BaseNode.IsNull())
   {
     m_BaseNode = mitk::DataNode::New();
     m_BaseNode->SetName(QmitkUSAbstractNavigationStep::DATANAME_BASENODE);
     this->GetDataStorage()->Add(m_BaseNode);
   }
 
   connect(ui->m_CtToUsRegistrationWidget, SIGNAL(GetCursorPosition()), this, SLOT(OnGetCursorPosition()));
   connect(ui->m_CtToUsRegistrationWidget, SIGNAL(ActualizeCtToUsRegistrationWidget()), this, SLOT(OnActualizeCtToUsRegistrationWidget()));
   connect(ui->m_initializeCtToUsRegistration, SIGNAL(clicked()), this, SLOT(OnInitializeCtToUsRegistration()));
   connect(ui->m_initializeTargetMarking, SIGNAL(clicked()), this, SLOT(OnInitializeTargetMarking()));
   connect(ui->m_initializeCritStructureMarking, SIGNAL(clicked()), this, SLOT(OnInitializeCriticalStructureMarking()));
   connect(ui->m_initializeNavigation, SIGNAL(clicked()), this, SLOT(OnInitializeNavigation()));
 
   // indicate that no experiment is running at start
   ui->runningLabel->setPixmap(m_IconNotRunning);
 
   connect(ui->m_settingsWidget, SIGNAL(SettingsChanged(itk::SmartPointer<mitk::DataNode>)),
           this, SLOT(OnSettingsChanged(itk::SmartPointer<mitk::DataNode>)));
 }
 
 void QmitkUSNavigationMarkerPlacement::ReInitializeSettingsNodesAndImageStream()
 {
   //If update timer is not stopped (signals stopped), setting the m_CombinedModality
   // will cause a crash of the workbench in some times.
   m_UpdateTimer->blockSignals(true);
   m_UpdateTimer->stop();
   m_SettingsNode = mitk::DataNode::New();
   ui->m_settingsWidget->OnSetSettingsNode(m_SettingsNode, true);
   InitImageStream();
   m_CombinedModality = ui->m_CombinedModalityCreationWidget->GetSelectedCombinedModality();
   // Having set the m_CombinedModality reactivate the update timer again
   m_UpdateTimer->start(50); // every 50 Milliseconds = 20 Frames/Second
   m_UpdateTimer->blockSignals(false);
 }
 
 void QmitkUSNavigationMarkerPlacement::OnGetCursorPosition()
 {
   auto centroid = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetSelectedPosition();
   ui->m_CtToUsRegistrationWidget->OnCalculateTRE(centroid);
 }
 
 void QmitkUSNavigationMarkerPlacement::OnActualizeCtToUsRegistrationWidget()
 {
   m_SettingsNode = mitk::DataNode::New();
   ui->m_settingsWidget->OnSetSettingsNode(m_SettingsNode, true);
   this->InitImageStream();
 
   if (ui->m_CombinedModalityCreationWidget->GetSelectedCombinedModality().IsNull())
   {
     return;
   }
   ui->m_CtToUsRegistrationWidget->SetCombinedModality(
     ui->m_CombinedModalityCreationWidget->GetSelectedCombinedModality());
 
   m_CombinedModality = ui->m_CombinedModalityCreationWidget->GetSelectedCombinedModality();
 
   if (!m_StdMultiWidget)
   {
     // try to get the standard multi widget if it couldn't be got before
     mitk::IRenderWindowPart *renderWindowPart = this->GetRenderWindowPart();
 
     QmitkStdMultiWidgetEditor *multiWidgetEditor = dynamic_cast<QmitkStdMultiWidgetEditor *>(renderWindowPart);
 
     // if there is a standard multi widget now, disable the level window and
     // change the layout to 2D up and 3d down
     if (multiWidgetEditor)
     {
       m_StdMultiWidget = dynamic_cast<QmitkStdMultiWidget *>(multiWidgetEditor->GetMultiWidget());
       multiWidgetEditor->ShowLevelWindowWidget(false);
       SetTwoWindowView();
     }
   }
   else
   {
     this->OnRefreshView();
   }
   m_UpdateTimer->start(50); // every 50 Milliseconds = 20 Frames/Second
 }
 
 void QmitkUSNavigationMarkerPlacement::OnInitializeCtToUsRegistration()
 {
   ui->m_CtToUsRegistrationWidget->SetDataStorage(this->GetDataStorage());
   ui->m_CtToUsRegistrationWidget->OnSettingsChanged(m_SettingsNode);
   ui->m_CtToUsRegistrationWidget->OnActivateStep();
   ui->m_CtToUsRegistrationWidget->OnStartStep();
   ui->m_CtToUsRegistrationWidget->Update();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnInitializeTargetMarking()
 {
   ReInitializeSettingsNodesAndImageStream();
   ui->m_TargetMarkingWidget->SetCombinedModality(m_CombinedModality);
   ui->m_TargetMarkingWidget->SetDataStorage(this->GetDataStorage());
   ui->m_TargetMarkingWidget->OnSettingsChanged(m_SettingsNode);
   ui->m_TargetMarkingWidget->OnActivateStep();
   ui->m_TargetMarkingWidget->OnStartStep();
   ui->m_TargetMarkingWidget->Update();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnInitializeCriticalStructureMarking()
 {
   ReInitializeSettingsNodesAndImageStream();
   ui->m_CriticalStructuresWidget->SetCombinedModality(m_CombinedModality);
   ui->m_CriticalStructuresWidget->SetDataStorage(this->GetDataStorage());
   ui->m_CriticalStructuresWidget->OnSettingsChanged(m_SettingsNode);
   ui->m_CriticalStructuresWidget->OnActivateStep();
   ui->m_CriticalStructuresWidget->OnStartStep();
   ui->m_CriticalStructuresWidget->Update();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnInitializeNavigation()
 {
   ReInitializeSettingsNodesAndImageStream();
   ui->m_NavigationWidget->SetCombinedModality(m_CombinedModality);
   ui->m_NavigationWidget->SetDataStorage(this->GetDataStorage());
   ui->m_NavigationWidget->OnSettingsChanged(m_SettingsNode);
   ui->m_NavigationWidget->OnActivateStep();
   ui->m_NavigationWidget->OnStartStep();
   ui->m_NavigationWidget->Update();
 
   // test if it is tracked US, if yes add visualization filter
   if (m_CombinedModality->GetIsTrackedUltrasoundActive())
   {
     m_InstrumentNode = mitk::DataNode::New();
     m_InstrumentNode->SetName("Tracked US Instrument");
     m_InstrumentNode->SetData(
       m_CombinedModality->GetNavigationDataSource()->GetToolMetaData(0)->GetToolSurface()->Clone());
     this->GetDataStorage()->Add(m_InstrumentNode);
     m_ToolVisualizationFilter = mitk::NavigationDataObjectVisualizationFilter::New();
     m_ToolVisualizationFilter->ConnectTo(m_CombinedModality->GetNavigationDataSource());
     m_ToolVisualizationFilter->SetRepresentationObject(0, m_InstrumentNode->GetData()); //caution: currently hard coded that instrument has id 0
     //set dummy objects to avoid spamming of console
     mitk::Surface::Pointer dummyObject = mitk::Surface::New();
     m_ToolVisualizationFilter->SetRepresentationObject(1, dummyObject.GetPointer());
     m_ToolVisualizationFilter->SetRepresentationObject(2, dummyObject.GetPointer());
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::InitImageStream()
 {
   if (m_ImageStreamNode.IsNull())
   {
     m_ImageStreamNode = mitk::DataNode::New();
     m_ImageStreamNode->SetName("US Navigation Viewing Stream");
     this->GetDataStorage()->Add(m_ImageStreamNode);
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnCombinedModalityPropertyChanged(const std::string &key, const std::string &)
 {
   if (key == mitk::USDevice::GetPropertyKeys().US_PROPKEY_BMODE_DEPTH)
   {
     m_ReinitAlreadyDone = false;
     this->ReinitOnImage();
 
     if (m_CombinedModality.IsNotNull() && !m_CombinedModality->GetIsCalibratedForCurrentStatus())
     {
       mitk::LayoutAnnotationRenderer::AddAnnotation(
         m_WarnOverlay.GetPointer(), "stdmulti.widget0", mitk::LayoutAnnotationRenderer::TopLeft);
       MITK_WARN << "No calibration available for the selected ultrasound image depth.";
     }
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::SetFocus()
 {
   this->ReinitOnImage();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnTimeout()
 {
   if (m_CombinedModality.IsNull())
     return;
-  m_CombinedModality->Modified(); // shouldn't be nessecary ... fix in abstract ultrasound tracker device!
+  m_CombinedModality->Modified(); // shouldn't be necessary ... fix in abstract ultrasound tracker device!
   m_CombinedModality->Update();
   if (m_ToolVisualizationFilter.IsNotNull())
   {
     m_ToolVisualizationFilter->Update();
   }
 
   ui->m_CtToUsRegistrationWidget->Update();
   ui->m_TargetMarkingWidget->Update();
   ui->m_CriticalStructuresWidget->Update();
   ui->m_NavigationWidget->Update();
 
   mitk::Image::Pointer image = m_CombinedModality->GetOutput();
   // make sure that always the current image is set to the data node
   if (image.IsNotNull() && m_ImageStreamNode->GetData() != image.GetPointer() && image->IsInitialized())
   {
     m_ImageStreamNode->SetData(image);
   }
 
   if (!m_StdMultiWidget)
   {
     // try to get the standard multi widget if it couldn't be got before
     mitk::IRenderWindowPart *renderWindowPart = this->GetRenderWindowPart();
 
     QmitkStdMultiWidgetEditor *multiWidgetEditor = dynamic_cast<QmitkStdMultiWidgetEditor*>(renderWindowPart);
 
     // if there is a standard multi widget now, disable the level window and
     // change the layout to 2D up and 3d down
     if (multiWidgetEditor)
     {
       m_StdMultiWidget = dynamic_cast<QmitkStdMultiWidget*>(multiWidgetEditor->GetMultiWidget());
       multiWidgetEditor->ShowLevelWindowWidget(false);
       SetTwoWindowView();
     }
 
     this->CreateOverlays();
   }
 
   if (m_CombinedModality.IsNotNull() && !this->m_CombinedModality->GetIsFreezed()) // if the combined modality is freezed: do nothing
   {
     m_AblationZonesDisplacementFilter->Update();
 
     // update the 3D window only every fourth time to speed up the rendering (at least in 2D)
     this->RequestRenderWindowUpdate(mitk::RenderingManager::REQUEST_UPDATE_2DWINDOWS);
 
     // make sure that a reinit was performed on the image
     this->ReinitOnImage();
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnEnableNavigationLayout()
 {
   MITK_INFO << "Navigation Layout";
   // try to get the standard multi widget if it couldn't be got before
   mitk::IRenderWindowPart *renderWindowPart = this->GetRenderWindowPart();
 
   QmitkStdMultiWidgetEditor *multiWidgetEditor = dynamic_cast<QmitkStdMultiWidgetEditor*>(renderWindowPart);
 
   // if there is a standard multi widget now, disable the level window and
   // change the layout to 2D up and 3d down
   if (multiWidgetEditor)
   {
     m_StdMultiWidget = dynamic_cast<QmitkStdMultiWidget*>(multiWidgetEditor->GetMultiWidget());
     multiWidgetEditor->ShowLevelWindowWidget(false);
     SetTwoWindowView();
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnRenderWindowSelection()
 {
   SetTwoWindowView();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnRefreshView()
 {
   if (!ui->m_enableNavigationLayout->isChecked())
     OnResetStandardLayout();
   else
   {
     // Reinit the US Image Stream (this might be broken if there was a global reinit somewhere...)
     try
     {
       mitk::RenderingManager::GetInstance()->InitializeViews( // Reinit
         this
           ->GetDataStorage() // GetDataStorage
           ->GetNamedNode("US Viewing Stream - Image 0")
           ->GetData()
           ->GetTimeGeometry()); // GetNode
     }
     catch (...)
     {
       MITK_DEBUG << "No reinit possible";
     }
     SetTwoWindowView();
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::SetTwoWindowView()
 {
   if (m_StdMultiWidget)
   {
     int i, j, k;
     switch (this->ui->m_RenderWindowSelection->value())
     {
       case 1:
         mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget3"))->GetCameraController()->SetViewToCaudal();
         i = 1;
         j = 2; // other windows
         k = 0;
         break;
       case 2:
         mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget3"))->GetCameraController()->SetViewToSinister();
         i = 0;
         j = 2;
         k = 1;
         break;
       case 3:
         mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget3"))->GetCameraController()->SetViewToAnterior();
         i = 1;
         j = 0;
         k = 2;
         break;
       default:
         return;
     }
 
     // get the render window which is defined by index "k" and set it as "current render window widget"
     // chose the layout that will set the current 2D window as top render window and the 3D windows as bottom render window
     auto renderWindowWidget = m_StdMultiWidget->GetRenderWindowWidget(m_StdMultiWidget->GetNameFromIndex(k));
     m_StdMultiWidget->GetMultiWidgetLayoutManager()->SetCurrentRenderWindowWidget(renderWindowWidget.get());
     m_StdMultiWidget->GetMultiWidgetLayoutManager()->SetOneTop3DBottomLayout();
 
     ////Crosshair invisible in 3D view
     this->GetDataStorage()->GetNamedNode("stdmulti.widget" + std::to_string(i) + ".plane")
       ->SetBoolProperty("visible", false, mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget4")));
     this->GetDataStorage()->GetNamedNode("stdmulti.widget" + std::to_string(j) + ".plane")
       ->SetBoolProperty("visible", false, mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget4")));
     this->GetDataStorage()->GetNamedNode("stdmulti.widget" + std::to_string(k) + ".plane")
       ->SetBoolProperty("visible", true, mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget4")));
     this->GetDataStorage()->GetNamedNode("stdmulti.widget" + std::to_string(i) + ".plane")
       ->SetIntProperty("Crosshair.Gap Size", 0);
     this->GetDataStorage()->GetNamedNode("stdmulti.widget" + std::to_string(j) + ".plane")
       ->SetIntProperty("Crosshair.Gap Size", 0);
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnResetStandardLayout()
 {
   if (m_StdMultiWidget)
   {
     //reset render windows
     m_StdMultiWidget->SetCrosshairVisibility(true);
     m_StdMultiWidget->GetMultiWidgetLayoutManager()->SetDefaultLayout();
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnChangeLayoutClicked()
 {
   if (ui->m_enableNavigationLayout->isChecked())
     OnEnableNavigationLayout();
   else
     OnResetStandardLayout();
 }
 
 void QmitkUSNavigationMarkerPlacement::OnImageAndNavigationDataLoggingTimeout()
 {
   // update filter for logging navigation data and ultrasound images
   if (m_CombinedModality.IsNotNull())
   {
     m_NavigationDataRecorder->Update();
     // get last messages for logging filer and store them
     std::vector<std::string> messages = m_LoggingBackend.GetNavigationMessages();
     std::string composedMessage = "";
     for (std::size_t i = 0; i < messages.size(); i++)
     {
       composedMessage += messages.at(i);
     }
     m_USImageLoggingFilter->AddMessageToCurrentImage(composedMessage);
     m_LoggingBackend.ClearNavigationMessages();
     // update logging filter
     m_USImageLoggingFilter->Update();
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnStartExperiment()
 {
   // get name for the experiment by a QInputDialog
   bool ok;
   if (m_ExperimentName.isEmpty())
   { // default: current date
     m_ExperimentName = QString::number(QDateTime::currentDateTime().date().year()) + "_" +
                        QString::number(QDateTime::currentDateTime().date().month()) + "_" +
                        QString::number(QDateTime::currentDateTime().date().day()) + "_experiment_" +
                        QString::number(QDateTime::currentDateTime().time().hour()) + "." +
                        QString::number(QDateTime::currentDateTime().time().minute());
   }
   m_ExperimentName = QInputDialog::getText(
     m_Parent, QString("Experiment Name"), QString("Name of the Experiment"), QLineEdit::Normal, m_ExperimentName, &ok);
   MITK_INFO("USNavigationLogging") << "Experiment started: " << m_ExperimentName.toStdString();
   if (ok && !m_ExperimentName.isEmpty())
   {
     // display error message and call the function recursively if a directory
     // with the given name already exists
     QDir experimentResultsDir(m_ResultsDirectory + QDir::separator() + m_ExperimentName);
     if (experimentResultsDir.exists())
     {
       QMessageBox::critical(
         m_Parent, "Results Directory Exists", "The result directory already exists.\nPlease choose an other name.");
       this->OnStartExperiment();
     }
     else
     {
       QDir(m_ResultsDirectory).mkdir(m_ExperimentName);
       m_ExperimentResultsSubDirectory = m_ResultsDirectory + QDir::separator() + m_ExperimentName;
 
       // experiment is running now
       ui->runningLabel->setPixmap(m_IconRunning);
 
       // (re)start timer for navigation step durations
       m_NavigationStepTimer->Reset();
       m_NavigationStepTimer->SetOutputFileName(
         QString(m_ExperimentResultsSubDirectory + QDir::separator() + QString("durations.cvs")).toStdString());
       m_NavigationStepTimer->SetActiveIndex(0, "Initialization");
 
       ui->finishExperimentButton->setEnabled(true);
       ui->startExperimentButton->setDisabled(true);
 
       // initialize and register logging backend
       QString loggingFilename = m_ExperimentResultsSubDirectory + QDir::separator() + "logging.txt";
       m_LoggingBackend.SetOutputFileName(loggingFilename.toStdString());
       mitk::RegisterBackend(&m_LoggingBackend);
 
       // initialize and start navigation data recorder form xml recording
       m_NavigationDataRecorder->StartRecording();
 
       m_IsExperimentRunning = true;
 
       m_ImageAndNavigationDataLoggingTimer->start(1000);
     }
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::OnFinishExperiment()
 {
   this->WaitCursorOn();
 
   MITK_INFO("USNavigationLogging") << "Experiment finished!";
   MITK_INFO("USNavigationLogging") << "Position/Orientation of needle tip: "
                                    << (dynamic_cast<mitk::NavigationData *>(
                                          m_CombinedModality->GetTrackingDeviceDataSource()->GetOutput(0)))
                                         ->GetPosition();
   MITK_INFO("USNavigationLogging")
     << "Position of target: " << m_TargetNodeDisplacementFilter->GetRawDisplacementNavigationData(0)->GetPosition();
   MITK_INFO("USNavigationLogging") << "Total duration: " << m_NavigationStepTimer->GetTotalDuration();
 
   m_ImageAndNavigationDataLoggingTimer->stop();
 
   ui->runningLabel->setPixmap(m_IconNotRunning);
 
   m_NavigationStepTimer->Stop();
 
   ui->finishExperimentButton->setDisabled(true);
   ui->startExperimentButton->setEnabled(true);
 
   MITK_INFO("USNavigationLogging") << "Writing logging data to " << m_ExperimentResultsSubDirectory.toStdString();
   //  save ultrasound images to the file system
   QDir(m_ExperimentResultsSubDirectory).mkdir("ImageStream");
   m_USImageLoggingFilter->Update();
   m_USImageLoggingFilter->SetImageFilesExtension(".jpg");
   m_USImageLoggingFilter->SaveImages(
     QString(m_ExperimentResultsSubDirectory + QDir::separator() + "ImageStream" + QDir::separator()).toStdString());
   m_USImageLoggingFilter = mitk::USImageLoggingFilter::New();
 
   m_NavigationDataRecorder->StopRecording();
 
   // Write data to csv and xml file
   mitk::IOUtil::Save(
     m_NavigationDataRecorder->GetNavigationDataSet(),
     (QString(m_ExperimentResultsSubDirectory + QDir::separator() + "navigation-data.xml").toStdString().c_str()));
   mitk::IOUtil::Save(
     m_NavigationDataRecorder->GetNavigationDataSet(),
     (QString(m_ExperimentResultsSubDirectory + QDir::separator() + "navigation-data.csv").toStdString().c_str()));
 
   // write logged navigation data messages to separate file
   std::stringstream csvNavigationMessagesFilename;
   csvNavigationMessagesFilename << m_ExperimentResultsSubDirectory.toStdString() << QDir::separator().toLatin1()
                                 << "CSVNavigationMessagesLogFile.csv";
   MITK_INFO("USNavigationLogging") << "Writing logged navigation messages to separate csv file: "
                                    << csvNavigationMessagesFilename.str();
   m_LoggingBackend.WriteCSVFileWithNavigationMessages(csvNavigationMessagesFilename.str());
 
   mitk::UnregisterBackend(&m_LoggingBackend);
 
   m_IsExperimentRunning = false;
 
   m_ImageAndNavigationDataLoggingTimer->stop();
   m_CombinedModality = nullptr;
 
   // reset scene number for next experiment
   m_SceneNumber = 1;
 
   this->WaitCursorOff();
   MITK_INFO("USNavigationLogging") << "Finished!";
 }
 
 void QmitkUSNavigationMarkerPlacement::OnSettingsChanged(itk::SmartPointer<mitk::DataNode> settings)
 {
   // initialize gui according to the experiment mode setting
   bool experimentMode = false;
   settings->GetBoolProperty("settings.experiment-mode", experimentMode);
   ui->startExperimentButton->setVisible(experimentMode);
   ui->finishExperimentButton->setVisible(experimentMode);
   ui->runningLabel->setVisible(experimentMode);
   if (experimentMode && !m_IsExperimentRunning)
   {
     ui->runningLabel->setPixmap(m_IconNotRunning);
   }
   else if (!experimentMode)
   {
     if (m_IsExperimentRunning)
     {
       this->OnFinishExperiment();
     }
   }
 
   // get the results directory from the settings and use home directory if
   // there is no results directory configured
   std::string resultsDirectory;
   if (settings->GetStringProperty("settings.experiment-results-directory", resultsDirectory))
   {
     m_ResultsDirectory = QString::fromStdString(resultsDirectory);
   }
   else
   {
     m_ResultsDirectory = QDir::homePath();
   }
 
   // make sure that the results directory exists
   QDir resultsDirectoryQDir = QDir(m_ResultsDirectory);
   if (!resultsDirectoryQDir.exists())
   {
     resultsDirectoryQDir.mkpath(m_ResultsDirectory);
   }
 
   MITK_INFO("USNavigation") << "Results Directory: " << m_ResultsDirectory.toStdString();
 }
 
 void QmitkUSNavigationMarkerPlacement::ReinitOnImage()
 {
   if (!m_ReinitAlreadyDone && m_CombinedModality.IsNotNull())
   {
     // make sure that the output is already calibrated correctly
     // (if the zoom level was changed recently)
     m_CombinedModality->Modified();
     m_CombinedModality->Update();
 
     mitk::Image::Pointer image = m_CombinedModality->GetOutput();
     if (image.IsNotNull() && image->IsInitialized())
     {
       // make a reinit on the ultrasound image
       mitk::IRenderWindowPart *renderWindowPart = this->GetRenderWindowPart();
       if (renderWindowPart != nullptr && image->GetTimeGeometry()->IsValid())
       {
         renderWindowPart->GetRenderingManager()->InitializeViews(image->GetTimeGeometry());
       }
 
       this->RequestRenderWindowUpdate();
 
       m_ReinitAlreadyDone = true;
     }
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::Convert2DImagesTo3D(mitk::DataStorage::SetOfObjects::ConstPointer nodes)
 {
   for (mitk::DataStorage::SetOfObjects::ConstIterator it = nodes->Begin(); it != nodes->End(); ++it)
   {
     if (it->Value()->GetData() && strcmp(it->Value()->GetData()->GetNameOfClass(), "Image") == 0)
     {
       // convert image to 3d image if it is 2d at the moment
       mitk::Image::Pointer image = dynamic_cast<mitk::Image *>(it->Value()->GetData());
       if (image.IsNotNull() && image->GetDimension() == 2 && !image->GetGeometry()->Is2DConvertable())
       {
         mitk::Convert2Dto3DImageFilter::Pointer convert2DTo3DImageFilter = mitk::Convert2Dto3DImageFilter::New();
         convert2DTo3DImageFilter->SetInput(image);
         convert2DTo3DImageFilter->Update();
         it->Value()->SetData(convert2DTo3DImageFilter->GetOutput());
       }
     }
   }
 }
 
 void QmitkUSNavigationMarkerPlacement::CreateOverlays()
 {
   // initialize warning overlay (and do not display it, yet)
   m_WarnOverlay->SetText("Warning: No calibration available for current depth.");
 
   // set position and font size for the text overlay
-  // (nonesense postition as a layouter is used, but it ignored
+  // (nonsense position as a layouter is used, but it ignored
   // the overlay without setting a position here)
   mitk::Point2D overlayPosition;
   overlayPosition.SetElement(0, -50.0f);
   overlayPosition.SetElement(1, -50.0f);
   m_WarnOverlay->SetPosition2D(overlayPosition);
   m_WarnOverlay->SetFontSize(22);
   m_WarnOverlay->SetColor(1, 0, 0); // overlay should be red
 }
 
 void QmitkUSNavigationMarkerPlacement::UpdateToolStorage()
 {
   if (m_NavigationDataSource.IsNull())
   {
     m_NavigationDataSource = m_CombinedModality->GetNavigationDataSource();
   }
   if (m_NavigationDataSource.IsNull())
   {
     MITK_WARN << "Found an invalid navigation data source object!";
   }
   us::ModuleContext *context = us::GetModuleContext();
   std::string id = m_NavigationDataSource->US_PROPKEY_ID;
   std::string filter = "(" + mitk::NavigationToolStorage::US_PROPKEY_SOURCE_ID + "=" + id + ")";
   // Get Storage
   std::vector<us::ServiceReference<mitk::NavigationToolStorage>> refs =
     context->GetServiceReferences<mitk::NavigationToolStorage>();
   m_CurrentStorage = context->GetService(refs.front());
 
   if (m_CurrentStorage.IsNull())
   {
     MITK_WARN << "Found an invalid storage object!";
   }
   else if (m_CurrentStorage->GetToolCount() !=
            m_NavigationDataSource->GetNumberOfOutputs()) // there is something wrong with the storage
   {
     MITK_WARN << "Found a tool storage, but it has not the same number of tools like the NavigationDataSource. This "
                  "storage won't be used because it isn't the right one.";
     m_CurrentStorage = nullptr;
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h
index 357fafcf48..33d2d43b81 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.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 QmitkUSNavigationMarkerPlacement_h
 #define QmitkUSNavigationMarkerPlacement_h
 
 #include <QmitkAbstractView.h>
 
 #include "IO/mitkUSNavigationLoggingBackend.h"
 #include "mitkNavigationDataRecorder.h"
 #include "mitkNodeDisplacementFilter.h"
 #include "mitkUSImageLoggingFilter.h"
 #include <mitkMessage.h>
 #include <mitkTextAnnotation2D.h>
 #include <mitkAbstractUltrasoundTrackerDevice.h>
 #include <mitkNavigationToolStorage.h>
 #include <mitkNavigationDataObjectVisualizationFilter.h>
 
 namespace itk
 {
   template <class T>
   class SmartPointer;
 }
 
 namespace mitk
 {
   class USNavigationStepTimer;
 }
 
 namespace Ui
 {
   class QmitkUSNavigationMarkerPlacement;
 }
 
 class QmitkUSAbstractNavigationStep;
 class QmitkUSNavigationStepPunctuationIntervention;
 class QmitkStdMultiWidget;
 class QTimer;
 class QSignalMapper;
 
 /**
 * \brief View for navigated marker placement using the combined modality.
 * This view utilizes the QmitkUSNavigationProcessWidget to do the navigation
 * process. It can be switched between widgets for marker placement and widgets
 * for punctuation.
 *
 * An experiment mode allows for logging results, durations and the ultrasound
 * images.
 */
 class QmitkUSNavigationMarkerPlacement : public QmitkAbstractView
 {
   Q_OBJECT
 
     protected slots:
 
   void OnGetCursorPosition();
   void OnActualizeCtToUsRegistrationWidget();
   void OnInitializeCtToUsRegistration();
   void OnInitializeTargetMarking();
   void OnInitializeCriticalStructureMarking();
   void OnInitializeNavigation();
 
   /**
   * \brief Called periodically to update the rendering.
   * The standard multi widget is changed to fit the navigation process once it
   * is available and a reinit on the ultrasound image is done for a new image
   * node.
   */
   void OnTimeout();
 
   /**
   * \brief Called periodically during an experiment for logging the ultrasound images.
   */
   void OnImageAndNavigationDataLoggingTimeout();
 
   /**
-  * \brief Initializes anything neccessary for an experiment.
+  * \brief Initializes anything necessary for an experiment.
   * The user is asked for a directory for storing the results and the logging
   * is started.
   */
   void OnStartExperiment();
 
   /**
   * \brief Stops logging and saves everything to the file system.
   */
   void OnFinishExperiment();
 
   /**
   * \brief Switches the navigation step widgets if the navigation application was changed.
   */
   void OnSettingsChanged(itk::SmartPointer<mitk::DataNode>);
 
   void OnAddAblationZone(int size);
 
   void OnEnableNavigationLayout();
 
   void OnResetStandardLayout();
 
   void OnChangeLayoutClicked();
 
   void OnChangeAblationZone(int id, int newSize);
 
   void OnRenderWindowSelection();
 
   void OnRefreshView();
 
 public:
   static const char *DATANAME_TUMOUR;
   static const char *DATANAME_TARGETSURFACE;
   static const char *DATANAME_ZONES;
   static const char *DATANAME_TARGETS;
   static const char *DATANAME_TARGETS_PATHS;
   static const char *DATANAME_REACHED_TARGETS;
 
   explicit QmitkUSNavigationMarkerPlacement();
   ~QmitkUSNavigationMarkerPlacement() override;
 
   void CreateQtPartControl(QWidget *parent) override;
 
   static const std::string VIEW_ID;
 
   void OnCombinedModalityPropertyChanged(const std::string &, const std::string &);
 
 protected:
   /**
   * \brief A reinit on the ultrasound image is performed every time the view gets the focus.
   */
   void SetFocus() override;
 
   /**
   * \brief Helper function which performs a reinit on the ultrasound image.
   */
   void ReinitOnImage();
 
   /**
   * \brief Sets the multiwidget to two windows, axial on top and 3D render window on the bottom.
   */
   virtual void SetTwoWindowView();
 
   /**
   * \brief Helper function for being able to serialize the 2d ultrasound image.
   */
   void Convert2DImagesTo3D(mitk::DataStorage::SetOfObjects::ConstPointer nodes);
 
   void ReInitializeSettingsNodesAndImageStream();
 
   void UpdateToolStorage();
 
   void CreateOverlays();
 
   void InitImageStream();
 
   QWidget *m_Parent;
   QTimer *m_UpdateTimer;
   QTimer *m_ImageAndNavigationDataLoggingTimer;
   QmitkStdMultiWidget *m_StdMultiWidget;
   itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
   itk::SmartPointer<mitk::DataNode> m_SettingsNode;
   bool m_ReinitAlreadyDone;
   bool m_IsExperimentRunning;
   std::string m_CurrentApplicationName;
   itk::SmartPointer<mitk::USNavigationStepTimer> m_NavigationStepTimer;
 
   QPixmap m_IconRunning;
   QPixmap m_IconNotRunning;
 
   QString m_ResultsDirectory;
   QString m_ExperimentName;
   QString m_ExperimentResultsSubDirectory;
   std::vector<QString>
     m_NavigationStepNames; // stores the names of the navigation steps which are currently used (for logging purposes)
 
   mitk::USNavigationLoggingBackend m_LoggingBackend;
   mitk::USImageLoggingFilter::Pointer m_USImageLoggingFilter;
   mitk::NavigationDataRecorder::Pointer m_NavigationDataRecorder; // records navigation data files
   mitk::NodeDisplacementFilter::Pointer m_TargetNodeDisplacementFilter;
   mitk::NodeDisplacementFilter::Pointer m_AblationZonesDisplacementFilter;
   mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter;
   mitk::DataNode::Pointer m_InstrumentNode;
   std::vector<mitk::DataNode::Pointer> m_AblationZonesVector;
 
   int m_NeedleIndex;
   int m_MarkerIndex;
 
   int m_SceneNumber;
 
   itk::SmartPointer<mitk::TextAnnotation2D> m_WarnOverlay;
 
   //To get tool storage
   mitk::NavigationDataSource::Pointer m_NavigationDataSource;
   mitk::NavigationToolStorage::Pointer m_CurrentStorage;
 
   itk::SmartPointer<mitk::DataNode> m_BaseNode;
   itk::SmartPointer<mitk::DataNode> m_ImageStreamNode;
 
 private:
   Ui::QmitkUSNavigationMarkerPlacement *ui;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.cpp
index be23087d0c..3cc5c90e06 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.cpp
@@ -1,1398 +1,1398 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Qmitk
 #include "QmitkUltrasoundCalibration.h"
 #include <QTimer>
 
 // Qt
 #include <QFileDialog>
 #include <QMessageBox>
 #include <QTextStream>
 #include <QmitkServiceListWidget.h>
 
 // MITK
 #include <mitkVector.h>
 #include "mitkIOUtil.h"
 #include <mitkBaseData.h>
 #include <mitkImageGenerator.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkPointSet.h>
 #include <mitkPointSetDataInteractor.h>
 #include <mitkPointSetShapeProperty.h>
 #include <mitkSceneIO.h>
 
 // us
 #include <usServiceReference.h>
 
 // VTK
 #include <vtkLandmarkTransform.h>
 #include <vtkMatrix4x4.h>
 #include <vtkPlane.h>
 #include <vtkPoints.h>
 #include <vtkSphereSource.h>
 #include <vtkTransform.h>
 
 #include <vtkVertexGlyphFilter.h>
 
 #include "internal/org_mbi_gui_qt_usnavigation_Activator.h"
 
 // sleep headers
 #include <chrono>
 #include <thread>
 
 const std::string QmitkUltrasoundCalibration::VIEW_ID = "org.mitk.views.ultrasoundcalibration";
 
 QmitkUltrasoundCalibration::QmitkUltrasoundCalibration()
   : m_PhantomConfigurationPointSet(nullptr),
     m_USDeviceChanged(this, &QmitkUltrasoundCalibration::OnUSDepthChanged)
 {
   ctkPluginContext *pluginContext = mitk::PluginActivator::GetContext();
 
   if (pluginContext)
   {
     // to be notified about service event of an USDevice
     pluginContext->connectServiceListener(this,
                                           "OnDeviceServiceEvent",
                                           QString::fromStdString("(" + us::ServiceConstants::OBJECTCLASS() + "=" +
                                                                  us_service_interface_iid<mitk::USDevice>() + ")"));
   }
 }
 
 QmitkUltrasoundCalibration::~QmitkUltrasoundCalibration()
 {
   m_Controls.m_CombinedModalityManagerWidget->blockSignals(true);
   mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality;
   combinedModality = m_Controls.m_CombinedModalityManagerWidget->GetSelectedCombinedModality();
   if (combinedModality.IsNotNull())
   {
     combinedModality->GetUltrasoundDevice()->RemovePropertyChangedListener(m_USDeviceChanged);
   }
   m_Timer->stop();
 
   this->OnStopCalibrationProcess();
 
   this->OnStopPlusCalibration();
 
   mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode("Needle Path");
   if (node.IsNotNull())
     this->GetDataStorage()->Remove(node);
 
   this->GetDataStorage()->Remove(m_VerificationReferencePointsDataNode);
   this->GetDataStorage()->Remove(m_SpacingNode);
   
   delete m_Timer;
 
   // remove observer for phantom-based point adding
   m_CalibPointsImage->RemoveAllObservers();
 }
 
 void QmitkUltrasoundCalibration::SetFocus()
 {
   m_Controls.m_ToolBox->setFocus();
 }
 
 void QmitkUltrasoundCalibration::CreateQtPartControl(QWidget *parent)
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi(parent);
 
   m_Controls.m_CombinedModalityManagerWidget->SetCalibrationLoadedNecessary(false);
 
   m_Timer = new QTimer(this);
   m_StreamingTimer = new QTimer(this);
 
   m_Controls.m_SpacingBtnFreeze->setEnabled(true);
   m_Controls.m_SpacingAddPoint->setEnabled(false);
   m_Controls.m_CalculateSpacing->setEnabled(false);
 
   m_SpacingPointsCount = 0;
   m_SpacingPoints = mitk::PointSet::New();
   m_SpacingNode = mitk::DataNode::New();
   m_SpacingNode->SetName("Spacing Points");
   m_SpacingNode->SetData(this->m_SpacingPoints);
   this->GetDataStorage()->Add(m_SpacingNode);
 
   // Pointset for Calibration Points
   m_CalibPointsTool = mitk::PointSet::New();
 
   // Pointset for Worldpoints
   m_CalibPointsImage = mitk::PointSet::New();
 
   m_CalibPointsCount = 0;
 
   // Evaluation Pointsets (Non-Visualized)
   m_EvalPointsImage = mitk::PointSet::New();
   m_EvalPointsTool = mitk::PointSet::New();
   m_EvalPointsProjected = mitk::PointSet::New();
 
   // Neelde Projection Filter
   m_NeedleProjectionFilter = mitk::NeedleProjectionFilter::New();
 
   // Tracking Status Widgets
   m_Controls.m_CalibTrackingStatus->ShowStatusLabels();
   m_Controls.m_EvalTrackingStatus->ShowStatusLabels();
 
   // General & Device Selection
   connect(m_Timer, SIGNAL(timeout()), this, SLOT(Update()));
 
   // Calibration
   connect(m_Controls.m_CalibBtnFreeze, SIGNAL(clicked()), this, SLOT(SwitchFreeze())); // Freeze
   connect(m_Controls.m_CalibBtnAddPoint,
           SIGNAL(clicked()),
           this,
           SLOT(OnAddCalibPoint())); // Tracking & Image Points (Calibration)
   connect(m_Controls.m_CalibBtnCalibrate, SIGNAL(clicked()), this, SLOT(OnCalibration())); // Perform Calibration
   // Phantom-based calibration
   connect(m_Controls.m_CalibBtnLoadPhantomConfiguration,
           SIGNAL(clicked()),
           this,
           SLOT(OnLoadPhantomConfiguration())); // Phantom configuration
   connect(m_Controls.m_CalibBtnMatchAnnotationToPhantomConfiguration,
           SIGNAL(clicked()),
           this,
           SLOT(OnMatchAnnotationToPhantomConfiguration()));
   connect(m_Controls.m_CalibBtnMoveUp, SIGNAL(clicked()), this, SLOT(OnMovePhantomAnnotationsUp()));
   connect(m_Controls.m_CalibBtnMoveDown, SIGNAL(clicked()), this, SLOT(OnMovePhantomAnnotationsDown()));
   connect(m_Controls.m_CalibBtnMoveLeft, SIGNAL(clicked()), this, SLOT(OnMovePhantomAnnotationsLeft()));
   connect(m_Controls.m_CalibBtnMoveRight, SIGNAL(clicked()), this, SLOT(OnMovePhantomAnnotationsRight()));
   connect(m_Controls.m_CalibBtnRotateRight, SIGNAL(clicked()), this, SLOT(OnRotatePhantomAnnotationsRight()));
   connect(m_Controls.m_CalibBtnRotateLeft, SIGNAL(clicked()), this, SLOT(OnRotatePhantomAnnotationsLeft()));
 
   connect(m_Controls.m_CalibBtnPerformPhantomCalibration,
           SIGNAL(clicked()),
           this,
           SLOT(OnPhantomBasedCalibration())); // Perform phantom-based calibration
   connect(m_Controls.m_CalibBtnSavePhantomCalibration,
           SIGNAL(clicked()),
           this,
           SLOT(OnSaveCalibration())); // Save phantom-based calibration
 
   // Evaluation
   connect(m_Controls.m_EvalBtnStep1, SIGNAL(clicked()), this, SLOT(OnAddEvalProjectedPoint())); // Needle Projection
   connect(m_Controls.m_EvalBtnStep2, SIGNAL(clicked()), this, SLOT(SwitchFreeze()));            // Freeze
   connect(m_Controls.m_EvalBtnStep3,
           SIGNAL(clicked()),
           this,
           SLOT(OnAddEvalTargetPoint())); // Tracking & Image Points (Evaluation)
   connect(m_Controls.m_EvalBtnSave, SIGNAL(clicked()), this, SLOT(OnSaveEvaluation())); // Save Evaluation Results
   connect(m_Controls.m_CalibBtnSaveCalibration,
           SIGNAL(clicked()),
           this,
           SLOT(OnSaveCalibration()));                                       // Save Evaluation Results
   connect(m_Controls.m_BtnReset, SIGNAL(clicked()), this, SLOT(OnReset())); // Reset Pointsets
 
   // PLUS Calibration
   connect(m_Controls.m_GetCalibrationFromPLUS, SIGNAL(clicked()), this, SLOT(OnGetPlusCalibration()));
   connect(m_Controls.m_StartStreaming, SIGNAL(clicked()), this, SLOT(OnStartStreaming()));
   connect(m_StreamingTimer, SIGNAL(timeout()), this, SLOT(OnStreamingTimerTimeout()));
   connect(m_Controls.m_StopPlusCalibration, SIGNAL(clicked()), this, SLOT(OnStopPlusCalibration()));
   connect(m_Controls.m_SavePlusCalibration, SIGNAL(clicked()), this, SLOT(OnSaveCalibration()));
   connect(this, SIGNAL(NewConnectionSignal()), this, SLOT(OnNewConnection()));
 
   // Determine Spacing for Calibration of USVideoDevice
   connect(m_Controls.m_SpacingBtnFreeze, SIGNAL(clicked()), this, SLOT(OnFreezeClicked()));
   connect(m_Controls.m_SpacingAddPoint, SIGNAL(clicked()), this, SLOT(OnAddSpacingPoint()));
   connect(m_Controls.m_CalculateSpacing, SIGNAL(clicked()), this, SLOT(OnCalculateSpacing()));
 
   connect(m_Controls.m_CombinedModalityManagerWidget, SIGNAL(SignalReadyForNextStep()), this, SLOT(OnDeviceSelected()));
   connect(m_Controls.m_CombinedModalityManagerWidget,
           SIGNAL(SignalNoLongerReadyForNextStep()),
           this,
           SLOT(OnDeviceDeselected()));
   connect(m_Controls.m_StartCalibrationButton, SIGNAL(clicked()), this, SLOT(OnStartCalibrationProcess()));
   connect(m_Controls.m_StartPlusCalibrationButton, SIGNAL(clicked()), this, SLOT(OnStartPlusCalibration()));
   connect(m_Controls.m_CalibBtnRestartCalibration, SIGNAL(clicked()), this, SLOT(OnReset()));
   connect(m_Controls.m_CalibBtnStopCalibration, SIGNAL(clicked()), this, SLOT(OnStopCalibrationProcess()));
 
   connect(m_Controls.m_AddReferencePoints, SIGNAL(clicked()), this, SLOT(OnAddCurrentTipPositionToReferencePoints()));
   connect(m_Controls.m_AddCurrentPointerTipForVerification,
           SIGNAL(clicked()),
           this,
           SLOT(OnAddCurrentTipPositionForVerification()));
   connect(m_Controls.m_StartVerification, SIGNAL(clicked()), this, SLOT(OnStartVerification()));
 
   // initialize data storage combo box
   m_Controls.m_ReferencePointsComboBox->SetDataStorage(this->GetDataStorage());
   m_Controls.m_ReferencePointsComboBox->SetAutoSelectNewItems(true);
   m_Controls.m_ReferencePointsComboBox->SetPredicate(mitk::NodePredicateDataType::New("PointSet"));
 
   // initialize point list widget
   if (m_VerificationReferencePoints.IsNull())
   {
     m_VerificationReferencePoints = mitk::PointSet::New();
   }
   if (m_VerificationReferencePointsDataNode.IsNull())
   {
     m_VerificationReferencePointsDataNode = mitk::DataNode::New();
     m_VerificationReferencePointsDataNode->SetName("US Verification Reference Points");
     m_VerificationReferencePointsDataNode->SetData(m_VerificationReferencePoints);
     this->GetDataStorage()->Add(m_VerificationReferencePointsDataNode);
   }
   m_Controls.m_ReferencePointsPointListWidget->SetPointSetNode(m_VerificationReferencePointsDataNode);
 
   m_Controls.m_ToolBox->setCurrentIndex(0);
 }
 
 void QmitkUltrasoundCalibration::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/,
                                                     const QList<mitk::DataNode::Pointer> & /*nodes*/)
 {
 }
 
 void QmitkUltrasoundCalibration::OnTabSwitch(int index)
 {
   switch (index)
   {
     case 0:
       if (m_Controls.m_ToolBox->isItemEnabled(1) || m_Controls.m_ToolBox->isItemEnabled(2))
       {
         this->OnStopCalibrationProcess();
       }
       break;
     default:;
   }
 }
 
 void QmitkUltrasoundCalibration::OnDeviceSelected()
 {
   mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality;
   combinedModality = m_Controls.m_CombinedModalityManagerWidget->GetSelectedCombinedModality();
   if (combinedModality.IsNotNull())
   {
     combinedModality->GetUltrasoundDevice()->AddPropertyChangedListener(m_USDeviceChanged);
 
     m_Controls.m_StartCalibrationButton->setEnabled(true);
     m_Controls.m_StartPlusCalibrationButton->setEnabled(true);
     m_Controls.m_ToolBox->setItemEnabled(1, true);
     m_Controls.m_ToolBox->setItemEnabled(2, true);
   }
 }
 
 void QmitkUltrasoundCalibration::OnDeviceDeselected()
 {
   mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality;
   combinedModality = m_Controls.m_CombinedModalityManagerWidget->GetSelectedCombinedModality();
   if (combinedModality.IsNotNull())
   {
     combinedModality->GetUltrasoundDevice()->RemovePropertyChangedListener(m_USDeviceChanged);
   }
   m_Controls.m_StartCalibrationButton->setEnabled(false);
   m_Controls.m_StartPlusCalibrationButton->setEnabled(false);
   m_Controls.m_ToolBox->setCurrentIndex(0);
   m_Controls.m_ToolBox->setItemEnabled(1, false);
   m_Controls.m_ToolBox->setItemEnabled(2, false);
 }
 
 void QmitkUltrasoundCalibration::OnAddCurrentTipPositionToReferencePoints()
 {
   if (m_Controls.m_VerificationPointerChoser->GetSelectedNavigationDataSource().IsNull() ||
       (m_Controls.m_VerificationPointerChoser->GetSelectedToolID() == -1))
   {
     MITK_WARN << "No tool selected, aborting";
     return;
   }
   mitk::NavigationData::Pointer currentPointerData =
     m_Controls.m_VerificationPointerChoser->GetSelectedNavigationDataSource()->GetOutput(
       m_Controls.m_VerificationPointerChoser->GetSelectedToolID());
   mitk::Point3D currentTipPosition = currentPointerData->GetPosition();
   m_VerificationReferencePoints->InsertPoint(m_VerificationReferencePoints->GetSize(), currentTipPosition);
 }
 
 void QmitkUltrasoundCalibration::OnStartVerification()
 {
   m_currentPoint = 0;
   mitk::PointSet::Pointer selectedPointSet =
     dynamic_cast<mitk::PointSet *>(m_Controls.m_ReferencePointsComboBox->GetSelectedNode()->GetData());
   m_Controls.m_CurrentPointLabel->setText("Point " + QString::number(m_currentPoint) + " of " +
                                           QString::number(selectedPointSet->GetSize()));
   m_allErrors = std::vector<double>();
   m_allReferencePoints = std::vector<mitk::Point3D>();
   for (int i = 0; i < selectedPointSet->GetSize(); i++)
   {
     m_allReferencePoints.push_back(selectedPointSet->GetPoint(i));
   }
 }
 
 void QmitkUltrasoundCalibration::OnAddCurrentTipPositionForVerification()
 {
   if (m_currentPoint == -1)
   {
     MITK_WARN << "Cannot add point";
     return;
   }
   if (m_Controls.m_VerificationPointerChoser->GetSelectedNavigationDataSource().IsNull() ||
       (m_Controls.m_VerificationPointerChoser->GetSelectedToolID() == -1))
   {
     MITK_WARN << "No tool selected, aborting";
     return;
   }
   mitk::NavigationData::Pointer currentPointerData =
     m_Controls.m_VerificationPointerChoser->GetSelectedNavigationDataSource()->GetOutput(
       m_Controls.m_VerificationPointerChoser->GetSelectedToolID());
   mitk::Point3D currentTipPosition = currentPointerData->GetPosition();
 
   double currentError = m_allReferencePoints.at(m_currentPoint).EuclideanDistanceTo(currentTipPosition);
   MITK_INFO << "Current Error: " << currentError << " mm";
   m_allErrors.push_back(currentError);
 
   if (++m_currentPoint < static_cast<int>(m_allReferencePoints.size()))
   {
     m_Controls.m_CurrentPointLabel->setText("Point " + QString::number(m_currentPoint) + " of " +
                                             QString::number(m_allReferencePoints.size()));
   }
   else
   {
     m_currentPoint = -1;
     double meanError = 0;
     for (std::size_t i = 0; i < m_allErrors.size(); ++i)
     {
       meanError += m_allErrors[i];
     }
     meanError /= m_allErrors.size();
 
     QString result = "Finished verification! \n Verification of " + QString::number(m_allErrors.size()) +
                      " points, mean error: " + QString::number(meanError) + " mm";
     m_Controls.m_ResultsTextEdit->setText(result);
     MITK_INFO << result.toStdString();
   }
 }
 
 void QmitkUltrasoundCalibration::OnStartCalibrationProcess()
 {
   // US Image Stream
   m_Node = dynamic_cast<mitk::DataNode*>(this->GetDataStorage()->GetNamedNode("US Viewing Stream - Image 0")->CreateAnother().GetPointer());
   m_Node->SetName("US Calibration Viewing Stream");
   this->GetDataStorage()->Add(m_Node);
 
   // data node for calibration point set
   m_CalibNode = mitk::DataNode::New();
   m_CalibNode->SetName("Tool Calibration Points");
   m_CalibNode->SetData(this->m_CalibPointsTool);
   this->GetDataStorage()->Add(m_CalibNode);
 
   // data node for world point set
   m_WorldNode = mitk::DataNode::New();
   m_WorldNode->SetName("Image Calibration Points");
   m_WorldNode->SetData(this->m_CalibPointsImage);
   this->GetDataStorage()->Add(m_WorldNode);
 
   m_CombinedModality = m_Controls.m_CombinedModalityManagerWidget->GetSelectedCombinedModality();
   m_CombinedModality->SetCalibration(mitk::AffineTransform3D::New()); // dummy calibration because without a calibration
                                                                       // the comined modality was laggy (maybe a bug?)
   if (m_CombinedModality.IsNull())
   {
     return;
   }
 
   m_Tracker = m_CombinedModality->GetNavigationDataSource();
 
   // Construct Pipeline
   this->m_NeedleProjectionFilter->SetInput(0, m_Tracker->GetOutput(0));
 
   QApplication::setOverrideCursor(Qt::WaitCursor);
   // make sure that the combined modality is in connected state before using it
   if (m_CombinedModality->GetUltrasoundDevice()->GetDeviceState() < mitk::USDevice::State_Connected)
   {
     m_CombinedModality->GetUltrasoundDevice()->Connect();
   }
   if (m_CombinedModality->GetUltrasoundDevice()->GetDeviceState() < mitk::USDevice::State_Activated)
   {
     m_CombinedModality->GetUltrasoundDevice()->Activate();
   }
   QApplication::restoreOverrideCursor();
 
   this->SwitchFreeze();
 
   // Trigger the ProbeChanged method for initializing/updating the spacing of the ultrasound image correctly
   std::string probeName = m_CombinedModality->GetUltrasoundDevice()->GetCurrentProbe()->GetName();
   m_CombinedModality->GetUltrasoundDevice()->ProbeChanged(probeName);
 
   mitk::DataNode::Pointer usNode = this->GetDataStorage()->GetNamedNode("US Viewing Stream - Image 0");
   if (usNode.IsNotNull())
   {
     this->GetDataStorage()->Remove(usNode);
   }
 
   // Todo: Maybe display this elsewhere
   this->ShowNeedlePath();
 
   // Switch active tab to Calibration page
   m_Controls.m_ToolBox->setItemEnabled(1, true);
   m_Controls.m_ToolBox->setCurrentIndex(1);
 }
 
 void QmitkUltrasoundCalibration::OnStartPlusCalibration()
 {
   if (m_CombinedModality.IsNull())
   {
     m_CombinedModality = m_Controls.m_CombinedModalityManagerWidget->GetSelectedCombinedModality();
     if (m_CombinedModality.IsNull())
     {
       return;
     } // something went wrong, there is no combined modality
   }
 
   // setup server to send UltrasoundImages to PLUS
   mitk::IGTLServer::Pointer m_USServer = mitk::IGTLServer::New(true);
   m_USServer->SetName("EchoTrack Image Source");
   m_USServer->SetHostname("127.0.0.1");
   m_USServer->SetPortNumber(18944);
 
   m_USMessageProvider = mitk::IGTLMessageProvider::New();
   m_USMessageProvider->SetIGTLDevice(m_USServer);
   m_USMessageProvider->SetFPS(5);
 
   m_USImageToIGTLMessageFilter = mitk::ImageToIGTLMessageFilter::New();
   m_USImageToIGTLMessageFilter->ConnectTo(m_CombinedModality->GetUltrasoundDevice());
   m_USImageToIGTLMessageFilter->SetName("USImage Filter");
 
   // setup server to send TrackingData to PLUS
   m_TrackingServer = mitk::IGTLServer::New(true);
   m_TrackingServer->SetName("EchoTrack Tracking Source");
   m_TrackingServer->SetHostname("127.0.0.1");
   m_TrackingServer->SetPortNumber(18945);
 
   m_TrackingMessageProvider = mitk::IGTLMessageProvider::New();
   m_TrackingMessageProvider->SetIGTLDevice(m_TrackingServer);
   m_TrackingMessageProvider->SetFPS(5);
 
   m_TrackingToIGTLMessageFilter = mitk::NavigationDataToIGTLMessageFilter::New();
   m_TrackingToIGTLMessageFilter->ConnectTo(m_CombinedModality->GetTrackingDeviceDataSource());
   m_TrackingToIGTLMessageFilter->SetName("Tracker Filter");
 
   typedef itk::SimpleMemberCommand<QmitkUltrasoundCalibration> CurCommandType;
 
   CurCommandType::Pointer newConnectionCommand = CurCommandType::New();
   newConnectionCommand->SetCallbackFunction(this, &QmitkUltrasoundCalibration::OnPlusConnected);
   this->m_NewConnectionObserverTag =
     this->m_TrackingServer->AddObserver(mitk::NewClientConnectionEvent(), newConnectionCommand);
 
   // Open connections of both servers
   if (m_USServer->OpenConnection())
   {
     MITK_INFO << "US Server opened its connection successfully";
     m_USServer->StartCommunication();
   }
   else
   {
     MITK_INFO << "US Server could not open its connection";
   }
   if (m_TrackingServer->OpenConnection())
   {
     MITK_INFO << "Tracking Server opened its connection successfully";
     m_TrackingServer->StartCommunication();
   }
   else
   {
     MITK_INFO << "Tracking Server could not open its connection";
   }
   if (m_USMessageProvider->IsCommunicating() && m_TrackingMessageProvider->IsCommunicating())
   {
     m_Controls.m_StartPlusCalibrationButton->setEnabled(false);
     m_Controls.m_GetCalibrationFromPLUS->setEnabled(true);
     m_Controls.m_StartStreaming->setEnabled(false);
     m_Controls.m_SavePlusCalibration->setEnabled(false);
     m_Controls.m_SetupStatus->setStyleSheet("QLabel { color : green; }");
-    m_Controls.m_SetupStatus->setText("Setup successfull you can now connect PLUS");
+    m_Controls.m_SetupStatus->setText("Setup successful you can now connect PLUS");
   }
   else
   {
     m_Controls.m_SetupStatus->setStyleSheet("QLabel { color : red; }");
     m_Controls.m_SetupStatus->setText("Something went wrong. Please try again");
   }
 }
 
 void QmitkUltrasoundCalibration::OnStopPlusCalibration()
 {
   // closing all server and clients when PlusCalibration is finished
   if (m_USMessageProvider.IsNotNull())
   {
     if (m_USMessageProvider->IsStreaming())
     {
       m_USMessageProvider->StopStreamingOfSource(m_USImageToIGTLMessageFilter);
     }
   }
   if (m_TrackingMessageProvider.IsNotNull())
   {
     if (m_TrackingMessageProvider->IsStreaming())
     {
       m_TrackingMessageProvider->StopStreamingOfSource(m_TrackingToIGTLMessageFilter);
     }
   }
   if (m_USServer.IsNotNull())
   {
     m_USServer->CloseConnection();
   }
   if (m_TrackingServer.IsNotNull())
   {
     m_TrackingServer->CloseConnection();
   }
   if (m_TransformClient.IsNotNull())
   {
     m_TransformClient->CloseConnection();
   }
   m_Controls.m_GotCalibrationLabel->setText("");
   m_Controls.m_ConnectionStatus->setText("");
   m_Controls.m_SetupStatus->setText("");
   m_Controls.m_StartPlusCalibrationButton->setEnabled(true);
   m_StreamingTimer->stop();
   delete m_StreamingTimer;
 }
 
 void QmitkUltrasoundCalibration::OnPlusConnected()
 {
   emit NewConnectionSignal();
 }
 
 void QmitkUltrasoundCalibration::OnNewConnection()
 {
   m_Controls.m_StartStreaming->setEnabled(true);
   m_Controls.m_ConnectionStatus->setStyleSheet("QLabel { color : green; }");
-  m_Controls.m_ConnectionStatus->setText("Connection successfull you can now start streaming");
+  m_Controls.m_ConnectionStatus->setText("Connection successful you can now start streaming");
 }
 
 void QmitkUltrasoundCalibration::OnStreamingTimerTimeout()
 {
   m_USMessageProvider->Update();
   m_TrackingMessageProvider->Update();
 }
 
 void QmitkUltrasoundCalibration::OnStartStreaming()
 {
   m_USMessageProvider->StartStreamingOfSource(m_USImageToIGTLMessageFilter, 5);
   m_TrackingMessageProvider->StartStreamingOfSource(m_TrackingToIGTLMessageFilter, 5);
   m_Controls.m_StartStreaming->setEnabled(false);
   m_Controls.m_ConnectionStatus->setText("");
   m_StreamingTimer->start((1.0 / 5.0 * 1000.0));
 }
 
 void QmitkUltrasoundCalibration::OnGetPlusCalibration()
 {
   m_TransformClient = mitk::IGTLClient::New(true);
   m_TransformClient->SetHostname("127.0.0.1");
   m_TransformClient->SetPortNumber(18946);
   m_TransformDeviceSource = mitk::IGTLDeviceSource::New();
   m_TransformDeviceSource->SetIGTLDevice(m_TransformClient);
   m_TransformDeviceSource->Connect();
   if (m_TransformDeviceSource->IsConnected())
   {
     MITK_INFO << "successfully connected";
     m_TransformDeviceSource->StartCommunication();
     if (m_TransformDeviceSource->IsCommunicating())
     {
       MITK_INFO << "communication started";
       mitk::IGTLMessage::Pointer receivedMessage;
       bool condition = false;
       igtl::Matrix4x4 transformPLUS;
       while (!(receivedMessage.IsNotNull() && receivedMessage->IsDataValid()))
       {
         std::this_thread::sleep_for(std::chrono::milliseconds(50));
         m_TransformDeviceSource->Update();
         receivedMessage = m_TransformDeviceSource->GetOutput();
         igtl::TransformMessage::Pointer msg =
           dynamic_cast<igtl::TransformMessage *>(m_TransformDeviceSource->GetOutput()->GetMessage().GetPointer());
         if (msg == nullptr || msg.IsNull())
         {
           MITK_INFO << "Received message could not be casted to TransformMessage. Skipping...";
           continue;
         }
         else
         {
           if (std::strcmp(msg->GetDeviceName(), "ImageToTracker") != 0)
           {
             MITK_INFO << "Was not Image to Tracker Transform. Skipping...";
             continue;
           }
           else
           {
             msg->GetMatrix(transformPLUS);
             condition = true;
             break;
           }
         }
       }
       if (condition)
       {
         this->ProcessPlusCalibration(transformPLUS);
       }
       else
       {
         m_Controls.m_GotCalibrationLabel->setStyleSheet("QLabel { color : red; }");
         m_Controls.m_GotCalibrationLabel->setText("Something went wrong. Please try again");
       }
     }
     else
     {
       MITK_INFO << " no connection";
       m_Controls.m_GotCalibrationLabel->setStyleSheet("QLabel { color : red; }");
       m_Controls.m_GotCalibrationLabel->setText("Something went wrong. Please try again");
     }
   }
   else
   {
     m_Controls.m_GotCalibrationLabel->setStyleSheet("QLabel { color : red; }");
     m_Controls.m_GotCalibrationLabel->setText("Something went wrong. Please try again");
   }
 }
 
 void QmitkUltrasoundCalibration::ProcessPlusCalibration(igtl::Matrix4x4 &imageToTracker)
 {
   mitk::AffineTransform3D::Pointer imageToTrackerTransform = mitk::AffineTransform3D::New();
   itk::Matrix<mitk::ScalarType, 3, 3> rotationFloat = itk::Matrix<mitk::ScalarType, 3, 3>();
   itk::Vector<mitk::ScalarType, 3> translationFloat = itk::Vector<mitk::ScalarType, 3>();
 
   rotationFloat[0][0] = imageToTracker[0][0];
   rotationFloat[0][1] = imageToTracker[0][1];
   rotationFloat[0][2] = imageToTracker[0][2];
   rotationFloat[1][0] = imageToTracker[1][0];
   rotationFloat[1][1] = imageToTracker[1][1];
   rotationFloat[1][2] = imageToTracker[1][2];
   rotationFloat[2][0] = imageToTracker[2][0];
   rotationFloat[2][1] = imageToTracker[2][1];
   rotationFloat[2][2] = imageToTracker[2][2];
   translationFloat[0] = imageToTracker[0][3];
   translationFloat[1] = imageToTracker[1][3];
   translationFloat[2] = imageToTracker[2][3];
 
   imageToTrackerTransform->SetTranslation(translationFloat);
   imageToTrackerTransform->SetMatrix(rotationFloat);
 
   m_CombinedModality->SetCalibration(imageToTrackerTransform);
   m_Controls.m_ToolBox->setItemEnabled(2, true);
   m_Controls.m_SavePlusCalibration->setEnabled(true);
   m_Controls.m_GotCalibrationLabel->setStyleSheet("QLabel { color : green; }");
-  m_Controls.m_GotCalibrationLabel->setText("Recieved Calibration from PLUS you can now save it");
+  m_Controls.m_GotCalibrationLabel->setText("Received Calibration from PLUS you can now save it");
 }
 
 void QmitkUltrasoundCalibration::OnStopCalibrationProcess()
 {
   this->ClearTemporaryMembers();
 
   m_Timer->stop();
 
   this->GetDataStorage()->Remove(m_Node);
   m_Node = nullptr;
 
   this->GetDataStorage()->Remove(m_CalibNode);
   m_CalibNode = nullptr;
 
   this->GetDataStorage()->Remove(m_WorldNode);
   m_WorldNode = nullptr;
 
   m_Controls.m_ToolBox->setCurrentIndex(0);
 }
 
 void QmitkUltrasoundCalibration::OnDeviceServiceEvent(const ctkServiceEvent event)
 {
   if (m_CombinedModality.IsNull() || event.getType() != ctkServiceEvent::MODIFIED)
   {
     return;
   }
 
   ctkServiceReference service = event.getServiceReference();
 
   QString curDepth =
     service.getProperty(QString::fromStdString(mitk::USDevice::GetPropertyKeys().US_PROPKEY_BMODE_DEPTH)).toString();
   if (m_CurrentDepth != curDepth)
   {
     m_CurrentDepth = curDepth;
     this->OnReset();
   }
 }
 
 void QmitkUltrasoundCalibration::OnAddCalibPoint()
 {
   auto world = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetSelectedPosition();
 
   this->m_CalibPointsImage->InsertPoint(m_CalibPointsCount, world);
   this->m_CalibPointsTool->InsertPoint(m_CalibPointsCount, this->m_FreezePoint);
 
   QString text = text.number(m_CalibPointsCount + 1);
   text = "Point " + text;
   this->m_Controls.m_CalibPointList->addItem(text);
 
   m_CalibPointsCount++;
   SwitchFreeze();
 }
 
 void QmitkUltrasoundCalibration::OnCalibration()
 {
   if (m_CombinedModality.IsNull())
   {
     return;
   }
 
   // Compute transformation
   vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
 
   transform->SetSourceLandmarks(this->ConvertPointSetToVtkPolyData(m_CalibPointsImage)->GetPoints());
   transform->SetTargetLandmarks(this->ConvertPointSetToVtkPolyData(m_CalibPointsTool)->GetPoints());
 
   if (!m_CombinedModality->GetIsTrackedUltrasoundActive())
   {
     if (m_Controls.m_ScaleTransform->isChecked())
     {
       transform->SetModeToSimilarity();
     } // use affine transform
     else
     {
       transform->SetModeToRigidBody();
     } // use similarity transform: scaling is not touched
     MITK_INFO << "TEST";
   }
   else
   {
     transform->SetModeToRigidBody(); // use similarity transform: scaling is not touched
   }
 
   transform->Modified();
   transform->Update();
 
   // Convert from vtk to itk data types
   itk::Matrix<mitk::ScalarType, 3, 3> rotationFloat = itk::Matrix<mitk::ScalarType, 3, 3>();
   itk::Vector<mitk::ScalarType, 3> translationFloat = itk::Vector<mitk::ScalarType, 3>();
   vtkSmartPointer<vtkMatrix4x4> m = transform->GetMatrix();
   rotationFloat[0][0] = m->GetElement(0, 0);
   rotationFloat[0][1] = m->GetElement(0, 1);
   rotationFloat[0][2] = m->GetElement(0, 2);
   rotationFloat[1][0] = m->GetElement(1, 0);
   rotationFloat[1][1] = m->GetElement(1, 1);
   rotationFloat[1][2] = m->GetElement(1, 2);
   rotationFloat[2][0] = m->GetElement(2, 0);
   rotationFloat[2][1] = m->GetElement(2, 1);
   rotationFloat[2][2] = m->GetElement(2, 2);
   translationFloat[0] = m->GetElement(0, 3);
   translationFloat[1] = m->GetElement(1, 3);
   translationFloat[2] = m->GetElement(2, 3);
 
   mitk::PointSet::Pointer ImagePointsTransformed = m_CalibPointsImage->Clone();
   this->ApplyTransformToPointSet(ImagePointsTransformed, transform);
   mitk::DataNode::Pointer CalibPointsImageTransformed =
     this->GetDataStorage()->GetNamedNode("Calibration Points Image (Transformed)");
   if (CalibPointsImageTransformed.IsNull())
   {
     CalibPointsImageTransformed = mitk::DataNode::New();
     CalibPointsImageTransformed->SetName("Calibration Points Image (Transformed)");
     this->GetDataStorage()->Add(CalibPointsImageTransformed);
   }
   CalibPointsImageTransformed->SetData(ImagePointsTransformed);
 
   // Set new calibration transform
   m_Transformation = mitk::AffineTransform3D::New();
   m_Transformation->SetTranslation(translationFloat);
   m_Transformation->SetMatrix(rotationFloat);
   MITK_INFO << "New Calibration transform: " << m_Transformation;
 
   mitk::SlicedGeometry3D::Pointer sliced3d = dynamic_cast<mitk::SlicedGeometry3D *>(m_Node->GetData()->GetGeometry());
 
   mitk::PlaneGeometry::Pointer plane = const_cast<mitk::PlaneGeometry *>(sliced3d->GetPlaneGeometry(0));
 
   plane->SetIndexToWorldTransform(m_Transformation);
 
   // Save to US-Device
   m_CombinedModality->SetCalibration(m_Transformation);
   m_Controls.m_ToolBox->setItemEnabled(2, true);
 
   // Save to NeedleProjectionFilter
   m_NeedleProjectionFilter->SetTargetPlane(m_Transformation);
 
   // Update Calibration FRE
   m_CalibrationStatistics = mitk::PointSetDifferenceStatisticsCalculator::New();
   mitk::PointSet::Pointer p1 =
     this->m_CalibPointsTool->Clone(); // We use clones to calculate statistics to avoid concurrency Problems
 
   // Create point set with transformed image calibration points for
   // calculating the difference of image calibration and tool
   // calibration points in one geometry space
   mitk::PointSet::Pointer p2 = mitk::PointSet::New();
   int n = 0;
   for (mitk::PointSet::PointsConstIterator it = m_CalibPointsImage->Begin(); it != m_CalibPointsImage->End(); ++it, ++n)
   {
     p2->InsertPoint(n, m_Transformation->TransformPoint(it->Value()));
   }
 
   m_CalibrationStatistics->SetPointSets(p1, p2);
   // QString text = text.number(m_CalibrationStatistics->GetRMS());
   QString text = QString::number(ComputeFRE(m_CalibPointsImage, m_CalibPointsTool, transform));
   MITK_INFO << "Calibration FRE: " << text.toStdString().c_str();
   m_Controls.m_EvalLblCalibrationFRE->setText(text);
 
   m_Node->SetStringProperty("Calibration FRE", text.toStdString().c_str());
   // Enable Button to save Calibration
   m_Controls.m_CalibBtnSaveCalibration->setEnabled(true);
 }
 
 void QmitkUltrasoundCalibration::OnLoadPhantomConfiguration()
 {
   // clear all data
   ClearTemporaryMembers();
   // reset UI
   m_Controls.m_CalibBtnMatchAnnotationToPhantomConfiguration->setEnabled(false);
   m_Controls.m_RefinePhantomAnnotationsGroupBox->setEnabled(false);
   m_Controls.m_CalibBtnPerformPhantomCalibration->setEnabled(false);
   m_Controls.m_CalibBtnSavePhantomCalibration->setEnabled(false);
 
   // open phantom configuration
   QString fileName = QFileDialog::getOpenFileName(nullptr, "Load phantom configuration", "", "*.mps");
 
   // dialog closed or selection canceled
   if (fileName.isNull())
   {
     return;
   }
 
   m_PhantomConfigurationPointSet = dynamic_cast<mitk::PointSet *>(mitk::IOUtil::Load(fileName.toStdString()).at(0).GetPointer());
 
   // transform phantom fiducials to tracking space
   mitk::NavigationData::Pointer currentSensorData = this->m_Tracker->GetOutput(0)->Clone();
 
   for (int i = 0; i < m_PhantomConfigurationPointSet->GetSize(); i++)
   {
     mitk::Point3D phantomPoint = m_PhantomConfigurationPointSet->GetPoint(i);
     mitk::Point3D transformedPoint = currentSensorData->TransformPoint(phantomPoint);
     this->m_CalibPointsTool->InsertPoint(i, transformedPoint);
   }
 
   // add point set interactor for image calibration points
   mitk::PointSetDataInteractor::Pointer imageCalibrationPointSetInteractor = mitk::PointSetDataInteractor::New();
   imageCalibrationPointSetInteractor->LoadStateMachine("PointSet.xml");
   imageCalibrationPointSetInteractor->SetEventConfig("PointSetConfig.xml");
   imageCalibrationPointSetInteractor->SetDataNode(m_WorldNode);
   imageCalibrationPointSetInteractor->SetMaxPoints(m_PhantomConfigurationPointSet->GetSize());
   // Call On AddCalibPointPhantomBased() when point was added
   itk::SimpleMemberCommand<QmitkUltrasoundCalibration>::Pointer pointAddedCommand =
     itk::SimpleMemberCommand<QmitkUltrasoundCalibration>::New();
   pointAddedCommand->SetCallbackFunction(this, &QmitkUltrasoundCalibration::OnPhantomCalibPointsChanged);
   m_CalibPointsImage->AddObserver(mitk::PointSetAddEvent(), pointAddedCommand);
   m_CalibPointsImage->AddObserver(mitk::PointSetMoveEvent(), pointAddedCommand);
   // Set size of image points points
   m_WorldNode->ReplaceProperty("point 2D size", mitk::FloatProperty::New(10.0));
 }
 
 void QmitkUltrasoundCalibration::OnPhantomCalibPointsChanged()
 {
   int currentIndex = m_CalibPointsImage->SearchSelectedPoint();
   mitk::Point3D currentImagePoint = m_CalibPointsImage->GetPoint(currentIndex);
   UpdatePhantomAnnotationPointVisualization(currentIndex);
   // create sphere to show radius in which next point has to be placed
    this->GetDataStorage()->Remove(this->GetDataStorage()->GetNamedNode("NextPointIndicator"));
    if (currentIndex < m_CalibPointsTool->GetSize() - 1)
   {
     float distanceToNextPoint =
       m_CalibPointsTool->GetPoint(currentIndex).EuclideanDistanceTo(m_CalibPointsTool->GetPoint(currentIndex + 1));
     vtkSmartPointer<vtkSphereSource> vtkHelperSphere = vtkSmartPointer<vtkSphereSource>::New();
     vtkHelperSphere->SetCenter(currentImagePoint[0], currentImagePoint[1], currentImagePoint[2]);
     vtkHelperSphere->SetRadius(distanceToNextPoint);
     vtkHelperSphere->SetPhiResolution(40);
     vtkHelperSphere->SetThetaResolution(40);
     vtkHelperSphere->Update();
     mitk::Surface::Pointer helperSphere = mitk::Surface::New();
     helperSphere->SetVtkPolyData(vtkHelperSphere->GetOutput());
     mitk::DataNode::Pointer helperSphereNode = mitk::DataNode::New();
     helperSphereNode->SetName("NextPointIndicator");
     helperSphereNode->SetData(helperSphere);
     helperSphereNode->SetColor(0.0, 1.0, 0.0);
     this->GetDataStorage()->Add(helperSphereNode);
   }
   if (m_CalibPointsTool->GetSize() == m_CalibPointsImage->GetSize())
   {
     m_Controls.m_CalibBtnMatchAnnotationToPhantomConfiguration->setEnabled(true);
   }
 }
 
 void QmitkUltrasoundCalibration::UpdatePhantomAnnotationPointVisualization(int index)
 {
   mitk::Point3D currentImagePoint = m_CalibPointsImage->GetPoint(index);
   // create sphere to show current fiducial
   std::stringstream pointName;
   pointName << "Point";
   pointName << index;
   this->GetDataStorage()->Remove(this->GetDataStorage()->GetNamedNode(pointName.str()));
   vtkSmartPointer<vtkSphereSource> vtkPointSphere = vtkSmartPointer<vtkSphereSource>::New();
   vtkPointSphere->SetCenter(currentImagePoint[0], currentImagePoint[1], currentImagePoint[2]);
   vtkPointSphere->SetRadius(5.0);
   vtkPointSphere->SetPhiResolution(40);
   vtkPointSphere->SetThetaResolution(40);
   vtkPointSphere->Update();
   mitk::Surface::Pointer pointSphere = mitk::Surface::New();
   pointSphere->SetVtkPolyData(vtkPointSphere->GetOutput());
   mitk::DataNode::Pointer sphereNode = mitk::DataNode::New();
   sphereNode->SetName(pointName.str());
   sphereNode->SetData(pointSphere);
   sphereNode->SetColor(1.0, 1.0, 0.0);
   this->GetDataStorage()->Add(sphereNode);
 }
 
 void QmitkUltrasoundCalibration::OnMatchAnnotationToPhantomConfiguration()
 {
   // Transform pointset of phantom configuration to currently annotated image points
   vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
   transform->SetModeToRigidBody();
   vtkSmartPointer<vtkPoints> toolLandmarks = this->ConvertPointSetToVtkPolyData(m_CalibPointsTool)->GetPoints();
   transform->SetSourceLandmarks(toolLandmarks);
   transform->SetTargetLandmarks(this->ConvertPointSetToVtkPolyData(m_CalibPointsImage)->GetPoints());
   transform->Update();
   // update image annotation with matched phantom configuration
   vtkSmartPointer<vtkPoints> transformedToolLandmarks = vtkSmartPointer<vtkPoints>::New();
   transform->TransformPoints(toolLandmarks, transformedToolLandmarks);
   for (int i = 0; i < transformedToolLandmarks->GetNumberOfPoints(); i++)
   {
     m_CalibPointsImage->InsertPoint(i, transformedToolLandmarks->GetPoint(i));
     UpdatePhantomAnnotationPointVisualization(i);
   }
   m_Controls.m_RefinePhantomAnnotationsGroupBox->setEnabled(true);
   m_Controls.m_CalibBtnPerformPhantomCalibration->setEnabled(true);
 }
 
 void QmitkUltrasoundCalibration::TranslatePhantomAnnotations(double tx, double ty, double tz)
 {
   vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
   transform->Translate(tx, ty, tz);
   vtkSmartPointer<vtkPoints> currentPoints = this->ConvertPointSetToVtkPolyData(m_CalibPointsImage)->GetPoints();
   vtkSmartPointer<vtkPoints> transformedPoints = vtkSmartPointer<vtkPoints>::New();
   transform->TransformPoints(currentPoints, transformedPoints);
   for (int i = 0; i < transformedPoints->GetNumberOfPoints(); i++)
   {
     m_CalibPointsImage->InsertPoint(i, transformedPoints->GetPoint(i));
     UpdatePhantomAnnotationPointVisualization(i);
   }
 }
 
 void QmitkUltrasoundCalibration::RotatePhantomAnnotations(double angle)
 {
   vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
   transform->RotateZ(angle);
   vtkSmartPointer<vtkPoints> currentPoints = this->ConvertPointSetToVtkPolyData(m_CalibPointsImage)->GetPoints();
   vtkSmartPointer<vtkPoints> transformedPoints = vtkSmartPointer<vtkPoints>::New();
   transform->TransformPoints(currentPoints, transformedPoints);
   for (int i = 0; i < transformedPoints->GetNumberOfPoints(); i++)
   {
     m_CalibPointsImage->InsertPoint(i, transformedPoints->GetPoint(i));
     UpdatePhantomAnnotationPointVisualization(i);
   }
 }
 
 void QmitkUltrasoundCalibration::OnMovePhantomAnnotationsUp()
 {
   this->TranslatePhantomAnnotations(0, -m_Image->GetGeometry()->GetSpacing()[1], 0);
 }
 
 void QmitkUltrasoundCalibration::OnMovePhantomAnnotationsDown()
 {
   this->TranslatePhantomAnnotations(0, m_Image->GetGeometry()->GetSpacing()[1], 0);
 }
 
 void QmitkUltrasoundCalibration::OnMovePhantomAnnotationsLeft()
 {
   this->TranslatePhantomAnnotations(-m_Image->GetGeometry()->GetSpacing()[0], 0, 0);
 }
 
 void QmitkUltrasoundCalibration::OnMovePhantomAnnotationsRight()
 {
   this->TranslatePhantomAnnotations(m_Image->GetGeometry()->GetSpacing()[0], 0, 0);
 }
 
 void QmitkUltrasoundCalibration::OnRotatePhantomAnnotationsRight()
 {
   mitk::BoundingBox::PointType centerOfPointSet = m_CalibPointsImage->GetGeometry()->GetBoundingBox()->GetCenter();
   this->TranslatePhantomAnnotations(-centerOfPointSet[0], -centerOfPointSet[1], -centerOfPointSet[2]);
   this->RotatePhantomAnnotations(0.5);
   this->TranslatePhantomAnnotations(centerOfPointSet[0], centerOfPointSet[1], centerOfPointSet[2]);
 }
 
 void QmitkUltrasoundCalibration::OnRotatePhantomAnnotationsLeft()
 {
   mitk::BoundingBox::PointType centerOfPointSet = m_CalibPointsImage->GetGeometry()->GetBoundingBox()->GetCenter();
   this->TranslatePhantomAnnotations(-centerOfPointSet[0], -centerOfPointSet[1], -centerOfPointSet[2]);
   this->RotatePhantomAnnotations(-0.5);
   this->TranslatePhantomAnnotations(centerOfPointSet[0], centerOfPointSet[1], centerOfPointSet[2]);
 }
 
 void QmitkUltrasoundCalibration::OnPhantomBasedCalibration()
 {
   // perform calibration
   OnCalibration();
   m_Controls.m_CalibBtnSavePhantomCalibration->setEnabled(true);
 }
 
 void QmitkUltrasoundCalibration::OnAddEvalTargetPoint()
 {
   auto world = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetSelectedPosition();
 
   this->m_EvalPointsImage->InsertPoint(m_EvalPointsImage->GetSize(), world);
   this->m_EvalPointsTool->InsertPoint(m_EvalPointsTool->GetSize(), this->m_FreezePoint);
 
   QString text = text.number(this->m_EvalPointsTool->GetSize());
   this->m_Controls.m_EvalLblNumTargetPoints->setText(text);
 
   // Update FREs
   // Update Evaluation FRE, but only if it contains more than one point (will crash otherwise)
   if ((m_EvalPointsProjected->GetSize() > 1) && (m_EvalPointsTool->GetSize() > 1))
   {
     m_EvaluationStatistics = mitk::PointSetDifferenceStatisticsCalculator::New();
     m_ProjectionStatistics = mitk::PointSetDifferenceStatisticsCalculator::New();
     mitk::PointSet::Pointer p1 =
       this->m_EvalPointsTool->Clone(); // We use clones to calculate statistics to avoid concurrency Problems
     mitk::PointSet::Pointer p2 = this->m_EvalPointsImage->Clone();
     mitk::PointSet::Pointer p3 = this->m_EvalPointsProjected->Clone();
     m_EvaluationStatistics->SetPointSets(p1, p2);
     m_ProjectionStatistics->SetPointSets(p1, p3);
     QString evalText = evalText.number(m_EvaluationStatistics->GetRMS());
     QString projText = projText.number(m_ProjectionStatistics->GetRMS());
     m_Controls.m_EvalLblEvaluationFRE->setText(evalText);
     m_Controls.m_EvalLblProjectionFRE->setText(projText);
   }
   SwitchFreeze();
 }
 
 void QmitkUltrasoundCalibration::OnAddEvalProjectedPoint()
 {
   MITK_WARN << "Projection Evaluation may currently be inaccurate.";
   // TODO: Verify correct Evaluation. Is the Point that is added really current?
   mitk::Point3D projection = this->m_NeedleProjectionFilter->GetProjection()->GetPoint(1);
   m_EvalPointsProjected->InsertPoint(m_EvalPointsProjected->GetSize(), projection);
   QString text = text.number(this->m_EvalPointsProjected->GetSize());
   this->m_Controls.m_EvalLblNumProjectionPoints->setText(text);
 }
 
 void QmitkUltrasoundCalibration::OnSaveEvaluation()
 {
   // Filename without suffix
   QString filename = m_Controls.m_EvalFilePath->text() + "//" + m_Controls.m_EvalFilePrefix->text();
 
   MITK_WARN << "CANNOT SAVE, ABORTING!";
   /* not working any more TODO!
   mitk::PointSetWriter::Pointer psWriter = mitk::PointSetWriter::New();
   psWriter->SetInput(0, m_CalibPointsImage);
   psWriter->SetInput(1, m_CalibPointsTool);
   psWriter->SetInput(2, m_EvalPointsImage);
   psWriter->SetInput(3, m_EvalPointsTool);
   psWriter->SetInput(4, m_EvalPointsProjected);
   psWriter->SetFileName(filename.toStdString() + ".xml");
   psWriter->Write();
   */
 
   // TODO: New writer for transformations must be implemented.
   /*
   mitk::TransformationFileWriter::Pointer tWriter = mitk::TransformationFileWriter::New();
   tWriter->SetInput(0, m_CalibPointsImage);
   tWriter->SetInput(1, m_CalibPointsTool);
   tWriter->SetInput(2, m_EvalPointsImage);
   tWriter->SetInput(3, m_EvalPointsTool);
   tWriter->SetInput(4, m_EvalPointsProjected);
   tWriter->SetOutputFilename(filename.toStdString() + ".txt");
   tWriter->DoWrite(this->m_Transformation);
   */
 }
 
 void QmitkUltrasoundCalibration::OnSaveCalibration()
 {
   m_Controls.m_GotCalibrationLabel->setText("");
   QString filename =
     QFileDialog::getSaveFileName(QApplication::activeWindow(), "Save Calibration", "", "Calibration files *.cal");
 
   QFile file(filename);
   if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
   {
     MITK_WARN << "Cannot open file '" << filename.toStdString() << "' for writing.";
     return;
   }
 
   std::string calibrationSerialization = m_CombinedModality->SerializeCalibration();
 
   QTextStream outStream(&file);
   outStream << QString::fromStdString(calibrationSerialization);
 
   // save additional information
   if (m_Controls.m_saveAdditionalCalibrationLog->isChecked())
   {
     mitk::SceneIO::Pointer mySceneIO = mitk::SceneIO::New();
     QString filenameScene = filename + "_mitkScene.mitk";
     mitk::NodePredicateNot::Pointer isNotHelperObject =
       mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)));
     mitk::DataStorage::SetOfObjects::ConstPointer nodesToBeSaved = this->GetDataStorage()->GetSubset(isNotHelperObject);
     mySceneIO->SaveScene(nodesToBeSaved, this->GetDataStorage(), filenameScene.toStdString().c_str());
   }
 }
 
 void QmitkUltrasoundCalibration::OnReset()
 {
   this->ClearTemporaryMembers();
 
   if (m_Transformation.IsNull())
   {
     m_Transformation = mitk::AffineTransform3D::New();
   }
   m_Transformation->SetIdentity();
 
   if (m_Node.IsNotNull() && (m_Node->GetData() != nullptr) && (m_Node->GetData()->GetGeometry() != nullptr))
   {
     mitk::SlicedGeometry3D::Pointer sliced3d = dynamic_cast<mitk::SlicedGeometry3D *>(m_Node->GetData()->GetGeometry());
     mitk::PlaneGeometry::Pointer plane = const_cast<mitk::PlaneGeometry *>(sliced3d->GetPlaneGeometry(0));
     plane->SetIndexToWorldTransform(m_Transformation);
   }
 
   QString text1 = text1.number(this->m_EvalPointsTool->GetSize());
   this->m_Controls.m_EvalLblNumTargetPoints->setText(text1);
   QString text2 = text2.number(this->m_EvalPointsProjected->GetSize());
   this->m_Controls.m_EvalLblNumProjectionPoints->setText(text2);
 }
 
 void QmitkUltrasoundCalibration::Update()
 {
   // Update Tracking Data
   std::vector<mitk::NavigationData::Pointer> *datas = new std::vector<mitk::NavigationData::Pointer>();
   datas->push_back(m_Tracker->GetOutput());
   m_Controls.m_CalibTrackingStatus->SetNavigationDatas(datas);
   m_Controls.m_CalibTrackingStatus->Refresh();
   m_Controls.m_EvalTrackingStatus->SetNavigationDatas(datas);
   m_Controls.m_EvalTrackingStatus->Refresh();
 
   m_CombinedModality->Modified();
   m_CombinedModality->Update();
 
   // Update US Image
   mitk::Image::Pointer image = m_CombinedModality->GetOutput();
   // make sure that always the current image is set to the data node
   if (image.IsNotNull() && m_Node->GetData() != image.GetPointer() && image->IsInitialized())
   {
     m_Node->SetData(image);
   }
 
   // Update Needle Projection
   m_NeedleProjectionFilter->Update();
 
   // only update 2d window because it is faster
   this->RequestRenderWindowUpdate(mitk::RenderingManager::REQUEST_UPDATE_2DWINDOWS);
 }
 
 void QmitkUltrasoundCalibration::SwitchFreeze()
 {
   m_Controls.m_CalibBtnAddPoint->setEnabled(false); // generally deactivate
   // We use the activity state of the timer to determine whether we are currently viewing images
   if (!m_Timer->isActive()) // Activate Imaging
   {
     // if (m_Node) m_Node->ReleaseData();
     if (m_CombinedModality.IsNull())
     {
       m_Timer->stop();
       return;
     }
 
     m_CombinedModality->Update();
     m_Image = m_CombinedModality->GetOutput();
     if (m_Image.IsNotNull() && m_Image->IsInitialized())
     {
       m_Node->SetData(m_Image);
     }
 
     std::vector<mitk::NavigationData::Pointer> datas;
     datas.push_back(m_Tracker->GetOutput());
     m_Controls.m_CalibTrackingStatus->SetNavigationDatas(&datas);
     m_Controls.m_CalibTrackingStatus->ShowStatusLabels();
     m_Controls.m_CalibTrackingStatus->Refresh();
 
     m_Controls.m_EvalTrackingStatus->SetNavigationDatas(&datas);
     m_Controls.m_EvalTrackingStatus->ShowStatusLabels();
     m_Controls.m_EvalTrackingStatus->Refresh();
 
     int interval = 40;
     m_Timer->setInterval(interval);
     m_Timer->start();
 
     m_CombinedModality->SetIsFreezed(false);
   }
   else if (this->m_Tracker->GetOutput(0)->IsDataValid())
   {
     // deactivate Imaging
     m_Timer->stop();
     // Remember last tracking coordinates
     m_FreezePoint = this->m_Tracker->GetOutput(0)->GetPosition();
     m_Controls.m_CalibBtnAddPoint->setEnabled(true); // activate only, if valid point is set
 
     m_CombinedModality->SetIsFreezed(true);
   }
 }
 
 void QmitkUltrasoundCalibration::ShowNeedlePath()
 {
   // Init Filter
   this->m_NeedleProjectionFilter->SelectInput(0);
 
   // Create Node for Pointset
   mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode("Needle Path");
   if (node.IsNull())
   {
     node = mitk::DataNode::New();
     node->SetName("Needle Path");
     node->SetData(m_NeedleProjectionFilter->GetProjection());
     node->SetBoolProperty("show contour", true);
     this->GetDataStorage()->Add(node);
   }
 }
 
 void QmitkUltrasoundCalibration::ClearTemporaryMembers()
 {
   m_CalibPointsTool->Clear();
   m_CalibPointsImage->Clear();
   m_CalibPointsCount = 0;
 
   m_EvalPointsImage->Clear();
   m_EvalPointsTool->Clear();
   m_EvalPointsProjected->Clear();
 
   this->m_Controls.m_CalibPointList->clear();
 
   m_SpacingPoints->Clear();
   m_Controls.m_SpacingPointsList->clear();
   m_SpacingPointsCount = 0;
 }
 
 vtkSmartPointer<vtkPolyData> QmitkUltrasoundCalibration::ConvertPointSetToVtkPolyData(mitk::PointSet::Pointer PointSet)
 {
   vtkSmartPointer<vtkPolyData> returnValue = vtkSmartPointer<vtkPolyData>::New();
   vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
   for (int i = 0; i < PointSet->GetSize(); i++)
   {
     double point[3] = {PointSet->GetPoint(i)[0], PointSet->GetPoint(i)[1], PointSet->GetPoint(i)[2]};
     points->InsertNextPoint(point);
   }
   vtkSmartPointer<vtkPolyData> temp = vtkSmartPointer<vtkPolyData>::New();
   temp->SetPoints(points);
 
   vtkSmartPointer<vtkVertexGlyphFilter> vertexFilter = vtkSmartPointer<vtkVertexGlyphFilter>::New();
   vertexFilter->SetInputData(temp);
   vertexFilter->Update();
 
   returnValue->ShallowCopy(vertexFilter->GetOutput());
 
   return returnValue;
 }
 
 double QmitkUltrasoundCalibration::ComputeFRE(mitk::PointSet::Pointer imageFiducials,
                                               mitk::PointSet::Pointer realWorldFiducials,
                                               vtkSmartPointer<vtkLandmarkTransform> transform)
 {
   if (imageFiducials->GetSize() != realWorldFiducials->GetSize())
     return -1;
   double FRE = 0;
   for (int i = 0; i < imageFiducials->GetSize(); ++i)
   {
     itk::Point<double> current_image_fiducial_point = imageFiducials->GetPoint(i);
     if (transform != nullptr)
     {
       current_image_fiducial_point = transform->TransformPoint(
         imageFiducials->GetPoint(i)[0], imageFiducials->GetPoint(i)[1], imageFiducials->GetPoint(i)[2]);
     }
     double cur_error_squared = current_image_fiducial_point.SquaredEuclideanDistanceTo(realWorldFiducials->GetPoint(i));
     FRE += cur_error_squared;
   }
 
   FRE = sqrt(FRE / (double)imageFiducials->GetSize());
 
   return FRE;
 }
 
 void QmitkUltrasoundCalibration::ApplyTransformToPointSet(mitk::PointSet::Pointer pointSet,
                                                           vtkSmartPointer<vtkAbstractTransform> transform)
 {
   for (int i = 0; i < pointSet->GetSize(); ++i)
   {
     itk::Point<double> current_point_transformed = itk::Point<double>();
     current_point_transformed =
       transform->TransformPoint(pointSet->GetPoint(i)[0], pointSet->GetPoint(i)[1], pointSet->GetPoint(i)[2]);
     pointSet->SetPoint(i, current_point_transformed);
   }
 }
 
 void QmitkUltrasoundCalibration::OnFreezeClicked()
 {
   if (m_CombinedModality.IsNull())
   {
     return;
   }
 
   if (m_CombinedModality->GetIsFreezed())
   {
     // device was already frozen so we need to delete all spacing points because they need to be collected all at once
     // no need to check if all four points are already collected, because if that's the case you can no longer click the
     // Freeze button
     m_SpacingPoints->Clear();
     m_Controls.m_SpacingPointsList->clear();
     m_SpacingPointsCount = 0;
     m_Controls.m_SpacingAddPoint->setEnabled(false);
   }
   else
   {
     m_Controls.m_SpacingAddPoint->setEnabled(true);
   }
   SwitchFreeze();
 }
 
 void QmitkUltrasoundCalibration::OnAddSpacingPoint()
 {
   auto point = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetSelectedPosition();
 
   this->m_SpacingPoints->InsertPoint(m_SpacingPointsCount, point);
 
   QString text = text.number(m_SpacingPointsCount + 1);
   text = "Point " + text;
 
   this->m_Controls.m_SpacingPointsList->addItem(text);
 
   m_SpacingPointsCount++;
 
   if (m_SpacingPointsCount == 4) // now we have all 4 points needed
   {
     m_Controls.m_SpacingAddPoint->setEnabled(false);
     m_Controls.m_CalculateSpacing->setEnabled(true);
     m_Controls.m_SpacingBtnFreeze->setEnabled(false);
   }
 }
 
 void QmitkUltrasoundCalibration::OnCalculateSpacing()
 {
   mitk::Point3D horizontalOne = m_SpacingPoints->GetPoint(0);
   mitk::Point3D horizontalTwo = m_SpacingPoints->GetPoint(1);
   mitk::Point3D verticalOne = m_SpacingPoints->GetPoint(2);
   mitk::Point3D verticalTwo = m_SpacingPoints->GetPoint(3);
 
   // Get the distances between the points in the image
   double xDistance = horizontalOne.EuclideanDistanceTo(horizontalTwo);
   double yDistance = verticalOne.EuclideanDistanceTo(verticalTwo);
 
   // Calculate the spacing of the image and fill a vector with it
   double xSpacing = 30 / xDistance;
   double ySpacing = 20 / yDistance;
 
   m_CombinedModality->GetUltrasoundDevice()->SetSpacing(xSpacing, ySpacing);
 
   // Now that the spacing is set clear all stuff and return to Calibration
   m_SpacingPoints->Clear();
   m_Controls.m_SpacingPointsList->clear();
   m_SpacingPointsCount = 0;
   m_CombinedModality->SetIsFreezed(false);
 }
 
 void QmitkUltrasoundCalibration::OnUSDepthChanged(const std::string &key, const std::string &)
 {
   // whenever depth of USImage is changed the spacing should no longer be overwritten
   if (key == mitk::USDevice::GetPropertyKeys().US_PROPKEY_BMODE_DEPTH)
   {
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
index f92a943e7b..78bfc1132f 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
@@ -1,380 +1,380 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkUltrasoundCalibration_h
 #define QmitkUltrasoundCalibration_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 // MITK
 #include <mitkIGTLClient.h>
 #include <mitkNavigationDataToIGTLMessageFilter.h>
 #include <mitkNeedleProjectionFilter.h>
 #include <mitkPointSet.h>
 #include <mitkPointSetDifferenceStatisticsCalculator.h>
 #include <mitkUSCombinedModality.h>
 
 // Microservices
 #include "ui_QmitkUltrasoundCalibrationControls.h"
 
 #include <vtkLandmarkTransform.h>
 #include <vtkPolyData.h>
 #include <vtkSmartPointer.h>
 
 #include <ctkServiceEvent.h>
 
 /*!
   \brief QmitkUltrasoundCalibration
 
   \warning  This view provides a simple calibration process.
 
   \ingroup ${plugin_target}_internal
   */
 class QmitkUltrasoundCalibration : public QmitkAbstractView
 {
   Q_OBJECT
 
 public:
   QmitkUltrasoundCalibration();
   ~QmitkUltrasoundCalibration() override;
 
   static const std::string VIEW_ID;
 
   void CreateQtPartControl(QWidget *parent) override;
 
   void OnUSDepthChanged(const std::string &, const std::string &);
 
 protected slots:
 
   /**
    * \brief Triggered, whenever the user switches Tabs
    *
    */
   void OnTabSwitch(int index);
 
   /**
    * \brief Triggered, when the user has clicked "select Devices".
    *
    */
   void OnDeviceSelected();
   void OnDeviceDeselected();
 
   /**
    * \brief Triggered, when the user clicks "Add Point"
    *
    */
   void OnAddCalibPoint();
 
   /**
    * \brief Triggered, when the user clicks "Calibrate"
    *
    */
   void OnCalibration();
 
   /**
    * \brief Triggered, when the user clicks "Add Target Points".
    *
    * Adds an image point and an tracking point to their respective evaluation pointsets
    */
   void OnAddEvalTargetPoint();
 
   /**
    * \brief Triggered, when the user clicks "Add Point".
    *
    * Adds a projected point to the projected point evaluation set.
    */
   void OnAddEvalProjectedPoint();
 
   /**
    * \brief Triggered when the user clicks "Save Results" in the Evaluation tab.
    */
   void OnSaveEvaluation();
 
   /**
    * \brief Triggered when the user clicks "Save Calibration" in the Calibration tab.
    */
   void OnSaveCalibration();
 
   /**
    * \brief Triggered when the user clicks "Run Next Round". Also used as a reset mechanism.
    */
   void OnReset();
 
   /**
    * \brief Triggered in regular intervals by a timer, when live view is enabled.
    *
    */
   void Update();
 
   /**
    * \brief Freezes or unfreezes the image.
    */
   void SwitchFreeze();
 
   /**
    *
    */
   void OnStartCalibrationProcess();
 
   /**
    *\brief Method to use the PLUS-Toolkoit for Calibration of EchoTrack
    */
   void OnStartPlusCalibration();
 
   void OnStopPlusCalibration();
 
   /**
    *\ brief Starts the Streaming of USImage and Navigation Data when PLUS is connected
    */
   void OnStartStreaming();
 
   void OnNewConnection();
 
   /**
   \*brief Get the Calibration from the PLUS-Toolkit once Calibration with fCal is done
   */
   void OnGetPlusCalibration();
 
   /**
-  \*brief Convert the recieved igtl::Matrix into an mitk::AffineTransform3D which can be used to calibrate the
+  \*brief Convert the received igtl::Matrix into an mitk::AffineTransform3D which can be used to calibrate the
   CombinedModality
   */
   void ProcessPlusCalibration(igtl::Matrix4x4 &imageToTracker);
 
   void OnStreamingTimerTimeout();
 
   /**
    *
    */
   void OnStopCalibrationProcess();
 
   void OnAddCurrentTipPositionToReferencePoints();
 
   void OnStartVerification();
 
   void OnAddCurrentTipPositionForVerification();
 
   void OnDeviceServiceEvent(const ctkServiceEvent event);
 
   void OnFreezeClicked();
 
   void OnAddSpacingPoint();
 
   void OnCalculateSpacing();
 
   /*
    * \brief load the configuration of the phantom fiducials which have to be saved as points in the sensor coordinate
    * system of the tracking sensor attached to the phantom
    */
   void OnLoadPhantomConfiguration();
   /*
    * \brief match the annotation pointset with the geometry of the phantom configuration
    */
   void OnMatchAnnotationToPhantomConfiguration();
   /*
    * \brief move the annotation pointset up
    */
   void OnMovePhantomAnnotationsUp();
   /*
    * \brief move the annotation pointset down
    */
   void OnMovePhantomAnnotationsDown();
   /*
    * \brief move the annotation pointset left
    */
   void OnMovePhantomAnnotationsLeft();
   /*
    * \brief move the annotation pointset right
    */
   void OnMovePhantomAnnotationsRight();
   /*
    * \brief rotate the annotation pointset right
    */
   void OnRotatePhantomAnnotationsRight();
   /*
    * \brief rotate the annotation pointset left
    */
   void OnRotatePhantomAnnotationsLeft();
 
   /*
    * \brief add a calibration point to be used for phantom based calibration
    */
   void OnPhantomCalibPointsChanged();
   /*
    * \brief perform phantom based calibration
    */
   void OnPhantomBasedCalibration();
 
 signals:
   /**
-   * \brief used for thread seperation, the worker thread must not call OnNewConnection directly.
+   * \brief used for thread separation, the worker thread must not call OnNewConnection directly.
    * QT signals are thread safe and separate the threads
    */
   void NewConnectionSignal();
 
 protected:
   void SetFocus() override;
 
   void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes) override;
 
   void UpdatePhantomAnnotationPointVisualization(int index = -1);
   /*! \brief translate the annotated image feature m_CalibPoints image by the specified translation vector
   */
   void TranslatePhantomAnnotations(double tx, double ty, double tz);
   /*! \brief rotate the annotated image feature m_CalibPoints image by the specified angle
    */
   void RotatePhantomAnnotations(double angle);
 
   Ui::QmitkUltrasoundCalibrationControls m_Controls;
 
   /**
    * \brief Internal function that activates display of the needle path.
    */
   void ShowNeedlePath();
 
   /**
    * \brief Clears all member attributes which are holding intermediate results for the calibration.
    */
   void ClearTemporaryMembers();
 
   void OnPlusConnected();
 
   /**
    * \brief The combined modality used for imaging and tracking.
    */
   mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality;
 
   /**
    * \brief NavigationDataSource used for tracking data.
    * This will be gotten by the combined modality.
    */
   mitk::NavigationDataSource::Pointer m_Tracker;
 
   QTimer *m_Timer;
 
   mitk::DataNode::Pointer m_Node;
   mitk::DataNode::Pointer m_CalibNode;
   mitk::DataNode::Pointer m_WorldNode;
 
   // IGTL Servers and Devices needed for the communication with PLUS
   mitk::IGTLServer::Pointer m_USServer;
   mitk::IGTLMessageProvider::Pointer m_USMessageProvider;
   mitk::ImageToIGTLMessageFilter::Pointer m_USImageToIGTLMessageFilter;
 
   mitk::IGTLServer::Pointer m_TrackingServer;
   mitk::IGTLMessageProvider::Pointer m_TrackingMessageProvider;
   mitk::NavigationDataToIGTLMessageFilter::Pointer m_TrackingToIGTLMessageFilter;
 
   mitk::IGTLClient::Pointer m_TransformClient;
   mitk::IGTLDeviceSource::Pointer m_TransformDeviceSource;
 
   QTimer *m_StreamingTimer;
 
   unsigned long m_NewConnectionObserverTag;
 
   /**
    * \brief The current Ultrasound Image.
    */
   mitk::Image::Pointer m_Image;
   /**
    * \brief Current point when the image was last frozen.
    */
   mitk::Point3D m_FreezePoint;
 
   /**
    * \brief Pointset containing all tool points.
    */
   mitk::PointSet::Pointer m_CalibPointsImage;
   /**
    * \brief Pointset containing corresponding points on the image.
    */
   mitk::PointSet::Pointer m_CalibPointsTool;
   mitk::PointSet::Pointer
     m_PhantomConfigurationPointSet; ///< pointset holding the feature position of the phantom in tool coordinates
   /**
    * \brief Pointset containing Projected Points (aka "where we thought the needle was gonna land")
    */
   mitk::PointSet::Pointer m_EvalPointsProjected;
   /**
    * \brief Pointset containing the evaluated points on the image.
    */
   mitk::PointSet::Pointer m_EvalPointsImage;
   /**
    * \brief Pointset containing tracked evaluation points.
    */
   mitk::PointSet::Pointer m_EvalPointsTool;
 
   /**
    * \brief Pointset containing tracked evaluation points.
    */
   mitk::PointSet::Pointer m_VerificationReferencePoints;
   mitk::DataNode::Pointer m_VerificationReferencePointsDataNode;
 
   int m_currentPoint;
   std::vector<mitk::Point3D> m_allReferencePoints;
   std::vector<double> m_allErrors;
 
   /**
    * \brief Creates a Pointset that projects the needle's path
    */
   mitk::NeedleProjectionFilter::Pointer m_NeedleProjectionFilter;
   /**
    * \brief Total number of calibration points set.
    */
   int m_CalibPointsCount;
 
   QString m_CurrentDepth;
 
   /**
    * \brief StatisticsRegarding Projection Accuracy.
    * (Compares m_EvalPointsProjected to m_EvalPointsImage)
    */
   mitk::PointSetDifferenceStatisticsCalculator::Pointer m_ProjectionStatistics;
   /**
    * \brief StatisticsRegarding Evaluation Accuracy.
    * (Compares m_EvalPointsTool to m_EvalPointsImage)
    */
   mitk::PointSetDifferenceStatisticsCalculator::Pointer m_EvaluationStatistics;
   /**
    * \brief StatisticsRegarding Calibration Accuracy.
    * (Compares m_CalibPointsTool to a transformed copy of m_CalibPointsImage).
    */
   mitk::PointSetDifferenceStatisticsCalculator::Pointer m_CalibrationStatistics;
 
   /**
    * \brief Result of the Calibration.
    */
   mitk::AffineTransform3D::Pointer m_Transformation;
 
   /**
    * This method is copied from PointSetModifier which is part of MBI. It should be replaced
    * by external method call as soon as this functionality will be available in MITK.
    */
   vtkSmartPointer<vtkPolyData> ConvertPointSetToVtkPolyData(mitk::PointSet::Pointer PointSet);
 
   double ComputeFRE(mitk::PointSet::Pointer imageFiducials,
                     mitk::PointSet::Pointer realWorldFiducials,
                     vtkSmartPointer<vtkLandmarkTransform> transform = nullptr);
 
   void ApplyTransformToPointSet(mitk::PointSet::Pointer pointSet, vtkSmartPointer<vtkAbstractTransform> transform);
 
   mitk::PointSet::Pointer m_SpacingPoints;
   mitk::DataNode::Pointer m_SpacingNode;
   int m_SpacingPointsCount;
 
 private:
   mitk::MessageDelegate2<QmitkUltrasoundCalibration, const std::string &, const std::string &> m_USDeviceChanged;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h
index c6c03d4be2..2133f307f5 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.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 QmitkUSNavigationAbstractSettingsWidget_h
 #define QmitkUSNavigationAbstractSettingsWidget_h
 
 #include <QWidget>
 
 #include "mitkDataNode.h"
 
 /**
  * \brief Abstract class of settings widgets used by the QmitkUSNavigationProcessWidget.
  * This class handles the emitting of Saved(), Canceled() and SettingsChanged()
  * signals and provides slots for save and cancel buttons.
  *
  * The actual saving and loading of settings is delegated to concrete subclasses
  * which should therefore implement OnSetSettingsNode(), OnSaveProcessing(),
  * OnCancelProcessing(), OnLoadSettingsProcessing().
  */
 class QmitkUSNavigationAbstractSettingsWidget : public QWidget
 {
   Q_OBJECT
 
 signals:
   void Saved();
   void Canceled();
   void SettingsChanged(itk::SmartPointer<mitk::DataNode>);
 
 protected slots:
   /**
    * \brief Triggers the saving of the current settings.
    * OnSaveProcessing() is called and the Saved() signal is emitted afterwards.
    */
   void OnSave();
 
   /**
    * \brief Ends the settings changing process without saving the changes.
    * OnCancelProcessing() is called and the Canceled() signal is emitted
    * afterwards.
    */
   void OnCancel();
 
 public:
   explicit QmitkUSNavigationAbstractSettingsWidget(QWidget *parent = nullptr);
   ~QmitkUSNavigationAbstractSettingsWidget() override;
 
   /**
    * \brief Loads the settings.
    * The actual loading is done by calling the OnLoadSettingsProcessing()
    * method.
    */
   void LoadSettings();
 
   /**
    * \brief Setter for the data node in which the settings are loaded.
    * The settings are made available as properties of this data node.
    */
   void SetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues = false);
   itk::SmartPointer<mitk::DataNode> GetSettingsNode();
 
 protected:
   /**
    * \brief Method for handling the setting of a new settings node.
    * This method has to be implemented by a concrete subclass.
    */
   virtual void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues) = 0;
 
   /**
    * \brief Method for actually saving the settings.
    * This method has to be implemented by a concrete subclass.
    */
   virtual void OnSaveProcessing() = 0;
 
   /**
    * \brief Method for handling the cancel process.
    * This method can be implemented by a concrete subclass. An empty default
    * implementation exists.
    */
   virtual void OnCancelProcessing() {}
 
   /**
-   * \brief Method for acutally loading the settings.
+   * \brief Method for actually loading the settings.
    * This method has to be implemented by a concrete subclass.
    */
   virtual void OnLoadSettingsProcessing() = 0;
 
 private:
   mitk::DataNode::Pointer m_SettingsNode;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/USNavigationControls.ui b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/USNavigationControls.ui
index 578840cd65..3e998fe46e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/USNavigationControls.ui
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/USNavigationControls.ui
@@ -1,370 +1,370 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
   <class>USNavigationControls</class>
   <widget class="QWidget" name="USNavigationControls">
     <property name="geometry">
       <rect>
         <x>0</x>
         <y>0</y>
         <width>360</width>
         <height>330</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">
       <item>
         <widget class="QTabWidget" name="m_TabWidget">
           <property name="currentIndex">
             <number>0</number>
           </property>
           <widget class="QWidget" name="Devices">
             <attribute name="title">
               <string>Devices</string>
             </attribute>
             <layout class="QVBoxLayout" name="verticalLayout_2">
               <item>
                 <widget class="QLabel" name="label_3">
                   <property name="font">
                     <font>
                       <weight>75</weight>
                       <bold>true</bold>
                       <underline>true</underline>
                     </font>
                   </property>
                   <property name="text">
                     <string>Step 1:</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QLabel" name="label_4">
                   <property name="text">
                     <string>
                       &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
                       &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
                       p, li { white-space: pre-wrap; }
                       &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
                       &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Please select an ultrasound device and a tracking device from the list above. These devices will be used to perform the procedure. Both devices must be active to appear on their respective List. Optionally, you may load a calibration file along with the ultrasound device.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
                     </string>
                   </property>
                   <property name="wordWrap">
                     <bool>true</bool>
                   </property>
                 </widget>
               </item>
               <item>
                 <spacer name="verticalSpacer">
                   <property name="orientation">
                     <enum>Qt::Vertical</enum>
                   </property>
                   <property name="sizeType">
                     <enum>QSizePolicy::Fixed</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                     <size>
                       <width>20</width>
                       <height>10</height>
                     </size>
                   </property>
                 </spacer>
               </item>
               <item>
                 <widget class="QLabel" name="label_13">
                   <property name="font">
                     <font>
                       <pointsize>14</pointsize>
                       <weight>75</weight>
                       <bold>true</bold>
                     </font>
                   </property>
                   <property name="text">
                     <string>Device Selection:</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QmitkUSNavigationStepCombinedModality" name="m_CombinedModalitySelectionWidget" native="true"/>
               </item>
               <item>
                 <widget class="QPushButton" name="m_BtnSelectDevices">
                   <property name="enabled">
                     <bool>false</bool>
                   </property>
                   <property name="minimumSize">
                     <size>
                       <width>0</width>
                       <height>50</height>
                     </size>
                   </property>
                   <property name="text">
                     <string>Select Combined Modality</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <spacer name="spacer1">
                   <property name="orientation">
                     <enum>Qt::Vertical</enum>
                   </property>
                   <property name="sizeType">
                     <enum>QSizePolicy::Expanding</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                     <size>
                       <width>20</width>
                       <height>220</height>
                     </size>
                   </property>
                 </spacer>
               </item>
             </layout>
           </widget>
           <widget class="QWidget" name="tab">
             <attribute name="title">
               <string>Zoning</string>
             </attribute>
             <layout class="QVBoxLayout" name="verticalLayout_5">
               <item>
                 <widget class="QLabel" name="label_14">
                   <property name="sizePolicy">
                     <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                     </sizepolicy>
                   </property>
                   <property name="font">
                     <font>
                       <weight>75</weight>
                       <bold>true</bold>
                       <underline>true</underline>
                     </font>
                   </property>
                   <property name="text">
                     <string>Step 2:</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QLabel" name="label_15">
                   <property name="sizePolicy">
                     <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                     </sizepolicy>
                   </property>
                   <property name="text">
                     <string>
                       &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
                       &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
                       p, li { white-space: pre-wrap; }
                       &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
                       &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Mark risk struktures by navigating to them with the ultrasound probe. Once located, press freeze. Mark the structures by clicking in the center, moving the mouse till the size is acceptable and clicking again to fix the size. You may then change the zone's color and size. Repeat until satisfied. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
                     </string>
                   </property>
                   <property name="wordWrap">
                     <bool>true</bool>
                   </property>
                 </widget>
               </item>
               <item>
                 <spacer name="verticalSpacer_4">
                   <property name="orientation">
                     <enum>Qt::Vertical</enum>
                   </property>
                   <property name="sizeType">
                     <enum>QSizePolicy::Fixed</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                     <size>
                       <width>20</width>
                       <height>10</height>
                     </size>
                   </property>
                 </spacer>
               </item>
               <item>
                 <widget class="QPushButton" name="m_BtnFreeze">
                   <property name="sizePolicy">
                     <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                     </sizepolicy>
                   </property>
                   <property name="minimumSize">
                     <size>
                       <width>0</width>
                       <height>50</height>
                     </size>
                   </property>
                   <property name="text">
                     <string>Freeze Image</string>
                   </property>
                   <property name="checkable">
                     <bool>true</bool>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QLabel" name="label">
                   <property name="sizePolicy">
                     <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                     </sizepolicy>
                   </property>
                   <property name="text">
                     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Current Zones:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QmitkUSZoneManagementWidget" name="m_ZonesWidget" native="true">
                   <property name="sizePolicy">
                     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                     </sizepolicy>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QPushButton" name="m_BtnStartIntervention">
                   <property name="minimumSize">
                     <size>
                       <width>0</width>
                       <height>50</height>
                     </size>
                   </property>
                   <property name="font">
                     <font>
                       <pointsize>12</pointsize>
                       <weight>75</weight>
                       <bold>true</bold>
                     </font>
                   </property>
                   <property name="text">
                     <string>Start Intervention</string>
                   </property>
                 </widget>
               </item>
             </layout>
           </widget>
           <widget class="QWidget" name="tab_4">
             <attribute name="title">
               <string>Intervention</string>
             </attribute>
             <layout class="QVBoxLayout" name="verticalLayout_4">
               <item>
                 <widget class="QLabel" name="label_10">
                   <property name="font">
                     <font>
                       <weight>75</weight>
                       <bold>true</bold>
                       <underline>true</underline>
                     </font>
                   </property>
                   <property name="text">
                     <string>Step 3:</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QLabel" name="label_11">
                   <property name="text">
                     <string>
                       &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
                       &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
                       p, li { white-space: pre-wrap; }
                       &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-                      &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;When all the previous steps are completed, click &amp;quot;Start Intervention&amp;quot; to proceed. When done, click &amp;quot;Stop Intervention&amp;quot; to finsih. No further input is required at this stage. You may stop the intervention to go back and change parameters at any time.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
+                      &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;When all the previous steps are completed, click &amp;quot;Start Intervention&amp;quot; to proceed. When done, click &amp;quot;Stop Intervention&amp;quot; to finish. No further input is required at this stage. You may stop the intervention to go back and change parameters at any time.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
                     </string>
                   </property>
                   <property name="wordWrap">
                     <bool>true</bool>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QPushButton" name="m_BtnReset">
                   <property name="minimumSize">
                     <size>
                       <width>0</width>
                       <height>50</height>
                     </size>
                   </property>
                   <property name="text">
                     <string>Stop and Reset</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QPushButton" name="m_BtnNeedleView">
                   <property name="minimumSize">
                     <size>
                       <width>0</width>
                       <height>50</height>
                     </size>
                   </property>
                   <property name="text">
                     <string>NeedleView</string>
                   </property>
                   <property name="checkable">
                     <bool>true</bool>
                   </property>
                   <property name="checked">
                     <bool>false</bool>
                   </property>
                 </widget>
               </item>
               <item>
                 <widget class="QGroupBox" name="m_RangeBox">
                   <property name="title">
                     <string>Zone Range</string>
                   </property>
                 </widget>
               </item>
               <item>
                 <spacer name="verticalSpacer_3">
                   <property name="orientation">
                     <enum>Qt::Vertical</enum>
                   </property>
                   <property name="sizeHint" stdset="0">
                     <size>
                       <width>20</width>
                       <height>40</height>
                     </size>
                   </property>
                 </spacer>
               </item>
             </layout>
           </widget>
         </widget>
       </item>
     </layout>
   </widget>
   <layoutdefault spacing="6" margin="11"/>
   <customwidgets>
     <customwidget>
       <class>QmitkUSZoneManagementWidget</class>
       <extends>QWidget</extends>
       <header>src/internal/Widgets/QmitkUSZoneManagementWidget.h</header>
       <container>1</container>
     </customwidget>
     <customwidget>
       <class>QmitkUSNavigationStepCombinedModality</class>
       <extends>QWidget</extends>
       <header>src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h</header>
       <container>1</container>
     </customwidget>
   </customwidgets>
   <resources/>
   <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h
index b862ea1fd8..9e7dc059b4 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.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 QmitkUSCombinedModalityCreationWidget_h
 #define QmitkUSCombinedModalityCreationWidget_h
 
 #include <QWidget>
 
 #include "mitkUSCombinedModality.h"
 
 namespace Ui {
 class QmitkUSCombinedModalityCreationWidget;
 }
 
 /**
  * \brief Widget that enables the user to create a mitk::USCombinedModality of a mitk::NavigationDataSource and a mitk::USDevice.
  * A mitk::NavigationDataSource and a mitk::USDevice can be picked from two lists, showing
  * the corresponding micro service objects. The combined modality is registered as a micro
  * service as well during the creation process.
  */
 class QmitkUSCombinedModalityCreationWidget : public QWidget
 {
   Q_OBJECT
 
 signals:
-  /** \brief Emmited when the user clicks the "Cancel" button. */
+  /** \brief Emitted when the user clicks the "Cancel" button. */
   void SignalAborted();
 
-  /** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */
+  /** \brief Emitted when the user clicked the "Create" button and the creation is successful. */
   void SignalCreated(mitk::USCombinedModality::Pointer combinedModality);
 
-  /** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */
+  /** \brief Emitted when the user clicked the "Create" button and the creation is successful. */
   void SignalCreated();
 
 protected slots:
   /** \brief Creates a combined modility of the selected mitk::NavigationDataSource and mitk::USDevice. **/
   void OnCreation();
 
   /** \brief Handles the enabled state of the "Create" button. **/
   void OnSelectedUltrasoundOrTrackingDevice();
 
 public:
   explicit QmitkUSCombinedModalityCreationWidget(QWidget *parent = nullptr);
   ~QmitkUSCombinedModalityCreationWidget() override;
 
 private:
   Ui::QmitkUSCombinedModalityCreationWidget *ui;
 
   itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.ui b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.ui
index fddd41ad6f..0a5b900580 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.ui
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.ui
@@ -1,174 +1,174 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkUSCombinedModalityCreationWidget</class>
  <widget class="QWidget" name="QmitkUSCombinedModalityCreationWidget">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>323</width>
     <height>350</height>
    </rect>
   </property>
   <property name="minimumSize">
    <size>
     <width>0</width>
     <height>350</height>
    </size>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QLabel" name="usDevicesServiceListLabel">
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="text">
       <string>Ultrasound Devices:</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QmitkServiceListWidget" name="usDevicesServiceList" native="true">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>0</height>
       </size>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="trackingDevicesServiceListLabel">
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="text">
       <string>Tracking Devices:</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QmitkServiceListWidget" name="trackingDevicesServiceList" native="true">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="helpLabel">
      <property name="text">
       <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Please select an ultrasound device and a tracking device from the lists above. These devices will be used to create a combined modality. Additionally, you may specifiy a vendor and a name.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Please select an ultrasound device and a tracking device from the lists above. These devices will be used to create a combined modality. Additionally, you may specify a vendor and a name.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QFormLayout" name="formLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="vendorLineEditLabel">
        <property name="text">
         <string>Vendor</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1">
       <widget class="QLineEdit" name="vendorLineEdit">
        <property name="text">
         <string>MBI</string>
        </property>
       </widget>
      </item>
      <item row="1" column="0">
       <widget class="QLabel" name="nameLineEditLabel">
        <property name="text">
         <string>Name</string>
        </property>
       </widget>
      </item>
      <item row="1" column="1">
       <widget class="QLineEdit" name="nameLineEdit">
        <property name="text">
         <string>Combined Modality</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QCheckBox" name="activateTrackedUSCheckbox">
      <property name="text">
       <string>Activate Tracked Ultrasound</string>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
       <widget class="QPushButton" name="createButton">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="text">
         <string>Create Combined Modality</string>
        </property>
        <property name="icon">
         <iconset resource="../../../resources/USNavigation.qrc">
          <normaloff>:/USNavigation/accept.png</normaloff>:/USNavigation/accept.png</iconset>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="cancelButton">
        <property name="text">
         <string>Cancel</string>
        </property>
        <property name="icon">
         <iconset resource="../../../resources/USNavigation.qrc">
          <normaloff>:/USNavigation/restart.png</normaloff>:/USNavigation/restart.png</iconset>
        </property>
       </widget>
      </item>
     </layout>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkServiceListWidget</class>
    <extends>QWidget</extends>
    <header>QmitkServiceListWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources>
   <include location="../../../resources/USNavigation.qrc"/>
  </resources>
  <connections/>
  <slots>
   <slot>SignalAborted()</slot>
  </slots>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h
index d0552974ca..53b56553b8 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.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 QmitkUSNavigationFreezeButton_h
 #define QmitkUSNavigationFreezeButton_h
 
 #include <QPushButton>
 
 #include "mitkUSCombinedModality.h"
 
 /**
  * \brief QPushButton for freezing and unfreezing a combined modality.
- * The button already has an icon and a text. On every successfull
+ * The button already has an icon and a text. On every successful
  * freeze or unfreeze the signal SignalFrezzed() is emitted. One should
  * listen to this signal rather than to the clicked() signal of the
  * QPushButton as the combined modality may not be freezed after
  * clicked() was emitted.
  */
 class QmitkUSNavigationFreezeButton : public QPushButton
 {
   Q_OBJECT
 
 signals:
   /**
    * \brief Emitted every time the freeze state of the combined modality changed.
    * True if the combined modality is freezed now, false if it isn't.
    */
   void SignalFreezed(bool);
 
 protected slots:
   void OnButtonClicked(bool checked);
   void OnFreezeButtonToggle();
 
 public:
   explicit QmitkUSNavigationFreezeButton(QWidget* parent = nullptr);
   ~QmitkUSNavigationFreezeButton() override;
 
   /**
    * \brief Setter for the combined modality to be freezed by this button.
    * An index may be specified for a tracking data output. The combined
    * modality will only be freezed then, if the current tracking data of
    * this output is valid.
    */
   void SetCombinedModality(mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality, int outputIndex = -1);
 
   /**
    * \brief Try to freeze the combined modality.
    * This does the same as clicking the button while the combined
    * modality isn't freezed. If the combined modality is already
    * freezed this method does nothing.
    */
   void Freeze();
 
   /**
    * \brief Unfreeze the combined modality.
    * This does the same as clicking the button while the combined
    * modality is freezed. If the combined modality isn't freezed
    * this method does nothing.
    */
   void Unfreeze();
 
 private:
   mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality;
   int                               m_OutputIndex;
   bool m_FreezeButtonToggle;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h
index 3e5910075a..07ce78de3f 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.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 QmitkUSNavigationZoneDistancesWidget_h
 #define QmitkUSNavigationZoneDistancesWidget_h
 
 #include <QWidget>
 
 #include "mitkNumericTypes.h"
 
 namespace itk {
   template<class T> class SmartPointer;
 }
 
 namespace mitk {
   class NavigationData;
   class DataNode;
 }
 
 class QmitkZoneProgressBar;
 
 /**
  * \brief Widget for showing distances to given zones using instances of QmitkZoneProgressBar.
  * The zones can be added by AddZone() and removed by ClearZones(). To update
  * the progress bars, UpdateDistancesToNeedlePosition() has to be called with
  * a navigation data.
  */
 class QmitkUSNavigationZoneDistancesWidget : public QWidget
 {
   Q_OBJECT
 
 signals:
-  /** \brief Emmited whenever a the distance to a zone falls below zero. */
+  /** \brief Emitted whenever a the distance to a zone falls below zero. */
   void SignalZoneViolated(const mitk::DataNode*, mitk::Point3D);
 
 public:
   explicit QmitkUSNavigationZoneDistancesWidget(QWidget *parent = nullptr);
   ~QmitkUSNavigationZoneDistancesWidget() override;
 
   /**
    * \brief Set the key for the data node float property holding the radius of a zone.
    * The default value of this attribute is "zone.size".
    */
   void SetSizePropertyKey(const std::string& sizePropertyKey);
 
   /** \brief Get the key for the data node float property holding the radius of a zone. */
   const std::string& GetSizePropertyKey() const;
 
   /** \brief Adds a zone to the widget. */
   void AddZone(itk::SmartPointer<mitk::DataNode> zoneNode);
 
   /** \brief Removes all zones from the widget. */
   void ClearZones();
 
   /** \brief Updates color and label of each zone distance bar according to the given needle position. */
   void UpdateDistancesToNeedlePosition(itk::SmartPointer<mitk::NavigationData> needle);
 
 protected:
   std::string                                     m_SizePropertyKey;
   QVector<itk::SmartPointer<mitk::DataNode> >     m_ZoneNodes;
   QVector<QmitkZoneProgressBar*>                  m_ZoneProgressBars;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
index b87de26d5b..1302e7dd96 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
@@ -1,150 +1,150 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #ifndef QmitkUSZoneManagementWidget_h
 #define QmitkUSZoneManagementWidget_h
 
 #include <QWidget>
 #include "mitkDataStorage.h"
 
 namespace itk {
 template<class T> class SmartPointer;
 }
 
 namespace mitk {
 class USZonesInteractor;
 }
 
 namespace Ui {
 class QmitkUSZoneManagementWidget;
 }
 
 class QmitkUSZonesDataModel;
 class QItemSelection;
 class QModelIndex;
 
 /**
  * \brief Shows a table of the zone nodes and allows to change properties and add and delete zone nodes.
  *
  * A data node interactor (mitk::USZonesInteractor) is used for creating new zone nodes and a QTableModel
  * (QmitkUSZonesDataModel) is used for handling the zones data.
  *
  * When using the widget, one has to call OnStartAddingZone() every time he wants the interaction for adding
  * new zone nodes to be active.
  */
 class QmitkUSZoneManagementWidget : public QWidget
 {
   Q_OBJECT
 
 signals:
   /**
-   * \brief Emmited whenever a new zone was added to the data model.
+   * \brief Emitted whenever a new zone was added to the data model.
    */
   void ZoneAdded();
 
   /**
-   * \brief Emmited whenever a new zone was removed from the data mode.
+   * \brief Emitted whenever a new zone was removed from the data mode.
    */
   void ZoneRemoved();
 
 public slots:
   /**
    * \brief Removes all rows from the data model which are selected in the table.
    */
   void RemoveSelectedRows();
 
   /**
    * \brief Creates a new zone node and activates the data interactor on this node.
    * This slot has to be called whenever a new zone should be added. Interactions are active
    * then, so the user can create the zone.
    */
   void OnStartAddingZone();
 
   /**
    * \brief Aborts the creation of a new zone and deletes the corresponding node.
    */
   void OnAbortAddingZone();
 
   /**
    * \brief Removes all nodes from the data model.
    */
   void OnResetZones();
 
 protected slots:
   void OnSelectionChanged(const QItemSelection& selected, const QItemSelection & deselected);
 
   /**
    * \brief Updates zone radius according to the value of the zone size slider.
    * \param value new radius of the zone
    */
   void OnZoneSizeSliderValueChanged(int value);
 
   /**
    * \brief Updates maximum number of added zones and selects the last row of the table.
    * It is called every time a row was added to the data model.
    */
   void OnRowInsertion(const QModelIndex& parent, int start, int end);
 
   /**
    * \brief Updates the zone size slider when data was changed.
    * It is called every time a row was changed in the data model.
    */
   void OnDataChanged(const QModelIndex& topLeft, const QModelIndex& /*bottomRight*/);
 
 public:
   explicit QmitkUSZoneManagementWidget(QWidget* parent = nullptr);
   ~QmitkUSZoneManagementWidget() override;
 
   /**
    * \brief Sets the state machine file for being used by the mitk::USZonesInteractor
    * \param filename name of the state machine file
    */
   void SetStateMachineFilename(const std::string& filename);
 
   /**
    * \brief Setter for the DataStorage where the zone nodes will be stored.
    * The nodes will be derivates of the node specified by the base node name.
    *
    * \param dataStorage data storage where the zone nodes will be stored
    * \param baseNodeName optional name of the node which will be the source node of all zone nodes (defaults "Zones")
    */
   void SetDataStorage(mitk::DataStorage::Pointer dataStorage, const char* baseNodeName = "Zones");
 
   /**
    * \brief Setter for the DataStorage where the zone nodes will be stored.
    * The nodes will be derivates of the base nodes.
    *
-   * \param dataStorage data storage where the zone nodes will be strored
+   * \param dataStorage data storage where the zone nodes will be stored
    * \param baseNode data node which will be the source node of all zone nodes
    */
   void SetDataStorage(mitk::DataStorage::Pointer dataStorage, itk::SmartPointer<mitk::DataNode> baseNode);
 
   /**
    * \brief Get all zone nodes from the data storage.
    */
   mitk::DataStorage::SetOfObjects::ConstPointer GetZoneNodes();
 
 protected:
   QmitkUSZonesDataModel*                      m_ZonesDataModel;
 
   itk::SmartPointer<mitk::USZonesInteractor>  m_Interactor;
   mitk::DataStorage::Pointer                  m_DataStorage;
   mitk::DataNode::Pointer                     m_BaseNode;
 
   std::string                                 m_StateMachineFileName;
 
 private:
   Ui::QmitkUSZoneManagementWidget* ui;
 
   unsigned int m_CurMaxNumOfZones;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h
index 7e965c790c..1a40b3f20d 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.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 QmitkZoneProgressBar_h
 #define QmitkZoneProgressBar_h
 
 #include <QProgressBar>
 
 /**
  * \brief QProgressBar for displaying distances to zones.
  * Colors are changed according to the distance to the zone and and the
  * progress will be filled more the smaller the distance to the zone
  * becomes.
  */
 class QmitkZoneProgressBar : public QProgressBar
 {
   Q_OBJECT
 public:
   /**
    * \brief Initializes the progress bar with the given name, max range and warn range.
    * The colors are set to default values (color: red, warn color: red, border
    * color: gray).
    *
    * \param name will be shown on the progress bar
    * \param maxRange the progress bar will be empty for distances greater or equal to this distance
-   * \param warnRange the progess bar will change its color for distances smaller than this distance
+   * \param warnRange the progress bar will change its color for distances smaller than this distance
    */
   explicit QmitkZoneProgressBar(QString name, int maxRange, int warnRange, QWidget *parent = nullptr);
 
   /**
    * @param value the current distance to the zone
    */
   void setValue(int value);
 
   /**
    * \brief Can be called to indicate that there is currently no valid distance value available.
    * E.g. if tracking data is not available at the moment. If there is a valid
    * value again, the method setValue() can be called.
    */
   void setValueInvalid();
 
   /**
    * \brief Setter for the text on the progress bar.
    * Defaults to the string given as name to the constructor. The format string
    * can contain '%1' which will be replaced by the current distance value.
    *
    * \param format the text to be displayed on the progress bar
    */
   void SetTextFormatValid(QString format);
 
   /**
    * \param format the text to be displayed when setValueInvalid() was called
    */
   void SetTextFormatInvalid(QString format);
 
   /**
    * \param color the color for the progress bar fill
    */
   void SetColor(float color[3]);
 
   /**
    * \param color the color, the progress bar fill changes to if the distance falls below the warn range
    */
   void SetWarnColor(float color[3]);
 
   /**
    * @param color the color for the border of the progress bar
    */
   void SetBorderColor(float color[3]);
 
 protected:
   void UpdateStyleSheet(QString startColor, QString stopColor);
 
   QString ColorToString(float color[3]);
 
   QString m_TextFormatValid;
   QString m_TextFormatInvalid;
 
   int     m_MaxRange;
   int     m_WarnRange;
 
   QString m_ColorString;
   QString m_WarnColorString;
   QString m_BorderColorString;
 
   QString m_StyleSheet;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.cpp b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.cpp
index b35d43278e..aa13133c00 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.cpp
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.cpp
@@ -1,146 +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.
 
 ============================================================================*/
 
 #include "mitkUSTargetPlacementQualityCalculator.h"
 
 #include "mitkDataNode.h"
 #include "mitkSurface.h"
 #include "mitkPointSet.h"
 
 #include <vtkSmartPointer.h>
 #include <vtkPolyData.h>
 #include <vtkTransformPolyDataFilter.h>
 #include <vtkCenterOfMass.h>
 #include <vtkMath.h>
 #include <vtkLinearTransform.h>
 
 mitk::USTargetPlacementQualityCalculator::USTargetPlacementQualityCalculator()
 : m_OptimalAngle(-1), m_CentersOfMassDistance(-1), m_MeanAngleDifference(-1)
 {
 }
 
 mitk::USTargetPlacementQualityCalculator::~USTargetPlacementQualityCalculator()
 {
 }
 
 void mitk::USTargetPlacementQualityCalculator::Update()
 {
   if ( m_OptimalAngle < 0 )
   {
     mitkThrow() << "Optimal angle must be set before call of update.";
   }
 
   if ( m_TargetPoints.IsNull() )
   {
     mitkThrow() << "Targets points must be set before call of update.";
   }
 
   vtkSmartPointer<vtkPolyData> targetSurface = this->GetTransformedPolydata();
 
   vtkSmartPointer<vtkCenterOfMass> centerOfMass = vtkSmartPointer<vtkCenterOfMass>::New();
   centerOfMass->SetUseScalarsAsWeights(false);
   centerOfMass->SetInputData(targetSurface);
   centerOfMass->Update();
 
   double targetCenter[3];
   centerOfMass->GetCenter(targetCenter);
 
   mitk::Point3D targetCenterPoint;
   targetCenterPoint[0] = targetCenter[0];
   targetCenterPoint[1] = targetCenter[1];
   targetCenterPoint[2] = targetCenter[2];
 
   MITK_INFO("QmitkUSAbstractNavigationStep")("QmitkUSNavigationStepPlacementPlanning")
     << "Center of mass of the target calculated as: " << targetCenterPoint;
 
   vtkSmartPointer<vtkPoints> plannedTargetsPoints = vtkSmartPointer<vtkPoints>::New();
   std::vector< itk::Vector<float, 3u> > targetsToCenterOfMassVectors;
 
   for ( mitk::PointSet::PointsConstIterator it = m_TargetPoints->Begin();
     it != m_TargetPoints->End(); ++it )
   {
     // insert all planned target points into a vtkPolyData for calculating
     // the center of mass afterwards
     //mitk::Point3D origin = it->GetData()->GetGeometry()->GetOrigin();
     mitk::Point3D origin = it->Value();
     plannedTargetsPoints->InsertNextPoint(origin[0], origin[1], origin[2]);
 
     // define normalised vectors from each planned target point to the center
     // of mass of the target structure
     itk::Vector<float, 3u> vector = targetCenterPoint - origin;
     vector.Normalize();
     targetsToCenterOfMassVectors.push_back(vector);
   }
 
   vtkSmartPointer<vtkPolyData> plannedTargetsPointSet = vtkSmartPointer<vtkPolyData>::New();
   plannedTargetsPointSet->SetPoints(plannedTargetsPoints);
 
   centerOfMass->SetInputData(plannedTargetsPointSet);
   centerOfMass->Update();
   double plannedCenter[3];
   centerOfMass->GetCenter(plannedCenter);
 
   mitk::Point3D plannedTargetsCenterPoint;
   plannedTargetsCenterPoint[0] = plannedCenter[0];
   plannedTargetsCenterPoint[1] = plannedCenter[1];
   plannedTargetsCenterPoint[2] = plannedCenter[2];
 
   MITK_INFO("QmitkUSAbstractNavigationStep")("QmitkUSNavigationStepPlacementPlanning")
-    << "Center of mass of the planned target points caclulated as: " << plannedTargetsCenterPoint;
+    << "Center of mass of the planned target points calculated as: " << plannedTargetsCenterPoint;
 
   m_CentersOfMassDistance = targetCenterPoint.EuclideanDistanceTo(plannedTargetsCenterPoint);
   MITK_INFO("QmitkUSAbstractNavigationStep")("QmitkUSNavigationStepPlacementPlanning")
     << "Distance between target center of mass and planned target points center of mass: " << m_CentersOfMassDistance;
 
   unsigned int numberOfAngles = targetsToCenterOfMassVectors.size() * (targetsToCenterOfMassVectors.size()-1) / 2;
 
   m_AngleDifferences.set_size(numberOfAngles);
   unsigned int n = 0;
 
   m_MeanAngleDifference = 0;
   for ( unsigned int i = 0; i < targetsToCenterOfMassVectors.size(); i++ )
   {
     for ( unsigned int j = i+1; j < targetsToCenterOfMassVectors.size(); j++ )
     {
       double angleDiff = acos ( targetsToCenterOfMassVectors.at(i) * targetsToCenterOfMassVectors.at(j) ) - m_OptimalAngle;
       if ( angleDiff < 0 ) { angleDiff = -angleDiff; }
 
       m_AngleDifferences.put(n++, angleDiff);
       m_MeanAngleDifference += angleDiff;
     }
   }
 
   m_MeanAngleDifference /= numberOfAngles; // calculate mean
   m_MeanAngleDifference = vtkMath::DegreesFromRadians(m_MeanAngleDifference);
 
   MITK_INFO("QmitkUSAbstractNavigationStep")("QmitkUSNavigationStepPlacementPlanning")
     << "Angles between the target points: " << m_AngleDifferences;
   MITK_INFO("QmitkUSAbstractNavigationStep")("QmitkUSNavigationStepPlacementPlanning")
     << "Mean difference of angles between the target points: " << m_MeanAngleDifference;
 }
 
 vtkSmartPointer<vtkPolyData> mitk::USTargetPlacementQualityCalculator::GetTransformedPolydata()
 {
   if ( m_TargetSurface.IsNull() || ! m_TargetSurface->GetVtkPolyData() )
   {
     mitkThrow() << "Target surface must not be null.";
   }
 
   // transform vtk polydata according to mitk geometry
   vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter =
     vtkSmartPointer<vtkTransformPolyDataFilter>::New();
   transformFilter->SetInputData(0, m_TargetSurface->GetVtkPolyData());
   transformFilter->SetTransform(m_TargetSurface->GetGeometry()->GetVtkTransform());
   transformFilter->Update();
 
   return transformFilter->GetOutput();
 }
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkIGTTutorial.dox b/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkIGTTutorial.dox
index 3ab99a43a9..53abfc7575 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkIGTTutorial.dox
+++ b/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkIGTTutorial.dox
@@ -1,92 +1,92 @@
 /**
 \page org_imageguidedtherapytutorial The MITK-IGT Tutorial View
 
 This view is not meant as an end-user module. It contains tutorial program code that explains how to use the MITK-IGT component.
 
 It contains only two buttons. The "Start image guided therapy" button will create a virtual tracking device and a virtual tool.
 It will move the tool around on random paths in a tracking volume of 200x200x200 mm. The tool is visualized with a cone.
 If you do not see a cone moving around, you will need to initialize the rendering views correctly. Use the DataManager view to perform
 a global reinit.
 
 The symbol of this view is the following:
 
 \imageMacro{icon_igt_simple_example.png,"",2}
 
 and the whole view looks like this:
 
 \imageMacro{IGTExampleIGT_QT_Tutorial_PluginView.png,"",2}
 
 In this tutorial we connect to the NDI Polaris tracking system (or alternatively use a virtual tracking device) and we will show the movement of a tool as cone in the StdMultiWidget editor.
 
 First of all, you will have to add an IGT dependency to your cmake list. For this example, MitkIGTUI would be sufficient, but as the plugin contains several views, we have additional OpenIGTLink and US dependencies:
 
 \code{.cpp}
 
     project(org_mitk_gui_qt_igtexamples)
 
     mitk_create_plugin(
         EXPORT_DIRECTIVE IGTEXAMPLES_EXPORT
         EXPORTED_INCLUDE_SUFFIXES src
         MODULE_DEPENDS MitkQtWidgetsExt MitkIGT MitkIGTUI MitkOpenIGTLink MitkOpenIGTLinkUI MitkUS
     )
 \endcode
 
 When clicking the start button, a cone should move in the 3D view and stop after clicking the stop button.
 
-The view has several fuctions. Most of them deal with the basic functionality with the plugin (e.g. CreateQTPartControl or CreateConnections). For a deeper understanding, you might have a look at the files QmitkIGTTutorialView.cpp and QmitkIGTTutorialView.h
+The view has several functions. Most of them deal with the basic functionality with the plugin (e.g. CreateQTPartControl or CreateConnections). For a deeper understanding, you might have a look at the files QmitkIGTTutorialView.cpp and QmitkIGTTutorialView.h
 For our IGT functionality, the following functions are important:
 \li OnStartIGT: Starts the navigation pipeline
 \li OnStopIGT: Disconnect the pipeline
 \li OnTimer: Updates the view
 
 Let's now have a deeper look at these functions.
 
 \section OnStartIGT OnStartIGT
 
 \snippet QmitkIGTTutorialView.cpp OnStart 1
 
-We first check in a try environment, if we should use an NDI tracking device or a virtual device. Let's start with NDI, we hardcode the parameters here and give out a warning. In your propper application, the parameters should be set via the gui aswell (see \ref org_mitk_views_igttrackingtoolbox ), but for simplicity, we just set hardcoded parameters here. If you want to try it with your own NDI device, you need to adapt these parameters here in the code:
+We first check in a try environment, if we should use an NDI tracking device or a virtual device. Let's start with NDI, we hardcode the parameters here and give out a warning. In your proper application, the parameters should be set via the gui aswell (see \ref org_mitk_views_igttrackingtoolbox ), but for simplicity, we just set hardcoded parameters here. If you want to try it with your own NDI device, you need to adapt these parameters here in the code:
 
 \snippet QmitkIGTTutorialView.cpp OnStart 2
 
 The tracking device has to be set to a source. For more information on the tracking pipeline, please have a look at the \ref IGTTutorialStepFilterPipeline.
 
 \snippet QmitkIGTTutorialView.cpp OnStart 3
 
 Alternatively, we can setup a virtual tracking device. We create this device, set the bounds, add a tool and connect it to the source:
 
 \snippet QmitkIGTTutorialView.cpp OnStart 4
 
 Now we need to connect the tracking system
 
 \snippet QmitkIGTTutorialView.cpp OnStart 5
 
 For the visualisation, we need an object. Here, we create a red cone
 
 \snippet QmitkIGTTutorialView.cpp OnStart 6
 
 The visualization filter will actually render the cone
 \snippet QmitkIGTTutorialView.cpp OnStart 7
 
 For a continuous display, we need to call update, here we decide to do it every 100 ms using a timer.
 \snippet QmitkIGTTutorialView.cpp OnStart 8
 
 Disable the selection of tracking devices during tracking:
 \snippet QmitkIGTTutorialView.cpp OnStart 8a
 
-For propper coding, you should always catch the exceptions:
+For proper coding, you should always catch the exceptions:
 \snippet QmitkIGTTutorialView.cpp OnStart 9
 
 \section OnTimer OnTimer
 
 Each time, the timer is updated, the following code is executed:
 \snippet QmitkIGTTutorialView.cpp OnTimer
 
 \section OnStopIGT OnStopIGT
 This function will stop the pipeline and clean up everything:
 \snippet QmitkIGTTutorialView.cpp OnStop
 
 You now have a very simple plugin, which creates an own tracking device and starts or stops tracking. Of course, for your more advanced project, you could implement a new tracking device to be available in every plugin (see \ref IGTHowToImplementATrackingDevice ) or use already implemented tracking devices via the tracking toolbox and/or microservices. This small example should just show you the most simple way to start tracking.
 
 Return to the \ref IGTTutorialOverview "[IGT Tutorial Overview]"
 */
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkOpenIGTLinkExample.dox b/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkOpenIGTLinkExample.dox
index 76addade04..b0f9435159 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkOpenIGTLinkExample.dox
+++ b/Plugins/org.mitk.gui.qt.igtexamples/documentation/UserManual/QmitkOpenIGTLinkExample.dox
@@ -1,6 +1,6 @@
 /**
 \page org_openigtlinkexample OpenIGTLink client example
 
-A simple OpenIGTLink client that can stream and visualize tracking data from an OpenIGTLink server. This server can be another MITK intances, e.g., running the OpenIGTLink provider example or any other OpenIGTLink server such as a PLUS server.
+A simple OpenIGTLink client that can stream and visualize tracking data from an OpenIGTLink server. This server can be another MITK instances, e.g., running the OpenIGTLink provider example or any other OpenIGTLink server such as a PLUS server.
 
 */
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.cpp b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.cpp
index f108526e35..aed6e67a60 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.cpp
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.cpp
@@ -1,728 +1,728 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Qmitk
 #include "QmitkIGTTrackingLabView.h"
 
 #include <QmitkRenderWindow.h>
 #include <QmitkNDIConfigurationWidget.h>
 #include <QmitkFiducialRegistrationWidget.h>
 #include <QmitkUpdateTimerWidget.h>
 #include <QmitkToolSelectionWidget.h>
 #include <QmitkToolTrackingStatusWidget.h>
 #include <mitkStaticIGTHelperFunctions.h>
 
 #include <mitkIGTException.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <itkVector.h>
 
 #include <vtkTransform.h>
 #include <vtkTransformPolyDataFilter.h>
 #include <vtkAppendPolyData.h>
 #include <vtkPoints.h>
 
 // Qt
 #include <QMessageBox>
 #include <QIcon>
 #include <QPushButton>
 
 // vtk
 #include <mitkVtkResliceInterpolationProperty.h>
 
 
 const std::string QmitkIGTTrackingLabView::VIEW_ID = "org.mitk.views.igttrackinglab";
 
 QmitkIGTTrackingLabView::QmitkIGTTrackingLabView()
 : QmitkAbstractView()
 ,m_Source(nullptr)
 ,m_PermanentRegistrationFilter(nullptr)
 ,m_Visualizer(nullptr)
 ,m_VirtualView(nullptr)
 ,m_PSRecordingPointSet(nullptr)
 ,m_PointSetRecording(false)
 ,m_PermanentRegistration(false)
 ,m_CameraView(false)
 ,m_ImageFiducialsDataNode(nullptr)
 ,m_TrackerFiducialsDataNode(nullptr)
 ,m_PermanentRegistrationSourcePoints(nullptr)
 {
 }
 
 //###############################################################################################
 //###############################################################################################
 //############################## Timer method for IGT pipeline updating #########################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::UpdateTimer()
 {
   if (m_PermanentRegistration && m_PermanentRegistrationFilter.IsNotNull())
   {
     if(IsTransformDifferenceHigh(m_ObjectmarkerNavigationData, m_ObjectmarkerNavigationDataLastUpdate))
     {
       m_ObjectmarkerNavigationDataLastUpdate->Graft(m_ObjectmarkerNavigationData);
       m_PermanentRegistrationFilter->Update();
     }
   }
 
   if (m_CameraView && m_VirtualView.IsNotNull()) {m_VirtualView->Update();}
 
   if(m_PointSetRecording && m_PSRecordingPointSet.IsNotNull())
     {
       int size = m_PSRecordingPointSet->GetSize();
       mitk::NavigationData::Pointer nd = m_PointSetRecordingNavigationData;
 
       if(size > 0)
       {
         mitk::Point3D p = m_PSRecordingPointSet->GetPoint(size-1);
         if(p.EuclideanDistanceTo(nd->GetPosition()) > (double) m_Controls.m_PSRecordingSpinBox->value())
           m_PSRecordingPointSet->InsertPoint(size, nd->GetPosition());
       }
       else
         m_PSRecordingPointSet->InsertPoint(size, nd->GetPosition());
     }
   }
 
 //###############################################################################################
 //###############################################################################################
 //############################## Slots of CONFIGURATION step ####################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::OnSetupNavigation()
 {
   if(m_Source.IsNotNull())
     if(m_Source->IsTracking())
       return;
 
   mitk::DataStorage* ds = this->GetDataStorage();
 
   if(ds == nullptr)
   {
     MITK_WARN << "IGTSurfaceTracker: Error. Cannot access DataStorage. Navigation not possible";
     return;
   }
 
   //Building up the filter pipeline
   try
   {
     this->InitializeRegistration();
   }
   catch(mitk::IGTException& e)
   {
     MITK_WARN << "Error while building the IGT-Pipeline: " << e.GetDescription();
     this->DestroyIGTPipeline(); // destroy the pipeline if building is incomplete
     return;
   }
   catch(...)
   {
     MITK_WARN << "Unexpected error while building the IGT-Pipeline";
     this->DestroyIGTPipeline();
     return;
   }
 }
 
 void QmitkIGTTrackingLabView::OnInstrumentSelected()
 {
   if (m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedNavigationDataSource().IsNotNull())
     {
     m_InstrumentNavigationData = m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedToolID());
     }
   else
     {
     m_Controls.m_PointerNameLabel->setText("<not available>");
     return;
     }
 
   if (m_InstrumentNavigationData.IsNotNull())
     {
     m_Controls.m_PointerNameLabel->setText(m_InstrumentNavigationData->GetName());
     }
   else
     {
     m_Controls.m_PointerNameLabel->setText("<not available>");
     }
 }
 
 void QmitkIGTTrackingLabView::OnObjectmarkerSelected()
 {
   if (m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedNavigationDataSource().IsNotNull())
     {
     m_ObjectmarkerNavigationData = m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_Controls.m_TrackingDeviceSelectionWidget->GetSelectedToolID());
     MITK_INFO << "Objectmarker rotation: " << m_ObjectmarkerNavigationData->GetOrientation();
     }
   else
     {
     m_Controls.m_ObjectmarkerNameLabel->setText("<not available>");
     return;
     }
 
   if (m_ObjectmarkerNavigationData.IsNotNull())
     {
     m_Controls.m_ObjectmarkerNameLabel->setText(m_ObjectmarkerNavigationData->GetName());
     }
   else
     {
     m_Controls.m_ObjectmarkerNameLabel->setText("<not available>");
     }
 }
 
 //###############################################################################################
 //###############################################################################################
 //####################### Slots of INITIAL REGISTRATION step ####################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::OnInitialRegistration()
 {
   //Check for initialization
   if (!CheckRegistrationInitialization()) return;
 
   mitk::PointSet::Pointer imageFiducials = dynamic_cast<mitk::PointSet*>(m_ImageFiducialsDataNode->GetData());
   mitk::PointSet::Pointer trackerFiducials = dynamic_cast<mitk::PointSet*>(m_TrackerFiducialsDataNode->GetData());
 
   //############### conversion to vtk data types (we will use the vtk landmark based transform) ##########################
   //convert point sets to vtk poly data
   vtkSmartPointer<vtkPoints> sourcePoints = vtkSmartPointer<vtkPoints>::New();
   vtkSmartPointer<vtkPoints> targetPoints = vtkSmartPointer<vtkPoints>::New();
   for (int i=0; i<imageFiducials->GetSize(); i++)
     {
     double point[3] = {imageFiducials->GetPoint(i)[0],imageFiducials->GetPoint(i)[1],imageFiducials->GetPoint(i)[2]};
     sourcePoints->InsertNextPoint(point);
     double point_targets[3] = {trackerFiducials->GetPoint(i)[0],trackerFiducials->GetPoint(i)[1],trackerFiducials->GetPoint(i)[2]};
     targetPoints->InsertNextPoint(point_targets);
     }
 
   //########################### here, the actual transform is computed ##########################
   //compute transform
   vtkSmartPointer<vtkLandmarkTransform> transform = vtkSmartPointer<vtkLandmarkTransform>::New();
   transform->SetSourceLandmarks(sourcePoints);
   transform->SetTargetLandmarks(targetPoints);
   transform->SetModeToRigidBody();
   transform->Modified();
   transform->Update();
   //compute FRE of transform
   double FRE = mitk::StaticIGTHelperFunctions::ComputeFRE(imageFiducials, trackerFiducials, transform);
   m_Controls.m_RegistrationWidget->SetQualityDisplayText("FRE: " + QString::number(FRE) + " mm");
   //#############################################################################################
 
   //############### conversion back to itk/mitk data types ##########################
   //convert from vtk to itk data types
   itk::Matrix<float,3,3> rotationFloat = itk::Matrix<float,3,3>();
   itk::Vector<float,3> translationFloat = itk::Vector<float,3>();
   itk::Matrix<double,3,3> rotationDouble = itk::Matrix<double,3,3>();
   itk::Vector<double,3> translationDouble = itk::Vector<double,3>();
 
   vtkSmartPointer<vtkMatrix4x4> m = transform->GetMatrix();
   for(int k=0; k<3; k++) for(int l=0; l<3; l++)
   {
     rotationFloat[k][l] = m->GetElement(k,l);
     rotationDouble[k][l] = m->GetElement(k,l);
 
   }
   for(int k=0; k<3; k++)
   {
     translationFloat[k] = m->GetElement(k,3);
     translationDouble[k] = m->GetElement(k,3);
   }
   //create affine transform 3D surface
   mitk::AffineTransform3D::Pointer mitkTransform = mitk::AffineTransform3D::New();
   mitkTransform->SetMatrix(rotationDouble);
   mitkTransform->SetOffset(translationDouble);
   //#############################################################################################
 
   //############### object is transformed ##########################
   //save transform
   m_T_ObjectReg = mitk::NavigationData::New(mitkTransform); // this is stored in a member because it is needed for permanent registration later on
 
   //transform surface
   if(m_Controls.m_SurfaceActive->isChecked() && m_Controls.m_ObjectComboBox->GetSelectedNode().IsNotNull())
   {
     m_Controls.m_ObjectComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(mitkTransform);
   }
   //################################################################
 
   //############### if activated: ct image is also transformed ##########################
   //transform ct image
   //todo: Explain that AffineTransform3D is used, because NavigationData does not support spacing!
   if(m_Controls.m_ImageActive->isChecked() && m_Controls.m_ImageComboBox->GetSelectedNode().IsNotNull())
   {
     //first we have to store the original ct image transform to compose it with the new transform later
     mitk::AffineTransform3D::Pointer imageTransform = m_Controls.m_ImageComboBox->GetSelectedNode()->GetData()->GetGeometry()->GetIndexToWorldTransform();
     m_T_ImageGeo = mitk::AffineTransform3D::New(); // this is also stored in a member because it is needed for permanent registration later on
     //now the new transform of the ct image is computed
     m_T_ImageGeo->Compose(imageTransform);
     imageTransform->Compose(mitkTransform);
     mitk::AffineTransform3D::Pointer newImageTransform = mitk::AffineTransform3D::New(); //create new image transform... setting the composed directly leads to an error
     itk::Matrix<mitk::ScalarType,3,3> rotationFloatNew = imageTransform->GetMatrix();
     itk::Vector<mitk::ScalarType,3> translationFloatNew = imageTransform->GetOffset();
     newImageTransform->SetMatrix(rotationFloatNew);
     newImageTransform->SetOffset(translationFloatNew);
     m_Controls.m_ImageComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(newImageTransform);
     m_T_ImageReg = m_Controls.m_ImageComboBox->GetSelectedNode()->GetData()->GetGeometry()->GetIndexToWorldTransform();
   }
   //################################################################
 
 }
 
 
 void QmitkIGTTrackingLabView::OnAddRegistrationTrackingFiducial()
 {
   mitk::NavigationData::Pointer nd = m_InstrumentNavigationData;
 
   if( nd.IsNull() || !nd->IsDataValid())
   {
     QMessageBox::warning( nullptr, "Invalid tracking data", "Navigation data is not available or invalid!", QMessageBox::Ok );
     return;
   }
 
   if(m_TrackerFiducialsDataNode.IsNotNull() && m_TrackerFiducialsDataNode->GetData() != nullptr)
   {
     mitk::PointSet::Pointer ps = dynamic_cast<mitk::PointSet*>(m_TrackerFiducialsDataNode->GetData());
     ps->InsertPoint(ps->GetSize(), nd->GetPosition());
   }
   else
     QMessageBox::warning(nullptr, "IGTSurfaceTracker: Error", "Can not access Tracker Fiducials. Adding fiducial not possible!");
 }
 
 
 void QmitkIGTTrackingLabView::InitializeRegistration()
 {
   mitk::DataStorage* ds = this->GetDataStorage();
   if( ds == nullptr )
     return;
 
   // let the registration widget know about the slice navigation controllers
   // in the active render window part (crosshair updates)
   foreach(QmitkRenderWindow* renderWindow, this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetQmitkRenderWindows().values())
   {
     m_Controls.m_RegistrationWidget->AddSliceNavigationController(renderWindow->GetSliceNavigationController());
   }
 
   if(m_ImageFiducialsDataNode.IsNull())
   {
     m_ImageFiducialsDataNode = mitk::DataNode::New();
     mitk::PointSet::Pointer ifPS = mitk::PointSet::New();
 
     m_ImageFiducialsDataNode->SetData(ifPS);
 
     mitk::Color color;
     color.Set(1.0f, 0.0f, 0.0f);
     m_ImageFiducialsDataNode->SetName("Image Fiducials");
     m_ImageFiducialsDataNode->SetColor(color);
     m_ImageFiducialsDataNode->SetBoolProperty( "updateDataOnRender", false );
 
     ds->Add(m_ImageFiducialsDataNode);
   }
   m_Controls.m_RegistrationWidget->SetImageFiducialsNode(m_ImageFiducialsDataNode);
 
   if(m_TrackerFiducialsDataNode.IsNull())
   {
     m_TrackerFiducialsDataNode = mitk::DataNode::New();
     mitk::PointSet::Pointer tfPS = mitk::PointSet::New();
     m_TrackerFiducialsDataNode->SetData(tfPS);
 
     mitk::Color color;
     color.Set(0.0f, 1.0f, 0.0f);
     m_TrackerFiducialsDataNode->SetName("Tracking Fiducials");
     m_TrackerFiducialsDataNode->SetColor(color);
     m_TrackerFiducialsDataNode->SetBoolProperty( "updateDataOnRender", false );
 
     ds->Add(m_TrackerFiducialsDataNode);
   }
 
   m_Controls.m_RegistrationWidget->SetTrackerFiducialsNode(m_TrackerFiducialsDataNode);
 }
 
 //###############################################################################################
 //###############################################################################################
 //####################### Slots of PERMANENT REGISTRATION step ##################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::OnPermanentRegistration(bool on)
 {
   if(on)
     {
     //######################################################################
-    //######################## inititalization #############################
+    //######################## initialization ##############################
     //######################################################################
 
     //some initial checks
     if(!CheckRegistrationInitialization())
     {
       m_Controls.m_UsePermanentRegistrationToggle->setChecked(false);
       return;
     }
 
     //remember initial object transform to calculate the object to marker transform later on and convert it to navigation data
     mitk::AffineTransform3D::Pointer transform = this->m_Controls.m_ObjectComboBox->GetSelectedNode()->GetData()->GetGeometry()->GetIndexToWorldTransform();
     mitk::NavigationData::Pointer T_Object = mitk::NavigationData::New(transform,false); //TODO: catch exception during conversion?
 
     //then reset the transform because we will now start to calculate the permanent registration
     this->m_Controls.m_ObjectComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIdentity();
     if(m_Controls.m_ImageActive->isChecked()) {this->m_Controls.m_ImageComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(m_T_ImageGeo);}
 
     //create the permanent registration filter
     m_PermanentRegistrationFilter = mitk::NavigationDataObjectVisualizationFilter::New();
 
     //######################################################################
     //first: initialize permanent registration of surface (always activated)
     //######################################################################
 
     //connect filter to source
     m_PermanentRegistrationFilter->SetInput(0,this->m_ObjectmarkerNavigationData);
 
     //set representation object
     m_PermanentRegistrationFilter->SetRepresentationObject(0,this->m_Controls.m_ObjectComboBox->GetSelectedNode()->GetData());
 
     //get the marker transform out of the navigation data
     mitk::NavigationData::Pointer T_Marker = m_ObjectmarkerNavigationData;
 
     //compute transform from object to marker (T_MarkerRel = T_Object * T_Marker^-1)
     mitk::NavigationData::Pointer T_MarkerRel = mitk::NavigationData::New();
     T_MarkerRel->Compose(T_Object);
     T_MarkerRel->Compose(T_Marker->GetInverse());
     m_T_MarkerRel = T_MarkerRel;
     m_PermanentRegistrationFilter->SetOffset(0,m_T_MarkerRel->GetAffineTransform3D());
 
     //######################################################################
     //second: initialize permanent registration of image (if activated)
     //######################################################################
     if (m_Controls.m_ImageActive->isChecked() && (m_Controls.m_ImageComboBox->GetSelectedNode().IsNotNull()))
       {
       mitk::DataNode::Pointer imageNode = this->m_Controls.m_ImageComboBox->GetSelectedNode();
       imageNode->AddProperty( "reslice interpolation", mitk::VtkResliceInterpolationProperty::New(VTK_RESLICE_LINEAR) );
       m_PermanentRegistrationFilter->SetInput(1,this->m_ObjectmarkerNavigationData);
       m_PermanentRegistrationFilter->SetRepresentationObject(1,imageNode->GetData());
 
       //for the image we can't use NavigationData objects as transforms because an image needs additional geometry information, e.g., spacing
       //thus we use mitk::AffineTransform3D objects
 
       //computer transform from image to marker (T_ImageRel = T_ImageGeo * T_MarkerRel)
       mitk::AffineTransform3D::Pointer T_ImageRel = mitk::AffineTransform3D::New();
       T_ImageRel->SetIdentity();
       T_ImageRel->Compose(m_T_ImageGeo);
       T_ImageRel->Compose(m_T_MarkerRel->GetAffineTransform3D());
       m_PermanentRegistrationFilter->SetOffset(1,T_ImageRel);
       }
 
     //some general stuff
     m_PermanentRegistration = true;
     m_ObjectmarkerNavigationDataLastUpdate = mitk::NavigationData::New();
     }
   else //if off = disable the permanent registration
     {
     //stop permanent registration
     m_PermanentRegistration = false;
 
     //restore old registration
     if(m_T_ObjectReg.IsNotNull()) {this->m_Controls.m_ObjectComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(m_T_ObjectReg->GetAffineTransform3D());}
     if(m_T_ImageReg.IsNotNull()) {this->m_Controls.m_ImageComboBox->GetSelectedNode()->GetData()->GetGeometry()->SetIndexToWorldTransform(m_T_ImageReg);}
 
     //delete filter
     m_PermanentRegistrationFilter = nullptr;
     }
 }
 
 //###############################################################################################
 //###############################################################################################
 //####################### Slots of POINT SET RECORDING step #####################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::OnPointSetRecording(bool record)
 {
   mitk::DataStorage* ds = this->GetDataStorage();
 
   if(record)
   {
     if (m_Controls.m_PointSetRecordingToolSelectionWidget->GetSelectedToolID() == -1)
       {
       QMessageBox::warning(nullptr, "Error", "No tool selected for point set recording!");
       m_Controls.m_PointSetRecordCheckBox->setChecked(false);
       return;
       }
     m_PointSetRecordingNavigationData = m_Controls.m_PointSetRecordingToolSelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_Controls.m_PointSetRecordingToolSelectionWidget->GetSelectedToolID());
 
     //initialize point set
     mitk::DataNode::Pointer psRecND = ds->GetNamedNode("Recorded Points");
     if(m_PSRecordingPointSet.IsNull() || psRecND.IsNull())
     {
       m_PSRecordingPointSet = nullptr;
       m_PSRecordingPointSet = mitk::PointSet::New();
       mitk::DataNode::Pointer dn = mitk::DataNode::New();
       dn->SetName("Recorded Points");
       dn->SetColor(0.,1.,0.);
       dn->SetData(m_PSRecordingPointSet);
       ds->Add(dn);
     }
     else
     {
       m_PSRecordingPointSet->Clear();
     }
     m_PointSetRecording = true;
   }
 
   else
   {
     m_PointSetRecording = false;
   }
 }
 
 //###############################################################################################
 //###############################################################################################
 //####################### Slots of VIRTUAL CAMERA VIEW step #####################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::OnVirtualCamera(bool on)
 {
 if (m_Controls.m_CameraViewSelection->GetSelectedToolID() == -1)
     {
     m_Controls.m_ActivateNeedleView->setChecked(false);
     QMessageBox::warning(nullptr, "Error", "No tool selected for camera view!");
     return;
     }
 
 if(on)
   {
   m_VirtualView = mitk::CameraVisualization::New();
   m_VirtualView->SetInput(m_Controls.m_CameraViewSelection->GetSelectedNavigationDataSource()->GetOutput(m_Controls.m_CameraViewSelection->GetSelectedToolID()));
 
   mitk::Vector3D viewDirection;
   viewDirection[0] = (int)(m_Controls.m_NeedleViewX->isChecked());
   viewDirection[1] = (int)(m_Controls.m_NeedleViewY->isChecked());
   viewDirection[2] = (int)(m_Controls.m_NeedleViewZ->isChecked());
   if (m_Controls.m_NeedleViewInvert->isChecked()) viewDirection *= -1;
   m_VirtualView->SetDirectionOfProjectionInToolCoordinates(viewDirection);
 
   mitk::Vector3D viewUpVector;
   viewUpVector[0] = (int)(m_Controls.m_NeedleUpX->isChecked());
   viewUpVector[1] = (int)(m_Controls.m_NeedleUpY->isChecked());
   viewUpVector[2] = (int)(m_Controls.m_NeedleUpZ->isChecked());
   if (m_Controls.m_NeedleUpInvert->isChecked()) viewUpVector *= -1;
   m_VirtualView->SetViewUpInToolCoordinates(viewUpVector);
 
   m_VirtualView->SetRenderer(this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetQmitkRenderWindow("3d")->GetRenderer());
   //next line: better code when this plugin is migrated to mitk::abstractview
   //m_VirtualView->SetRenderer(mitk::BaseRenderer::GetInstance(this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetRenderWindow("3d")->GetRenderWindow()));
   m_CameraView = true;
 
   //make pointer itself invisible
   m_Controls.m_CameraViewSelection->GetSelectedNavigationTool()->GetDataNode()->SetBoolProperty("visible",false);
 
   //disable UI elements
   m_Controls.m_ViewDirectionBox->setEnabled(false);
   m_Controls.m_ViewUpBox->setEnabled(false);
   }
 else
   {
   m_VirtualView = nullptr;
   m_CameraView = false;
   m_Controls.m_CameraViewSelection->GetSelectedNavigationTool()->GetDataNode()->SetBoolProperty("visible",true);
 
   m_Controls.m_ViewDirectionBox->setEnabled(true);
   m_Controls.m_ViewUpBox->setEnabled(true);
   }
 
 }
 
 //###############################################################################################
 //###############################################################################################
 //############################## some general UI methods, always needed #########################
 //###############################################################################################
 //###############################################################################################
 
 QmitkIGTTrackingLabView::~QmitkIGTTrackingLabView()
 {
   if (m_Timer->isActive()) m_Timer->stop();
 }
 
 void QmitkIGTTrackingLabView::CreateQtPartControl( QWidget *parent )
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi( parent );
   this->CreateBundleWidgets();
   this->CreateConnections();
 }
 
 
 void QmitkIGTTrackingLabView::CreateBundleWidgets()
 {
   //initialize registration widget
   m_Controls.m_RegistrationWidget->HideStaticRegistrationRadioButton(true);
   m_Controls.m_RegistrationWidget->HideContinousRegistrationRadioButton(true);
   m_Controls.m_RegistrationWidget->HideUseICPRegistrationCheckbox(true);
 }
 
 
 void QmitkIGTTrackingLabView::CreateConnections()
 {
   //initialize timer
   m_Timer = new QTimer(this);
 
   //create connections
   connect(m_Timer, SIGNAL(timeout()), this, SLOT(UpdateTimer()));
   connect( m_Controls.m_UsePermanentRegistrationToggle, SIGNAL(toggled(bool)), this, SLOT(OnPermanentRegistration(bool)) );
   connect( m_Controls.m_TrackingDeviceSelectionWidget, SIGNAL(NavigationDataSourceSelected(mitk::NavigationDataSource::Pointer)), this, SLOT(OnSetupNavigation()) );
   connect( m_Controls.m_UseAsPointerButton, SIGNAL(clicked()), this, SLOT(OnInstrumentSelected()) );
   connect( m_Controls.m_UseAsObjectmarkerButton, SIGNAL(clicked()), this, SLOT(OnObjectmarkerSelected()) );
   connect( m_Controls.m_RegistrationWidget, SIGNAL(AddedTrackingFiducial()), this, SLOT(OnAddRegistrationTrackingFiducial()) );
   connect( m_Controls.m_RegistrationWidget, SIGNAL(PerformFiducialRegistration()), this, SLOT(OnInitialRegistration()) );
   connect( m_Controls.m_PointSetRecordCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPointSetRecording(bool)) );
   connect( m_Controls.m_ActivateNeedleView, SIGNAL(toggled(bool)), this, SLOT(OnVirtualCamera(bool)) );
 
   //start timer
   m_Timer->start(30);
 
   //initialize Combo Boxes
   m_Controls.m_ObjectComboBox->SetDataStorage(this->GetDataStorage());
   m_Controls.m_ObjectComboBox->SetAutoSelectNewItems(false);
   m_Controls.m_ObjectComboBox->SetPredicate(mitk::NodePredicateDataType::New("Surface"));
 
   m_Controls.m_ImageComboBox->SetDataStorage(this->GetDataStorage());
   m_Controls.m_ImageComboBox->SetAutoSelectNewItems(false);
   m_Controls.m_ImageComboBox->SetPredicate(mitk::NodePredicateDataType::New("Image"));
 }
 
 void QmitkIGTTrackingLabView::SetFocus()
 {
   m_Controls.m_UseAsPointerButton->setFocus();
 }
 
 //###############################################################################################
 //###############################################################################################
 //####################### some additional slots and help methods ################################
 //####################### for cleaner code - not that important  ################################
 //####################### to understand the basic functions      ################################
 //###############################################################################################
 //###############################################################################################
 
 void QmitkIGTTrackingLabView::DestroyIGTPipeline()
 {
   if(m_Source.IsNotNull())
   {
     m_Source->StopTracking();
     m_Source->Disconnect();
     m_Source = nullptr;
   }
   m_PermanentRegistrationFilter = nullptr;
   m_Visualizer = nullptr;
   m_VirtualView = nullptr;
 }
 
 bool QmitkIGTTrackingLabView::CheckRegistrationInitialization()
 {
   // a couple of variables which we need in this method
   std::string warningMessage = "";
   bool initializationErrorDetected = false;
   mitk::PointSet::Pointer imageFiducials,trackerFiducials;
 
   // check some initialization stuff
   if (m_ImageFiducialsDataNode.IsNull() || m_TrackerFiducialsDataNode.IsNull())
   {
     warningMessage = "Initialization not finished!";
     MITK_WARN << warningMessage;
     QMessageBox::warning(nullptr, "Registration not possible", warningMessage.c_str());
     return false;
   }
   else
   {
     imageFiducials = dynamic_cast<mitk::PointSet*>(m_ImageFiducialsDataNode->GetData());
     trackerFiducials = dynamic_cast<mitk::PointSet*>(m_TrackerFiducialsDataNode->GetData());
   }
 
   // now, do a lot of other checks...
   if (m_Controls.m_SurfaceActive->isChecked() && m_Controls.m_ObjectComboBox->GetSelectedNode().IsNull())
   {
     warningMessage = "No surface selected for registration.\nRegistration is not possible";
     initializationErrorDetected = true;
   }
   else if (m_Controls.m_ImageActive->isChecked() && m_Controls.m_ImageComboBox->GetSelectedNode().IsNull())
   {
     warningMessage = "No image selected for registration.\nRegistration is not possible";
     initializationErrorDetected = true;
   }
   else if (imageFiducials.IsNull() || trackerFiducials.IsNull())
   {
    warningMessage = "Fiducial data objects not found. \n"
       "Please set 3 or more fiducials in the image and with the tracking system.\n\n"
       "Registration is not possible";
     initializationErrorDetected = true;
   }
   else if ((imageFiducials->GetSize() < 3) || (trackerFiducials->GetSize() < 3) || (imageFiducials->GetSize() != trackerFiducials->GetSize()))
   {
     warningMessage = "Not enough fiducial pairs found. At least 3 fiducial must exist for the image and the tracking system respectively.";
     initializationErrorDetected = true;
   }
 
-  // finaly: if an err was detected, give a warning and an error popup, then return false
+  // finally: if an err was detected, give a warning and an error popup, then return false
   if(initializationErrorDetected)
   {
     MITK_WARN << warningMessage;
     QMessageBox::warning(nullptr, "Registration not possible", warningMessage.c_str());
     return false;
   }
   //if no error was detected simply return true
   else {return true;}
 
 }
 
 bool QmitkIGTTrackingLabView::IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold, double angularDifferenceThreshold)
 {
   if(transformA.IsNull() || transformA.IsNull())
     {return false;}
   mitk::Point3D posA,posB;
   posA = transformA->GetPosition();
   posB = transformB->GetPosition();
 
 
   if(posA.EuclideanDistanceTo(posB) > euclideanDistanceThreshold)
     {return true;}
 
   double returnValue;
   mitk::Quaternion rotA,rotB;
   rotA = transformA->GetOrientation();
   rotB = transformB->GetOrientation();
 
   itk::Vector<double,3> point; //caution 5D-Tools: Vector must lie in the YZ-plane for a correct result.
   point[0] = 0.0;
   point[1] = 0.0;
   point[2] = 100000.0;
 
   rotA.normalize();
   rotB.normalize();
 
   itk::Matrix<double,3,3> rotMatrixA;
   for(int i=0; i<3; i++) for(int j=0; j<3; j++) rotMatrixA[i][j] = rotA.rotation_matrix_transpose().transpose()[i][j];
 
   itk::Matrix<double,3,3> rotMatrixB;
   for(int i=0; i<3; i++) for(int j=0; j<3; j++) rotMatrixB[i][j] = rotB.rotation_matrix_transpose().transpose()[i][j];
 
   itk::Vector<double,3> pt1 = rotMatrixA * point;
   itk::Vector<double,3> pt2 = rotMatrixB * point;
 
   returnValue = (pt1[0]*pt2[0]+pt1[1]*pt2[1]+pt1[2]*pt2[2]) / ( sqrt(pow(pt1[0],2.0)+pow(pt1[1],2.0)+pow(pt1[2],2.0)) * sqrt(pow(pt2[0],2.0)+pow(pt2[1],2.0)+pow(pt2[2],2.0)));
   returnValue = acos(returnValue);
 
   if(returnValue*57.3 > angularDifferenceThreshold){return true;}
 
   return false;
 }
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
index a5c31d3f0d..fce88e2519 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
@@ -1,208 +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 QmitkIGTTrackingLabView_h
 #define QmitkIGTTrackingLabView_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include "ui_QmitkIGTTrackingLabViewControls.h"
 
 #include <mitkNavigationDataToPointSetFilter.h>
 #include <mitkNavigationDataLandmarkTransformFilter.h>
 #include <mitkNavigationDataReferenceTransformFilter.h>
 #include <mitkNavigationDataObjectVisualizationFilter.h>
 #include <mitkNavigationDataToPointSetFilter.h>
 #include <mitkTrackingDeviceSource.h>
 #include <mitkSurface.h>
 #include <mitkCameraVisualization.h>
 
 #include <QToolBox>
 #include <QCheckBox>
 #include <QComboBox>
 #include <QPushButton>
 #include <QLabel>
 #include <QSpinBox>
 #include <QTimer>
 
 #include <vtkLandmarkTransform.h>
 #include <vtkSmartPointer.h>
 
 /*!
 \brief QmitkIGTTrackingLabView
 
 \warning  This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
 
 \ingroup ${plugin_target}_internal
 */
 class QmitkIGTTrackingLabView : 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;
 
 /**
 \brief default constructor
 */
 QmitkIGTTrackingLabView();
 
 /**
 \brief default destructor
 */
 ~QmitkIGTTrackingLabView() override;
 
 void CreateQtPartControl(QWidget *parent) override;
 
 void SetFocus() override;
 
 protected slots:
 
-/** This timer updates the IGT pipline, when nessecary:
+/** This timer updates the IGT pipline, when necessary:
 *   1: if permanent registration is activated, then the permanent
 *      registration filter has to be updated
 *   2: if the camera view is on it also must be updated
 *   3: point set recording is based on another filter which needs to be
 *      updated when activated
 */
 void UpdateTimer();
 
 //############## Configuration Step #####################
 
 /**
 \brief This method sets up the navigation pipeline during initialization.
 */
 void OnSetupNavigation();
 
 /** This method is called when the instrument is selected.
 *  It stores the navigation data of the instrument.
 */
 void OnInstrumentSelected();
 
 /** This method is called when the object marker is selected.
 *  It stores the navigation data of the object marker.
 */
 void OnObjectmarkerSelected();
 
 //############## Initial Registration Step ##############
 
 /**
 \brief This method calls the initial fiducial registration.
 */
 void OnInitialRegistration();
 
 /**
 \brief This method adds a new fiducial to the tracker fiducials PointSet.
 */
 void OnAddRegistrationTrackingFiducial();
 
 /**
 \brief This method initializes the registration for the FiducialRegistrationWidget.
 */
 void InitializeRegistration();
 
 //############## Permanent Registration Step ############
 
 /**
 \brief This method activates the permanent registration based on one tool's position.
 */
 void OnPermanentRegistration(bool on);
 
 //############## Pointset Recording Step ################
 
 /**
 \brief This method starts the PointSet recording.
 */
 void OnPointSetRecording(bool record);
 
 //############## Camera View Step #######################
 /**
 \brief This method activates the virtual camera.
 */
 void OnVirtualCamera(bool on);
 
 protected:
 
 Ui::QmitkIGTTrackingLabViewControls m_Controls;
 /**
 \brief This method creates all widgets this bundle needs.
 */
 void CreateBundleWidgets();
 /**
 \brief This method creates the SIGNAL SLOT connections.
 */
 void CreateConnections();
 /**
 * Checks if everything is initialized for registration. Gives error messages and returns false if not.
 */
 bool CheckRegistrationInitialization();
 /**
 \brief This method destroys the filter pipeline.
 */
 void DestroyIGTPipeline();
 
 //####################### Members for the IGT pipeline ######################################
 // The IGT pipeline is basically initialized in the method OnSetupNavigation(). Further initialization
 // is done in the methods OnPermanentRegistration(), OnPointSetRecording() and OnVirtualCamera().
 // The pipline is updated in the method UpdateTimer(). When the complete pipeline is active, it is
 // structured as follows:
 //          ,-> m_PermanentRegistrationFilter
 // m_Source -> m_Visualizer
 //          `-> m_VirtualView
 mitk::TrackingDeviceSource::Pointer m_Source;                                         ///< source that connects to the tracking device
 mitk::NavigationDataObjectVisualizationFilter::Pointer m_PermanentRegistrationFilter; ///< this filter transforms from tracking coordinates into mitk world coordinates if needed it is interconnected before the FiducialEegistrationFilter
 mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer;                  ///< visualization filter
 mitk::CameraVisualization::Pointer m_VirtualView;                                     ///< filter to update the vtk camera according to the reference navigation data
 //in addition to the pipeline objects, pointers to the navigation data objects are stored for fast access:
 mitk::NavigationData::Pointer m_InstrumentNavigationData;                             ///< navigation data of instrument
 mitk::NavigationData::Pointer m_ObjectmarkerNavigationData;                           ///< navigation data of object marker
 
 //####################### other members ######################################
 QTimer* m_Timer; ///< central timer which updates the IGT pipeline
 
 //members for the point set recording
 mitk::NavigationData::Pointer m_PointSetRecordingNavigationData;
 mitk::PointSet::Pointer m_PSRecordingPointSet;
 bool m_PointSetRecording;
 bool m_PermanentRegistration;
 bool m_CameraView;
 
 //members for initial registration
 mitk::DataNode::Pointer m_ImageFiducialsDataNode;
 mitk::DataNode::Pointer m_TrackerFiducialsDataNode;
 
 //members for permanent registration
 mitk::PointSet::Pointer m_PermanentRegistrationSourcePoints;
 mitk::NavigationData::Pointer m_T_MarkerRel;
 mitk::NavigationData::Pointer m_T_ObjectReg;
 mitk::AffineTransform3D::Pointer m_T_ImageReg;
 mitk::AffineTransform3D::Pointer m_T_ImageGeo;
 mitk::NavigationData::Pointer m_ObjectmarkerNavigationDataLastUpdate; ///< this is the position of the object marker from the last call of update(); it is used to check the difference and decide if the visualization must be updated
 
 //######################## some internal help methods ############################
 /**
 * Checks if the difference between two given transformations is high which means the method returns
-* true if the difference exeeds the given position and angular threshold.
+* true if the difference exceeds the given position and angular threshold.
 */
 bool IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold = .8, double angularDifferenceThreshold = .8);
 
 
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.cpp b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.cpp
index f5412b58bd..2404b52536 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.cpp
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "QmitkIGTTutorialView.h"
 
 #include "mitkNDIPassiveTool.h"
 #include "mitkNDITrackingDevice.h"
 #include "mitkVirtualTrackingDevice.h"
 #include "mitkStandardFileLocations.h"
 #include "mitkSerialCommunication.h"
 #include "mitkCone.h"
 
 #include <QTimer>
 #include <QMessageBox>
 
 #include "mitkNDIPolarisTypeInformation.h"
 
 
 const std::string QmitkIGTTutorialView::VIEW_ID = "org.mitk.views.igttutorial";
 
 QmitkIGTTutorialView::QmitkIGTTutorialView()
 : QmitkAbstractView(),
 m_Controls(nullptr), m_Source(nullptr), m_Visualizer(nullptr), m_Timer(nullptr)
 {
 }
 
 
 QmitkIGTTutorialView::~QmitkIGTTutorialView()
 {
 }
 
 
 void QmitkIGTTutorialView::CreateQtPartControl(QWidget *parent)
 {
   if (!m_Controls)
   {
     // create GUI widget
     m_Controls = new Ui::QmitkIGTTutorialViewControls;
     m_Controls->setupUi(parent);
     this->CreateConnections();
   }
 }
 
 
 
 void QmitkIGTTutorialView::CreateConnections()
 {
   if ( m_Controls )
   {
     connect( (QObject*)(m_Controls->m_StartButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnStartIGT()));
     connect( (QObject*)(m_Controls->m_StopButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnStopIGT()));
   }
 }
 
 void QmitkIGTTutorialView::SetFocus()
 {
   m_Controls->m_virtualTrackingRadioButton->setFocus();
 }
 
 //The next line starts a snippet to display this code in the documentation. If you don't revise the documentation, don't remove it!
     //! [OnStart 1]
 void QmitkIGTTutorialView::OnStartIGT()
 {
   //This method is called when the "Start Image Guided Therapy" button is pressed. Any kind of navigation application will
   //start with the connection to a tracking system and as we do image guided procedures we want to show
   //something on the screen. In this tutorial we connect to the NDI Polaris tracking system pr a virtual tracking device and we will
   //show the movement of a tool as cone in MITK.
 
    //! [OnStart 1]
 
    //! [OnStart 2]
   try
   {
     if(m_Controls->m_NDITrackingRadioButton->isChecked())
     {
       /**************** Variant 1: Use a NDI Polaris Tracking Device ****************/
       //Here we want to use the NDI Polaris tracking device. Therefore we instantiate a object of the class
       //NDITrackingDevice and make some settings which are necessary for a proper connection to the device.
       MITK_INFO << "NDI tracking";
       QMessageBox::warning ( nullptr, "Warning", "You have to set the parameters for the NDITracking device inside the code (QmitkIGTTutorialView::OnStartIGT()) before you can use it.");
       mitk::NDITrackingDevice::Pointer tracker = mitk::NDITrackingDevice::New();  //instantiate
       tracker->SetPortNumber(mitk::SerialCommunication::COM4); //set the comport
       tracker->SetBaudRate(mitk::SerialCommunication::BaudRate115200); //set the baud rate
       tracker->SetType(mitk::NDIPolarisTypeInformation::GetTrackingDeviceName()); //set the type there you can choose between Polaris and Aurora
 
       //The tools represent the sensors of the tracking device. In this case we have one pointer tool.
       //The TrackingDevice object it self fills the tool with data. So we have to add the tool to the
       //TrackingDevice object.
       // The Polaris system needs a ".rom" file which describes the geometry of the markers related to the tool tip.
       //NDI provides an own software (NDI architect) to generate those files.
       tracker->AddTool("MyInstrument", "c:\\myinstrument.rom");
     //! [OnStart 2]
       /**************** End of Variant 1 ****************/
     //! [OnStart 3]
       //The tracking device object is used for the physical connection to the device. To use the
       //data inside of our tracking pipeline we need a source. This source encapsulate the tracking device
       //and provides objects of the type mitk::NavigationData as output. The NavigationData objects stores
-      //position, orientation, if the data is valid or not and special error informations in a covariance
+      //position, orientation, if the data is valid or not and special error information in a covariance
       //matrix.
       //
       //Typically the start of a pipeline is a TrackingDeviceSource. To work correct we have to set a
       //TrackingDevice object. Attention you have to set the tools before you set the whole TrackingDevice
       //object to the TrackingDeviceSource because the source need to know how many outputs should be
       //generated.
       m_Source = mitk::TrackingDeviceSource::New();   //We need the filter objects to stay alive,
       //therefore they must be members.
       m_Source->SetTrackingDevice(tracker); //Here we set the tracking device to the source of the pipeline.
     //! [OnStart 3]
 
     }
     //! [OnStart 4]
     else
     {
       /**************** Variant 2: Emulate a Tracking Device with mitk::VirtualTrackingDevice ****************/
       // For tests, it is useful to simulate a tracking device in software. This is what mitk::VirtualTrackingDevice does.
       // It will produce random position, orientation and error values for each tool that is added.
       MITK_INFO << "virtual tracking"<<endl;
       mitk::VirtualTrackingDevice::Pointer tracker = mitk::VirtualTrackingDevice::New(); // create virtual tracker
 
       mitk::ScalarType bounds[] = {0.0, 200.0, 0.0, 200.0, 0.0, 200.0};
       tracker->SetBounds(bounds);
       tracker->AddTool("MyInstrument");      // add a tool to tracker
 
       //The tracking device object is used for the physical connection to the device. To use the
       //data inside of our tracking pipeline we need a source. This source encapsulate the tracking device
       //and provides objects of the type mitk::NavigationData as output. The NavigationData objects stores
-      //position, orientation, if the data is valid or not and special error informations in a covariance
+      //position, orientation, if the data is valid or not and special error information in a covariance
       //matrix.
       //
       //Typically the start of a pipeline is a TrackingDeviceSource. To work correct we have to set a
       //TrackingDevice object. Attention you have to set the tools before you set the whole TrackingDevice
       //object to the TrackingDeviceSource because the source need to know how many outputs should be
       //generated.
       m_Source = mitk::TrackingDeviceSource::New();   //We need the filter objects to stay alive,
       //therefore they must be members.
       m_Source->SetTrackingDevice(tracker); //Here we set the tracking device to the source of the pipeline.
       /**************** End of Variant 2 ****************/
     }
     //! [OnStart 4]
 
     //! [OnStart 5]
     m_Source->Connect();                  //Now we connect to the tracking system.
     //Note we do not call this on the TrackingDevice object
     //! [OnStart 5]
 
     //! [OnStart 6]
     //As we wish to visualize our tool we need to have a PolyData which shows us the movement of our tool.
     //Here we take a cone shaped PolyData. In MITK you have to add the PolyData as a node into the DataStorage
     //to show it inside of the rendering windows. After that you can change the properties of the cone
     //to manipulate rendering, e.g. the position and orientation as in our case.
     mitk::Cone::Pointer cone = mitk::Cone::New();                 //instantiate a new cone
     double scale[] = {10.0, 10.0, 10.0};
     cone->GetGeometry()->SetSpacing(scale);                       //scale it a little that so we can see something
     mitk::DataNode::Pointer node = mitk::DataNode::New(); //generate a new node to store the cone into
     //the DataStorage.
     node->SetData(cone);                          //The data of that node is our cone.
     node->SetName("My tracked object");           //The node has additional properties like a name
     node->SetColor(1.0, 0.0, 0.0);                //or the color. Here we make it red.
     this->GetDataStorage()->Add(node);     //After adding the Node with the cone in it to the
     //DataStorage, MITK will show the cone in the
     //render windows.
     //! [OnStart 6]
 
 
     //! [OnStart 7]
     //For updating the render windows we use another filter of the MITK-IGT pipeline concept. The
     //NavigationDataObjectVisualizationFilter needs as input a NavigationData and a
     //PolyData. In our case the input is the source and the PolyData our cone.
 
     //First we create a new filter for the visualization update.
     m_Visualizer = mitk::NavigationDataObjectVisualizationFilter::New();
     m_Visualizer->SetInput(0, m_Source->GetOutput());        //Then we connect to the pipeline.
     m_Visualizer->SetRepresentationObject(0, cone.GetPointer()); // After that we have to assign the cone to the input
 
     //Now this simple pipeline is ready, so we can start the tracking. Here again: We do not call the
     //StartTracking method from the tracker object itself. Instead we call this method from our source.
     m_Source->StartTracking();
     //! [OnStart 7]
 
     //! [OnStart 8]
     //Now every call of m_Visualizer->Update() will show us the cone at the position and orientation
     //given from the tracking device.
     //We use a QTimer object to call this Update() method in a fixed interval.
     if (m_Timer == nullptr)
     {
       m_Timer = new QTimer(this);  //create a new timer
     }
     connect(m_Timer, SIGNAL(timeout()), this, SLOT(OnTimer())); //connect the timer to the method OnTimer()
 
     m_Timer->start(100);  //Every 100ms the method OnTimer() is called. -> 10fps
     //! [OnStart 8]
 
     //! [OnStart 8a]
     //disable the tracking device selection
     this->m_Controls->m_NDITrackingRadioButton->setDisabled(true);
     this->m_Controls->m_virtualTrackingRadioButton->setDisabled(true);
     //! [OnStart 8a]
 
   }
   //! [OnStart 9]
   catch (std::exception& e)
   {
     // add cleanup
     MITK_INFO << "Error in QmitkIGTTutorial::OnStartIGT():" << e.what();
   }
   //! [OnStart 9]
 }
 
     //![OnTimer]
 void QmitkIGTTutorialView::OnTimer()
 {
   //Here we call the Update() method from the Visualization Filter. Internally the filter checks if
   //new NavigationData is available. If we have a new NavigationData the cone position and orientation
   //will be adapted.
   m_Visualizer->Update();
 
   auto geo = this->GetDataStorage()->ComputeBoundingGeometry3D(this->GetDataStorage()->GetAll());
   mitk::RenderingManager::GetInstance()->InitializeViews( geo );
   this->RequestRenderWindowUpdate();
 }
     //![OnTimer]
 
     //![OnStop]
 void QmitkIGTTutorialView::OnStopIGT()
 {
   //This method is called when the Stop button is pressed. Here we disconnect the pipeline.
   if (m_Timer == nullptr)
   {
     MITK_INFO << "No Timer was set yet!";
     return;
   }
   //To disconnect the pipeline in a save way we first stop the timer than we disconnect the tracking device.
   //After that we destroy all filters with changing them to nullptr.
   m_Timer->stop();
   disconnect(m_Timer, SIGNAL(timeout()), this, SLOT(OnTimer()));
   m_Timer = nullptr;
   m_Source->StopTracking();
   m_Source->Disconnect();
   m_Source = nullptr;
   m_Visualizer = nullptr;
   m_Source = nullptr;
   this->GetDataStorage()->Remove(this->GetDataStorage()->GetNamedNode("My tracked object"));
 
   //enable the tracking device selection
   this->m_Controls->m_NDITrackingRadioButton->setEnabled(true);
   this->m_Controls->m_virtualTrackingRadioButton->setEnabled(true);
 }
     //![OnStop]
diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkIGTTracking.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkIGTTracking.dox
index c31bc51829..e1c8507387 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkIGTTracking.dox
+++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkIGTTracking.dox
@@ -1,20 +1,20 @@
 /**
 \page org_mitk_gui_qt_igttracking The IGT Tracking Plugin
 
 This plugin offers basic tracking functionalities. This includes connecting to a tracking system, logging and recording of tracking data, managing tracking tools and playing recorded tracking data.
 
 The plugin includes different views, which are described on different pages in detail.
 
 As part of the tutorial, it is recommended to get familiar with each of the following views as they lead you through the main functionality of the IGT plugin. Please read the following pages to get familiar with them:
 
 <ul>
 <li> \subpage org_mitk_views_igttrackingtoolbox : Allows for connecting a tracking system and logging/recording the tracked data.
-<li> \subpage org_mitk_views_igtnavigationtoolmanager : This view offers functionality to manage tool storages. Each tool storage holds a preconfigured tool collection. Once saved you can load a tool storage in the Tracking Toolbox and don't need to add every tool seperately.
+<li> \subpage org_mitk_views_igtnavigationtoolmanager : This view offers functionality to manage tool storages. Each tool storage holds a preconfigured tool collection. Once saved you can load a tool storage in the Tracking Toolbox and don't need to add every tool separately.
 <li> \subpage org_mitk_views_navigationdataplayer : Plays navigation data which was recorded with the Tracking Toolbox for example.
 <li> \subpage org_mitk_views_calibrationtoolmanager Calibration Tool Manager. This view offers functionality to calibrate navigation tools.
 <li> \subpage org_mitk_views_igtregistrationview : The IGTFiducialRegistration view allows the recording of real world landmarks and corresponding landmarks on a virtual object.
 </ul>
 
 Return to the \ref TrackingPlugins "[IGT Tutorial Overview]"
 
 */
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolCalibration.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolCalibration.dox
index 079e6d0673..b380197a0f 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolCalibration.dox
+++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolCalibration.dox
@@ -1,85 +1,85 @@
 /**
 
 \page org_mitk_views_calibrationtoolmanager The MITK-IGT Navigation Tool Calibration
 
 \imageMacro{iconTrackingToolCalibration.png,"Icon of the MITK-IGT Tracking Toolbox",2.00}
 
 \tableofcontents
 
 \section QmitkMITKIGTNavigationToolCalibrationIntroduction Introduction
 This view allows the calibration of navigation tools. The calibrated tools can be saved permanently and later be used for any other IGT application. The following coordinate transforms are associated with tracking of a tool:
  <ul>
  <li> The sensor transformation from the global tracking coordinate system to the local coordinate system of the tracked sensor (m_Position, m_Orientation).
  <li> The tool tip transformation from the local sensor coordinate system to a tool tip coordinate system defined by a tool tip position and a main tool axis (m_ToolTipPosition, m_ToolAxisOrientation). The tool axis is defined as the negative z-axis of the tool tip coordinate system.
  <li> The main axis of the representation object of the tool (e.g. a surface) has to be defined along the negative z-axis.
  </ul>
 \imageMacro{TrackingTool.png,"Coordinate transforms associated to the tracking tool.",5.00}
 
 
 \section QmitkMITKIGTNavigationToolCalibrationPrerequisities Prerequisites
 
 In the IGT Tracking Toolbox configure your tracking device with at least two tools. The tool you wish to calibrate and one tool used as a pointer during the calibration process. For details on how to configure your tracking device and your tools have a look at \ref org_mitk_views_igttrackingtoolbox .
 After you configured your device and your tools connect your device and start tracking. Now switch to the IGT Navigation Tool Calibration for the calibration process.
 
 
 \section QmitkMITKIGTNavigationToolCalibrationInitialization Initialization
 
 On the tab Initialization choose the tracking device you configured in the prevois step by clicking on it in the box "Available Navigation Data Sources". Then in the box "Tools" the tools you configured for this device should appear. Click on the tool that needs to be calibrated and then on the button "Use as Tool to Calibrate". On top of the view under the headline "Tool To calibrate" you now see the tool information for the chosen tool.
 For the tool used as a pointer do the same. Click on it, then click on the button "Use as Calibration Pointer" and on top of the view under the headline "Calibration pointer you should see the tool information for the pointer tool.
 
 \imageMacro{QmitkIGTTracking_ToolCalibration_Initialization.png,"MITK Screenshot with the initialized tools for calibration",5.00}
 
 
 \section QmitkMITKIGTNavigationToolCalibrationToolTipCalibration Tool Tip Calibration
 
 After you finished the initialization of your tracking device you can proceed on to the tab Tool Tip Calibration to calibrate your tool.
 For the Tool Tip Calibration you have four different options:
 
 <ul>
 <li> Manual: Enter the known Translation and Rotation for the Tool Tip manually
 <li> Single Reference Tool: Use a calibrated tool as a reference to calibrate the non-calibrated tool
 <li> Multiple Tools Reference: Not implemented yet
 <li> Pivoting: Calibrate the tool by pivoting it around its tip. (Not fully implemented yet)
 </ul>
 
 \subsection QmitkMITKIGTNavigationToolCalibrationManual Manual Tool Tip Calibration
 
 Use this method to calibrate a navigation tool, of which you already know the translation and rotation that determine the tool tip calibration.
 Click on Start Edit Tooltip and in the new window you can enter the values for the translation and the rotation. Either by using the sliders or by entering the values into the boxes.
 \imageMacro{QmitkIGTTracking_ToolCalibration_Manual_EditingWindow.png,"MITK Screenshot of the window for manual tool calibration",5.00}
 After you entered the values you can click "Use Manipulated ToolTip" to perform the Calibration on the Tool to calibrate. The box "Current Tool Tip Orientation" will show you the results. It will list the resulting values of the Quaternion, the Euler Angles and the Matrix.
 \imageMacro{QmitkIGTTracking_ToolCalibration_Manual_After.png,"MITK Screenshot of the Current Tool Tip Orientation Box after the tool was manually calibrated",5.00}
 To save the result permanently just click "Save Calibrated Navigation Tool" and you can save the calibrated tool as an IGTTool for later use with your tracking device in a navigation application.
-If you are not satisfied with the results you can click "Start Edit Tooltip" again and either change the values for the rotation and translation again or just reset everything by clicking on "Reset to Identity". To write the new values or reseted values into the tool just click "Use Manipulated Tool Tip" again. Now you can save your relust just as described above.
+If you are not satisfied with the results you can click "Start Edit Tooltip" again and either change the values for the rotation and translation again or just reset everything by clicking on "Reset to Identity". To write the new values or resetted values into the tool just click "Use Manipulated Tool Tip" again. Now you can save your relust just as described above.
 
 \subsection QmitkMITKIGTNavigationToolCalibrationReference Tool Tip Calibration with a single Reference Tool
 
 Use this method to calibrate a navigation tool using a tool as pointer that is already calibrated.
 First choose the number of tracking data you wish to collect. It is 100 by default but you may choose as many as you wish. Now place your tool to calibrate in a fixed position where it is tracked. Next place your pointing tool in a manner that its tip touches the tip and is tracked too. Fix it in this position. For a good calibration it is important that the tools move the least possible.
 After you placed the tools click on the "Collect Navigation Data" Button and wait until all the data is gathered. Now you have several options to adjust the calibration to your needs. You can calibrate the position and/or the orientation or even invert the calibration transform. Calibrating the position will translate the position of the tool to calibrate to the position of the calibration pointer. The orientation calibration will copy the mean orientation of the calibration pointer to the tool the calibrate. Choose the options needed for your tool and tracker and then click on "Run Calibration".
 The new Tool Tip Position and Orientation will be displayed und you can now apply them onto your tool by clicking on "Set New Tool Tip Position and/or Tool Orientation". To finally save the calibrated tool for later use just click on "Save Calibrated Navigation Tool".
 If you are not satisfied with the result of the calibration just repeat the steps described above.
 
 \imageMacro{QmitkIGTTracking_ToolCalibration_Reference.png,"MITK Screenshot of the Tool Tip Calibration Widget after a fully performed Tool Calibration using a single reference tool ",5.00}
 
 \subsection QmitkMITKIGTNavigationToolCalibrationPivot Tool Tip Calibration via Pivoting
 
-To calibrate your tool via pivoting place it on its tip an pivot it around its tip. Be careful not to move the tip otherwise the calibration result will be inaccurate. You can define the number of poses that should be collected. After starting the collecting process pivote the tool to different poses until the collection ends. Then click on "Comute Pivot Point" to compute the pivot point. Finally you can use the pivot result as tooltip transformation and save the calibrated tool to the hard disc for later use.
+To calibrate your tool via pivoting place it on its tip an pivot it around its tip. Be careful not to move the tip otherwise the calibration result will be inaccurate. You can define the number of poses that should be collected. After starting the collecting process pivote the tool to different poses until the collection ends. Then click on "Compute Pivot Point" to compute the pivot point. Finally you can use the pivot result as tooltip transformation and save the calibrated tool to the hard disc for later use.
 
 \subsection QmitkMITKIGTNavigationToolCalibration Tool Landmark Calibration
 
 Two types of landmarks can be defined for each tool:
 <ul>
 <li> Control points for a later point-based registration
 <li> Tool landmarks that represents features on the tool which are e.g. visible in a CT image
 </ul>
 
 Both sets of landmarks are defined in the tool coordinate space.
 
 Control points are virtual and can only defined manually. These landmarks 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. They may be used, e.g., for a point based registration of a tool from image space to tracking space. A typical set of three control points for a 6 DoF tool might be [1;0;0], [0;1;0], [0;0;1].
 
-Tool landmarks are designed for representing defined landmarks on a tool. The number of these landmarks might exeed the number of 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. The tool landmarks can be calibrated manually or by using a second tracked pointer, move it to each landmark and press "Add Pointer Position".
+Tool landmarks are designed for representing defined landmarks on a tool. The number of these landmarks might exceed the number of 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. The tool landmarks can be calibrated manually or by using a second tracked pointer, move it to each landmark and press "Add Pointer Position".
 
 Return to the overview of the IGT Tracking Plugin views: \ref org_mitk_gui_qt_igttracking
 
 */
diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolManager.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolManager.dox
index dfff505877..34c22b8c4d 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolManager.dox
+++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTNavigationToolManager.dox
@@ -1,53 +1,53 @@
 /**
 
 \page org_mitk_views_igtnavigationtoolmanager The MITK-IGT Navigation Tool Manager
 
 \imageMacro{iconTrackingToolManager.png,"Icon of the Navigation Tool Manager",2.00}
 
 \section QmitkMITKIGTNavigationToolManager Introduction
 
-This view allows for creating and editing NavigationToolStorages. These storages contains naviagtion tools of a tracking device, can be saved permanently and used later for any other IGT application.
+This view allows for creating and editing NavigationToolStorages. These storages contains navigation tools of a tracking device, can be saved permanently and used later for any other IGT application.
 
 \tableofcontents
 
 \section QmitkMITKIGTNavigationToolManagerToolOverview Navigation Tools Overview
 
 A navigation tool of MITK-IGT represents a tracking tool (e.g. an emt sensor or an optically tracked tool) and it's corresponding data, like it's name and it's surface. A navigation tool is a generalized container for any trackable object in combination with it's additional information. Every navigation tool has different properties which are:
 
 <ul>
 <li> Name
 <li> Unique identifier
 <li> Tool definition file
 <li> Serial number
 <li> Surface for visualization
 <li> Type of tracking device
 <li> Type of the tool
 <li> Tool landmarks
 </ul>
 
 Note that not all properties are needed for all types of tools. A tool definition file, for example, is only needed by optical tracking tools (e.g. a .rom file for Polaris or a toolfile for the MicronTracker). A tool associated with the aurora system is alwalys identified by it's serial number. You can also detect Aurora tools automatically with the TrackingToolbox view and edit the automatically detected tool storage later with this view.
 
 \section QmitkMITKIGTNavigationToolManagerManagingNavigationToolStorage Managing Navigation Tool Storage
 
-In order to create edit a tool storage container, you can select one of the available tool storages listed in the upper part of the UI. The list shows all tool storages which are available throug the micro services concept of MITK. The list also shows the current tool storage of the IGT tracking toolbox view if it is active. In addition to the listed tool storages, you can load new storages from the hard disc which will then appear in the list and might be edited as all other storage by simply selecting it in the list. You may also save a selected tool storage to the hard disc or create a new one.
+In order to create edit a tool storage container, you can select one of the available tool storages listed in the upper part of the UI. The list shows all tool storages which are available through the micro services concept of MITK. The list also shows the current tool storage of the IGT tracking toolbox view if it is active. In addition to the listed tool storages, you can load new storages from the hard disc which will then appear in the list and might be edited as all other storage by simply selecting it in the list. You may also save a selected tool storage to the hard disc or create a new one.
 
 In the lower part of the UI you always see the list of tools of the tool storage which is currently selected in the upper part. Use the buttons "add", "edit" and "delete" to manage the contained navigation tools. If you click "edit" or "delete" the operation is applied on the currently selected tool, as shown in the screenshot below.
 
 \imageMacro{QmitkIGTTracking_NavigationToolManagemantStartScreen.png,"Screenshot of the main view of NavigationToolManagent",10.90}
 
 \section QmitkMITKIGTNavigationToolManagerAddingEditingNavigationTools Adding / Editing Navigation Tools
 
-If you add or edit a navigation tool, an input mask, as shown in the screenshot below, appears. The tool identifier is filled automatically, if you change it, remember that it is unique in the current storage. Also, choose a valid surface for every tool, this is nessesary for correct tool visualization. By default, a cone is displayed. The other information depends on the tracking system type, e.g. choose a tool file for the Polaris or the MicronTracker system and type in a serial number for the Aurora system. Two identical tools with the same serial number are also possible, they are assigned by the order in which they are attached to the device. As long as they also have the same surface as representation, this should not be a problem for most of the use cases.
+If you add or edit a navigation tool, an input mask, as shown in the screenshot below, appears. The tool identifier is filled automatically, if you change it, remember that it is unique in the current storage. Also, choose a valid surface for every tool, this is necessary for correct tool visualization. By default, a cone is displayed. The other information depends on the tracking system type, e.g. choose a tool file for the Polaris or the MicronTracker system and type in a serial number for the Aurora system. Two identical tools with the same serial number are also possible, they are assigned by the order in which they are attached to the device. As long as they also have the same surface as representation, this should not be a problem for most of the use cases.
 
 The tool type is additional information which is not needed by the tracking device but might be needed by further IGT applications. The same applies to the tool landmarks which might be defined for a tool. There are two different types of landmarks which are designed as described here:
 
 <ul>
 <li> Tool Calibration Landmarks: 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.
-<li> Tool Registration Landmarks: These landmarks are designed for representing defined landmarks on a tools surface. The number of these landmarks might exeed the number of tool calibration landmarks 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.
+<li> Tool Registration Landmarks: These landmarks are designed for representing defined landmarks on a tools surface. The number of these landmarks might exceed the number of tool calibration landmarks 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.
 </ul>
 
 \imageMacro{QmitkIGTTracking_NavigationToolManagementAddTool.png,"Screenshot of add/edit navigation tool screen",9.19}
 
 Return to the overview of the IGT Tracking Plugin views: \ref org_mitk_gui_qt_igttracking
 
 */
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox
index 1e80ec7f9f..a97d92c6c8 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox
+++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox
@@ -1,93 +1,93 @@
 /**
 
 \page org_mitk_views_igttrackingtoolbox The MITK-IGT Tracking Toolbox
 
 \imageMacro{iconTrackingToolbox.png,"Icon of the MITK-IGT Tracking Toolbox",2.00}
 
 \tableofcontents
 
 \section QmitkMITKIGTTrackingToolboxIntroduction Introduction
 
 The MITK-IGT Tracking Toolbox is a view which allows you to connect to a tracking device, track and visualize navigation tools and write the tracked data into a log file.
 This page gives an overview of the view and is at the same time part of the IGT tutorial step \ref org_mitk_gui_qt_igttracking. All parts containing instructions
 for the tutorial begin with the bold printed label <b>Tutorial</b>.
 
 \imageMacro{QmitkIGTTracking_ScreenshotMitk.png,"MITK Screenshot with the TrackingToolbox activated",16.00}
 
 \section QmitkMITKIGTTrackingToolboxWorkflow General workflow Introduction
 
 Currently the devices Polaris, Aurora (both Northern Digital Inc. (NDI); Waterloo, Ontario, Canada), MicronTracker (Claron Technology, Inc.; Toronto, Ontario, Canada) and Optitrack (NaturalPoint) are supported (see <a href="https://www.mitk.org/wiki/Mitk-Tracking-Device_Support_Levels"> Hardware Tracking Device Support</a>). Different tracking hardware can be used via OpenIGTLink connections (see \ref IGTTutorialStepOpenIGTLink "Open IGT Link tutorial"
 ). For this Tracking Toolbox tutorial, we will use a virtual tracking device, which allows you to use simulated tracking data. This is very helpful if you want to test or implement some tracking application and don't have the hardware always available.
 
 A general Workflow with the Tracking Toolbox may be:
 
 <ul>
 <li> Configuration of a tracking device
 <li> Adding or loading a toolfile which holds tool definitions
 <li> Start tracking
 <li> Logging tracked data
 </ul>
 
 <b>Tutorial:</b> In the following sections, we will get familiar with each of these points using the Virtual Tracking Device.
 
 \section QmitkMITKIGTTrackingToolboxConnecting Tracking Device Configuration
 
 The tracking device can be specified in the tracking device configuration section located in the upper area of the tracking tab. As shown in the screenshot below, you choose your tracking device in the drop down menu.
 
-If you use a real tracking system, you might need to set some parameters like the serial port for Aurora or Polaris or the host name for your OpenIGTLink connection. Most implemented tracking device include an option to test your conection. Therefore you just need to press the button "test connection". The results are displayed in the small black box on the right.
+If you use a real tracking system, you might need to set some parameters like the serial port for Aurora or Polaris or the host name for your OpenIGTLink connection. Most implemented tracking device include an option to test your connection. Therefore you just need to press the button "test connection". The results are displayed in the small black box on the right.
 
 <b>Tutorial:</b> For a first introduction, please select the virtual tracking device in the drop-down-menu. You should see an option to add some jittering to the simulated data.
 
 \imageMacro{QmitkIGTTracking_ConfigurationWidget.png,"Tracking Device Configuration",8.55}
 
 \section Tracking Tools
 
 For tracking, you need information about your tools. You can either add single tools, load previously created tool storages or for some devices auto-detect all available tools. The best way to edit tools after creation/loading is \ref org_mitk_views_igtnavigationtoolmanager view. Creation of new tools or loading of existing tool storages can be done within the Tracking Tool Widget.
 
 \imageMacro{QmitkIGTTracking_NavigationToolManagement_TrackingTools.png, "The tracking tool widget for adding or loading tools.",9.00}
 
 All added or loaded tools will then be displayed in grey as shown in the screenshot below. If you start tracking they will become green if the tools were found and red if they were not found inside the tracking volume.
 \imageMacro{QmitkIGTTracking_TrackingToolsWidget.png,"Added Tracking Tools",9.08}
 
 \subsection QmitkMITKIGTTrackingToolboxAddingTools Adding tools
 The most simple step to begin with is to add new tools with this widget. The same widget is also available within \ref org_mitk_views_igtnavigationtoolmanager view and the single parameters are explained there in more detail.
 \imageMacro{QmitkIGTTracking_NavigationToolManagementAddTool.png,"Adding a new tool", 9.00}
 
 <b>Tutorial:</b> Please click the "Add single tool" button and make sure, that the Virtual Tracker is selected in the drop-down-menu (the tracking device configured in the first step must always match your tools!). You might want to give your tool a new name in the "Basic Information" section and load a surface for visualization in the "Tool Visualization" section (a surface file can be found in your binary folder if you did compile MITK by yourself: MITK-superbuild\MITK-Data\IGT-Data\ClaronTool.stl). If you don't have any surface data, you can just select "use simple cone". Click on "Finished" and repeat this step to add a second tool.
 
 \subsection QmitkMITKIGTTrackingToolboxLoadingTools Loading tools
 To load tools which can be tracked you need a predefined tracking tool storage. You can use the MITK \ref org_mitk_views_igtnavigationtoolmanager view to define a navigation tool storage or to save the tools created within the last step in a toolstorage.
 
 Navigation tool storages can be loaded by pressing the button "Load Tools". Please ensure that the tracking device type of the tools matches the chosen tracking device, otherwise you will get an error message if you try to start tracking.
 
 \subsection QmitkMITKIGTTrackingToolboxAutoDetection Auto detection of tools (only Aurora)
 If you use the Aurora system you also have the possibility to automatically detect the connected tools. In this case a tracking tool storage is created by the software.
 In the Tracking Device Configuration widget, a button "Auto Detection" appears. If you press this button the software connects to the system and automatically detects all connected tools. You will then be asked whether you want to save the detected tools as a tool storage to the hard drive. You might want to do this if you want to use or modify this tool storage later. In the automatically detected tool storage the tools are named AutoDetectedTools1, AutoDetectedTools2, and so on. Small spheres are used as tool surfaces. After autodetection the detected tools are loaded automatically even if you did not save them.
 
 \section QmitkMITKIGTTrackingToolboxStartTracking Start/stop tracking
 To start tracking, you first need to connect to your tracking device ("connect" button). If your tools or tool storage don't match the tracking device or if no connection can be established, this might give an error message here.
 \imageMacro{QmitkIGTTracking_TrackingControl.png,"Tracking Control to start tracking.", 9.00}
-If connected succesfully, the start tracking button is enabled. As soon as you clicked this button, the tool information and tools will be highlighted red or green (un-/successful tracking) and in case of successful tracking, it's position will be updated and the tools are visualized in the 3D view of MITK.
+If connected successfully, the start tracking button is enabled. As soon as you clicked this button, the tool information and tools will be highlighted red or green (un-/successful tracking) and in case of successful tracking, it's position will be updated and the tools are visualized in the 3D view of MITK.
 Note that options may not be changed after connecting the tracking device.
 
 You can start, freeze, unfreeze and stop the tracking as long as you are connected. If you want to finish your tracking, please stop an disconnect your tracking device.
 
 <b>Tutorial:</b> Please click "connect" and "start tracking". Both tools should move within the tracking volume, the position data should be updated in the tool widget and be highlighted green. You can freeze, unfreeze and stop/restart the tracking as often as you like. When finished, please stop and disconnect.
 
 \section QmitkMITKIGTTrackingOptions Options
 
-In the options tab you can enable or disable the visualization of the tracking volume and of the tool quaternions. If enabled, the tool quaternions are shown in the tool information. You can also define the update rate of the tracking data. The update rate should not be set higher than the update rate of the tracking system. Other options might be available here depending on the newest developement within MITK-IGT.
+In the options tab you can enable or disable the visualization of the tracking volume and of the tool quaternions. If enabled, the tool quaternions are shown in the tool information. You can also define the update rate of the tracking data. The update rate should not be set higher than the update rate of the tracking system. Other options might be available here depending on the newest development within MITK-IGT.
 \imageMacro{QmitkIGTTracking_Options.png,"Recorded logging data.", 9.00}
 
 \section QmitkMITKIGTTrackingToolboxLogging Logging features
 The logging feature of the Tracking Toolbox supports logging in XML or CSV format.
-If your device is tracking, you are able to log the tracking data by using the logging tab. You first must define a file name. You can then choose whether you want comma seperated (csv) or xml format. Press "Start Logging" to start logging. You can also limit the number of logged frames, which will cause the logging to stop automatically after the given number.
+If your device is tracking, you are able to log the tracking data by using the logging tab. You first must define a file name. You can then choose whether you want comma separated (csv) or xml format. Press "Start Logging" to start logging. You can also limit the number of logged frames, which will cause the logging to stop automatically after the given number.
 
 \imageMacro{QmitkIGTTracking_LoggingWidget.png,"Tracking options.", 9.00}
 
 <b>Tutorial:</b> Please connect and start tracking as you already did in the last step, switch to the logging tab, specify a csv file and start logging for a view seconds. Stop the tracking after a short period of time. You should now find the specified file which should look similar to the following screenshot and contain position data for both tools:
 \imageMacro{QmitkIGTTracking_LogFile.png,"Recorded logging data.", 9.00}
 
 Return to the overview of the IGT Tracking Plugin views: \ref org_mitk_gui_qt_igttracking
 
 */
diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox
index 89ef20256f..0878386ff1 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox
+++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox
@@ -1,29 +1,29 @@
 /**
 \page org_mitk_views_navigationdataplayer The NavigationData Player
 
 \imageMacro{iconTrackingDataPlayer.png,"Icon of the NavigationData Player",2.00}
 
 \tableofcontents
 
 \section NavigationDataPlayerOverview
-The navigation data player plays recorded or artificial navigation data of one ore more tracking tools and visualizes their trajectory.
-It can also make the data available als a NavigationDataSource to Plugins that require a stream of tracking data, without having to create a tracking device.
+The navigation data player plays recorded or artificial navigation data of one or more tracking tools and visualizes their trajectory.
+It can also make the data available as a NavigationDataSource to Plugins that require a stream of tracking data, without having to create a tracking device.
 
 \imageMacro{QmitkIGTTracking_NavigationDataPlayer.png, "The Navigation Data Player", 7}
 
 To use it, select a set of recorded navigation data using the "Open File" button.
 The Player will show the number of tools and the number of frames in the file.
 Select the sequential player if you want to play the data with a specified tempo (set the update Interval accordingly).
 Use the Time-based player to play the data in the speed they were originally acquired in.
 
 <ul>
 <li>Check "Repeat" to repeat the data as a loop indefinitely.
 <li>Check "Register as Microservice" to make the data available as a microservice TrackingDataSource. Other Filters can then be connected to it from other plugins. This is useful for development purposes or to replay previously recorded Situations.
 <li> Check "Display" to render the data in the render Window.
 </ul>
 
 <b>Tutorial:</b> As part of the IGT tutorial, you might try to replay your recorded data from step \ref org_mitk_views_igttrackingtoolbox. You should see two spheric tools moving within the tracking volume. Note that the tool storage is not included in the navigation data player at the moment, and hence all tools are represented as spheres.
 
 Return to the overview of the IGT Tracking Plugin views: \ref org_mitk_gui_qt_igttracking
 
 */
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.cpp b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.cpp
index 74ac043b7c..8f50df4c2c 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.cpp
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.cpp
@@ -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.
 
 ============================================================================*/
 
 #include <numeric>
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // Qmitk
 #include "QmitkIGTNavigationToolCalibration.h"
 
 // mitk
 #include <mitkNavigationToolWriter.h>
 #include <mitkTrackingDeviceSource.h>
 #include <mitkTrackingDevice.h>
 #include <mitkTrackingTool.h>
 #include <mitkQuaternionAveraging.h>
 #include <mitkPivotCalibration.h>
 #include <mitkNavigationData.h>
 
 // Qt
 #include <QMessageBox>
 #include <QFileDialog>
 #include <QFileInfo>
 
 // vtk
 #include <vtkSphereSource.h>
 
 const std::string QmitkIGTNavigationToolCalibration::VIEW_ID = "org.mitk.views.igtnavigationtoolcalibration";
 
 QmitkIGTNavigationToolCalibration::QmitkIGTNavigationToolCalibration()
 {
   m_ToolTransformationWidget = new QmitkInteractiveTransformationWidget();
 }
 
 QmitkIGTNavigationToolCalibration::~QmitkIGTNavigationToolCalibration()
 {
   //The following code is required due to a bug in the point list widget.
   //If this is removed, MITK crashes when closing the view:
   m_Controls.m_RegistrationLandmarkWidget->SetPointSetNode(nullptr);
   m_Controls.m_CalibrationLandmarkWidget->SetPointSetNode(nullptr);
 
   //clean up data storage
   this->GetDataStorage()->Remove(m_ToolTipPointPreview);
 
 
   delete m_ToolTransformationWidget;
 }
 
 void QmitkIGTNavigationToolCalibration::SetFocus()
 {
 
 }
 
 void QmitkIGTNavigationToolCalibration::OnToolCalibrationMethodChanged(int index)
 {
   //if pivot calibration (3) or manual(0) is chosen only calibration pointer is needed
   if (index == 0 || index == 3) {
 
     if (!CheckInitialization(false)) {
       return;
     }
   }
   else{
     if (!CheckInitialization()) { return; }
   }
 
   UpdateManualToolTipCalibrationView();
   m_Controls.m_CalibrationMethodsWidget->setCurrentIndex(index);
   m_IndexCurrentCalibrationMethod = index;
 }
 
 void QmitkIGTNavigationToolCalibration::CreateQtPartControl(QWidget *parent)
 {
   m_TrackingTimer = new QTimer(this);
 
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi(parent);
   connect(m_Controls.m_SetToolToCalibrate, SIGNAL(clicked()), this, SLOT(SetToolToCalibrate()));
   connect(m_Controls.m_SetPointer, SIGNAL(clicked()), this, SLOT(SetCalibrationPointer()));
   connect(m_TrackingTimer, SIGNAL(timeout()), this, SLOT(UpdateTrackingTimer()));
   connect(m_Controls.m_AddLandmark, SIGNAL(clicked()), this, SLOT(AddLandmark()));
   connect(m_Controls.m_SaveCalibratedTool, SIGNAL(clicked()), this, SLOT(SaveCalibratedTool()));
   connect(m_Controls.m_AddPivotPose, SIGNAL(clicked()), this, SLOT(OnAddPivotPose()));
   connect(m_Controls.m_ComputePivot, SIGNAL(clicked()), this, SLOT(OnComputePivot()));
   connect(m_Controls.m_UseComputedPivotPoint, SIGNAL(clicked()), this, SLOT(OnUseComputedPivotPoint()));
   connect(m_Controls.m_StartEditTooltipManually, SIGNAL(clicked()), this, SLOT(OnStartManualToolTipCalibration()));
   connect(m_Controls.m_GetPositions, SIGNAL(clicked()), this, SLOT(OnGetPositions()));
   connect(m_Controls.m_ToolAxis_X, SIGNAL(valueChanged(double)), this, SLOT(OnToolAxisSpinboxChanged()));
   connect(m_Controls.m_ToolAxis_Y, SIGNAL(valueChanged(double)), this, SLOT(OnToolAxisSpinboxChanged()));
   connect(m_Controls.m_ToolAxis_Z, SIGNAL(valueChanged(double)), this, SLOT(OnToolAxisSpinboxChanged()));
   connect(m_Controls.m_CalibrateToolAxis, SIGNAL(clicked()), this, SLOT(OnCalibrateToolAxis()));
   connect((QObject*)(m_ToolTransformationWidget), SIGNAL(EditToolTipFinished(mitk::AffineTransform3D::Pointer)), this,
     SLOT(OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer)));
   connect(m_Controls.m_CalibrationMethodComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnToolCalibrationMethodChanged(int)));
 
   connect((QObject*)(m_Controls.m_RunCalibrationButton), SIGNAL(clicked()), (QObject*) this, SLOT(OnRunSingleRefToolCalibrationClicked()));
   connect((QObject*)(m_Controls.m_CollectNavigationDataButton), SIGNAL(clicked()), (QObject*) this, SLOT(OnLoginSingleRefToolNavigationDataClicked()));
   connect((QObject*)(m_Controls.m_SetNewToolTipPosButton), SIGNAL(clicked()), (QObject*) this, SLOT(OnSetNewToolTipPosButtonClicked()));
 
   m_IDToolToCalibrate = -1;
   m_IDCalibrationPointer = -1;
   m_IndexCurrentCalibrationMethod = -1;
   m_OnLoginSingleRefToolNavigationDataClicked = false;
   m_NumberOfNavigationDataCounter = 0;
   m_NumberOfNavigationData = -1;
 
   //for pivot calibration
   m_OnAddPivotPoseClicked = false;
   PivotCount = 0;
   m_PivotPoses = std::vector<mitk::NavigationData::Pointer>();
 
   m_CalibrationLandmarks = mitk::PointSet::New();
   m_CalibrationLandmarksNode = mitk::DataNode::New();
   m_CalibrationLandmarksNode->SetData(m_CalibrationLandmarks);
   m_Controls.m_CalibrationLandmarkWidget->SetPointSetNode(m_CalibrationLandmarksNode);
 
   m_RegistrationLandmarks = mitk::PointSet::New();
   m_RegistrationLandmarksNode = mitk::DataNode::New();
   m_RegistrationLandmarksNode->SetData(m_RegistrationLandmarks);
   m_Controls.m_RegistrationLandmarkWidget->SetPointSetNode(m_RegistrationLandmarksNode);
 
   m_ToolSurfaceInToolCoordinatesDataNode = mitk::DataNode::New();
   m_ToolSurfaceInToolCoordinatesDataNode->SetName("ToolSurface(ToolCoordinates)");
 
   m_LoggedNavigationDataDifferences = std::vector< mitk::NavigationData::Pointer >();
 }
 
 
 void QmitkIGTNavigationToolCalibration::OnRunSingleRefToolCalibrationClicked()
 {
   if (!CheckInitialization()) { return; }
 
   mitk::NavigationData::Pointer ToolTipTransform = mitk::NavigationData::New();
 
   if (m_Controls.m_CalibratePosition->isChecked())
   {
     //1: Compute mean translational offset vector
     m_ResultOffsetVector.Fill(0);
     for (std::vector<mitk::Point3D>::iterator vecIter = m_LoggedNavigationDataOffsets.begin(); vecIter != m_LoggedNavigationDataOffsets.end(); vecIter++)
     {
       m_ResultOffsetVector[0] = m_ResultOffsetVector[0] + (*vecIter)[0];
       m_ResultOffsetVector[1] = m_ResultOffsetVector[1] + (*vecIter)[1];
       m_ResultOffsetVector[2] = m_ResultOffsetVector[2] + (*vecIter)[2];
     }
     m_ResultOffsetVector[0] = m_ResultOffsetVector[0] / m_LoggedNavigationDataOffsets.size();
     m_ResultOffsetVector[1] = m_ResultOffsetVector[1] / m_LoggedNavigationDataOffsets.size();
     m_ResultOffsetVector[2] = m_ResultOffsetVector[2] / m_LoggedNavigationDataOffsets.size();
 
     this->m_Controls.m_ResultOfCalibration->setText(
       QString("x: ") + QString(QString::number(m_ResultOffsetVector[0], 103, 3)) +
       QString("; y: ") + (QString::number(m_ResultOffsetVector[1], 103, 3)) +
       QString("; z: ") + (QString::number(m_ResultOffsetVector[2], 103, 3)));
 
     ToolTipTransform->SetPosition(m_ResultOffsetVector);
   }
 
 
   if (m_Controls.m_CalibrateOrientation->isChecked())
   {
     //2: Compute mean orientation
     mitk::Quaternion meanOrientation;
     std::vector <mitk::Quaternion> allOrientations = std::vector <mitk::Quaternion>();
     for (std::size_t i = 0; i < m_LoggedNavigationDataDifferences.size(); i++) { allOrientations.push_back(m_LoggedNavigationDataDifferences.at(i)->GetOrientation()); }
     meanOrientation = mitk::QuaternionAveraging::CalcAverage(allOrientations);
     this->m_Controls.m_ResultOfCalibrationOrientation->setText(
       QString("qx: ") + QString(QString::number(meanOrientation.x(), 103, 3)) +
       QString("; qy: ") + (QString::number(meanOrientation.y(), 103, 3)) +
       QString("; qz: ") + (QString::number(meanOrientation.z(), 103, 3)) +
       QString("; qr: ") + (QString::number(meanOrientation.r(), 103, 3)));
 
     ToolTipTransform->SetOrientation(meanOrientation);
   }
 
   MITK_INFO << "Computed calibration: ";
   MITK_INFO << "Translation Vector: " << ToolTipTransform->GetPosition();
   MITK_INFO << "Quaternion: (" << ToolTipTransform->GetOrientation() << ")";
   MITK_INFO << "Euler Angles [rad]: (" << ToolTipTransform->GetOrientation().rotation_euler_angles() << ")";
   MITK_INFO << "Matrix:";
   vnl_matrix_fixed<double, 3, 3> rotMatrix = ToolTipTransform->GetOrientation().rotation_matrix_transpose();
   MITK_INFO << rotMatrix[0][0] << " " << rotMatrix[0][1] << " " << rotMatrix[0][2] << std::endl;
   MITK_INFO << rotMatrix[1][0] << " " << rotMatrix[1][1] << " " << rotMatrix[1][2] << std::endl;
   MITK_INFO << rotMatrix[2][0] << " " << rotMatrix[2][1] << " " << rotMatrix[2][2] << std::endl;
 
   //3: write everything into the final tool tip transform and save it as member (it will be written to the tool later on)
   mitk::NavigationData::Pointer ToolTipInTrackingCoordinates = mitk::NavigationData::New();
   ToolTipInTrackingCoordinates->Compose(ToolTipTransform);
   ToolTipInTrackingCoordinates->Compose(m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate));
   ShowToolTipPreview(ToolTipInTrackingCoordinates);
   m_Controls.m_SetNewToolTipPosButton->setEnabled(true);
   m_ComputedToolTipTransformation = ToolTipTransform;
 
 }
 
 void QmitkIGTNavigationToolCalibration::OnLoginSingleRefToolNavigationDataClicked()
 {
 
   if (!CheckInitialization()) { return; }
 
   //reset old data
   m_LoggedNavigationDataOffsets.clear();
   m_LoggedNavigationDataDifferences.clear();
 
   m_OnLoginSingleRefToolNavigationDataClicked = true;
   m_Controls.m_CollectNavigationDataButton->setEnabled(false);
   m_NumberOfNavigationData = m_Controls.m_NumberOfNavigationDataToCollect->value();
   MITK_INFO << "Collecting " << m_NumberOfNavigationData << " NavigationData ... " << endl;
 }
 
 void QmitkIGTNavigationToolCalibration::LoginSingleRefToolNavigationData()
 {
   if (!CheckInitialization()) { return; }
 
   if (m_NumberOfNavigationDataCounter < m_NumberOfNavigationData)
   {
     //update label text
     QString labelText = "Collecting Data: " + QString::number(m_NumberOfNavigationDataCounter);
     m_Controls.m_CollectionStatus->setText(labelText);
 
     mitk::NavigationData::Pointer referenceTool = m_NavigationDataSourceOfCalibrationPointer->GetOutput(m_IDCalibrationPointer);
     mitk::NavigationData::Pointer toolToCalibrate = m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate);
 
     //compute difference:
     // differenceND = toolToCalibrate^-1 * referenceTool
     mitk::NavigationData::Pointer differenceND = mitk::NavigationData::New();
     differenceND->Compose(referenceTool);
     differenceND->Compose(toolToCalibrate->GetInverse());
 
     //inverse mode...
     if (m_Controls.m_InvertQuaternions->isChecked())
     {
       // negate identity matrix to directly show parameters that will set up in NDI 6D Software Architect
       differenceND = differenceND->GetInverse();
     }
 
     //save difference in member
     m_LoggedNavigationDataOffsets.push_back(differenceND->GetPosition());
     m_LoggedNavigationDataDifferences.push_back(differenceND);
     m_NumberOfNavigationDataCounter++;
   }
 
   if (m_NumberOfNavigationDataCounter == m_NumberOfNavigationData)
   {
     m_NumberOfNavigationDataCounter = 0;
     m_OnLoginSingleRefToolNavigationDataClicked = false;
     m_Controls.m_CollectNavigationDataButton->setEnabled(true);
     m_Controls.m_RunCalibrationButton->setEnabled(true);
     MITK_INFO << "Collecting " << m_NumberOfNavigationData << " NavigationData ... Finished" << endl;
     QString labelText = "Collected " + QString::number(m_NumberOfNavigationData) + " data samples!";
     m_Controls.m_CollectionStatus->setText(labelText);
   }
 }
 
 void QmitkIGTNavigationToolCalibration::OnSetNewToolTipPosButtonClicked()
 {
   ApplyToolTipTransform(m_ComputedToolTipTransformation);
   RemoveToolTipPreview();
 }
 
 void QmitkIGTNavigationToolCalibration::ClearOldPivot()
 {
   mitk::NavigationData::Pointer tempND = mitk::NavigationData::New();
   this->ApplyToolTipTransform(tempND);
   UpdateManualToolTipCalibrationView();
   //m_ManualToolTipEditWidget->hide(); //TODO
   this->GetDataStorage()->Remove(m_ToolSurfaceInToolCoordinatesDataNode);
 }
 void QmitkIGTNavigationToolCalibration::OnAddPivotPose()
 {
   ClearOldPivot();
   //When the collect Poses Button is Clicked
   m_OnAddPivotPoseClicked = true;
   m_NumberOfNavigationData = m_Controls.m_PosesToCollect->value();
 
 }
 
 void QmitkIGTNavigationToolCalibration::AddPivotPose()
 {
   //Save the poses to be used in computation
   if (PivotCount < m_NumberOfNavigationData)
   {
     mitk::NavigationData::Pointer currentPose = mitk::NavigationData::New();
     currentPose->Graft(m_Controls.m_SelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_IDToolToCalibrate));
     m_PivotPoses.push_back(currentPose);
     m_Controls.m_PoseNumber->setText(QString::number(m_PivotPoses.size()));
     PivotCount++;
   }
   if (PivotCount == m_NumberOfNavigationData)
   {
     m_OnAddPivotPoseClicked = false;
   }
 }
 
 void QmitkIGTNavigationToolCalibration::OnComputePivot()
 {
 
   mitk::PivotCalibration::Pointer myPivotCalibration = mitk::PivotCalibration::New();
   for (std::size_t i = 0; i < this->m_PivotPoses.size(); i++)
   {
     myPivotCalibration->AddNavigationData(m_PivotPoses.at(i));
   }
   QString resultString;
   if (myPivotCalibration->ComputePivotResult())
   {
     mitk::NavigationData::Pointer markerTransformationTrackingCoordinates = m_PivotPoses.at(0);
 
-    //Get computed pivot transfromation in tool coordinates
+    //Get computed pivot transformation in tool coordinates
 
     mitk::NavigationData::Pointer ToolTipToTool = mitk::NavigationData::New();
     ToolTipToTool->SetPosition(myPivotCalibration->GetResultPivotPoint());
     ToolTipToTool->SetOrientation(mitk::Quaternion(0,0,0,1));
     mitk::NavigationData::Pointer TrackerToTool = mitk::NavigationData::New();
     TrackerToTool->SetOrientation(markerTransformationTrackingCoordinates->GetOrientation());
     TrackerToTool->SetPosition(markerTransformationTrackingCoordinates->GetPosition());
     TrackerToTool->Compose(ToolTipToTool);
 
     // Compute pivot point in relation to marker transformation for preview
     mitk::NavigationData::Pointer ToolTipToTracker = mitk::NavigationData::New();
     ToolTipToTracker->Compose(ToolTipToTool);
     ToolTipToTracker->Compose(markerTransformationTrackingCoordinates);
 
     //add the preview node to the data storage
     ShowToolTipPreview(ToolTipToTracker);
 
     //parse result string
     resultString = QString("Pivot computation succeeded!\n")
       + QString("RMS Error: ") + QString::number(myPivotCalibration->GetResultRMSError()) + QString("\n")
       + QString("Pivot Point: ") + QString::number(myPivotCalibration->GetResultPivotPoint()[0]) + ";" + QString::number(myPivotCalibration->GetResultPivotPoint()[1]) + ";" + QString::number(myPivotCalibration->GetResultPivotPoint()[2]) + QString("\n");
 
     //finally: save results to member variable
     m_ComputedToolTipTransformation = ToolTipToTool;
 
 
     //enable button to use the computed point with the tool
     m_Controls.m_UseComputedPivotPoint->setEnabled(true);
   }
   else
   {
     resultString = "Pivot computation failed!";
   }
   MITK_INFO << resultString.toStdString().c_str();
   m_Controls.m_ResultText->setText(resultString);
 
 }
 void QmitkIGTNavigationToolCalibration::UpdatePivotCount()
 {
   PivotCount = 0;
   while (!m_PivotPoses.empty())
   {
     m_PivotPoses.pop_back();
   }
   m_Controls.m_PoseNumber->setText(QString::number(PivotCount));
 }
 
 void QmitkIGTNavigationToolCalibration::OnUseComputedPivotPoint()
 {
   RemoveToolTipPreview();
   QString resultString = QString("Pivoted tool tip transformation was written to the tool ") + m_ToolToCalibrate->GetToolName().c_str();
   ApplyToolTipTransform(m_ComputedToolTipTransformation, resultString.toStdString());
   m_Controls.m_ResultText->setText(resultString);
   UpdatePivotCount();
 }
 
 void QmitkIGTNavigationToolCalibration::ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message)
 {
   if (!CheckInitialization(false)) { return; }
 
   //Update tool in tool storage
   m_ToolToCalibrate->SetToolTipPosition(ToolTipTransformInToolCoordinates->GetPosition());
   m_ToolToCalibrate->SetToolAxisOrientation(ToolTipTransformInToolCoordinates->GetOrientation());
 
   //And also update tracking device, so the transform is directly used
   mitk::TrackingDeviceSource::Pointer trackingDeviceSource;
   try
   {
     trackingDeviceSource = dynamic_cast<mitk::TrackingDeviceSource*>(m_NavigationDataSourceOfToolToCalibrate.GetPointer());
     mitk::TrackingTool::Pointer TrackingToolToCalibrate = trackingDeviceSource->GetTrackingDevice()->GetTool(m_IDToolToCalibrate);
     TrackingToolToCalibrate->SetToolTipPosition(ToolTipTransformInToolCoordinates->GetPosition(), ToolTipTransformInToolCoordinates->GetOrientation());
   }
   catch (std::exception& e)
   {
     MITK_ERROR << "Error while trying to set the tool tip to the running tracking device. Aborting! (" << e.what() << ")";
   }
   MITK_INFO << message;
 }
 
 void QmitkIGTNavigationToolCalibration::ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates)
 {
   if(m_ToolTipPointPreview.IsNull())
   {
     m_ToolTipPointPreview = mitk::DataNode::New();
     m_ToolTipPointPreview->SetName("Modified Tool Tip Preview");
     mitk::Color blue;
     blue.SetBlue(1);
     m_ToolTipPointPreview->SetColor(blue);
     mitk::Surface::Pointer mySphere = mitk::Surface::New();
     vtkSmartPointer<vtkSphereSource> vtkData = vtkSmartPointer<vtkSphereSource>::New();
     vtkData->SetRadius(3.0f);
     vtkData->SetCenter(0.0, 0.0, 0.0);
     vtkData->Update();
     mySphere->SetVtkPolyData(vtkData->GetOutput());
     m_ToolTipPointPreview->SetData(mySphere);
 
     this->GetDataStorage()->Add(m_ToolTipPointPreview);
   }
   m_ToolTipPointPreview->GetData()->GetGeometry()->SetIndexToWorldTransform(ToolTipInTrackingCoordinates->GetAffineTransform3D());
 }
 
 void QmitkIGTNavigationToolCalibration::RemoveToolTipPreview()
 {
   this->GetDataStorage()->Remove(m_ToolTipPointPreview.GetPointer());
 }
 void QmitkIGTNavigationToolCalibration::UpdateManualToolTipCalibrationView()
 {
   if (m_ToolToCalibrate.IsNull()) { return; }
   //parse human readable transformation data and display it
   std::stringstream translation;
   std::stringstream orientation;
   translation << m_ToolToCalibrate->GetToolTipPosition();
   orientation << "Quaternion: (" << m_ToolToCalibrate->GetToolAxisOrientation() << ")" << std::endl;
   orientation << std::endl;
   orientation << "Euler Angles [rad]: (" << m_ToolToCalibrate->GetToolAxisOrientation().rotation_euler_angles() << ")" << std::endl;
   orientation << std::endl;
   orientation << "Matrix:" << std::endl;
   vnl_matrix_fixed<double, 3, 3> rotMatrix = m_ToolToCalibrate->GetToolAxisOrientation().rotation_matrix_transpose();
   orientation << rotMatrix[0][0] << " " << rotMatrix[0][1] << " " << rotMatrix[0][2] << std::endl;
   orientation << rotMatrix[1][0] << " " << rotMatrix[1][1] << " " << rotMatrix[1][2] << std::endl;
   orientation << rotMatrix[2][0] << " " << rotMatrix[2][1] << " " << rotMatrix[2][2] << std::endl;
   m_Controls.m_ManualCurrentTranslation->setText(translation.str().c_str());
   m_Controls.m_ManualCurrentOrientation->setPlainText(orientation.str().c_str());
 }
 
 void QmitkIGTNavigationToolCalibration::OnStartManualToolTipCalibration()
 {
   if (!CheckInitialization(false)) { return; }
 
   m_ToolTransformationWidget->SetToolToEdit(m_ToolToCalibrate);
   m_ToolTransformationWidget->SetDefaultOffset(m_ToolToCalibrate->GetToolTipPosition());
   m_ToolTransformationWidget->SetDefaultRotation(m_ToolToCalibrate->GetToolAxisOrientation());
 
   m_ToolTransformationWidget->open();
 }
 
 void QmitkIGTNavigationToolCalibration::OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip)
 {
   //This function is called, when the toolTipEdit view is closed.
-  //if user pressed cancle, nullptr is returned. Do nothing. Else, set values.
+  //if user pressed cancel, nullptr is returned. Do nothing. Else, set values.
   if (toolTip)
   {
     mitk::NavigationData::Pointer tempND = mitk::NavigationData::New(toolTip);//Convert to Navigation data for simple transversion to quaternion
     QString resultString = QString("Manual edited values are written to ") + m_ToolToCalibrate->GetToolName().c_str();
     ApplyToolTipTransform(tempND, resultString.toStdString());
     m_Controls.m_ResultText->setText(resultString);
     m_ComputedToolTipTransformation = tempND;
   }
 
   UpdateManualToolTipCalibrationView();
 }
 
 void QmitkIGTNavigationToolCalibration::OnGetPositions()
 {
   if (!CheckInitialization(true)) { return; }
 
   //Navigation Data from Tool which should be calibrated
   if (!m_AxisCalibration_ToolToCalibrate)
     m_AxisCalibration_ToolToCalibrate = mitk::NavigationData::New();
   m_AxisCalibration_ToolToCalibrate->Graft(m_Controls.m_SelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_IDToolToCalibrate));
 
   //Navigation Data from calibration pointer tool
   if (!m_AxisCalibration_NavDataCalibratingTool)
     m_AxisCalibration_NavDataCalibratingTool = mitk::NavigationData::New();
   m_AxisCalibration_NavDataCalibratingTool->Graft(m_Controls.m_SelectionWidget->GetSelectedNavigationDataSource()->GetOutput(m_IDCalibrationPointer));
 
   MITK_DEBUG << "Positions for tool axis calibration:";
   MITK_DEBUG << "    ToolTip: " << m_AxisCalibration_ToolToCalibrate->GetPosition() << ",";
   MITK_DEBUG << "    Rotation: \n" << m_AxisCalibration_ToolToCalibrate->GetRotationMatrix();
   MITK_DEBUG << "    End of the tool: " << m_AxisCalibration_NavDataCalibratingTool->GetPosition();
 
   QString _label = "Position recorded: " + QString::number(m_AxisCalibration_NavDataCalibratingTool->GetPosition()[0], 'f', 1) + ", "
     + QString::number(m_AxisCalibration_NavDataCalibratingTool->GetPosition()[1], 'f', 1) + ", "
     + QString::number(m_AxisCalibration_NavDataCalibratingTool->GetPosition()[2], 'f', 1);
   m_Controls.m_ToolAxisPositionLabel->setText(_label);
 }
 
 void QmitkIGTNavigationToolCalibration::OnCalibrateToolAxis()
 {
   if (!m_ComputedToolTipTransformation)
   {
     MITK_ERROR << "Please compute tool tip first.";
-    QMessageBox::information(nullptr, "Error", "Please compute / specifiy tool tip first");
+    QMessageBox::information(nullptr, "Error", "Please compute / specify tool tip first");
     return;
   }
   if (!m_AxisCalibration_ToolToCalibrate || !m_AxisCalibration_NavDataCalibratingTool)
   {
     MITK_ERROR << "Please record position first.";
     QMessageBox::information(nullptr, "Error", "Please record position first");
     return;
   }
 
   //Calculate the tool tip
   //here is an explanation, what is happening here:
   /*
   The axis is equal to the (tool tip) minus the (end of the tool) in tool coordinates of the tool which should be calibrated.
   The tool tip is defined as the origin of the tool coordinate system.
   The end of the tool is recorded by the calibration pointer's position and is transformed into the coordinate system of the tool to be calibrated
   Normalize it.
   */
   //m_CalibratedToolAxis = -m_AxisCalibration_ToolToCalibrate->TransformPoint(m_AxisCalibration_NavDataCalibratingTool->GetPosition()).GetVectorFromOrigin();
   m_CalibratedToolAxis = -m_AxisCalibration_ToolToCalibrate->GetInverse()->TransformPoint(m_AxisCalibration_NavDataCalibratingTool->GetPosition()).GetVectorFromOrigin();
   MITK_DEBUG << "Tool Endpoint in Tool coordinates: " << m_CalibratedToolAxis;
   m_CalibratedToolAxis.Normalize();
   MITK_DEBUG << "Tool Axis: " << m_CalibratedToolAxis;
 
   m_ToolToCalibrate->SetToolAxis(mitk::Point3D(m_CalibratedToolAxis));
 
   // Update TrackingTool
   m_ComputedToolTipTransformation->SetPosition(m_ToolToCalibrate->GetToolTipPosition());
   m_ComputedToolTipTransformation->SetOrientation(m_ToolToCalibrate->GetToolAxisOrientation());
   ApplyToolTipTransform(m_ComputedToolTipTransformation);
 
   //Update GUI
   QString calibratedToolAxisString = "Tool Axis: " + QString::number(m_CalibratedToolAxis.GetElement(0), 'f', 3) + ", " +
     QString::number(m_CalibratedToolAxis.GetElement(1), 'f', 3) + ", " + QString::number(m_CalibratedToolAxis.GetElement(2), 'f', 3);
   m_Controls.m_ToolAxisCalibrationLabel->setText(calibratedToolAxisString);
 
   //Block QT signals, we don't want to emit SpinboxChanged on the first value to overwrite the next ones
   m_Controls.m_ToolAxis_X->blockSignals(true); m_Controls.m_ToolAxis_Y->blockSignals(true); m_Controls.m_ToolAxis_Z->blockSignals(true);
   m_Controls.m_ToolAxis_X->setValue(m_CalibratedToolAxis[0]);
   m_Controls.m_ToolAxis_Y->setValue(m_CalibratedToolAxis[1]);
   m_Controls.m_ToolAxis_Z->setValue(m_CalibratedToolAxis[2]);
   m_Controls.m_ToolAxis_X->blockSignals(false); m_Controls.m_ToolAxis_Y->blockSignals(false); m_Controls.m_ToolAxis_Z->blockSignals(false);
 }
 
 void QmitkIGTNavigationToolCalibration::OnToolAxisSpinboxChanged()
 {
   m_CalibratedToolAxis.SetElement(0, m_Controls.m_ToolAxis_X->value());
   m_CalibratedToolAxis.SetElement(1, m_Controls.m_ToolAxis_Y->value());
   m_CalibratedToolAxis.SetElement(2, m_Controls.m_ToolAxis_Z->value());
   m_ToolToCalibrate->SetToolAxis(mitk::Point3D(m_CalibratedToolAxis));
   // Update TrackingTool
   if (m_ComputedToolTipTransformation.IsNull())
   {
     m_ComputedToolTipTransformation = mitk::NavigationData::New();
   }
   m_ComputedToolTipTransformation->SetPosition(m_ToolToCalibrate->GetToolTipPosition());
   m_ComputedToolTipTransformation->SetOrientation(m_ToolToCalibrate->GetToolAxisOrientation());
   ApplyToolTipTransform(m_ComputedToolTipTransformation);
 
   MITK_INFO << "Tool axis changed to " << m_CalibratedToolAxis;
 }
 
 void QmitkIGTNavigationToolCalibration::SetToolToCalibrate()
 {
   m_IDToolToCalibrate = m_Controls.m_SelectionWidget->GetSelectedToolID();
   if (m_IDToolToCalibrate == -1) //no valid tool to calibrate
   {
     m_Controls.m_CalToolLabel->setText("<none>");
     m_Controls.m_StatusWidgetToolToCalibrate->RemoveStatusLabels();
     m_TrackingTimer->stop();
   }
   else
   {
     m_ToolToCalibrate = m_Controls.m_SelectionWidget->GetSelectedNavigationTool();
     m_NavigationDataSourceOfToolToCalibrate = m_Controls.m_SelectionWidget->GetSelectedNavigationDataSource();
     m_Controls.m_CalToolLabel->setText(m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate)->GetName());
     //initialize widget
     m_Controls.m_StatusWidgetToolToCalibrate->RemoveStatusLabels();
     m_Controls.m_StatusWidgetToolToCalibrate->SetShowPositions(true);
     m_Controls.m_StatusWidgetToolToCalibrate->SetTextAlignment(Qt::AlignLeft);
     m_Controls.m_StatusWidgetToolToCalibrate->AddNavigationData(m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate));
     m_Controls.m_StatusWidgetToolToCalibrate->ShowStatusLabels();
     //initialize manual tool tip calibration view
     UpdateManualToolTipCalibrationView();
     //save tool surface in tool coordinates for further editing
     mitk::Surface::Pointer ToolSurface = dynamic_cast<mitk::Surface*>(m_ToolToCalibrate->GetDataNode()->GetData())->Clone();
     m_ToolSurfaceInToolCoordinatesDataNode->SetData(ToolSurface);
     m_ToolSurfaceInToolCoordinatesDataNode->GetData()->GetGeometry()->SetIdentity();
     // update tool tip and rotation information for tool tip calibration tab
     UpdateManualToolTipCalibrationView();
     // update tool axis information for tool axis calibration tab
     mitk::Point3D toolAxis = m_ToolToCalibrate->GetToolAxis();
     m_CalibratedToolAxis[0] = toolAxis[0];
     m_CalibratedToolAxis[1] = toolAxis[1];
     m_CalibratedToolAxis[2] = toolAxis[2];
     m_Controls.m_ToolAxis_X->blockSignals(true); m_Controls.m_ToolAxis_Y->blockSignals(true); m_Controls.m_ToolAxis_Z->blockSignals(true);
     m_Controls.m_ToolAxis_X->setValue(m_CalibratedToolAxis[0]);
     m_Controls.m_ToolAxis_Y->setValue(m_CalibratedToolAxis[1]);
     m_Controls.m_ToolAxis_Z->setValue(m_CalibratedToolAxis[2]);
     m_Controls.m_ToolAxis_X->blockSignals(false); m_Controls.m_ToolAxis_Y->blockSignals(false); m_Controls.m_ToolAxis_Z->blockSignals(false);
 
     //start updating timer for status widgets, etc.
     if (!m_TrackingTimer->isActive()) m_TrackingTimer->start(100);
   }
 }
 
 void QmitkIGTNavigationToolCalibration::SetCalibrationPointer()
 {
   m_IDCalibrationPointer = m_Controls.m_SelectionWidget->GetSelectedToolID();
   if (m_IDCalibrationPointer == -1)
   {
     m_Controls.m_PointerLabel->setText("<none>");
     m_Controls.m_StatusWidgetCalibrationPointer->RemoveStatusLabels();
     m_TrackingTimer->stop();
   }
   else
   {
     m_NavigationDataSourceOfCalibrationPointer = m_Controls.m_SelectionWidget->GetSelectedNavigationDataSource();
     m_Controls.m_PointerLabel->setText(m_NavigationDataSourceOfCalibrationPointer->GetOutput(m_IDCalibrationPointer)->GetName());
     //initialize widget
     m_Controls.m_StatusWidgetCalibrationPointer->RemoveStatusLabels();
     m_Controls.m_StatusWidgetCalibrationPointer->SetShowPositions(true);
     m_Controls.m_StatusWidgetCalibrationPointer->SetTextAlignment(Qt::AlignLeft);
     m_Controls.m_StatusWidgetCalibrationPointer->AddNavigationData(m_NavigationDataSourceOfCalibrationPointer->GetOutput(m_IDCalibrationPointer));
     m_Controls.m_StatusWidgetCalibrationPointer->ShowStatusLabels();
     if (!m_TrackingTimer->isActive()) m_TrackingTimer->start(100);
   }
 }
 
 void QmitkIGTNavigationToolCalibration::UpdateOffsetCoordinates()
 {
   if (m_NavigationDataSourceOfCalibrationPointer.IsNull() || m_NavigationDataSourceOfToolToCalibrate.IsNull())
   {
     return;
   }
 
   mitk::NavigationData::Pointer referenceToolND = m_NavigationDataSourceOfCalibrationPointer->GetOutput(m_IDCalibrationPointer);
   mitk::NavigationData::Pointer toolToCalibrateND = m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate);
 
   if (referenceToolND->IsDataValid() && toolToCalibrateND->IsDataValid())
   {
     //computation: difference between both tools (in tool coordinates)
     //differenceND = toolToCalibrateND^-1 * referenceToolND
     mitk::NavigationData::Pointer differenceND = mitk::NavigationData::New();
     differenceND->Compose(referenceToolND);
     differenceND->Compose(toolToCalibrateND->GetInverse());
 
     //display this orientation in the UI
     m_Controls.m_OffsetCoordinates->setText(
       QString("x: ") + QString(QString::number(differenceND->GetPosition()[0], 103, 3)) +
       QString("; y: ") + (QString::number(differenceND->GetPosition()[1], 103, 3)) +
       QString("; z: ") + (QString::number(differenceND->GetPosition()[2], 103, 3)));
 
     m_Controls.m_OrientationOffsetCoordinates->setText(
       QString("qx: ") + QString(QString::number(differenceND->GetOrientation().x(), 103, 3)) +
       QString("; qy: ") + (QString::number(differenceND->GetOrientation().y(), 103, 3)) +
       QString("; qz: ") + (QString::number(differenceND->GetOrientation().z(), 103, 3)) +
       QString("; qr: ") + (QString::number(differenceND->GetOrientation().r(), 103, 3)));
 
     //also update preview if active
     if (m_ToolTipPointPreview.IsNotNull()) //NOT WORKING! TODO: fix or remove!
     {
       mitk::NavigationData::Pointer ToolTipTransform = mitk::NavigationData::New();
       ToolTipTransform->SetPosition(m_ResultOffsetVector);
-      mitk::NavigationData::Pointer ToolTipInTrackingCoordinates = mitk::NavigationData::New(); //maybe store as for better peformance...
+      mitk::NavigationData::Pointer ToolTipInTrackingCoordinates = mitk::NavigationData::New(); //maybe store as for better performance...
       ToolTipInTrackingCoordinates->Compose(m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate));
       ToolTipInTrackingCoordinates->Compose(ToolTipTransform);
       m_ToolTipPointPreview->GetData()->GetGeometry()->SetIndexToWorldTransform(ToolTipInTrackingCoordinates->GetAffineTransform3D());
     }
   }
 }
 
 void QmitkIGTNavigationToolCalibration::UpdateTrackingTimer()
 {
   m_Controls.m_StatusWidgetToolToCalibrate->Refresh();
   m_Controls.m_StatusWidgetCalibrationPointer->Refresh();
 
   if (m_OnLoginSingleRefToolNavigationDataClicked) LoginSingleRefToolNavigationData();
 
   if (m_OnAddPivotPoseClicked) AddPivotPose();
 
   // 1 == Single Reference Calibration Method
   if (m_IndexCurrentCalibrationMethod == 1) UpdateOffsetCoordinates();
 
 }
 
 void QmitkIGTNavigationToolCalibration::AddLandmark()
 {
   if (!CheckInitialization()) { return; }
   mitk::NavigationData::Pointer navDataTool = m_NavigationDataSourceOfToolToCalibrate->GetOutput(m_IDToolToCalibrate);
   mitk::Point3D landmark = m_NavigationDataSourceOfCalibrationPointer->GetOutput(m_IDCalibrationPointer)->GetPosition();
 
   //convert to itk transform
   itk::Vector<double, 3> translation;
   for (int k = 0; k < 3; k++) translation[k] = navDataTool->GetPosition()[k];
   itk::Matrix<double, 3, 3> rotation;
   for (int k = 0; k < 3; k++) for (int l = 0; l < 3; l++) rotation[k][l] = navDataTool->GetOrientation().rotation_matrix_transpose()[k][l];
   rotation = rotation.GetTranspose();
   itk::Vector<double> landmarkItk;
   landmarkItk[0] = landmark[0];
   landmarkItk[1] = landmark[1];
   landmarkItk[2] = landmark[2];
 
   //compute landmark in tool coordinates
   itk::Matrix<double, 3, 3> rotationInverse;
   for (int k = 0; k < 3; k++) for (int l = 0; l < 3; l++) rotationInverse[k][l] = rotation.GetInverse()[k][l];
   landmarkItk = rotationInverse * (landmarkItk - translation);
 
   //convert back and add landmark to pointset
   landmark[0] = landmarkItk[0];
   landmark[1] = landmarkItk[1];
   landmark[2] = landmarkItk[2];
   m_RegistrationLandmarks->InsertPoint(m_RegistrationLandmarks->GetSize(), landmark);
 }
 
 void QmitkIGTNavigationToolCalibration::SaveCalibratedTool()
 {
   if (m_ToolToCalibrate.IsNotNull())
   {
     mitk::NavigationTool::Pointer calibratedTool = m_ToolToCalibrate;
     calibratedTool->SetToolControlPoints(this->m_CalibrationLandmarks);
     calibratedTool->SetToolLandmarks(this->m_RegistrationLandmarks);
     mitk::NavigationToolWriter::Pointer myWriter = mitk::NavigationToolWriter::New();
     QString filename = QFileDialog::getSaveFileName(nullptr,tr("Save Navigation Tool"), "/", "*.IGTTool");
     if (filename.isEmpty()) return;
 
     // ensure that file suffix is set
     QFileInfo file(filename);
     if (file.suffix().isEmpty())
     {
       filename += ".IGTTool";
     }
 
     if (myWriter->DoWrite(filename.toStdString(), calibratedTool)) MITK_INFO << "Saved calibrated tool to file " << filename;
     else MITK_WARN << "Can't write tool to file " << filename;
   }
   else
   {
     MITK_ERROR << "Did not find navigation tool storage of calibrated tool, aborting!";
   }
 }
 
 bool QmitkIGTNavigationToolCalibration::CheckInitialization(bool CalibrationPointerRequired)
 {
   if ((m_IDToolToCalibrate == -1) ||
     ((CalibrationPointerRequired) &&
     (m_IDCalibrationPointer == -1)
     )
     )
   {
     QMessageBox msgBox;
     msgBox.setText("Tool to calibrate and/or calibration pointer not initialized, cannot proceed!");
     msgBox.exec();
     return false;
   }
   else { return true; }
 }
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h
index 00c3e4c14c..8bb0f43f75 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.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 QmitkIGTNavigationToolCalibration_h
 #define QmitkIGTNavigationToolCalibration_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include <mitkNavigationData.h>
 
 #include "QmitkInteractiveTransformationWidget.h"
 
 
 #include "ui_QmitkIGTNavigationToolCalibrationControls.h"
 
 #include <mitkNavigationDataRecorder.h>
 
 //QT headers
 #include <QTimer>
 
 
 /*!
   \brief IGTNavigationToolCalibration
 
   \warning  This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
 
   \ingroup ${plugin_target}_internal
   */
 class  QmitkIGTNavigationToolCalibration : 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:
 
 	QmitkIGTNavigationToolCalibration();
 
   ~QmitkIGTNavigationToolCalibration() override;
 
   static const std::string VIEW_ID;
 
   void CreateQtPartControl(QWidget *parent) override;
 
   protected slots:
 
 
   void OnAddPivotPose();
   void OnComputePivot();
   void OnUseComputedPivotPoint();
   void SetToolToCalibrate();
   void SetCalibrationPointer();
   void UpdateTrackingTimer();
   void AddLandmark();
   void SaveCalibratedTool();
   void OnToolCalibrationMethodChanged(int index);
   void OnStartManualToolTipCalibration();
   void OnRunSingleRefToolCalibrationClicked();
   void OnLoginSingleRefToolNavigationDataClicked();
   void OnSetNewToolTipPosButtonClicked();
   void OnGetPositions();
   void OnCalibrateToolAxis();
   void OnToolAxisSpinboxChanged();
   void OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip);
 
 protected:
 
   void SetFocus() override;
 
   void UpdateOffsetCoordinates();
 
   int m_IndexCurrentCalibrationMethod;
 
   Ui::IGTNavigationToolCalibrationControls m_Controls;
 
   //some general members
   mitk::NavigationTool::Pointer m_ToolToCalibrate; //<<< tool that will be calibrated
   int m_IDToolToCalibrate; //<<< id of tool that will be calibrated (of the navigation data source)
   mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfToolToCalibrate; //<<< navigation data source of the tool that will be calibrated
   mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfCalibrationPointer; //<<< navigation data source of the calibration pointer
   mitk::DataNode::Pointer m_ToolSurfaceInToolCoordinatesDataNode; //<<< holds the tool surface in tool coordinates (for preview purposes)
   int m_IDCalibrationPointer; //<<< id of the calibration pointer (of the corresponding navigation data source)
   QTimer* m_TrackingTimer; //<<< tracking timer that updates the status widgets
-  void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message = "Tool was updated with the calibrated tool tip!"); //<<< applys the given tool tip transform to the tool to calibrate
+  void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message = "Tool was updated with the calibrated tool tip!"); //<<< applies the given tool tip transform to the tool to calibrate
   bool CheckInitialization(bool CalibrationPointerRequired = true); //<<< checks if the tool to calibrate and (if required) the calibration pointer is initialized. Displays a warning and returns false if not.
   mitk::NavigationData::Pointer m_ComputedToolTipTransformation; //<<< holds the new tooltip transformation after it was computed to write it into the tool later
 
   // members and helper methods for pivot tool calibration
   std::vector<mitk::NavigationData::Pointer> m_PivotPoses;
   void AddPivotPose();
   void ClearOldPivot();
   void UpdatePivotCount();
   bool  m_OnAddPivotPoseClicked;
   int PivotCount;
 
   // members and helper methods for manual tool calibration
   void UpdateManualToolTipCalibrationView();
   QmitkInteractiveTransformationWidget* m_ToolTransformationWidget;
 
   // members and helper methods for single reference tool calibration
   void LoginSingleRefToolNavigationData();
   std::vector< mitk::Point3D > m_LoggedNavigationDataOffsets;
   std::vector< mitk::NavigationData::Pointer > m_LoggedNavigationDataDifferences;
   bool m_OnLoginSingleRefToolNavigationDataClicked;
   int m_NumberOfNavigationData;
   int m_NumberOfNavigationDataCounter;
   mitk::Point3D m_ResultOffsetVector;
 
   // members and helper methods for tool tip preview
   mitk::DataNode::Pointer m_ToolTipPointPreview; //<<< Data node of the tool tip preview
   void ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates); //<<< Adds a preview of the tool tip into the data storage
   void RemoveToolTipPreview(); //<<< Removes the preview
 
   // members for the tool landmark calibration
   mitk::PointSet::Pointer m_CalibrationLandmarks;
   mitk::DataNode::Pointer m_CalibrationLandmarksNode;
   mitk::PointSet::Pointer m_RegistrationLandmarks;
   mitk::DataNode::Pointer m_RegistrationLandmarksNode;
 
   //members and helper methods for tool axis calibration
   mitk::Vector3D m_CalibratedToolAxis;
   mitk::NavigationData::Pointer  m_AxisCalibration_ToolToCalibrate;
   mitk::NavigationData::Pointer  m_AxisCalibration_NavDataCalibratingTool;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.cpp b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.cpp
index 82feb76914..cae308e21e 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.cpp
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.cpp
@@ -1,1437 +1,1437 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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>
 
 // Qmitk
 #include "QmitkMITKIGTTrackingToolboxView.h"
 
 // Qt
 #include <QMessageBox>
 #include <QSettings>
 #include <QFileDialog>
 
 // MITK
 #include <mitkNavigationToolStorageDeserializer.h>
 #include <mitkTrackingVolumeGenerator.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNavigationToolStorageSerializer.h>
 #include <mitkIOUtil.h>
 #include <mitkLogBackend.h>
 #include <mitkTrackingDeviceTypeCollection.h>
 #include <mitkUnspecifiedTrackingTypeInformation.h>
 #include <mitkNeedleProjectionFilter.h>
 
 //for exceptions
 #include <mitkIGTException.h>
 #include <mitkIGTIOException.h>
 
 #include "mitkPluginActivator.h"
 
 const std::string QmitkMITKIGTTrackingToolboxView::VIEW_ID = "org.mitk.views.mitkigttrackingtoolbox";
 
 QmitkMITKIGTTrackingToolboxView::QmitkMITKIGTTrackingToolboxView()
   : QmitkAbstractView()
   , m_Controls(nullptr)
   , m_DeviceTypeCollection(nullptr)
   , m_ToolProjectionNode(nullptr)
 {
   m_TrackingLoggingTimer = new QTimer(this);
   m_TrackingRenderTimer = new QTimer(this);
   m_TimeoutTimer = new QTimer(this);
   m_tracking = false;
   m_connected = false;
   m_logging = false;
   m_ShowHideToolAxis = false;
   m_loggedFrames = 0;
   m_SimpleModeEnabled = false;
   m_NeedleProjectionFilter = mitk::NeedleProjectionFilter::New();
 
   //create filename for autosaving of tool storage
   auto loggingPathWithoutFilename = QString::fromStdString(mitk::LogBackend::GetLogFile());
   if (!loggingPathWithoutFilename.isEmpty()) //if there already is a path for the MITK logging file use this one
   {
     //extract path from path+filename (if someone knows a better way to do this feel free to change it)
     int lengthOfFilename = QFileInfo(QString::fromStdString(mitk::LogBackend::GetLogFile())).fileName().size();
     loggingPathWithoutFilename.resize(loggingPathWithoutFilename.size() - lengthOfFilename);
     m_AutoSaveFilename = loggingPathWithoutFilename + "TrackingToolboxAutoSave.IGTToolStorage";
   }
   else //if not: use a temporary path from IOUtil
   {
     m_AutoSaveFilename = QString(mitk::IOUtil::GetTempPath().c_str()) + "TrackingToolboxAutoSave.IGTToolStorage";
   }
   MITK_INFO("IGT Tracking Toolbox") << "Filename for auto saving of IGT ToolStorages: " << m_AutoSaveFilename.toStdString();
 
   //! [Thread 1]
   //initialize worker thread
   m_WorkerThread = new QThread();
   m_Worker = new QmitkMITKIGTTrackingToolboxViewWorker();
   //! [Thread 1]
 
   ctkPluginContext* pluginContext = mitk::PluginActivator::GetContext();
   if (pluginContext)
   {
     QString interfaceName = QString::fromStdString(us_service_interface_iid<mitk::TrackingDeviceTypeCollection>());
     QList<ctkServiceReference> serviceReference = pluginContext->getServiceReferences(interfaceName);
 
     if (serviceReference.size() > 0)
     {
       m_DeviceTypeServiceReference = serviceReference.at(0);
       const ctkServiceReference& r = serviceReference.at(0);
       m_DeviceTypeCollection = pluginContext->getService<mitk::TrackingDeviceTypeCollection>(r);
     }
     else
     {
       MITK_INFO << "No Tracking Device Collection!";
     }
   }
 }
 
 QmitkMITKIGTTrackingToolboxView::~QmitkMITKIGTTrackingToolboxView()
 {
   this->StoreUISettings();
   m_TrackingLoggingTimer->stop();
   m_TrackingRenderTimer->stop();
   m_TimeoutTimer->stop();
   delete m_TrackingLoggingTimer;
   delete m_TrackingRenderTimer;
   delete m_TimeoutTimer;
   try
   {
     //! [Thread 2]
     // wait for thread to finish
     m_WorkerThread->terminate();
     m_WorkerThread->wait();
     //clean up worker thread
     if (m_WorkerThread) { delete m_WorkerThread; }
     if (m_Worker) { delete m_Worker; }
     //! [Thread 2]
 
     //remove the tracking volume
     this->GetDataStorage()->Remove(m_TrackingVolumeNode);
     //unregister microservices
     if (m_toolStorage) { m_toolStorage->UnRegisterMicroservice(); }
 
     if (m_IGTLMessageProvider.IsNotNull()){ m_IGTLMessageProvider->UnRegisterMicroservice(); }
   }
   catch (std::exception& e) { MITK_WARN << "Unexpected exception during clean up of tracking toolbox view: " << e.what(); }
   catch (...) { MITK_WARN << "Unexpected unknown error during clean up of tracking toolbox view!"; }
   //store tool storage and UI settings for persistence
   this->AutoSaveToolStorage();
   this->StoreUISettings();
 
   m_DeviceTypeCollection = nullptr;
   mitk::PluginActivator::GetContext()->ungetService(m_DeviceTypeServiceReference);
 }
 
 void QmitkMITKIGTTrackingToolboxView::CreateQtPartControl(QWidget *parent)
 {
   // build up qt view, unless already done
   if (!m_Controls)
   {
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls = new Ui::QmitkMITKIGTTrackingToolboxViewControls;
     m_Controls->setupUi(parent);
 
     //create connections
     connect(m_Controls->m_LoadTools, SIGNAL(clicked()), this, SLOT(OnLoadTools()));
     connect(m_Controls->m_ConnectDisconnectButton, SIGNAL(clicked()), this, SLOT(OnConnectDisconnect()));
     connect(m_Controls->m_StartStopTrackingButton, SIGNAL(clicked()), this, SLOT(OnStartStopTracking()));
     connect(m_Controls->m_ConnectSimpleMode, SIGNAL(clicked()), this, SLOT(OnConnectDisconnect()));
     connect(m_Controls->m_StartTrackingSimpleMode, SIGNAL(clicked()), this, SLOT(OnStartStopTracking()));
     connect(m_Controls->m_FreezeUnfreezeTrackingButton, SIGNAL(clicked()), this, SLOT(OnFreezeUnfreezeTracking()));
     connect(m_TrackingLoggingTimer, SIGNAL(timeout()), this, SLOT(UpdateLoggingTrackingTimer()));
     connect(m_TrackingRenderTimer, SIGNAL(timeout()), this, SLOT(UpdateRenderTrackingTimer()));
     connect(m_TimeoutTimer, SIGNAL(timeout()), this, SLOT(OnTimeOut()));
     connect(m_Controls->m_ChooseFile, SIGNAL(clicked()), this, SLOT(OnChooseFileClicked()));
     connect(m_Controls->m_StartLogging, SIGNAL(clicked()), this, SLOT(StartLogging()));
     connect(m_Controls->m_StopLogging, SIGNAL(clicked()), this, SLOT(StopLogging()));
     connect(m_Controls->m_VolumeSelectionBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(OnTrackingVolumeChanged(QString)));
     connect(m_Controls->m_ShowTrackingVolume, SIGNAL(clicked()), this, SLOT(OnShowTrackingVolumeChanged()));
     connect(m_Controls->m_AutoDetectTools, SIGNAL(clicked()), this, SLOT(OnAutoDetectTools()));
     connect(m_Controls->m_ResetTools, SIGNAL(clicked()), this, SLOT(OnResetTools()));
     connect(m_Controls->m_AddSingleTool, SIGNAL(clicked()), this, SLOT(OnAddSingleTool()));
     connect(m_Controls->m_NavigationToolCreationWidget, SIGNAL(NavigationToolFinished()), this, SLOT(OnAddSingleToolFinished()));
     connect(m_Controls->m_NavigationToolCreationWidget, SIGNAL(Canceled()), this, SLOT(OnAddSingleToolCanceled()));
     connect(m_Controls->m_CsvFormat, SIGNAL(clicked()), this, SLOT(OnToggleFileExtension()));
     connect(m_Controls->m_XmlFormat, SIGNAL(clicked()), this, SLOT(OnToggleFileExtension()));
     connect(m_Controls->m_UseDifferentUpdateRates, SIGNAL(clicked()), this, SLOT(OnToggleDifferentUpdateRates()));
     connect(m_Controls->m_RenderUpdateRate, SIGNAL(valueChanged(int)), this, SLOT(OnChangeRenderUpdateRate()));
     connect(m_Controls->m_DisableAllTimers, SIGNAL(stateChanged(int)), this, SLOT(EnableDisableTimerButtons(int)));
     connect(m_Controls->m_advancedUI, SIGNAL(clicked()), this, SLOT(OnToggleAdvancedSimpleMode()));
     connect(m_Controls->m_SimpleUI, SIGNAL(clicked()), this, SLOT(OnToggleAdvancedSimpleMode()));
     connect(m_Controls->showHideToolProjectionCheckBox, SIGNAL(clicked()), this, SLOT(OnShowHideToolProjectionClicked()));
     connect(m_Controls->showHideToolAxisCheckBox, SIGNAL(clicked()), this, SLOT(OnShowHideToolAxisClicked()));
 
     connect(m_Controls->m_toolselector, SIGNAL(currentIndexChanged(int)), this, SLOT(SelectToolProjection(int)));
 
 
 
 
     //connections for the tracking device configuration widget
     connect(m_Controls->m_ConfigurationWidget, SIGNAL(TrackingDeviceSelectionChanged()), this, SLOT(OnTrackingDeviceChanged()));
 
 
     //! [Thread 3]
     //connect worker thread
     connect(m_Worker, SIGNAL(AutoDetectToolsFinished(bool, QString)), this, SLOT(OnAutoDetectToolsFinished(bool, QString)));
     connect(m_Worker, SIGNAL(ConnectDeviceFinished(bool, QString)), this, SLOT(OnConnectFinished(bool, QString)));
     connect(m_Worker, SIGNAL(StartTrackingFinished(bool, QString)), this, SLOT(OnStartTrackingFinished(bool, QString)));
     connect(m_Worker, SIGNAL(StopTrackingFinished(bool, QString)), this, SLOT(OnStopTrackingFinished(bool, QString)));
     connect(m_Worker, SIGNAL(DisconnectDeviceFinished(bool, QString)), this, SLOT(OnDisconnectFinished(bool, QString)));
     connect(m_WorkerThread, SIGNAL(started()), m_Worker, SLOT(ThreadFunc()));
 
     connect(m_Worker, SIGNAL(ConnectDeviceFinished(bool, QString)), m_Controls->m_ConfigurationWidget, SLOT(OnConnected(bool)));
     connect(m_Worker, SIGNAL(DisconnectDeviceFinished(bool, QString)), m_Controls->m_ConfigurationWidget, SLOT(OnDisconnected(bool)));
     connect(m_Worker, SIGNAL(StartTrackingFinished(bool, QString)), m_Controls->m_ConfigurationWidget, SLOT(OnStartTracking(bool)));
     connect(m_Worker, SIGNAL(StopTrackingFinished(bool, QString)), m_Controls->m_ConfigurationWidget, SLOT(OnStopTracking(bool)));
 
 
     //Add Listener, so that we know when the toolStorage changed.
     std::string m_Filter = "(" + us::ServiceConstants::OBJECTCLASS() + "=" + "org.mitk.services.NavigationToolStorage" + ")";
     mitk::PluginActivator::GetContext()->connectServiceListener(this, "OnToolStorageChanged", QString(m_Filter.c_str()));
 
     //move the worker to the thread
     m_Worker->moveToThread(m_WorkerThread);
     //! [Thread 3]
 
     //initialize widgets
     m_Controls->m_TrackingToolsStatusWidget->SetShowPositions(true);
     m_Controls->m_TrackingToolsStatusWidget->SetTextAlignment(Qt::AlignLeft);
     m_Controls->m_simpleWidget->setVisible(false);
 
     //initialize tracking volume node
     m_TrackingVolumeNode = mitk::DataNode::New();
     m_TrackingVolumeNode->SetName("TrackingVolume");
     m_TrackingVolumeNode->SetBoolProperty("Backface Culling", true);
     mitk::Color red;
     red.SetRed(1);
     m_TrackingVolumeNode->SetColor(red);
 
     //initialize buttons
     m_Controls->m_AutoDetectTools->setVisible(false); //only visible if supported by tracking device
     m_Controls->m_StartStopTrackingButton->setEnabled(false);
     m_Controls->m_StartTrackingSimpleMode->setEnabled(false);
     m_Controls->m_FreezeUnfreezeTrackingButton->setEnabled(false);
 
     //initialize warning labels
     m_Controls->m_RenderWarningLabel->setVisible(false);
     m_Controls->m_TrackingFrozenLabel->setVisible(false);
 
 
     //initialize projection buttons
     //first it is disabled when the tool is connected check box for projection and axis is enabled
     m_Controls->showHideToolAxisCheckBox->setEnabled(false);
     m_Controls->showHideToolProjectionCheckBox->setEnabled(false);
     m_Controls->m_toolselector->setEnabled(false);
 
     //Update List of available models for selected tool.
     std::vector<mitk::TrackingDeviceData> Compatibles;
     if ((m_Controls == nullptr) || //check all these stuff for NULL, latterly this causes crashes from time to time
       (m_Controls->m_ConfigurationWidget == nullptr) ||
       (m_Controls->m_ConfigurationWidget->GetTrackingDevice().IsNull()))
     {
       MITK_ERROR << "Couldn't get current tracking device or an object is nullptr, something went wrong!";
       return;
     }
     else
     {
       Compatibles = m_DeviceTypeCollection->GetDeviceDataForLine(m_Controls->m_ConfigurationWidget->GetTrackingDevice()->GetType());
     }
     m_Controls->m_VolumeSelectionBox->clear();
     for (std::size_t i = 0; i < Compatibles.size(); i++)
     {
       m_Controls->m_VolumeSelectionBox->addItem(Compatibles[i].Model.c_str());
     }
 
     //initialize tool storage
     m_toolStorage = mitk::NavigationToolStorage::New(GetDataStorage());
     m_toolStorage->SetName("TrackingToolbox Default Storage");
     m_toolStorage->RegisterAsMicroservice();
 
     //set home directory as default path for logfile
     m_Controls->m_LoggingFileName->setText(QDir::toNativeSeparators(QDir::homePath()) + QDir::separator() + "logfile.csv");
 
     //tracking device may be changed already by the persistence of the
     //QmitkTrackingDeciveConfigurationWidget
     this->OnTrackingDeviceChanged();
 
     this->LoadUISettings();
 
     //add tracking volume node only to data storage
     this->GetDataStorage()->Add(m_TrackingVolumeNode);
     if (!m_Controls->m_ShowTrackingVolume->isChecked()) m_TrackingVolumeNode->SetOpacity(0.0);
     else m_TrackingVolumeNode->SetOpacity(0.25);
 
     //Update List of available models for selected tool.
     m_Controls->m_VolumeSelectionBox->clear();
     for (std::size_t i = 0; i < Compatibles.size(); i++)
     {
       m_Controls->m_VolumeSelectionBox->addItem(Compatibles[i].Model.c_str());
     }
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnLoadTools()
 {
   //read in filename
   QString filename = QFileDialog::getOpenFileName(nullptr, tr("Open Tool Storage"), "/", tr("Tool Storage Files (*.IGTToolStorage)"));
   if (filename.isNull()) return;
 
   //read tool storage from disk
   std::string errorMessage = "";
   mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(GetDataStorage());
   // try-catch block for exceptions
   try
   {
     this->ReplaceCurrentToolStorage(myDeserializer->Deserialize(filename.toStdString()), filename.toStdString());
   }
   catch (mitk::IGTException&)
   {
     std::string errormessage = "Error during loading the tool storage file. Please only load tool storage files created with the NavigationToolManager view.";
     QMessageBox::warning(nullptr, "Tool Storage Loading Error", errormessage.c_str());
     return;
   }
 
   if (m_toolStorage->isEmpty())
   {
     errorMessage = myDeserializer->GetErrorMessage();
     MessageBox(errorMessage);
     return;
   }
 
   //update label
   UpdateToolStorageLabel(filename);
 
   //update tool preview
   m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels();
   m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage);
 
   //save filename for persistent storage
   m_ToolStorageFilename = filename;
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnResetTools()
 {
   //remove data nodes of surfaces from data storage to clean up
   for (unsigned int i = 0; i < m_toolStorage->GetToolCount(); i++)
   {
     this->GetDataStorage()->Remove(m_toolStorage->GetTool(i)->GetDataNode());
   }
   this->ReplaceCurrentToolStorage(mitk::NavigationToolStorage::New(GetDataStorage()), "TrackingToolbox Default Storage");
   m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels();
   QString toolLabel = QString("<none>");
   m_Controls->m_ToolLabel->setText(toolLabel);
   m_ToolStorageFilename = "";
 
   RemoveAllToolProjections();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnStartStopTracking()
 {
   if (!m_connected)
   {
     MITK_WARN << "Can't start tracking if no device is connected. Aborting";
     return;
   }
   if (m_tracking) { OnStopTracking(); }
   else { OnStartTracking(); }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnFreezeUnfreezeTracking()
 {
   if (m_Controls->m_FreezeUnfreezeTrackingButton->text() == "Freeze Tracking")
   {
     m_Worker->GetTrackingDeviceSource()->Freeze();
     m_Controls->m_FreezeUnfreezeTrackingButton->setText("Unfreeze Tracking");
     m_Controls->m_TrackingFrozenLabel->setVisible(true);
   }
   else if (m_Controls->m_FreezeUnfreezeTrackingButton->text() == "Unfreeze Tracking")
   {
     m_Worker->GetTrackingDeviceSource()->UnFreeze();
     m_Controls->m_FreezeUnfreezeTrackingButton->setText("Freeze Tracking");
     m_Controls->m_TrackingFrozenLabel->setVisible(false);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::ShowToolProjection(int index)
 {
   mitk::DataNode::Pointer toolnode = m_toolStorage->GetTool(index)->GetDataNode();
   QString ToolProjectionName = "ToolProjection" + QString::number(index);
   m_ToolProjectionNode = this->GetDataStorage()->GetNamedNode(ToolProjectionName.toStdString());
   //If node does not exist, create the node for the Pointset
   if (m_ToolProjectionNode.IsNull())
   {
     m_ToolProjectionNode = mitk::DataNode::New();
     m_ToolProjectionNode->SetName(ToolProjectionName.toStdString());
     if (index < static_cast<int>(m_NeedleProjectionFilter->GetNumberOfInputs()))
     {
       m_NeedleProjectionFilter->SelectInput(index);
       m_NeedleProjectionFilter->Update();
       m_ToolProjectionNode->SetData(m_NeedleProjectionFilter->GetProjection());
 
       m_ToolProjectionNode->SetBoolProperty("show contour", true);
       this->GetDataStorage()->Add(m_ToolProjectionNode, toolnode);
     }
     //  this->FireNodeSelected(node);
   }
   else
   {
     m_ToolProjectionNode->SetBoolProperty("show contour", true);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::RemoveAllToolProjections()
 {
   for (size_t i = 0; i < m_toolStorage->GetToolCount(); i++)
   {
     QString toolProjectionName = "ToolProjection" + QString::number(i);
 
     mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode(toolProjectionName.toStdString());
 
     //Deactivate and hide the tool projection
     if (!node.IsNull())
     {
       this->GetDataStorage()->Remove(node);
     }
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::SelectToolProjection(int idx)
 {
   if (m_Controls->showHideToolProjectionCheckBox->isChecked())
   {
     //Deactivate and hide the tool projection
     if (!m_ToolProjectionNode.IsNull())
     {
       this->GetDataStorage()->Remove(m_ToolProjectionNode);
     }
 
     if (m_NeedleProjectionFilter.IsNotNull())
     {
       m_NeedleProjectionFilter->Update();
     }
     //Refresh the view and the status widget
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
     // Show the tool projection for the currently selected tool
     ShowToolProjection(idx);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnShowHideToolProjectionClicked()
 {
   int index =  m_Controls->m_toolselector->currentIndex();
   //Activate and show the tool projection
   if (m_Controls->showHideToolProjectionCheckBox->isChecked())
   {
     ShowToolProjection(index);
     m_Controls->showHideToolAxisCheckBox->setEnabled(true);
   }
   else
   {
     RemoveAllToolProjections();
     m_Controls->showHideToolAxisCheckBox->setEnabled(false);
   }
   if(m_NeedleProjectionFilter->GetNumberOfInputs())
   {
     m_NeedleProjectionFilter->Update();
   }
   //Refresh the view and the status widget
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 //  m_Controls->m_TrackingToolsStatusWidget->Refresh();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnShowHideToolAxisClicked()
 {
   if( !m_ShowHideToolAxis )
   {
     //Activate and show the tool axis
     m_NeedleProjectionFilter->ShowToolAxis(true);
     m_ShowHideToolAxis = true;
   }
   else
   {
     //Deactivate and hide the tool axis
     m_NeedleProjectionFilter->ShowToolAxis(false);
     m_NeedleProjectionFilter->GetProjection()->RemovePointIfExists(2);
     m_ShowHideToolAxis = false;
   }
   //Update the filter
   if(m_NeedleProjectionFilter->GetNumberOfInputs())
   {
     m_NeedleProjectionFilter->Update();
   }
   //Refresh the view and the status widget
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
  // m_Controls->m_TrackingToolsStatusWidget->Refresh();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnConnectDisconnect()
 {
   if (m_connected) { OnDisconnect(); }
   else { OnConnect(); }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnConnect()
 {
   MITK_DEBUG << "Connect Clicked";
   //check if everything is ready to start tracking
   if (this->m_toolStorage.IsNull())
   {
     MessageBox("Error: No Tools Loaded Yet!");
     return;
   }
   else if (this->m_toolStorage->GetToolCount() == 0)
   {
     MessageBox("Error: No Way To Track Without Tools!");
     return;
   }
 
   //parse tracking device data
   mitk::TrackingDeviceData data = mitk::UnspecifiedTrackingTypeInformation::GetDeviceDataUnspecified();
   QString qstr = m_Controls->m_VolumeSelectionBox->currentText();
   if ((!qstr.isNull()) || (!qstr.isEmpty())) {
     std::string str = qstr.toStdString();
     data = m_DeviceTypeCollection->GetDeviceDataByName(str); //Data will be set later, after device generation
   }
 
   //! [Thread 4]
   //initialize worker thread
   m_Worker->SetWorkerMethod(QmitkMITKIGTTrackingToolboxViewWorker::eConnectDevice);
   m_Worker->SetTrackingDevice(this->m_Controls->m_ConfigurationWidget->GetTrackingDevice());
   m_Worker->SetInverseMode(m_Controls->m_InverseMode->isChecked());
   m_Worker->SetNavigationToolStorage(this->m_toolStorage);
   m_Worker->SetTrackingDeviceData(data);
   //start worker thread
   m_WorkerThread->start();
   //! [Thread 4]
 
 
   //enable checkboxes for projection and tool axis
   m_Controls->showHideToolAxisCheckBox->setEnabled(true);
   m_Controls->showHideToolProjectionCheckBox->setEnabled(true);
   m_Controls->m_toolselector->setEnabled(true);
 
 
 
   //disable buttons
   this->m_Controls->m_MainWidget->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::EnableDisableTimerButtons(int enable)
 {
   bool enableBool = enable;
   m_Controls->m_UpdateRateOptionsGroupBox->setEnabled(!enableBool);
   m_Controls->m_RenderWarningLabel->setVisible(enableBool);
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnConnectFinished(bool success, QString errorMessage)
 {
   m_WorkerThread->quit();
   m_WorkerThread->wait();
 
   //enable buttons
   this->m_Controls->m_MainWidget->setEnabled(true);
 
   if (!success)
   {
     MITK_WARN << errorMessage.toStdString();
     MessageBox(errorMessage.toStdString());
     return;
   }
 
   //! [Thread 6]
   //get data from worker thread
   m_TrackingDeviceData = m_Worker->GetTrackingDeviceData();
   m_ToolVisualizationFilter = m_Worker->GetToolVisualizationFilter();
   if( m_ToolVisualizationFilter.IsNotNull() )
   {
     //Connect the NeedleProjectionFilter to the ToolVisualizationFilter as third filter of the IGT pipeline
     m_NeedleProjectionFilter->ConnectTo(m_ToolVisualizationFilter);
     if (m_Controls->showHideToolProjectionCheckBox->isChecked())
     {
       ShowToolProjection(m_Controls->m_toolselector->currentIndex());
     }
   }
 
   //! [Thread 6]
 
   //enable/disable Buttons
   DisableOptionsButtons();
   DisableTrackingConfigurationButtons();
 
   m_Controls->m_TrackingControlLabel->setText("Status: connected");
   m_Controls->m_ConnectDisconnectButton->setText("Disconnect");
   m_Controls->m_ConnectSimpleMode->setText("Disconnect");
   m_Controls->m_StartStopTrackingButton->setEnabled(true);
   m_Controls->m_StartTrackingSimpleMode->setEnabled(true);
   m_connected = true;
 
-  //During connection, thi sourceID of the tool storage changed. However, Microservice can't be updated on a different thread.
+  //During connection, the sourceID of the tool storage changed. However, Microservice can't be updated on a different thread.
   //UpdateMicroservice is necessary to use filter to get the right storage belonging to a source.
   //Don't do it before m_connected is true, as we don't want to call content of OnToolStorageChanged.
   m_toolStorage->UpdateMicroservice();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnDisconnect()
 {
   m_Worker->SetWorkerMethod(QmitkMITKIGTTrackingToolboxViewWorker::eDisconnectDevice);
   m_WorkerThread->start();
   m_Controls->m_MainWidget->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnDisconnectFinished(bool success, QString errorMessage)
 {
   m_WorkerThread->quit();
   m_WorkerThread->wait();
   m_Controls->m_MainWidget->setEnabled(true);
 
   if (!success)
   {
     MITK_WARN << errorMessage.toStdString();
     MessageBox(errorMessage.toStdString());
     return;
   }
 
   //enable/disable Buttons
   m_Controls->m_StartStopTrackingButton->setEnabled(false);
   m_Controls->m_StartTrackingSimpleMode->setEnabled(false);
   EnableOptionsButtons();
   EnableTrackingConfigurationButtons();
   m_Controls->m_TrackingControlLabel->setText("Status: disconnected");
   m_Controls->m_ConnectDisconnectButton->setText("Connect");
   m_Controls->m_ConnectSimpleMode->setText("Connect");
   m_Controls->m_FreezeUnfreezeTrackingButton->setText("Freeze Tracking");
   m_Controls->m_TrackingFrozenLabel->setVisible(false);
   m_connected = false;
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnStartTracking()
 {
   //show tracking volume
   this->OnTrackingVolumeChanged(m_Controls->m_VolumeSelectionBox->currentText());
   //Reset the view to a defined start. Do it here and not in OnStartTrackingFinished, to give other tracking devices the chance to reset the view to a different direction.
   this->GlobalReinit();
   m_Worker->SetWorkerMethod(QmitkMITKIGTTrackingToolboxViewWorker::eStartTracking);
   m_WorkerThread->start();
   this->m_Controls->m_MainWidget->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnStartTrackingFinished(bool success, QString errorMessage)
 {
   //! [Thread 5]
   m_WorkerThread->quit();
   m_WorkerThread->wait();
   //! [Thread 5]
   this->m_Controls->m_MainWidget->setEnabled(true);
 
   if (!success)
   {
     MessageBox(errorMessage.toStdString());
     MITK_WARN << errorMessage.toStdString();
     return;
   }
 
   if (!(m_Controls->m_DisableAllTimers->isChecked()))
   {
     if (m_Controls->m_UseDifferentUpdateRates->isChecked())
     {
       if (m_Controls->m_RenderUpdateRate->value() != 0)
         m_TrackingRenderTimer->start(1000 / (m_Controls->m_RenderUpdateRate->value()));
       m_TrackingLoggingTimer->start(1000 / (m_Controls->m_LogUpdateRate->value()));
     }
     else
     {
       m_TrackingRenderTimer->start(1000 / (m_Controls->m_UpdateRate->value()));
       m_TrackingLoggingTimer->start(1000 / (m_Controls->m_UpdateRate->value()));
     }
   }
 
   m_Controls->m_TrackingControlLabel->setText("Status: tracking");
 
   //connect the tool visualization widget
   for (std::size_t i = 0; i < m_Worker->GetTrackingDeviceSource()->GetNumberOfOutputs(); i++)
   {
     m_Controls->m_TrackingToolsStatusWidget->AddNavigationData(m_Worker->GetTrackingDeviceSource()->GetOutput(i));
   }
   m_Controls->m_TrackingToolsStatusWidget->ShowStatusLabels();
   if (m_Controls->m_ShowToolQuaternions->isChecked()) { m_Controls->m_TrackingToolsStatusWidget->SetShowQuaternions(true); }
   else { m_Controls->m_TrackingToolsStatusWidget->SetShowQuaternions(false); }
 
   //if activated enable open IGT link microservice
   if (m_Controls->m_EnableOpenIGTLinkMicroService->isChecked())
   {
-    //create convertion filter
+    //create conversion filter
     m_IGTLConversionFilter = mitk::NavigationDataToIGTLMessageFilter::New();
     m_IGTLConversionFilter->SetName("IGT Tracking Toolbox");
     QString dataModeSelection = this->m_Controls->m_OpenIGTLinkDataFormat->currentText();
     if (dataModeSelection == "TDATA")
     {
       m_IGTLConversionFilter->SetOperationMode(mitk::NavigationDataToIGTLMessageFilter::ModeSendTDataMsg);
     }
     else if (dataModeSelection == "TRANSFORM")
     {
       m_IGTLConversionFilter->SetOperationMode(mitk::NavigationDataToIGTLMessageFilter::ModeSendTransMsg);
     }
     else if (dataModeSelection == "QTDATA")
     {
       m_IGTLConversionFilter->SetOperationMode(mitk::NavigationDataToIGTLMessageFilter::ModeSendQTDataMsg);
     }
     else if (dataModeSelection == "POSITION")
     {
       m_IGTLConversionFilter->SetOperationMode(mitk::NavigationDataToIGTLMessageFilter::ModeSendQTransMsg);
     }
     m_IGTLConversionFilter->ConnectTo(m_ToolVisualizationFilter);
     m_IGTLConversionFilter->RegisterAsMicroservice();
 
     //create server and message provider
     m_IGTLServer = mitk::IGTLServer::New(false);
     m_IGTLServer->SetName("Tracking Toolbox IGTL Server");
     m_IGTLMessageProvider = mitk::IGTLMessageProvider::New();
     m_IGTLMessageProvider->SetIGTLDevice(m_IGTLServer);
     m_IGTLMessageProvider->RegisterAsMicroservice();
   }
 
   m_tracking = true;
   m_Controls->m_ConnectDisconnectButton->setEnabled(false);
   m_Controls->m_StartStopTrackingButton->setText("Stop Tracking");
   m_Controls->m_StartTrackingSimpleMode->setText("Stop\nTracking");
   m_Controls->m_FreezeUnfreezeTrackingButton->setEnabled(true);
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnStopTracking()
 {
 	if (!m_tracking) return;
   for (unsigned int i = 0; i < m_ToolVisualizationFilter->GetNumberOfIndexedOutputs(); i++)
   {
 	mitk::NavigationData::Pointer currentTool = m_ToolVisualizationFilter->GetOutput(i);
 	if (currentTool->IsDataValid())
 	{
   	 this->m_toolStorage->GetTool(i)->GetDataNode()->SetColor(mitk::IGTColor_INVALID);
 	}
   }
 
   //refresh view and status widget
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 
 
   m_TrackingRenderTimer->stop();
   m_TrackingLoggingTimer->stop();
 
   m_Worker->SetWorkerMethod(QmitkMITKIGTTrackingToolboxViewWorker::eStopTracking);
   m_WorkerThread->start();
   m_Controls->m_MainWidget->setEnabled(false);
 
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnStopTrackingFinished(bool success, QString errorMessage)
 {
   m_WorkerThread->quit();
   m_WorkerThread->wait();
   m_Controls->m_MainWidget->setEnabled(true);
   if (!success)
   {
     MessageBox(errorMessage.toStdString());
     MITK_WARN << errorMessage.toStdString();
     return;
   }
 
   m_Controls->m_TrackingControlLabel->setText("Status: connected");
   if (m_logging) StopLogging();
   m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels();
   m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage);
   m_tracking = false;
   m_Controls->m_StartStopTrackingButton->setText("Start Tracking");
   m_Controls->m_StartTrackingSimpleMode->setText("Start\nTracking");
   m_Controls->m_ConnectDisconnectButton->setEnabled(true);
   m_Controls->m_FreezeUnfreezeTrackingButton->setEnabled(false);
 
   //unregister open IGT link micro service
   if (m_Controls->m_EnableOpenIGTLinkMicroService->isChecked())
   {
     m_IGTLConversionFilter->UnRegisterMicroservice();
     m_IGTLMessageProvider->UnRegisterMicroservice();
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnTrackingDeviceChanged()
 {
   mitk::TrackingDeviceType Type;
 
   if (m_Controls->m_ConfigurationWidget->GetTrackingDevice().IsNotNull())
   {
     Type = m_Controls->m_ConfigurationWidget->GetTrackingDevice()->GetType();
     //enable controls because device is valid
     m_Controls->m_TrackingToolsFrame->setEnabled(true);
     m_Controls->m_TrackingControlsFrame->setEnabled(true);
   }
   else
   {
     Type = mitk::UnspecifiedTrackingTypeInformation::GetTrackingDeviceName();
     MessageBox("Error: This tracking device is not included in this project. Please make sure that the device is installed and activated in your MITK build.");
     m_Controls->m_TrackingToolsFrame->setEnabled(false);
     m_Controls->m_TrackingControlsFrame->setEnabled(false);
     return;
   }
 
   // Code to enable/disable device specific buttons
   if (m_Controls->m_ConfigurationWidget->GetTrackingDevice()->AutoDetectToolsAvailable())
   {
     m_Controls->m_AutoDetectTools->setVisible(true);
   }
   else
   {
     m_Controls->m_AutoDetectTools->setVisible(false);
   }
 
   m_Controls->m_AddSingleTool->setEnabled(this->m_Controls->m_ConfigurationWidget->GetTrackingDevice()->AddSingleToolIsAvailable());
 
   // Code to select appropriate tracking volume for current type
   std::vector<mitk::TrackingDeviceData> Compatibles = m_DeviceTypeCollection->GetDeviceDataForLine(Type);
   m_Controls->m_VolumeSelectionBox->clear();
   for (std::size_t i = 0; i < Compatibles.size(); i++)
   {
     m_Controls->m_VolumeSelectionBox->addItem(Compatibles[i].Model.c_str());
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnTrackingVolumeChanged(QString qstr)
 {
   if (qstr.isNull()) return;
   if (qstr.isEmpty()) return;
 
   mitk::TrackingVolumeGenerator::Pointer volumeGenerator = mitk::TrackingVolumeGenerator::New();
 
   std::string str = qstr.toStdString();
 
   mitk::TrackingDeviceData data = m_DeviceTypeCollection->GetDeviceDataByName(str);
   m_TrackingDeviceData = data;
 
   volumeGenerator->SetTrackingDeviceData(data);
   volumeGenerator->Update();
 
   mitk::Surface::Pointer volumeSurface = volumeGenerator->GetOutput();
 
   m_TrackingVolumeNode->SetData(volumeSurface);
 
   if (!m_Controls->m_ShowTrackingVolume->isChecked()) m_TrackingVolumeNode->SetOpacity(0.0);
   else m_TrackingVolumeNode->SetOpacity(0.25);
 
   GlobalReinit();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnShowTrackingVolumeChanged()
 {
   if (m_Controls->m_ShowTrackingVolume->isChecked())
   {
     OnTrackingVolumeChanged(m_Controls->m_VolumeSelectionBox->currentText());
     m_TrackingVolumeNode->SetOpacity(0.25);
   }
   else
   {
     m_TrackingVolumeNode->SetOpacity(0.0);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnAutoDetectTools()
 {
   if (m_Controls->m_ConfigurationWidget->GetTrackingDevice()->AutoDetectToolsAvailable())
   {
     DisableTrackingConfigurationButtons();
     m_Worker->SetWorkerMethod(QmitkMITKIGTTrackingToolboxViewWorker::eAutoDetectTools);
     m_Worker->SetTrackingDevice(m_Controls->m_ConfigurationWidget->GetTrackingDevice().GetPointer());
     m_Worker->SetDataStorage(this->GetDataStorage());
     m_WorkerThread->start();
     m_TimeoutTimer->start(30000);
     //disable controls until worker thread is finished
     this->m_Controls->m_MainWidget->setEnabled(false);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnAutoDetectToolsFinished(bool success, QString errorMessage)
 {
-  //Check, if the thread is running. There might have been a timeOut inbetween and this causes crashes...
+  //Check, if the thread is running. There might have been a timeOut in between and this causes crashes...
   if (m_WorkerThread->isRunning())
   {
     m_TimeoutTimer->stop();
     m_WorkerThread->quit();
     m_WorkerThread->wait();
   }
 
   //enable controls again
   this->m_Controls->m_MainWidget->setEnabled(true);
   EnableTrackingConfigurationButtons();
 
   if (!success)
   {
     MITK_WARN << errorMessage.toStdString();
     MessageBox(errorMessage.toStdString());
     EnableTrackingConfigurationButtons();
     return;
   }
 
   mitk::NavigationToolStorage::Pointer autoDetectedStorage = m_Worker->GetNavigationToolStorage();
 
   //save detected tools
   std::string _autoDetectText;
   _autoDetectText = "Autodetected ";
   _autoDetectText.append(this->m_TrackingDeviceData.Line); //This is the device name as string of the current TrackingDevice.
   _autoDetectText.append(" Storage");
   this->ReplaceCurrentToolStorage(autoDetectedStorage, _autoDetectText);
   //auto save the new storage to hard disc (for persistence)
   AutoSaveToolStorage();
   //update label
   QString toolLabel = QString("Loaded Tools: ") + QString::number(m_toolStorage->GetToolCount()) + " Tools (Auto Detected)";
   m_Controls->m_ToolLabel->setText(toolLabel);
   //update tool preview
   m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels();
   m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage);
 
   EnableTrackingConfigurationButtons();
 
   //print a logging message about the detected tools
   switch (m_toolStorage->GetToolCount())
   {
   case 0:
     MITK_INFO("IGT Tracking Toolbox") << "Found no tools. Empty ToolStorage was autosaved to " << m_ToolStorageFilename.toStdString();
     break;
   case 1:
     MITK_INFO("IGT Tracking Toolbox") << "Found one tool. ToolStorage was autosaved to " << m_ToolStorageFilename.toStdString();
     break;
   default:
     MITK_INFO("IGT Tracking Toolbox") << "Found " << m_toolStorage->GetToolCount() << " tools. ToolStorage was autosaved to " << m_ToolStorageFilename.toStdString();
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::MessageBox(std::string s)
 {
   QMessageBox msgBox;
   msgBox.setText(s.c_str());
   msgBox.exec();
 }
 
 void QmitkMITKIGTTrackingToolboxView::UpdateRenderTrackingTimer()
 {
   //update filter
   m_ToolVisualizationFilter->Update();
   MITK_DEBUG << "Number of outputs ToolVisualizationFilter: " << m_ToolVisualizationFilter->GetNumberOfIndexedOutputs();
   MITK_DEBUG << "Number of inputs ToolVisualizationFilter: " << m_ToolVisualizationFilter->GetNumberOfIndexedInputs();
 
   //update tool colors to show tool status
   for (unsigned int i = 0; i < m_ToolVisualizationFilter->GetNumberOfIndexedOutputs(); i++)
   {
     mitk::NavigationData::Pointer currentTool = m_ToolVisualizationFilter->GetOutput(i);
     if (currentTool->IsDataValid())
     {
 
       this->m_toolStorage->GetTool(i)->GetDataNode()->SetColor(mitk::IGTColor_VALID);
     }
     else
     {
       this->m_toolStorage->GetTool(i)->GetDataNode()->SetColor(mitk::IGTColor_WARNING);
     }
   }
 
   //Update the NeedleProjectionFilter
   if( m_NeedleProjectionFilter.IsNotNull() )
   {
     m_NeedleProjectionFilter->Update();
   }
 
   //refresh view and status widget
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   m_Controls->m_TrackingToolsStatusWidget->Refresh();
 }
 
 void QmitkMITKIGTTrackingToolboxView::UpdateLoggingTrackingTimer()
 {
   //update logging
   if (m_logging)
   {
     this->m_loggingFilter->Update();
     m_loggedFrames = this->m_loggingFilter->GetNumberOfRecordedSteps();
     this->m_Controls->m_LoggedFramesLabel->setText("Logged Frames: " + QString::number(m_loggedFrames));
     //check if logging stopped automatically
     if ((m_loggedFrames > 1) && (!m_loggingFilter->GetRecording())){ StopLogging(); }
   }
   //refresh status widget
   m_Controls->m_TrackingToolsStatusWidget->Refresh();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnChooseFileClicked()
 {
   QDir currentPath = QFileInfo(m_Controls->m_LoggingFileName->text()).dir();
 
   // if no path was selected (QDir would select current working dir then) or the
   // selected path does not exist -> use home directory
   if (currentPath == QDir() || !currentPath.exists())
   {
     currentPath = QDir(QDir::homePath());
   }
 
   QString filename = QFileDialog::getSaveFileName(nullptr, tr("Choose Logging File"), currentPath.absolutePath(), "*.*");
   if (filename == "") return;
   this->m_Controls->m_LoggingFileName->setText(filename);
   this->OnToggleFileExtension();
 }
 // bug-16470: toggle file extension after clicking on radio button
 void QmitkMITKIGTTrackingToolboxView::OnToggleFileExtension()
 {
   QString currentInputText = this->m_Controls->m_LoggingFileName->text();
   QString currentFile = QFileInfo(currentInputText).baseName();
   QDir currentPath = QFileInfo(currentInputText).dir();
   if (currentFile.isEmpty())
   {
     currentFile = "logfile";
   }
   // Setting currentPath to default home path when currentPath is empty or it does not exist
   if (currentPath == QDir() || !currentPath.exists())
   {
     currentPath = QDir::homePath();
   }
   // check if csv radio button is clicked
   if (this->m_Controls->m_CsvFormat->isChecked())
   {
-    // you needn't add a seperator to the input text when currentpath is the rootpath
+    // you needn't add a separator to the input text when currentpath is the rootpath
     if (currentPath.isRoot())
     {
       this->m_Controls->m_LoggingFileName->setText(QDir::toNativeSeparators(currentPath.absolutePath()) + currentFile + ".csv");
     }
 
     else
     {
       this->m_Controls->m_LoggingFileName->setText(QDir::toNativeSeparators(currentPath.absolutePath()) + QDir::separator() + currentFile + ".csv");
     }
   }
   // check if xml radio button is clicked
   else if (this->m_Controls->m_XmlFormat->isChecked())
   {
-    // you needn't add a seperator to the input text when currentpath is the rootpath
+    // you needn't add a separator to the input text when currentpath is the rootpath
     if (currentPath.isRoot())
     {
       this->m_Controls->m_LoggingFileName->setText(QDir::toNativeSeparators(currentPath.absolutePath()) + currentFile + ".xml");
     }
     else
     {
       this->m_Controls->m_LoggingFileName->setText(QDir::toNativeSeparators(currentPath.absolutePath()) + QDir::separator() + currentFile + ".xml");
     }
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnToggleAdvancedSimpleMode()
 {
   if (m_SimpleModeEnabled)
   {
     m_Controls->m_simpleWidget->setVisible(false);
     m_Controls->m_MainWidget->setVisible(true);
     m_Controls->m_SimpleUI->setChecked(false);
     m_SimpleModeEnabled = false;
   }
   else
   {
     m_Controls->m_simpleWidget->setVisible(true);
     m_Controls->m_MainWidget->setVisible(false);
     m_SimpleModeEnabled = true;
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnToggleDifferentUpdateRates()
 {
   if (m_Controls->m_UseDifferentUpdateRates->isChecked())
   {
     if (m_Controls->m_RenderUpdateRate->value() == 0)
       m_Controls->m_RenderWarningLabel->setVisible(true);
     else
       m_Controls->m_RenderWarningLabel->setVisible(false);
 
     m_Controls->m_UpdateRate->setEnabled(false);
     m_Controls->m_OptionsUpdateRateLabel->setEnabled(false);
 
     m_Controls->m_RenderUpdateRate->setEnabled(true);
     m_Controls->m_OptionsRenderUpdateRateLabel->setEnabled(true);
 
     m_Controls->m_LogUpdateRate->setEnabled(true);
     m_Controls->m_OptionsLogUpdateRateLabel->setEnabled(true);
   }
 
   else
   {
     m_Controls->m_RenderWarningLabel->setVisible(false);
 
     m_Controls->m_UpdateRate->setEnabled(true);
     m_Controls->m_OptionsUpdateRateLabel->setEnabled(true);
 
     m_Controls->m_RenderUpdateRate->setEnabled(false);
     m_Controls->m_OptionsRenderUpdateRateLabel->setEnabled(false);
 
     m_Controls->m_LogUpdateRate->setEnabled(false);
     m_Controls->m_OptionsLogUpdateRateLabel->setEnabled(false);
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnChangeRenderUpdateRate()
 {
   if (m_Controls->m_RenderUpdateRate->value() == 0)
     m_Controls->m_RenderWarningLabel->setVisible(true);
   else
     m_Controls->m_RenderWarningLabel->setVisible(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::StartLogging()
 {
   if (m_ToolVisualizationFilter.IsNull())
   {
     MessageBox("Cannot activate logging without a connected device. Configure and connect a tracking device first.");
     return;
   }
 
   if (!m_logging)
   {
     //initialize logging filter
     m_loggingFilter = mitk::NavigationDataRecorder::New();
     m_loggingFilter->SetRecordOnlyValidData(m_Controls->m_SkipInvalidData->isChecked());
 
     m_loggingFilter->ConnectTo(m_ToolVisualizationFilter);
 
     if (m_Controls->m_LoggingLimit->isChecked()){ m_loggingFilter->SetRecordCountLimit(m_Controls->m_LoggedFramesLimit->value()); }
 
     //start filter with try-catch block for exceptions
     try
     {
       m_loggingFilter->StartRecording();
     }
     catch (mitk::IGTException&)
     {
       std::string errormessage = "Error during start recording. Recorder already started recording?";
       QMessageBox::warning(nullptr, "IGTPlayer: Error", errormessage.c_str());
       m_loggingFilter->StopRecording();
       return;
     }
 
     //update labels / logging variables
     this->m_Controls->m_LoggingLabel->setText("Logging ON");
     this->m_Controls->m_LoggedFramesLabel->setText("Logged Frames: 0");
     m_loggedFrames = 0;
     m_logging = true;
     DisableLoggingButtons();
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::StopLogging()
 {
   if (m_logging)
   {
     //stop logging
     m_loggingFilter->StopRecording();
     m_logging = false;
 
     //update GUI
     this->m_Controls->m_LoggingLabel->setText("Logging OFF");
     EnableLoggingButtons();
 
     //write the results to a file
     if (m_Controls->m_CsvFormat->isChecked())
     {
       mitk::IOUtil::Save(m_loggingFilter->GetNavigationDataSet(), this->m_Controls->m_LoggingFileName->text().toStdString());
     }
     else if (m_Controls->m_XmlFormat->isChecked())
     {
       mitk::IOUtil::Save(m_loggingFilter->GetNavigationDataSet(), this->m_Controls->m_LoggingFileName->text().toStdString());
     }
   }
 }
 
 void QmitkMITKIGTTrackingToolboxView::SetFocus()
 {
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnAddSingleTool()
 {
   QString Identifier = "Tool#";
   QString Name = "NewTool";
   if (m_toolStorage.IsNotNull()) {
     Identifier += QString::number(m_toolStorage->GetToolCount());
     Name += QString::number(m_toolStorage->GetToolCount());
   }
   else {
     Identifier += "0";
     Name += "0";
   }
   m_Controls->m_NavigationToolCreationWidget->Initialize(GetDataStorage(), Identifier.toStdString(), Name.toStdString());
   m_Controls->m_NavigationToolCreationWidget->SetTrackingDeviceType(m_Controls->m_ConfigurationWidget->GetTrackingDevice()->GetType(), false);
   m_Controls->m_TrackingToolsWidget->setCurrentIndex(1);
 
   //disable tracking volume during tool editing
   lastTrackingVolumeState = m_Controls->m_ShowTrackingVolume->isChecked();
   if (lastTrackingVolumeState) m_Controls->m_ShowTrackingVolume->click();
   GlobalReinit();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnAddSingleToolFinished()
 {
   m_Controls->m_TrackingToolsWidget->setCurrentIndex(0);
   if (this->m_toolStorage.IsNull())
   {
     //this shouldn't happen!
     MITK_WARN << "No ToolStorage available, cannot add tool, aborting!";
     return;
   }
   m_toolStorage->AddTool(m_Controls->m_NavigationToolCreationWidget->GetCreatedTool());
   m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage);
   m_Controls->m_ToolLabel->setText("<manually added>");
 
   //displya in tool selector
  // m_Controls->m_toolselector->addItem(QString::fromStdString(m_Controls->m_NavigationToolCreationWidget->GetCreatedTool()->GetToolName()));
 
 
   //auto save current storage for persistence
   MITK_INFO << "Auto saving manually added tools for persistence.";
   AutoSaveToolStorage();
 
   //enable tracking volume again
   if (lastTrackingVolumeState) m_Controls->m_ShowTrackingVolume->click();
   GlobalReinit();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnAddSingleToolCanceled()
 {
   m_Controls->m_TrackingToolsWidget->setCurrentIndex(0);
 
   //enable tracking volume again
   if (lastTrackingVolumeState) m_Controls->m_ShowTrackingVolume->click();
   GlobalReinit();
 }
 
 void QmitkMITKIGTTrackingToolboxView::GlobalReinit()
 {
   // 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 = this->GetDataStorage()->GetSubset(pred);
   // calculate bounding geometry of these nodes
   auto bounds = this->GetDataStorage()->ComputeBoundingGeometry3D(rs, "visible");
 
   // initialize the views to the bounding geometry
   mitk::RenderingManager::GetInstance()->InitializeViews(bounds);
 }
 
 void QmitkMITKIGTTrackingToolboxView::DisableLoggingButtons()
 {
   m_Controls->m_StartLogging->setEnabled(false);
   m_Controls->m_LoggingFileName->setEnabled(false);
   m_Controls->m_ChooseFile->setEnabled(false);
   m_Controls->m_LoggingLimit->setEnabled(false);
   m_Controls->m_LoggedFramesLimit->setEnabled(false);
   m_Controls->m_CsvFormat->setEnabled(false);
   m_Controls->m_XmlFormat->setEnabled(false);
   m_Controls->m_SkipInvalidData->setEnabled(false);
   m_Controls->m_StopLogging->setEnabled(true);
 }
 
 void QmitkMITKIGTTrackingToolboxView::EnableLoggingButtons()
 {
   m_Controls->m_StartLogging->setEnabled(true);
   m_Controls->m_LoggingFileName->setEnabled(true);
   m_Controls->m_ChooseFile->setEnabled(true);
   m_Controls->m_LoggingLimit->setEnabled(true);
   m_Controls->m_LoggedFramesLimit->setEnabled(true);
   m_Controls->m_CsvFormat->setEnabled(true);
   m_Controls->m_XmlFormat->setEnabled(true);
   m_Controls->m_SkipInvalidData->setEnabled(true);
   m_Controls->m_StopLogging->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::DisableOptionsButtons()
 {
   m_Controls->m_ShowTrackingVolume->setEnabled(false);
   m_Controls->m_UseDifferentUpdateRates->setEnabled(false);
   m_Controls->m_UpdateRate->setEnabled(false);
   m_Controls->m_OptionsUpdateRateLabel->setEnabled(false);
   m_Controls->m_RenderUpdateRate->setEnabled(false);
   m_Controls->m_OptionsRenderUpdateRateLabel->setEnabled(false);
   m_Controls->m_LogUpdateRate->setEnabled(false);
   m_Controls->m_OptionsLogUpdateRateLabel->setEnabled(false);
   m_Controls->m_DisableAllTimers->setEnabled(false);
   m_Controls->m_OtherOptionsGroupBox->setEnabled(false);
   m_Controls->m_EnableOpenIGTLinkMicroService->setEnabled(false);
   m_Controls->m_OpenIGTLinkDataFormat->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::EnableOptionsButtons()
 {
   m_Controls->m_ShowTrackingVolume->setEnabled(true);
   m_Controls->m_UseDifferentUpdateRates->setEnabled(true);
   m_Controls->m_DisableAllTimers->setEnabled(true);
   m_Controls->m_OtherOptionsGroupBox->setEnabled(true);
   m_Controls->m_EnableOpenIGTLinkMicroService->setEnabled(true);
   m_Controls->m_OpenIGTLinkDataFormat->setEnabled(true);
   OnToggleDifferentUpdateRates();
 }
 
 void QmitkMITKIGTTrackingToolboxView::EnableTrackingControls()
 {
   m_Controls->m_TrackingControlsFrame->setEnabled(true);
 }
 
 void QmitkMITKIGTTrackingToolboxView::DisableTrackingControls()
 {
   m_Controls->m_TrackingControlsFrame->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::EnableTrackingConfigurationButtons()
 {
   m_Controls->m_AutoDetectTools->setEnabled(true);
   m_Controls->m_AddSingleTool->setEnabled(this->m_Controls->m_ConfigurationWidget->GetTrackingDevice()->AddSingleToolIsAvailable());
   m_Controls->m_LoadTools->setEnabled(true);
   m_Controls->m_ResetTools->setEnabled(true);
 }
 
 void QmitkMITKIGTTrackingToolboxView::DisableTrackingConfigurationButtons()
 {
   m_Controls->m_AutoDetectTools->setEnabled(false);
   m_Controls->m_AddSingleTool->setEnabled(false);
   m_Controls->m_LoadTools->setEnabled(false);
   m_Controls->m_ResetTools->setEnabled(false);
 }
 
 void QmitkMITKIGTTrackingToolboxView::ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName)
 {
   //first: get rid of the old one
   //don't reset if there is no tool storage. BugFix #17793
   if (m_toolStorage.IsNotNull()){
     m_toolStorage->UnLockStorage(); //only to be sure...
     m_toolStorage->UnRegisterMicroservice();
     m_toolStorage = nullptr;
   }
 
   //now: replace by the new one
   m_toolStorage = newStorage;
   m_toolStorage->SetName(newStorageName);
   m_toolStorage->RegisterAsMicroservice();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnTimeOut()
 {
   MITK_WARN << "TimeOut. Quitting the thread...";
   m_WorkerThread->quit();
   //only if we can't quit use terminate.
   if (!m_WorkerThread->wait(1000))
   {
     MITK_ERROR << "Can't quit the thread. Terminating... Might cause further problems, be careful!";
     m_WorkerThread->terminate();
     m_WorkerThread->wait();
   }
   m_TimeoutTimer->stop();
 }
 
 void QmitkMITKIGTTrackingToolboxView::OnToolStorageChanged(const ctkServiceEvent event)
 {
   //don't listen to any changes during connection, toolStorage is locked anyway, so this are only changes of e.g. sourceID which are not relevant for the widget.
   if (!m_connected && (event.getType() == ctkServiceEvent::MODIFIED))
   {
     m_Controls->m_ConfigurationWidget->OnToolStorageChanged();
 
     m_Controls->m_toolselector->clear();
     for (size_t i = 0; i < m_toolStorage->GetToolCount(); i++)
     {
       m_Controls->m_toolselector->addItem(QString::fromStdString(m_toolStorage->GetTool(i)->GetToolName()));
     }
   }
 }
 
 //! [StoreUISettings]
 void QmitkMITKIGTTrackingToolboxView::StoreUISettings()
 {
   // persistence service does not directly work in plugins for now
   // -> using QSettings
   QSettings settings;
 
   settings.beginGroup(QString::fromStdString(VIEW_ID));
   MITK_DEBUG << "Store UI settings";
-  // set the values of some widgets and attrbutes to the QSettings
+  // set the values of some widgets and attributes to the QSettings
   settings.setValue("ShowTrackingVolume", QVariant(m_Controls->m_ShowTrackingVolume->isChecked()));
   settings.setValue("toolStorageFilename", QVariant(m_ToolStorageFilename));
   settings.setValue("VolumeSelectionBox", QVariant(m_Controls->m_VolumeSelectionBox->currentIndex()));
   settings.setValue("SimpleModeEnabled", QVariant(m_SimpleModeEnabled));
   settings.setValue("OpenIGTLinkDataFormat", QVariant(m_Controls->m_OpenIGTLinkDataFormat->currentIndex()));
   settings.setValue("EnableOpenIGTLinkMicroService", QVariant(m_Controls->m_EnableOpenIGTLinkMicroService->isChecked()));
   settings.endGroup();
 }
 //! [StoreUISettings]
 
 //! [LoadUISettings]
 void QmitkMITKIGTTrackingToolboxView::LoadUISettings()
 {
   // persistence service does not directly work in plugins for now -> using QSettings
   QSettings settings;
 
   settings.beginGroup(QString::fromStdString(VIEW_ID));
 
   // set some widgets and attributes by the values from the QSettings
   m_Controls->m_ShowTrackingVolume->setChecked(settings.value("ShowTrackingVolume", false).toBool());
   m_Controls->m_EnableOpenIGTLinkMicroService->setChecked(settings.value("EnableOpenIGTLinkMicroService", true).toBool());
   m_Controls->m_VolumeSelectionBox->setCurrentIndex(settings.value("VolumeSelectionBox", 0).toInt());
   m_Controls->m_OpenIGTLinkDataFormat->setCurrentIndex(settings.value("OpenIGTLinkDataFormat", 0).toInt());
   m_ToolStorageFilename = settings.value("toolStorageFilename", QVariant("")).toString();
   if (settings.value("SimpleModeEnabled", false).toBool()) { this->OnToggleAdvancedSimpleMode(); }
   settings.endGroup();
   //! [LoadUISettings]
 
   //! [LoadToolStorage]
   // try to deserialize the tool storage from the given tool storage file name
   if (!m_ToolStorageFilename.isEmpty())
   {
     // try-catch block for exceptions
     try
     {
       mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(GetDataStorage());
       m_toolStorage->UnRegisterMicroservice();
       m_toolStorage = myDeserializer->Deserialize(m_ToolStorageFilename.toStdString());
       m_toolStorage->RegisterAsMicroservice();
 
       //update label
       UpdateToolStorageLabel(m_ToolStorageFilename);
 
       //update tool preview
       m_Controls->m_TrackingToolsStatusWidget->RemoveStatusLabels();
       m_Controls->m_TrackingToolsStatusWidget->PreShowTools(m_toolStorage);
     }
     catch (const mitk::IGTException& e)
     {
       MITK_WARN("QmitkMITKIGTTrackingToolBoxView") << "Error during restoring tools. Problems with file (" << m_ToolStorageFilename.toStdString() << "), please check the file? Error message: "<<e.GetDescription();
       this->OnResetTools(); //if there where errors reset the tool storage to avoid problems later on
     }
   }
   //! [LoadToolStorage]
 }
 
 void QmitkMITKIGTTrackingToolboxView::UpdateToolStorageLabel(QString pathOfLoadedStorage)
 {
-  QFileInfo myPath(pathOfLoadedStorage); //use this to seperate filename from path
+  QFileInfo myPath(pathOfLoadedStorage); //use this to separate filename from path
   QString toolLabel = myPath.fileName();
   if (toolLabel.size() > 45) //if the tool storage name is to long trimm the string
   {
     toolLabel.resize(40);
     toolLabel += "[...]";
   }
   m_Controls->m_ToolLabel->setText(toolLabel);
 }
 
 void QmitkMITKIGTTrackingToolboxView::AutoSaveToolStorage()
 {
   m_ToolStorageFilename = m_AutoSaveFilename;
   mitk::NavigationToolStorageSerializer::Pointer mySerializer = mitk::NavigationToolStorageSerializer::New();
   mySerializer->Serialize(m_ToolStorageFilename.toStdString(), m_toolStorage);
 }
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h
index f1d4a2d830..6710d38709 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.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 QmitkMITKIGTTrackingToolboxView_h
 #define QmitkMITKIGTTrackingToolboxView_h
 
 #include <berryISelectionListener.h>
 #include <ctkServiceReference.h>
 #include <ctkServiceEvent.h>
 
 #include <QmitkAbstractView.h>
 
 #include "ui_QmitkMITKIGTTrackingToolboxViewControls.h"
 
 //mitk headers
 #include <mitkNavigationToolStorage.h>
 #include <mitkNavigationDataObjectVisualizationFilter.h>
 #include <mitkNavigationDataRecorder.h>
 #include <mitkNavigationDataToIGTLMessageFilter.h>
 #include <mitkIGTLServer.h>
 #include <mitkIGTLMessageProvider.h>
 
 //QT headers
 #include <QTimer>
 
 #include "QmitkMITKIGTTrackingToolboxViewWorker.h"
 
 //Forward declaration of MITK classes
 namespace mitk
 {
   class NeedleProjectionFilter;
 }
 
 /*!
   \brief QmitkMITKIGTTrackingToolboxView
 
    This is the view of the bundle IGT Tracking Toolbox. The IGT Tracking Toolbox can be used to access tracking devices with MITK-IGT. The Tracking Toolbox can be used to log tracking data in     XML or CSV format for measurement purposes. The Tracking Toolbox further allows for visualization of tools with given surfaces in combination with the NaviagtionToolManager.
 */
 class QmitkMITKIGTTrackingToolboxView : 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;
 
     QmitkMITKIGTTrackingToolboxView();
     ~QmitkMITKIGTTrackingToolboxView() override;
 
     void CreateQtPartControl(QWidget *parent) override;
 
     ///
     /// Sets the focus to an internal widget.
     ///
     void SetFocus() override;
 
   protected slots:
 
     /** @brief changes name of the filename when switching fileextension by radio button */
     void OnToggleFileExtension();
     /** @brief This slot is called if the user wants to load a new tool file. A new window opens where the user can choose a file. If the chosen file is
                corrupt or not valid the user gets an error message. If the file was loaded successfully the tools are show in the tool status widget. */
     void OnLoadTools();
 
     /** Starts tracking if tracking is stopped / stops tracking if tracking is started. */
     void OnStartStopTracking();
 
     /** Connects the device if it is disconnected / disconnects the device if it is connected. */
     void OnConnectDisconnect();
 
     /** Freezes the device if it is not frozen / unfreezes the device if it is frozen. */
     void OnFreezeUnfreezeTracking();
 
     /** @brief Shows or hides the tool projection of the standard tool axis. */
     void OnShowHideToolProjectionClicked();
 
     /** @brief Shows or hides the standard tool axis. */
     void OnShowHideToolAxisClicked();
 
     /** @brief This slot connects to the device. In status "connected" configuration of the device is disabled. */
     void OnConnect();
 
     /** @brief This slot disconnects from the device. */
     void OnDisconnect();
 
     /** @brief This slot tries to start tracking with the current device. If start tracking fails the user gets an error message and tracking stays off.*/
     void OnStartTracking();
 
     /** @brief This slot stops tracking. If tracking is not strated it does nothing.*/
     void OnStopTracking();
 
-    /** @brief This slot is called if the user want's to choose a file name for logging. A new windows to navigate through the file system and choose
+    /** @brief This slot is called if the user wants to choose a file name for logging. A new windows to navigate through the file system and choose
                a file opens.*/
     void OnChooseFileClicked();
 
     /** @brief This slot starts logging. Logging is only possible if a device is tracking. If not the logging mechanism start when the start tracking
                is called.*/
     void StartLogging();
 
     /** @brief This slot stops logging. If logging is not running it does nothing.*/
     void StopLogging();
 
     /** @brief This slot enables / disables UI elements depending on the tracking device after a device is changed.*/
     void OnTrackingDeviceChanged();
 
     /** @brief This slot selects the Tracking Volume appropriate for a given model */
     void OnTrackingVolumeChanged(QString qstr);
 
     /** @brief Shows or hides the tracking volume according to the checkboxe's state */
     void OnShowTrackingVolumeChanged();
 
     /** @brief This slot auto detects tools of a NDI Aurora tracking device. If tools where found they will be stored internally as a tool storage.
         The user is also asked if he wants to save this tool storage to load it later. Only call it if a Aurora device was configured because other
         devices don't support auto detection.*/
     void OnAutoDetectTools();
 
     /** @brief Slot for tracking timer. The timer updates the IGT pipline and also the logging filter if logging is activated.*/
     void UpdateRenderTrackingTimer();
     void UpdateLoggingTrackingTimer();
 
     /** @brief Slot for showing the rendering disabled warning label*/
     void OnChangeRenderUpdateRate();
 
     /** @brief Resets the Tracking Tools: this means all tools are removed. */
     void OnResetTools();
 
     /** @brief Opens a dialog where a new navigation tool can be created. */
     void OnAddSingleTool();
 
     /** @brief This slot is called if the user finishes the creation of a new tool. */
     void OnAddSingleToolFinished();
 
     /** @brief This slot is called if the user cancels the creation of a new tool. */
     void OnAddSingleToolCanceled();
 
     void OnTimeOut();
 
     /**
     * \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool.
     * ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView.
     */
     void OnToolStorageChanged(const ctkServiceEvent event);
 
-  /* This slot enables selction of tool for projection*/
+  /* This slot enables selection of tool for projection*/
     void SelectToolProjection(int idx);
 
   protected slots:
 
    //help slots for enable/disable buttons
    void DisableLoggingButtons();
    void EnableLoggingButtons();
    void DisableOptionsButtons();
    void EnableOptionsButtons();
    void EnableTrackingConfigurationButtons();
    void DisableTrackingConfigurationButtons();
    void EnableTrackingControls();
    void DisableTrackingControls();
    void EnableDisableTimerButtons(int enable);
    void OnToggleAdvancedSimpleMode();
    void OnToggleDifferentUpdateRates();
 
    //slots for worker thread
    void OnAutoDetectToolsFinished(bool success, QString errorMessage);
    void OnConnectFinished(bool success, QString errorMessage);
    void OnStartTrackingFinished(bool success, QString errorMessage);
    void OnStopTrackingFinished(bool success, QString errorMessage);
    void OnDisconnectFinished(bool success, QString errorMessage);
 
   protected:
 
     Ui::QmitkMITKIGTTrackingToolboxViewControls* m_Controls;
 
     bool m_tracking;    ///> bool which is true if tracking is running, false if not
     bool m_connected;   ///> bool that is true when a tracking device is connected
     bool m_logging;     ///> bool which is true if logging is running, false if not
     bool m_ShowHideToolAxis; ///> bool, which will be true, if the tool axis is visible during tracking
     int m_loggedFrames; ///> stores the current number of logged frames if logging is on
 
     mitk::NavigationToolStorage::Pointer m_toolStorage;  ///>stores the loaded tools
     mitk::DataNode::Pointer m_TrackingVolumeNode;        ///>holds the data node of the tracking volume if volume is visualized
     bool lastTrackingVolumeState;                        ///>temporary holds the state of the tracking volume (activated/not activated) during some methods
 
     QString m_ToolStorageFilename; ///>stores the filename of the current tool storage
     QString m_AutoSaveFilename; ///>a filename for auto saving tools if no m_ToolStorageFilename was given by the user
 
     /** @brief Shows a message box with the text given as parameter. */
     void MessageBox(std::string s);
 
     /** @brief reinits the view globally. */
     void GlobalReinit();
 
    //members for the filter pipeline
    mitk::TrackingDeviceData m_TrackingDeviceData; ///> stores the tracking device data as long as this is not handled by the tracking device configuration widget
    mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; ///> holds the tool visualization filter (second filter of the IGT pipeline)
    mitk::NavigationDataRecorder::Pointer m_loggingFilter; ///> holds the logging filter if logging is on (third filter of the IGT pipeline)
    itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; ///> Contains the needle projection filter which is used for displaying the tool projection and the tool axis during tracking (optional third filter of the IGT pipeline). The filter is updated in the method UpdateRenderTrackingTimer().
 
    //members for open IGT link server
    mitk::NavigationDataToIGTLMessageFilter::Pointer m_IGTLConversionFilter; ///> Converts the navigation data as open IGT link message and makes this filter available as microservice
    mitk::IGTLServer::Pointer m_IGTLServer;
    mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
 
    /** @brief This timer updates the IGT pipline and also the logging filter if logging is activated.*/
    QTimer* m_TrackingRenderTimer;
    QTimer* m_TrackingLoggingTimer;
    QTimer* m_TimeoutTimer;
 
    bool m_SimpleModeEnabled; ///>Stores if simple UI mode is enabled
 
    /** Replaces the current navigation tool storage which is stored in m_toolStorage.
-    *  Basically handles the microservice stuff: unregisteres the old storage, then
+    *  Basically handles the microservice stuff: unregisters the old storage, then
     *  replaces the storage and registers the new one.
     */
    void ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName);
 
    /**
     * \brief Stores the properties of some QWidgets (and the tool storage file name) to QSettings.
     */
    void StoreUISettings();
 
    /**
     * \brief Loads the properties of some QWidgets (and the tool storage file name) from QSettings.
     */
    void LoadUISettings();
    /**
     * Help method for updating the tool label
     */
    void UpdateToolStorageLabel(QString pathOfLoadedStorage);
    /**
-    * Auto saves the current tool storage to a temporary file. This ist used for persistence.
+    * Auto saves the current tool storage to a temporary file. This is used for persistence.
   */
    void AutoSaveToolStorage();
 
    /**
    * Shows the projection of the tool along the tool axis for the given tool index
    */
    void ShowToolProjection(int index);
    /**
    * Removes all the tool projections from the data storage
    */
    void RemoveAllToolProjections();
 
 
    //members for worker thread
    QThread* m_WorkerThread;
    QmitkMITKIGTTrackingToolboxViewWorker* m_Worker;
 
   private:
    ctkServiceReference m_DeviceTypeServiceReference;
    mitk::TrackingDeviceTypeCollection* m_DeviceTypeCollection;
    mitk::DataNode::Pointer m_ToolProjectionNode;
 };
 
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.cpp b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.cpp
index 4c6ada6221..441ecefd95 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.cpp
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.cpp
@@ -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.
 
 ============================================================================*/
 
 // Qmitk
 #include "QmitkMITKIGTTrackingToolboxViewWorker.h"
 
 #include <mitkTrackingDeviceSourceConfigurator.h>
 
 QmitkMITKIGTTrackingToolboxViewWorker::QmitkMITKIGTTrackingToolboxViewWorker()
 {
 }
 
 QmitkMITKIGTTrackingToolboxViewWorker::~QmitkMITKIGTTrackingToolboxViewWorker()
 {
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetWorkerMethod(WorkerMethod w)
 {
   m_WorkerMethod = w;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetTrackingDevice(mitk::TrackingDevice::Pointer t)
 {
   m_TrackingDevice = t;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetDataStorage(mitk::DataStorage::Pointer d)
 {
   m_DataStorage = d;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetInverseMode(bool mode)
 {
   m_InverseMode = mode;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetTrackingDeviceData(mitk::TrackingDeviceData d)
 {
   m_TrackingDeviceData = d;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::SetNavigationToolStorage(mitk::NavigationToolStorage::Pointer n)
 {
   m_NavigationToolStorage = n;
 }
 
 //! [Thread 7]
 void QmitkMITKIGTTrackingToolboxViewWorker::ThreadFunc()
 {
   switch (m_WorkerMethod)
   {
   case eAutoDetectTools:
     this->AutoDetectTools();
     break;
   case eConnectDevice:
     this->ConnectDevice();
     break;
   case eStartTracking:
     this->StartTracking();
     break;
   case eStopTracking:
     this->StopTracking();
     break;
   case eDisconnectDevice:
     this->DisconnectDevice();
     break;
   default:
     MITK_WARN << "Undefined worker method was set ... something went wrong!";
     break;
   }
 }
 //! [Thread 7]
 
 void QmitkMITKIGTTrackingToolboxViewWorker::AutoDetectTools()
 {
   mitk::NavigationToolStorage::Pointer autoDetectedStorage = mitk::NavigationToolStorage::New(m_DataStorage);
   try
   {
     mitk::NavigationToolStorage::Pointer tempStorage = m_TrackingDevice->AutoDetectTools();
     for (unsigned int i = 0; i < tempStorage->GetToolCount(); i++) { autoDetectedStorage->AddTool(tempStorage->GetTool(i)); }
   }
   catch (mitk::Exception& e)
   {
     MITK_WARN << e.GetDescription();
     emit AutoDetectToolsFinished(false, e.GetDescription());
     return;
   }
   m_NavigationToolStorage = nullptr;
   m_NavigationToolStorage = autoDetectedStorage;
   emit AutoDetectToolsFinished(true, "");
   MITK_INFO << "AutoDetect Tools Finished.";
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::ConnectDevice()
 {
   std::string message = "";
 
   //build the IGT pipeline
   mitk::TrackingDevice::Pointer trackingDevice = m_TrackingDevice;
   trackingDevice->SetData(m_TrackingDeviceData);
 
-  //set device to rotation mode transposed becaus we are working with VNL style quaternions
+  //set device to rotation mode transposed because we are working with VNL style quaternions
   if (m_InverseMode)
   {
     trackingDevice->SetRotationMode(mitk::TrackingDevice::RotationTransposed);
   }
 
   //Get Tracking Volume Data
   mitk::TrackingDeviceData data = m_TrackingDeviceData;
 
   //Create Navigation Data Source with the factory class
   mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory = mitk::TrackingDeviceSourceConfigurator::New(m_NavigationToolStorage, trackingDevice);
 
   m_TrackingDeviceSource = myTrackingDeviceSourceFactory->CreateTrackingDeviceSource(m_ToolVisualizationFilter);
 
   if (m_TrackingDeviceSource.IsNull())
   {
     message = std::string("Cannot connect to device: ") + myTrackingDeviceSourceFactory->GetErrorMessage();
     emit ConnectDeviceFinished(false, QString(message.c_str()));
     return;
   }
 
-  //set filter to rotation mode transposed becaus we are working with VNL style quaternions
+  //set filter to rotation mode transposed because we are working with VNL style quaternions
   if (m_InverseMode)
     m_ToolVisualizationFilter->SetRotationMode(mitk::NavigationDataObjectVisualizationFilter::RotationTransposed);
 
   //First check if the created object is valid
   if (m_TrackingDeviceSource.IsNull())
   {
     message = myTrackingDeviceSourceFactory->GetErrorMessage();
     emit ConnectDeviceFinished(false, QString(message.c_str()));
     return;
   }
 
   MITK_INFO << "Connected device with " << m_TrackingDeviceSource->GetNumberOfOutputs() << " tools.";
 
   //connect to device
   try
   {
     m_TrackingDeviceSource->Connect();
     //Microservice registration:
     m_TrackingDeviceSource->SetToolMetaDataCollection(m_NavigationToolStorage);
     m_TrackingDeviceSource->RegisterAsMicroservice();
     m_NavigationToolStorage->SetSourceID(m_TrackingDeviceSource->GetMicroserviceID()); //DEPRECATED / not needed anymore because NavigationDataSource now holds a member of its tool storage. Only left for backward compatibility.
     m_NavigationToolStorage->LockStorage();
   }
   catch (...) //todo: change to mitk::IGTException
   {
     message = "Error on connecting the tracking device.";
     emit ConnectDeviceFinished(false, QString(message.c_str()));
     return;
   }
   emit ConnectDeviceFinished(true, QString(message.c_str()));
 }
 
 mitk::TrackingDeviceSource::Pointer QmitkMITKIGTTrackingToolboxViewWorker::GetTrackingDeviceSource()
 {
   return this->m_TrackingDeviceSource;
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::StartTracking()
 {
   QString errorMessage = "";
   try
   {
     m_TrackingDeviceSource->StartTracking();
   }
   catch (...) //todo: change to mitk::IGTException
   {
     errorMessage += "Error while starting the tracking device!";
     emit StartTrackingFinished(false, errorMessage);
     return;
   }
   //remember the original colors of the tools
   m_OriginalColors = std::map<mitk::DataNode::Pointer, mitk::Color>();
   for (unsigned int i = 0; i < this->m_NavigationToolStorage->GetToolCount(); i++)
   {
     mitk::DataNode::Pointer currentToolNode = m_NavigationToolStorage->GetTool(i)->GetDataNode();
     float c[3];
     currentToolNode->GetColor(c);
     mitk::Color color;
     color.SetRed(c[0]);
     color.SetGreen(c[1]);
     color.SetBlue(c[2]);
     m_OriginalColors[currentToolNode] = color;
   }
 
   emit StartTrackingFinished(true, errorMessage);
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::StopTracking()
 {
   //stop tracking
   try
   {
     m_TrackingDeviceSource->StopTracking();
   }
   catch (mitk::Exception& e)
   {
     emit StopTrackingFinished(false, e.GetDescription());
   }
 
   //restore the original colors of the tools
   for (unsigned int i = 0; i < this->m_NavigationToolStorage->GetToolCount(); i++)
   {
     mitk::DataNode::Pointer currentToolNode = m_NavigationToolStorage->GetTool(i)->GetDataNode();
     if (m_OriginalColors.find(currentToolNode) == m_OriginalColors.end())
     {
       MITK_WARN << "Cannot restore original color of tool " << m_NavigationToolStorage->GetTool(i)->GetToolName();
     }
     else
     {
       currentToolNode->SetColor(m_OriginalColors[currentToolNode]);
     }
   }
 
   // clear map m_OriginalColors
   m_OriginalColors.clear();
 
   //emit signal
   emit StopTrackingFinished(true, "");
 }
 
 void QmitkMITKIGTTrackingToolboxViewWorker::DisconnectDevice()
 {
   try
   {
     if (m_TrackingDeviceSource->IsTracking()) { m_TrackingDeviceSource->StopTracking(); }
     m_TrackingDeviceSource->Disconnect();
     m_TrackingDeviceSource->UnRegisterMicroservice();
 
     m_NavigationToolStorage->UnLockStorage();
 
     m_TrackingDeviceSource = nullptr;
   }
   catch (mitk::Exception& e)
   {
     emit DisconnectDeviceFinished(false, e.GetDescription());
   }
   emit DisconnectDeviceFinished(true, "");
 }
diff --git a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperViewControls.ui b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperViewControls.ui
index 6afea7fa3c..75acf265a8 100644
--- a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperViewControls.ui
@@ -1,311 +1,311 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkImageCropperViewControls</class>
  <widget class="QWidget" name="QmitkImageCropperViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>300</width>
     <height>600</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
     <property name="sizePolicy">
      <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
       <horstretch>0</horstretch>
       <verstretch>0</verstretch>
      </sizepolicy>
     </property>
     <property name="title">
      <string>Data Selection</string>
     </property>
     <layout class="QGridLayout" name="gridLayoutDataSelection">
 	 <item row="0" column="0">
       <widget class="QLabel" name="labelImage">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Image</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1">
       <widget class="QmitkSingleNodeSelectionWidget" name="imageSelectionWidget" native="true">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
 	 <item row="1" column="0">
       <widget class="QLabel" name="labelBoundingBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Bounding Box</string>
        </property>
       </widget>
      </item>
 	 <item row="1" column="1">
       <widget class="QmitkSingleNodeSelectionWidget" name="boundingBoxSelectionWidget" native="true">
 	   <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
 	  </item>
 	  <item row="1" column="2">
 	   <widget class="QPushButton" name="buttonCreateNewBoundingBox">
  	    <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
 	    <property name="minimumSize">
          <size>
           <width>0</width>
           <height>40</height>
          </size>
         </property>
         <property name="text">
          <string>New</string>
         </property>
        </widget>
       </item>
 	 </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBoundingObject">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>90</height>
       </size>
      </property>
      <property name="title">
       <string>Processing</string>
      </property>
      <layout class="QGridLayout" name="gridLayoutProcessing">
       <item row="0" column="0">
        <widget class="QPushButton" name="buttonMasking">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="text">
          <string>Mask</string>
         </property>
        </widget>
       </item>
       <item row="" column="1">
        <widget class="QPushButton" name="buttonCropping">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="text">
          <string>Crop</string>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="labelWarningRotation">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="text">
       <string>The selected image has a rotated geometry, result won't be pixel-aligned</string>
      </property>
      <property name="textFormat">
       <enum>Qt::PlainText</enum>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <widget class="ctkExpandButton" name="buttonAdvancedSettings">
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>25</height>
       </size>
      </property>
      <property name="text">
       <string>Advanced settings</string>
      </property>
      <property name="checkable">
       <bool>false</bool>
      </property>
      <property name="autoRepeatInterval">
       <number>100</number>
      </property>
      <property name="toolButtonStyle">
       <enum>Qt::ToolButtonTextBesideIcon</enum>
      </property>
      <property name="autoRaise">
       <bool>false</bool>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupImageSettings">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>120</height>
       </size>
      </property>
      <property name="title">
       <string>Output image settings</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <layout class="QHBoxLayout" name="horizontalLayoutSettings">
         <item>
          <widget class="QLabel" name="labelOutsidePixelValue">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
            <string>Outside pixel value (masking):</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QSpinBox" name="spinBoxOutsidePixelValue">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <item>
        <widget class="QCheckBox" name="checkOverwriteImage">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="text">
-         <string>Overrride original image</string>
+         <string>Override original image</string>
         </property>
         <property name="checked">
          <bool>false</bool>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="checkBoxCropTimeStepOnly">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="text">
          <string>Only crop current timestep
 / cut off other timesteps</string>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkSingleNodeSelectionWidget.h</header>
   </customwidget>
   <customwidget>
    <class>ctkExpandButton</class>
    <extends>QToolButton</extends>
    <header>ctkExpandButton.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/documentation/UserManual/Manual.dox
index 5d4fcf4622..cd4556807e 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/documentation/UserManual/Manual.dox
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/documentation/UserManual/Manual.dox
@@ -1,40 +1,40 @@
 /**
 \page org_mitk_views_matchpoint_algorithm_control The MatchPoint Algorithm Control View
 
 \imageMacro{map_icon_run_doc.svg,"Icon of the MatchPoint Algorithm Control",3.0}
 
 \tableofcontents
 
 \section MAP_RUN_Introduction Introduction
 This plugin offers the user a way to register data (images or point sets) in order to establish a spatial correlation/mapping (stored as registration object in the data storage). To determine a registration the user has to select
 a registration algorithm. For the selection of an algorithm please see MatchPoint Algorithm Browser (\ref org_mitk_views_matchpoint_algorithm_browser).
 
 \section MAP_RUN_Usage Usage
 \imageMacro{map_control_example.png, "Example screenshot showing the control plugin in use.", 10}
 To use the plugin a registration algorithm must be loaded and moving data as well as target data must be selected.
 
 The type of data supported depends on the chosen algorithm. Basically the plugin supports the registration of images and point sets.
 The moving data is registered onto the target data. Thus in case of images, the result is a mapped input image in the geometry (field of view, orientation, spacing) defined by the target image.\n
-All inputs that should be used for the registration are selected via the respective selection widgets shown in the image below. The box with the mask input selectors are only shown if the chosen algorithm supports masks. It is also optional to set only one ore both masks. (Remark: implications of which mask to set may depend on the specific algorithms; e.g. sometimes it is computationally more efficient to set at least the moving mask if possible.)
+All inputs that should be used for the registration are selected via the respective selection widgets shown in the image below. The box with the mask input selectors are only shown if the chosen algorithm supports masks. It is also optional to set only one or both masks. (Remark: implications of which mask to set may depend on the specific algorithms; e.g. sometimes it is computationally more efficient to set at least the moving mask if possible.)
 
 \imageMacro{map_control_inputs.png, "Input selections for the registration. Moving and target inputs are mandatory. Moving and target masks are only available if the algorithm supports them and are optional.", 5}
 
 If an algorithm is loaded and inputs are selected, the plugin will automatically switch to the "Execution" tab.
 
 \subsection MAP_RUN_Usage_selection Selection tab
 \imageMacro{map_control_step1_selection.png, "Details of the selection tab.", 5}
 In this tab registration algorithms that are selected in the MatchPoint Algorithm Browser can be chosen. In the tab you see the ID of the algorithm selected by the browser and its profile information.\n
 If you press the button "Load selected algorithm", the algorithm will be used by the control plugin. The name of the algorithm occurs in the text field "Loaded algorithm" (at the top of the plugin view).\n
 At this point, it has no effect if you change the selection in the browser. The control plugin will keep the loaded algorithm until you choose to load another one.
 
 \subsection MAP_RUN_Usage_exec Execution tab
 \imageMacro{map_control_step2_execution.png, "Details of the execution tab.", 5}
 In this tab you can specify a name for the registration job (this will determine the names of the result nodes in the Data Manager View and the data selection widgets).\n
 You can also choose to "store registration" (which is normally the goal of the whole process, because this is the very result of the algorithm ;).\n
 Additionally you can choose "Generate + store mapped result". This is a convenience feature which often saves you the time to use the mapper plugin afterwards. It will do the same like using the mapper plugin with the moving and target image, setting padding value "0" and using "linear interpolation". If you need other settings, skip the convenience generation and use the MatchPoint mapper plugin directly.\n
 "Start" will trigger the registration process. Some algorithms can be stopped while processing takes place. In those cases, there is a "Stop" button enabled, as soon as the registration process starts.
 
 \subsection MAP_RUN_Usage_settings Settings tab
 \imageMacro{map_control_step3_settings.png, "Details of the settings tab.", 5}
 In this tab, you can change the parametrization of the loaded algorithm (before it starts), if it offers any possibility to do so.
 */
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 ac11c3bf6a..85dbf7e4dd 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,204 +1,204 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkMatchPoint_h
 #define QmitkMatchPoint_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.
 
 \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);
 
   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;
 
 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.
+  * they are stored m_MovingData and m_TargetData. It also sets the info labels 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.
+  Configure the node selectors predicates and information 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
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/documentation/UserManual/Manual.dox
index 0f87905d06..6d6b5c88ec 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/documentation/UserManual/Manual.dox
+++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/documentation/UserManual/Manual.dox
@@ -1,56 +1,56 @@
 /**
 \page org_mitk_views_matchpoint_evaluator The MatchPoint Registration Evaluation View
 
 \imageMacro{map_evaluator_doc.svg, "Icon of the MatchPoint Registration Evaluator", 3}
 
 \tableofcontents
 
 \section MAP_REGEVAL_Introduction Introduction
 This view offers the possibility to evaluate the quality of the registration/mapping of two given images by visual inspection.
 This can either by used to assess the visual quality of a registration or to assess how well the image contents are already aligned
 by default. To achieve the latter, one may select no registration. Then the images will be displayed in evaluation mode assuming an identity transform (so no mapping).
 It is one of several MatchPoint registration plug-ins.\n
 
 \section MAP_REGEVAL_Usage Usage
 \imageMacro{map_view_evaluator_example.png, "Example screenshot showing the main elements of the view.", 14}
 (1) The currently selected registration that should be used to map the moving image for evaluation. Click to change. If no registration is selected, a direct evaluation will be performed.\n
 (2) Reset button will remove the currently selected registration.\n
 (3) Auto select option. If active the view will try to deduce and automatically select (if loaded in the application) the moving and target image when the registration changes. The view assumes that the moving and target images used to determine the registration should be used.\n
 (4) The currently selected moving data. Click to change.\n
 (5) The currently selected target data. Click to change.\n
 (6) Start/Stop button used to activate/deactivate the evaluation. This button become active when at least the moving and the target image are selected.\n
 (7) Selection of the visualization style. (only visible if evaluation is active)\n
 (8) Style specific settings. (only visible if evaluation is active)\n
 
 If the evaluation view is active you can choose between different modes of visualization. For more details see \ref MAP_REGEVAL_Styles .\n
 To stop the evaluation mode, you may use the "Stop evaluation" button or just close the evaluation view.
 
 \remark The evaluation view will use the level window settings of the used images. So to change the level windowing of the evaluation view, you must change the
 level windowing of the respective input images (moving image and target image).
 
 \section MAP_REGEVAL_Accuracy Evaluating accuracy
 <b>Important note:</b> Please be aware, that a visual inspection of registration quality is only a weak surrogate for a thorough accuracy analysis based on representative and suitable ground truth data. From a visually good mapping you can not deduce a correct registration. This is especially true if the degrees of freedom of the registration increases. For a rigid registration it might by feasible to discern correct and incorrect registration. But for none rigid registrations you definitely you should use this view only for first visual inspection (to check if it SEEMS to do the right thing and is worth further exploration) or illustrating the registration effect for registration you have assessed in a sound way.
 
 \section MAP_REGEVAL_Styles Visualization styles
 You can choose from the following visualization styles to evaluate the registration/mapping quality:\n
 \li "Blend": Blends the images with a user defined weight. Default is 50:50.
 \imageMacro{map_view_blend_settings.png, "Settings of the Blend style", 8}
 (1) Click to set the weights to 100% target image.\n
 (2) Click to set the weights to 50:50 (equal blend).\n
 (3) Slider to adjust the weights between target image and the mapped input image. The spin box shows the weight of the mapped input image.\n
 (4) Click to set the weights to 100% mapped input image.\n
 (5) Click to toggle the weight between both images.\n
 \imageMacro{map_style_blend.png, "Example for mode: Blend (50:50)", 5}
 \li "Checkerboard": Checkerboard style that composes both images by showing image 1 in all light squares and image 2 in all dark squares. You can define the resolution/number of squares of the checkerboard.
 \imageMacro{map_style_checkerboard.png, "Example for mode: Checkerboard", 5}
 \li "Color blend": Color blend of the images (blue: target image; yellow: moving). Areas where you see no color implies good intensity matchings.
 \imageMacro{map_style_color_blend.png, "Example for mode: Color blend", 5}
 \li "Contour": Blend mode that displays one image as blue "background" and the other image in yellow contours. You can choose the role of the images.
 \imageMacro{map_style_contour.png, "Example for mode: Contour", 5}
 \li "Difference": Displays the absolute difference of both images.
-\li "Wipe": Blend mode that makes a rectilinear combination of the images. You can choose the mode how the images are splitted. The split is synchronized with the current selection. So you may interact with the split border to position it on interesting areas.
+\li "Wipe": Blend mode that makes a rectilinear combination of the images. You can choose the mode how the images are split. The split is synchronized with the current selection. So you may interact with the split border to position it on interesting areas.
 \imageMacro{map_style_wipe_cross.png, "Example for mode: Wipe cross", 5}
 \imageMacro{map_style_wipe_horizontal.png, "Example for mode: Wipe horizontal", 5}
 
 */
 
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 e923a6fe7f..3cb3750594 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,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 QmitkMatchPointRegistrationEvaluator_h
 #define QmitkMatchPointRegistrationEvaluator_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.
 
 \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);
 
   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();
 
   void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
 
 protected:
   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);
 
   /**
   * 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.*/
+  * It also sets the info labels accordingly.*/
   void CheckInputs();
 
   /**
   * Updates the state of controls regarding to selected eval object.*/
   void ConfigureControls();
 
   /**
   Configure the node selectors predicates according to the selected algorithm.
   */
   void ConfigureNodePredicates();
 
   mitk::DataNode::Pointer m_selectedEvalNode;
 
   QmitkSliceNavigationListener m_SliceChangeListener;
 
   itk::TimeStamp m_selectedNodeTime;
   itk::TimeStamp m_currentPositionTime;
 
   bool m_activeEvaluation;
 
   /** @brief currently valid selected position in the inspector*/
   mitk::Point3D m_currentSelectedPosition;
   /** @brief currently selected timepoint*/
   mitk::TimePointType m_currentSelectedTimePoint;
 
   mitk::DataNode::Pointer m_spSelectedRegNode;
   mitk::DataNode::Pointer m_spSelectedMovingNode;
   mitk::DataNode::Pointer m_spSelectedTargetNode;
 
   static const std::string HelperNodeName;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.cpp b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.cpp
index e7c2cac264..c94f8f78ad 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.cpp
+++ b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.cpp
@@ -1,724 +1,724 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "org_mitk_gui_qt_matchpoint_framereg_Activator.h"
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 #include <berryISelectionProvider.h>
 #include <berryQModelIndexObject.h>
 
 // Mitk
 #include <mitkStatusBar.h>
 #include <mitkPointSet.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDimension.h>
 #include <mitkNodePredicateGeometry.h>
 #include <mitkMAPAlgorithmInfoSelection.h>
 #include <mitkRegistrationHelper.h>
 #include <mitkResultNodeGenerationHelper.h>
 
 // Qmitk
 #include "QmitkMatchPointFrameCorrection.h"
 #include <QmitkRegistrationJob.h>
 #include <QmitkMappingJob.h>
 
 // Qt
 #include <QMessageBox>
 #include <QFileDialog>
 #include <QErrorMessage>
 #include <QThreadPool>
 #include <QDateTime>
 
 // MatchPoint
 #include <mapImageRegistrationAlgorithmInterface.h>
 #include <mapPointSetRegistrationAlgorithmInterface.h>
 #include <mapRegistrationAlgorithmInterface.h>
 #include <mapMaskedRegistrationAlgorithmInterface.h>
 #include <mapAlgorithmEvents.h>
 #include <mapAlgorithmWrapperEvent.h>
 #include <mapExceptionObjectMacros.h>
 #include <mapConvert.h>
 #include <mapDeploymentDLLAccess.h>
 
 const std::string QmitkMatchPointFrameCorrection::VIEW_ID =
   "org.mitk.views.matchpoint.algorithm.framereg";
 
 QmitkMatchPointFrameCorrection::QmitkMatchPointFrameCorrection()
   : m_Parent(nullptr), m_LoadedDLLHandle(nullptr), m_LoadedAlgorithm(nullptr), m_CanLoadAlgorithm(false), m_Working(false)
 {
   m_spSelectedTargetData = nullptr;
   m_spSelectedTargetMaskData = nullptr;
 }
 
 QmitkMatchPointFrameCorrection::~QmitkMatchPointFrameCorrection()
 {
   // remove selection service
   berry::ISelectionService* s = this->GetSite()->GetWorkbenchWindow()->GetSelectionService();
 
   if (s)
   {
     s->RemoveSelectionListener(m_AlgorithmSelectionListener.data());
   }
 }
 
 void QmitkMatchPointFrameCorrection::SetFocus()
 {
 }
 
 void QmitkMatchPointFrameCorrection::CreateConnections()
 {
   connect(m_Controls.imageNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointFrameCorrection::OnNodeSelectionChanged);
   connect(m_Controls.maskNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointFrameCorrection::OnNodeSelectionChanged);
 
   // ------
   // Tab 1 - Shared library loading interface
   // ------
 
   connect(m_Controls.m_pbLoadSelected, SIGNAL(clicked()), this, SLOT(OnLoadAlgorithmButtonPushed()));
 
   // -----
   // Tab 2 - Execution
   // -----
   connect(m_Controls.m_pbStartReg, SIGNAL(clicked()), this, SLOT(OnStartRegBtnPushed()));
   connect(m_Controls.m_pbSaveLog, SIGNAL(clicked()), this, SLOT(OnSaveLogBtnPushed()));
 
   // -----
   // Tab 4 - Frames
   // -----
   connect(m_Controls.m_btnFrameSelAll, SIGNAL(clicked()), this, SLOT(OnFramesSelectAllPushed()));
   connect(m_Controls.m_btnFrameDeSelAll, SIGNAL(clicked()), this, SLOT(OnFramesDeSelectAllPushed()));
   connect(m_Controls.m_btnFrameInvert, SIGNAL(clicked()), this, SLOT(OnFramesInvertPushed()));
 
 }
 
 const map::deployment::DLLInfo* QmitkMatchPointFrameCorrection::GetSelectedAlgorithmDLL() const
 {
   return m_SelectedAlgorithmInfo;
 }
 
 void QmitkMatchPointFrameCorrection::OnSelectedAlgorithmChanged()
 {
   std::stringstream descriptionString;
 
   ::map::deployment::DLLInfo::ConstPointer currentItemInfo = GetSelectedAlgorithmDLL();
 
   if (!currentItemInfo)
   {
     return;
   }
 
   m_Controls.m_teAlgorithmDetails->updateInfo(currentItemInfo);
 
   m_Controls.m_lbSelectedAlgorithm->setText(QString::fromStdString(
         currentItemInfo->getAlgorithmUID().getName()));
 
   // enable loading
   m_CanLoadAlgorithm = true;
   this->AdaptFolderGUIElements();
 }
 
 void QmitkMatchPointFrameCorrection::OnLoadAlgorithmButtonPushed()
 {
   map::deployment::DLLInfo::ConstPointer dllInfo = GetSelectedAlgorithmDLL();
 
   if (!dllInfo)
   {
     Error(QStringLiteral("No valid algorithm is selected. Cannot load algorithm. ABORTING."));
     return;
   }
 
   ::map::deployment::DLLHandle::Pointer tempDLLHandle = ::map::deployment::openDeploymentDLL(
         dllInfo->getLibraryFilePath());
   ::map::algorithm::RegistrationAlgorithmBase::Pointer tempAlgorithm
     = ::map::deployment::getRegistrationAlgorithm(tempDLLHandle);
 
   if (tempAlgorithm.IsNull())
   {
     Error(QStringLiteral("Error. Cannot load selected algorithm."));
     return;
   }
 
   this->m_LoadedAlgorithm = tempAlgorithm;
   this->m_LoadedDLLHandle = tempDLLHandle;
 
   this->m_Controls.m_AlgoConfigurator->setAlgorithm(m_LoadedAlgorithm);
 
   this->AdaptFolderGUIElements();
   this->ConfigureNodeSelectorPredicates();
   this->CheckInputs();
   this->ConfigureRegistrationControls();
   this->ConfigureProgressInfos();
   this->m_Controls.m_tabs->setCurrentIndex(1);
 }
 
 void QmitkMatchPointFrameCorrection::Error(QString msg)
 {
   mitk::StatusBar::GetInstance()->DisplayErrorText(msg.toLatin1());
   MITK_ERROR << msg.toStdString().c_str();
 
   m_Controls.m_teLog->append(QString("<font color='red'><b>") + msg + QString("</b></font>"));
 }
 
 void QmitkMatchPointFrameCorrection::AdaptFolderGUIElements()
 {
   m_Controls.m_pbLoadSelected->setEnabled(m_CanLoadAlgorithm);
 }
 
 void QmitkMatchPointFrameCorrection::CreateQtPartControl(QWidget* parent)
 {
 
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi(parent);
   m_Parent = parent;
 
   this->m_Controls.imageNodeSelector->SetDataStorage(this->GetDataStorage());
   this->m_Controls.imageNodeSelector->SetSelectionIsOptional(false);
   this->m_Controls.maskNodeSelector->SetDataStorage(this->GetDataStorage());
   this->m_Controls.maskNodeSelector->SetSelectionIsOptional(true);
 
   this->m_Controls.imageNodeSelector->SetInvalidInfo("Select dymamic image.");
   this->m_Controls.imageNodeSelector->SetPopUpTitel("Select dynamic image.");
   this->m_Controls.imageNodeSelector->SetPopUpHint("Select a dynamic image (time resolved) that should be frame corrected.");
   this->m_Controls.maskNodeSelector->SetInvalidInfo("Select target mask.");
   this->m_Controls.maskNodeSelector->SetPopUpTitel("Select target mask.");
   this->m_Controls.maskNodeSelector->SetPopUpHint("Select a target mask (mask of the target/first frame).");
 
   m_Controls.m_tabs->setCurrentIndex(0);
 
   m_Controls.m_mapperSettings->AllowSampling(false);
 
   m_AlgorithmSelectionListener.reset(new
                                      berry::SelectionChangedAdapter<QmitkMatchPointFrameCorrection>(this,
                                          &QmitkMatchPointFrameCorrection::OnAlgorithmSelectionChanged));
 
   // register selection listener
   GetSite()->GetWorkbenchWindow()->GetSelectionService()->AddSelectionListener(
     m_AlgorithmSelectionListener.data());
 
   this->ConfigureNodeSelectorPredicates();
   this->CreateConnections();
   this->AdaptFolderGUIElements();
   this->CheckInputs();
   this->ConfigureProgressInfos();
   this->ConfigureRegistrationControls();
 
   berry::ISelection::ConstPointer selection =
     GetSite()->GetWorkbenchWindow()->GetSelectionService()->GetSelection("org.mitk.views.matchpoint.algorithm.browser");
 
   this->UpdateAlgorithmSelection(selection);
 }
 
 void QmitkMatchPointFrameCorrection::ConfigureNodeSelectorPredicates()
 {
   auto isImage = mitk::MITKRegistrationHelper::ImageNodePredicate();
   mitk::NodePredicateBase::Pointer maskDimensionPredicate = mitk::NodePredicateOr::New(mitk::NodePredicateDimension::New(3), mitk::NodePredicateDimension::New(4)).GetPointer();
   mitk::NodePredicateDimension::Pointer imageDimensionPredicate = mitk::NodePredicateDimension::New(4);
 
   m_Controls.imageNodeSelector->setEnabled(m_LoadedAlgorithm.IsNotNull());
   m_Controls.maskNodeSelector->setEnabled(m_LoadedAlgorithm.IsNotNull());
 
   m_Controls.imageNodeSelector->SetNodePredicate(mitk::NodePredicateAnd::New(isImage, imageDimensionPredicate));
 
   mitk::NodePredicateAnd::Pointer maskPredicate = mitk::NodePredicateAnd::New(mitk::MITKRegistrationHelper::MaskNodePredicate(), maskDimensionPredicate);
   if (m_spSelectedTargetData != nullptr)
   {
     auto hasSameGeometry = mitk::NodePredicateGeometry::New(m_spSelectedTargetData->GetGeometry());
     hasSameGeometry->SetCheckPrecision(1e-10);
     maskPredicate = mitk::NodePredicateAnd::New(maskPredicate, hasSameGeometry);
   }
 
   m_Controls.maskNodeSelector->SetNodePredicate(maskPredicate);
 }
 
 void QmitkMatchPointFrameCorrection::CheckInputs()
 {
   mitk::DataNode::Pointer oldTargetNode = m_spSelectedTargetNode;
 
   m_spSelectedTargetNode = nullptr;
   m_spSelectedTargetData = nullptr;
 
   m_spSelectedTargetMaskNode = nullptr;
   m_spSelectedTargetMaskData = nullptr;
 
   if (m_LoadedAlgorithm.IsNull())
   {
     m_Controls.m_lbLoadedAlgorithmName->setText(
-      QStringLiteral("<font color='red'>No algorithm seleted!</font>"));
+      QStringLiteral("<font color='red'>No algorithm selected!</font>"));
   }
   else
   {
     m_spSelectedTargetNode = m_Controls.imageNodeSelector->GetSelectedNode();
     if (m_spSelectedTargetNode.IsNotNull())
     {
       m_spSelectedTargetData = m_spSelectedTargetNode->GetData();
     }
 
     m_spSelectedTargetMaskNode = m_Controls.maskNodeSelector->GetSelectedNode();
     if (m_spSelectedTargetMaskNode.IsNotNull())
     {
       m_spSelectedTargetMaskData = dynamic_cast<mitk::Image*>(m_spSelectedTargetMaskNode->GetData());
     }
   }
 
   if (oldTargetNode != m_spSelectedTargetNode)
   {
     ConfigureFrameList();
   }
 }
 
 
 mitk::DataStorage::SetOfObjects::Pointer QmitkMatchPointFrameCorrection::GetRegNodes() const
 {
 
   mitk::DataStorage::SetOfObjects::ConstPointer nodes = this->GetDataStorage()->GetAll();
   mitk::DataStorage::SetOfObjects::Pointer result = mitk::DataStorage::SetOfObjects::New();
 
   for (mitk::DataStorage::SetOfObjects::const_iterator pos = nodes->begin(); pos != nodes->end();
        ++pos)
   {
     if (mitk::MITKRegistrationHelper::IsRegNode(*pos))
     {
       result->push_back(*pos);
     }
   }
 
   return result;
 }
 
 std::string QmitkMatchPointFrameCorrection::GetDefaultJobName() const
 {
 
   mitk::DataStorage::SetOfObjects::ConstPointer nodes = this->GetRegNodes().GetPointer();
   mitk::DataStorage::SetOfObjects::ElementIdentifier newIndex = 0;
 
   bool isUnique = false;
 
   std::string baseName = "corrected #";
 
   if (m_spSelectedTargetNode.IsNotNull())
   {
     baseName = m_spSelectedTargetNode->GetName() + "corrected #";
   }
 
   std::string result = baseName;
 
   while (!isUnique)
   {
     ++newIndex;
     result = baseName + ::map::core::convert::toStr(newIndex);
     isUnique =  this->GetDataStorage()->GetNamedNode(result) == nullptr;
   }
 
   return result;
 }
 
 void QmitkMatchPointFrameCorrection::ConfigureRegistrationControls()
 {
   m_Controls.m_tabSelection->setEnabled(!m_Working);
   m_Controls.m_leRegJobName->setEnabled(!m_Working);
 
   m_Controls.m_pbStartReg->setEnabled(false);
 
   m_Controls.imageNodeSelector->setEnabled(!m_Working);
   m_Controls.maskNodeSelector->setEnabled(!m_Working);
 
   if (m_LoadedAlgorithm.IsNotNull())
   {
     m_Controls.m_tabSettings->setEnabled(!m_Working);
     m_Controls.m_tabExclusion->setEnabled(!m_Working);
     m_Controls.m_tabExecution->setEnabled(true);
     m_Controls.m_pbStartReg->setEnabled(m_spSelectedTargetNode.IsNotNull() && !m_Working);
     m_Controls.m_leRegJobName->setEnabled(!m_Working);
 
     typedef ::map::algorithm::facet::MaskedRegistrationAlgorithmInterface<3, 3> MaskRegInterface;
     const MaskRegInterface* pMaskReg = dynamic_cast<const MaskRegInterface*>
                                        (m_LoadedAlgorithm.GetPointer());
 
     m_Controls.maskNodeSelector->setVisible(pMaskReg != nullptr);
     m_Controls.label_TargetMask->setVisible(pMaskReg != nullptr);
     if (!pMaskReg)
     {
       m_Controls.maskNodeSelector->SetCurrentSelection(QmitkSingleNodeSelectionWidget::NodeList());
     }
 
     this->m_Controls.m_lbLoadedAlgorithmName->setText(
       QString::fromStdString(m_LoadedAlgorithm->getUID()->toStr()));
   }
   else
   {
     m_Controls.m_tabSettings->setEnabled(false);
     m_Controls.m_tabExclusion->setEnabled(false);
     m_Controls.m_tabExecution->setEnabled(false);
     this->m_Controls.m_lbLoadedAlgorithmName->setText(
       QStringLiteral("<font color='red'>no algorithm loaded!</font>"));
     m_Controls.maskNodeSelector->setVisible(false);
     m_Controls.label_TargetMask->setVisible(false);
   }
 
   if (!m_Working)
   {
     this->m_Controls.m_leRegJobName->setText(QString::fromStdString(this->GetDefaultJobName()));
   }
 }
 
 void QmitkMatchPointFrameCorrection::ConfigureProgressInfos()
 {
   const IIterativeAlgorithm* pIterative = dynamic_cast<const IIterativeAlgorithm*>
                                           (m_LoadedAlgorithm.GetPointer());
   const IMultiResAlgorithm* pMultiRes = dynamic_cast<const IMultiResAlgorithm*>
                                         (m_LoadedAlgorithm.GetPointer());
 
   m_Controls.m_progBarIteration->setVisible(pIterative);
   m_Controls.m_lbProgBarIteration->setVisible(pIterative);
 
 
   if (pIterative)
   {
     QString format = "%p% (%v/%m)";
 
     if (!pIterative->hasMaxIterationCount())
     {
       format = "%v";
       m_Controls.m_progBarIteration->setMaximum(0);
     }
     else
     {
       m_Controls.m_progBarIteration->setMaximum(pIterative->getMaxIterations());
     }
 
     m_Controls.m_progBarIteration->setFormat(format);
   }
 
   if (pMultiRes)
   {
     m_Controls.m_progBarLevel->setMaximum(pMultiRes->getResolutionLevels());
 
   }
   else
   {
     m_Controls.m_progBarLevel->setMaximum(1);
   }
 
   m_Controls.m_progBarIteration->reset();
   m_Controls.m_progBarLevel->reset();
   m_Controls.m_progBarFrame->reset();
 }
 
 void QmitkMatchPointFrameCorrection::ConfigureFrameList()
 {
   m_Controls.m_listFrames->clear();
 
   if (m_spSelectedTargetData.IsNotNull())
   {
     mitk::TimeGeometry::ConstPointer tg = m_spSelectedTargetData->GetTimeGeometry();
 
     for (unsigned int i = 1; i < tg->CountTimeSteps(); ++i)
     {
       QString lable = "Timepoint #" + QString::number(i) + QString(" (") + QString::number(
                         tg->GetMinimumTimePoint(i)) + QString(" ms - " + QString::number(tg->GetMaximumTimePoint(
                               i)) + QString(" ms)"));
       QListWidgetItem* item = new QListWidgetItem(lable, m_Controls.m_listFrames);
       item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
       item->setCheckState(Qt::Checked);
     }
   }
 }
 
 void QmitkMatchPointFrameCorrection::OnFramesSelectAllPushed()
 {
   for (int row = 0; row < m_Controls.m_listFrames->count(); row++)
   {
     QListWidgetItem* item = m_Controls.m_listFrames->item(row);
     item->setCheckState(Qt::Checked);
   }
 };
 
 void QmitkMatchPointFrameCorrection::OnFramesDeSelectAllPushed()
 {
   for (int row = 0; row < m_Controls.m_listFrames->count(); row++)
   {
     QListWidgetItem* item = m_Controls.m_listFrames->item(row);
     item->setCheckState(Qt::Unchecked);
   }
 };
 
 void QmitkMatchPointFrameCorrection::OnFramesInvertPushed()
 {
   for (int row = 0; row < m_Controls.m_listFrames->count(); row++)
   {
     QListWidgetItem* item = m_Controls.m_listFrames->item(row);
 
     if (item->checkState() == Qt::Unchecked)
     {
       item->setCheckState(Qt::Checked);
     }
     else
     {
       item->setCheckState(Qt::Unchecked);
     }
   }
 };
 
 mitk::TimeFramesRegistrationHelper::IgnoreListType
 QmitkMatchPointFrameCorrection::GenerateIgnoreList() const
 {
   mitk::TimeFramesRegistrationHelper::IgnoreListType result;
 
   for (int row = 0; row < m_Controls.m_listFrames->count(); row++)
   {
     QListWidgetItem* item = m_Controls.m_listFrames->item(row);
 
     if (item->checkState() == Qt::Unchecked)
     {
       result.push_back(row + 1);
     }
   }
 
   return result;
 }
 
 void QmitkMatchPointFrameCorrection::OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> /*nodes*/)
 
 {
   if (!m_Working)
   {
     ConfigureNodeSelectorPredicates();
     CheckInputs();
     ConfigureRegistrationControls();
   }
 }
 
 void QmitkMatchPointFrameCorrection::OnStartRegBtnPushed()
 {
   this->m_Working = true;
 
   ////////////////////////////////
   //configure GUI
   this->ConfigureProgressInfos();
 
   m_Controls.m_progBarIteration->reset();
   m_Controls.m_progBarLevel->reset();
 
   this->ConfigureRegistrationControls();
 
   if (m_Controls.m_checkClearLog->checkState() == Qt::Checked)
   {
     this->m_Controls.m_teLog->clear();
   }
 
 
   /////////////////////////
   //create job and put it into the thread pool
   QmitkFramesRegistrationJob* pJob = new QmitkFramesRegistrationJob(m_LoadedAlgorithm);
   pJob->setAutoDelete(true);
 
   pJob->m_spTargetData = m_spSelectedTargetData;
   pJob->m_TargetDataUID = mitk::EnsureUID(this->m_spSelectedTargetNode->GetData());
   pJob->m_IgnoreList = this->GenerateIgnoreList();
 
   if (m_spSelectedTargetMaskData.IsNotNull())
   {
     pJob->m_spTargetMask = m_spSelectedTargetMaskData;
     pJob->m_TargetMaskDataUID = mitk::EnsureUID(this->m_spSelectedTargetMaskNode->GetData());
   }
 
   pJob->m_MappedName = m_Controls.m_leRegJobName->text().toStdString();
 
   m_Controls.m_mapperSettings->ConfigureJobSettings(pJob);
 
   connect(pJob, SIGNAL(Error(QString)), this, SLOT(OnRegJobError(QString)));
   connect(pJob, SIGNAL(Finished()), this, SLOT(OnRegJobFinished()));
   connect(pJob, SIGNAL(ResultIsAvailable(mitk::Image::Pointer, const QmitkFramesRegistrationJob*)),
           this, SLOT(OnMapResultIsAvailable(mitk::Image::Pointer, const QmitkFramesRegistrationJob*)),
           Qt::BlockingQueuedConnection);
 
   connect(pJob, SIGNAL(AlgorithmInfo(QString)), this, SLOT(OnAlgorithmInfo(QString)));
   connect(pJob, SIGNAL(AlgorithmStatusChanged(QString)), this,
           SLOT(OnAlgorithmStatusChanged(QString)));
   connect(pJob, SIGNAL(AlgorithmIterated(QString, bool, unsigned long)), this,
           SLOT(OnAlgorithmIterated(QString, bool, unsigned long)));
   connect(pJob, SIGNAL(LevelChanged(QString, bool, unsigned long)), this, SLOT(OnLevelChanged(QString,
           bool, unsigned long)));
   connect(pJob, SIGNAL(FrameRegistered(double)), this, SLOT(OnFrameRegistered(double)));
   connect(pJob, SIGNAL(FrameMapped(double)), this, SLOT(OnFrameMapped(double)));
   connect(pJob, SIGNAL(FrameProcessed(double)), this, SLOT(OnFrameProcessed(double)));
 
   QThreadPool* threadPool = QThreadPool::globalInstance();
   threadPool->start(pJob);
 }
 
 void QmitkMatchPointFrameCorrection::OnSaveLogBtnPushed()
 {
   QDateTime currentTime = QDateTime::currentDateTime();
   QString fileName = tr("registration_log_") + currentTime.toString(tr("yyyy-MM-dd_hh-mm-ss")) +
                      tr(".txt");
   fileName = QFileDialog::getSaveFileName(nullptr, tr("Save registration log"), fileName,
                                           tr("Text files (*.txt)"));
 
   if (fileName.isEmpty())
   {
     QMessageBox::critical(nullptr, tr("No file selected!"),
                           tr("Cannot save registration log file. Please selected a file."));
   }
   else
   {
     std::ofstream file;
 
     std::ios_base::openmode iOpenFlag = std::ios_base::out | std::ios_base::trunc;
     file.open(fileName.toStdString().c_str(), iOpenFlag);
 
     if (!file.is_open())
     {
       mitkThrow() << "Cannot open or create specified file to save. File path: "
                   << fileName.toStdString();
     }
 
     file << this->m_Controls.m_teLog->toPlainText().toStdString() << std::endl;
 
     file.close();
   }
 }
 
 void QmitkMatchPointFrameCorrection::OnRegJobError(QString err)
 {
   Error(err);
 };
 
 void QmitkMatchPointFrameCorrection::OnRegJobFinished()
 {
   this->m_Working = false;
 
   auto* renderWindowPart = this->GetRenderWindowPart();
 
   if (nullptr != renderWindowPart)
     renderWindowPart->RequestUpdate();
 
   this->CheckInputs();
   this->ConfigureRegistrationControls();
   this->ConfigureProgressInfos();
 };
 
 
 void QmitkMatchPointFrameCorrection::OnMapResultIsAvailable(mitk::Image::Pointer spMappedData,
     const QmitkFramesRegistrationJob* job)
 {
   m_Controls.m_teLog->append(QString("<b><font color='blue'>Corrected image stored. Name: ") +
                              QString::fromStdString(job->m_MappedName) + QString("</font></b>"));
 
   mitk::DataNode::Pointer spResultNode = mitk::generateMappedResultNode(job->m_MappedName,
                                          spMappedData.GetPointer(), "", job->m_TargetDataUID, false, job->m_InterpolatorLabel);
 
   this->GetDataStorage()->Add(spResultNode, this->m_spSelectedTargetNode);
 
   auto* renderWindowPart = this->GetRenderWindowPart();
 
   if (nullptr != renderWindowPart)
     renderWindowPart->RequestUpdate();
 };
 
 void QmitkMatchPointFrameCorrection::OnMapJobError(QString err)
 {
   Error(err);
 };
 
 void QmitkMatchPointFrameCorrection::OnAlgorithmIterated(QString info, bool hasIterationCount,
     unsigned long currentIteration)
 {
   if (hasIterationCount)
   {
     m_Controls.m_progBarIteration->setValue(currentIteration);
   }
 
   m_Controls.m_teLog->append(info);
 };
 
 void QmitkMatchPointFrameCorrection::OnLevelChanged(QString info, bool hasLevelCount,
     unsigned long currentLevel)
 {
   if (hasLevelCount)
   {
     m_Controls.m_progBarLevel->setValue(currentLevel);
   }
 
   m_Controls.m_teLog->append(QString("<b><font color='green'>") + info + QString("</font></b>"));
 };
 
 void QmitkMatchPointFrameCorrection::OnAlgorithmStatusChanged(QString info)
 {
   m_Controls.m_teLog->append(QString("<b><font color='blue'>") + info + QString(" </font></b>"));
 };
 
 void QmitkMatchPointFrameCorrection::OnAlgorithmInfo(QString info)
 {
   m_Controls.m_teLog->append(QString("<font color='gray'><i>") + info + QString("</i></font>"));
 };
 
 void QmitkMatchPointFrameCorrection::OnFrameProcessed(double progress)
 {
   m_Controls.m_teLog->append(QStringLiteral("<b><font color='blue'>Frame processed...</font></b>"));
   m_Controls.m_progBarFrame->setValue(100 * progress);
 };
 
 void QmitkMatchPointFrameCorrection::OnFrameRegistered(double progress)
 {
   m_Controls.m_teLog->append(QStringLiteral("<b><font color='blue'>Frame registered...</font></b>"));
   m_Controls.m_progBarFrame->setValue(100 * progress);
 };
 
 void QmitkMatchPointFrameCorrection::OnFrameMapped(double progress)
 {
   m_Controls.m_teLog->append(QStringLiteral("<b><font color='blue'>Frame mapped...</font></b>"));
   m_Controls.m_progBarFrame->setValue(100 * progress);
 };
 
 void QmitkMatchPointFrameCorrection::OnAlgorithmSelectionChanged(const
     berry::IWorkbenchPart::Pointer& sourcepart,
     const berry::ISelection::ConstPointer& selection)
 {
   // check for null selection
   if (selection.IsNull())
   {
     return;
   }
 
   if (sourcepart != this)
   {
     UpdateAlgorithmSelection(selection);
   }
 }
 
 void QmitkMatchPointFrameCorrection::UpdateAlgorithmSelection(berry::ISelection::ConstPointer
     selection)
 {
   mitk::MAPAlgorithmInfoSelection::ConstPointer currentSelection =
     selection.Cast<const mitk::MAPAlgorithmInfoSelection>();
 
   if (currentSelection)
   {
     mitk::MAPAlgorithmInfoSelection::AlgorithmInfoVectorType infoVector =
       currentSelection->GetSelectedAlgorithmInfo();
 
     if (!infoVector.empty())
     {
       // only the first selection is of interest, the rest will be skipped.
       this->m_SelectedAlgorithmInfo = infoVector[0];
     }
   }
 
   this->OnSelectedAlgorithmChanged();
 };
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.cpp b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.cpp
index 3026cd148c..fd78a425ed 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.cpp
+++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.cpp
@@ -1,559 +1,559 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "org_mitk_gui_qt_matchpoint_mapper_Activator.h"
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // Mitk
 #include <mitkImageAccessByItk.h>
 #include <mitkStatusBar.h>
 #include "mitkImageMappingHelper.h"
 #include "mitkMAPRegistrationWrapper.h"
 #include "mitkMatchPointPropertyTags.h"
 #include "mitkRegistrationHelper.h"
 #include <mitkResultNodeGenerationHelper.h>
 #include <mitkUIDHelper.h>
 #include <mitkMAPAlgorithmHelper.h>
 #include <mitkResultNodeGenerationHelper.h>
 #include <mitkNodePredicateFunction.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateDataProperty.h>
 
 // Qmitk
 #include "QmitkMatchPointMapper.h"
 
 // Qt
 #include <QMessageBox>
 #include <QFileDialog>
 #include <QErrorMessage>
 #include <QThreadPool>
 
 const std::string QmitkMatchPointMapper::VIEW_ID = "org.mitk.views.matchpoint.mapper";
 
 QmitkMatchPointMapper::QmitkMatchPointMapper()
     : m_Parent(nullptr), m_preparedForBinaryInput(false)
 {
 }
 
 void QmitkMatchPointMapper::SetFocus()
 {
     //m_Controls.buttonPerformImageProcessing->setFocus();
 }
 
 void QmitkMatchPointMapper::CreateConnections()
 {
     connect(m_Controls.registrationNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointMapper::OnRegNodeSelectionChanged);
     connect(m_Controls.inputNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointMapper::OnInputNodeSelectionChanged);
     connect(m_Controls.referenceNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointMapper::OnReferenceNodeSelectionChanged);
 
     connect(m_Controls.m_cbManualRef, SIGNAL(clicked()), this, SLOT(OnManualRefChecked()));
     connect(m_Controls.m_cbLinkFactors, SIGNAL(clicked()), this, SLOT(OnLinkSampleFactorChecked()));
 
     connect(m_Controls.m_sbXFactor, SIGNAL(valueChanged(double)), this, SLOT(OnXFactorChanged(double)));
 
     connect(m_Controls.m_pbMap, SIGNAL(clicked()), this, SLOT(OnMapBtnPushed()));
     connect(m_Controls.m_pbRefine, SIGNAL(clicked()), this, SLOT(OnRefineBtnPushed()));
 }
 
 void QmitkMatchPointMapper::Error(QString msg)
 {
     mitk::StatusBar::GetInstance()->DisplayErrorText(msg.toLatin1());
     MITK_ERROR << msg.toStdString().c_str();
 
     m_Controls.m_teLog->append(QStringLiteral("<font color='red'><b>") + msg + QStringLiteral("</b></font>"));
 }
 
 void QmitkMatchPointMapper::CreateQtPartControl(QWidget* parent)
 {
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls.setupUi(parent);
 
     m_Parent = parent;
 
     this->m_Controls.registrationNodeSelector->SetDataStorage(this->GetDataStorage());
     this->m_Controls.registrationNodeSelector->SetSelectionIsOptional(true);
     this->m_Controls.inputNodeSelector->SetDataStorage(this->GetDataStorage());
     this->m_Controls.inputNodeSelector->SetSelectionIsOptional(false);
     this->m_Controls.referenceNodeSelector->SetDataStorage(this->GetDataStorage());
     this->m_Controls.referenceNodeSelector->SetSelectionIsOptional(false);
 
     this->m_Controls.registrationNodeSelector->SetInvalidInfo("Select valid registration.");
     this->m_Controls.registrationNodeSelector->SetEmptyInfo("Assuming identity mapping. Select registration to change.");
     this->m_Controls.registrationNodeSelector->SetPopUpTitel("Select registration.");
     this->m_Controls.registrationNodeSelector->SetPopUpHint("Select a registration object that should be used for the mapping of the input data. If no registration is selected, identity will be assumed for the mapping.");
 
     this->m_Controls.inputNodeSelector->SetInvalidInfo("Select input data.");
     this->m_Controls.inputNodeSelector->SetPopUpTitel("Select input data.");
     this->m_Controls.inputNodeSelector->SetPopUpHint("Select the input data for the mapping. (Images or point sets are supported so far).");
     this->m_Controls.referenceNodeSelector->SetInvalidInfo("Select the reference image.");
     this->m_Controls.referenceNodeSelector->SetPopUpTitel("Select the reference image.");
-    this->m_Controls.referenceNodeSelector->SetPopUpHint("Select the reference image that specifies the target geometrie the input should be mapped into.");
+    this->m_Controls.referenceNodeSelector->SetPopUpHint("Select the reference image that specifies the target geometry the input should be mapped into.");
 
     this->ConfigureRegNodePredicate();
     this->ConfigureNodePredicates();
 
     // show first page
     m_Controls.m_tabs->setCurrentIndex(0);
 
     this->CreateConnections();
     this->CheckInputs();
     this->ConfigureProgressInfos();
     this->ConfigureMappingControls();
 }
 
 /** 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  QmitkMatchPointMapper::IsAbleToRefineGeometry() const
 {
     bool result = false;
 
     if (this->m_spSelectedRegNode.IsNotNull())
     {
         const mitk::MAPRegistrationWrapper* wrapper = dynamic_cast<const mitk::MAPRegistrationWrapper*>
             (this->m_spSelectedRegNode->GetData());
 
         //if the helper does not return null, we can refine the geometry.
         result = mitk::MITKRegistrationHelper::getAffineMatrix(wrapper, false).IsNotNull();
     }
 
     return result;
 }
 
 bool  QmitkMatchPointMapper::IsBinaryInput() const
 {
     auto maskPredicate = mitk::MITKRegistrationHelper::MaskNodePredicate();
 
     bool result = false;
 
     if(this->m_spSelectedInputNode.IsNotNull())
     {
       result = maskPredicate->CheckNode(this->m_spSelectedInputNode);
     }
 
     return result;
 }
 
 bool  QmitkMatchPointMapper::IsPointSetInput() const
 {
     bool result = false;
 
     if (this->m_spSelectedInputNode.IsNotNull())
     {
         result = dynamic_cast<const mitk::PointSet*>(this->m_spSelectedInputNode->GetData()) != nullptr;
     }
 
     return result;
 }
 
 mitk::DataNode::Pointer QmitkMatchPointMapper::GetAutoRefNodeByReg()
 {
     mitk::DataNode::Pointer spResult = nullptr;
 
     if (this->m_spSelectedRegNode.IsNotNull() && this->m_spSelectedRegNode->GetData())
     {
         std::string nodeName;
         mitk::BaseProperty* uidProp = m_spSelectedRegNode->GetData()->GetProperty(mitk::Prop_RegAlgTargetData);
 
         if (uidProp)
         {
             //search for the target node
             mitk::NodePredicateDataProperty::Pointer predicate = mitk::NodePredicateDataProperty::New(mitk::Prop_UID,
                 uidProp);
             spResult = this->GetDataStorage()->GetNode(predicate);
         }
     }
     if (spResult.IsNull() && this->m_spSelectedInputNode.IsNotNull())
     {
         //no really reference is available -> use the input as reference
         spResult = this->m_spSelectedInputNode;
         if (this->m_spSelectedRefNode != spResult)
         {
           m_Controls.m_teLog->append(
             QStringLiteral("<font color='gray'><i>Cannot determine reference automatically. Use input image as reference.</i></font>"));
         }
     }
 
     return spResult;
 }
 
 void QmitkMatchPointMapper::ConfigureRegNodePredicate(const mitk::DataNode* input)
 {
   mitk::NodePredicateBase::ConstPointer nodePredicate = mitk::MITKRegistrationHelper::RegNodePredicate();
 
   if (input != nullptr)
   {
     unsigned int dimension = 0;
 
     auto inputImage = dynamic_cast<mitk::Image*>(input->GetData());
     auto pointset = dynamic_cast<const mitk::PointSet*>(input->GetData());
     if (inputImage)
     {
       dimension = inputImage->GetDimension();
 
       if (inputImage->GetTimeSteps() > 1)
       {
         //images has multiple time steps -> remove one dimension.
         dimension -= 1;
       }
     }
     else if (pointset)
     {
       dimension = 3;
     }
 
     auto dimCheck = [dimension](const mitk::DataNode * node)
     {
       const mitk::MAPRegistrationWrapper* wrapper = dynamic_cast < const mitk::MAPRegistrationWrapper* >(node->GetData());
 
       return wrapper != nullptr && wrapper->GetMovingDimensions() == dimension;
     };
     mitk::NodePredicateFunction::Pointer hasCorrectDim = mitk::NodePredicateFunction::New(dimCheck);
 
     nodePredicate = mitk::NodePredicateAnd::New(nodePredicate, hasCorrectDim).GetPointer();
   }
 
   this->m_Controls.registrationNodeSelector->SetNodePredicate(nodePredicate);
 }
 
 std::function<bool(const mitk::DataNode *)> GenerateDimCheckLambda(unsigned int dim)
 {
   auto dimCheck = [dim](const mitk::DataNode * node)
   {
     auto inputImage = dynamic_cast<mitk::Image*>(node->GetData());
 
     return inputImage != nullptr &&
       (inputImage->GetDimension() == dim ||
       (inputImage->GetDimension() == dim + 1 && inputImage->GetTimeSteps()>1));
   };
 
   return dimCheck;
 }
 
 void QmitkMatchPointMapper::ConfigureNodePredicates(const mitk::DataNode* reg)
 {
   auto isImage = mitk::MITKRegistrationHelper::ImageNodePredicate();
   auto isPointSet = mitk::MITKRegistrationHelper::PointSetNodePredicate();
 
   auto isData = mitk::NodePredicateOr::New(isImage, isPointSet);
 
   mitk::NodePredicateBase::ConstPointer inputPredicate = isData.GetPointer();
   mitk::NodePredicateBase::ConstPointer refPredicate = isImage.GetPointer();
 
   if (reg != nullptr)
   {
     const mitk::MAPRegistrationWrapper* wrapper = dynamic_cast <const mitk::MAPRegistrationWrapper*>(reg->GetData());
 
     if (wrapper != nullptr)
     {
       auto movingDim = wrapper->GetMovingDimensions();
 
       auto dimCheck = GenerateDimCheckLambda(movingDim);
       auto hasCorrectDim = mitk::NodePredicateFunction::New(dimCheck);
 
       if (movingDim == 3)
       {
         //Remark: Point sets are always 3D
         auto is3DInput = mitk::NodePredicateOr::New(isPointSet, mitk::NodePredicateAnd::New(isImage, hasCorrectDim));
         inputPredicate = is3DInput.GetPointer();
       }
       else
       {
         auto is2DInput = mitk::NodePredicateAnd::New(isImage, hasCorrectDim);
         inputPredicate = is2DInput.GetPointer();
       }
 
       auto targetDim = wrapper->GetTargetDimensions();
 
       auto targetDimCheck = GenerateDimCheckLambda(targetDim);
       auto hasCorrectTargetDim = mitk::NodePredicateFunction::New(targetDimCheck);
 
       auto isRef = mitk::NodePredicateAnd::New(isImage, hasCorrectTargetDim);
       refPredicate = isRef;
 
     }
   }
   this->m_Controls.inputNodeSelector->SetNodePredicate(inputPredicate);
   this->m_Controls.referenceNodeSelector->SetNodePredicate(refPredicate);
 }
 
 void QmitkMatchPointMapper::CheckInputs()
 {
     this->m_spSelectedRegNode = this->m_Controls.registrationNodeSelector->GetSelectedNode();
     this->m_spSelectedInputNode = this->m_Controls.inputNodeSelector->GetSelectedNode();
     this->m_spSelectedRefNode = this->m_Controls.referenceNodeSelector->GetSelectedNode();
 
     if (!(m_Controls.m_cbManualRef->isChecked()))
     {
         auto autoRefNode = this->GetAutoRefNodeByReg();
         if (this->m_spSelectedRefNode != autoRefNode)
         {
           this->m_spSelectedRefNode = autoRefNode;
           QmitkSingleNodeSelectionWidget::NodeList selection;
 
           if (this->m_spSelectedRefNode.IsNotNull())
           {
             selection.append(this->m_spSelectedRefNode);
           }
           this->m_Controls.referenceNodeSelector->SetCurrentSelection(selection);
         }
     }
 
     if (this->m_spSelectedRefNode.IsNotNull() && this->m_spSelectedRefNode->GetData()
         && this->m_spSelectedRefNode->GetData()->GetTimeSteps() > 1)
     {
         m_Controls.m_teLog->append(
           QStringLiteral("<font color='gray'><i>Selected reference image has multiple time steps. Only geometry of time step 1 is used as reference.</i></font>"));
     }
 }
 
 void QmitkMatchPointMapper::ConfigureMappingControls()
 {
     bool validInput = m_spSelectedInputNode.IsNotNull();
     bool validRef = m_spSelectedRefNode.IsNotNull();
 
     this->m_Controls.referenceNodeSelector->setEnabled(this->m_Controls.m_cbManualRef->isChecked());
     this->m_Controls.m_pbMap->setEnabled(validInput  && validRef);
     this->m_Controls.m_pbRefine->setEnabled(validInput && this->IsAbleToRefineGeometry() && !this->IsPointSetInput());
 
     if (validInput)
     {
       if (m_spSelectedRegNode.IsNotNull())
       {
         this->m_Controls.m_leMappedName->setText(tr("mapped_") + QString::fromStdString(m_spSelectedInputNode->GetName())
           + tr("_by_") + QString::fromStdString(m_spSelectedRegNode->GetName()));
       }
       else
       {
         this->m_Controls.m_leMappedName->setText(tr("resampled_") + QString::fromStdString(m_spSelectedInputNode->GetName()));
       }
     }
     else
     {
         this->m_Controls.m_leMappedName->setText(tr("mappedData"));
     }
 
     if (this->IsBinaryInput() != this->m_preparedForBinaryInput)
     {
         if (this->IsBinaryInput())
         {
             m_Controls.m_teLog->append(
-              QStringLiteral("<font color='gray'><i>Binary input (mask) detected. Preparing for mask mapping (default interpolation: nearest neigbour; padding value: 0)</i></font>"));
+              QStringLiteral("<font color='gray'><i>Binary input (mask) detected. Preparing for mask mapping (default interpolation: nearest neighbour; padding value: 0)</i></font>"));
 
             this->m_Controls.m_comboInterpolator->setCurrentIndex(0);
             this->m_Controls.m_sbErrorValue->setValue(0);
             this->m_Controls.m_sbPaddingValue->setValue(0);
         }
         else
         {
             this->m_Controls.m_comboInterpolator->setCurrentIndex(1);
         }
 
         this->m_preparedForBinaryInput = this->IsBinaryInput();
     }
 
     OnLinkSampleFactorChecked();
 }
 
 void QmitkMatchPointMapper::ConfigureProgressInfos()
 {
 
 }
 
 void QmitkMatchPointMapper::OnRegNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes)
 {
   mitk::DataNode::Pointer regNode;
   if (!nodes.isEmpty())
   {
     regNode = nodes.front();
   }
 
   this->ConfigureNodePredicates(regNode);
   this->CheckInputs();
   this->ConfigureMappingControls();
 }
 
 void QmitkMatchPointMapper::OnInputNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes)
 {
   mitk::DataNode::Pointer inputNode;
   if (!nodes.isEmpty())
   {
     inputNode = nodes.front();
   }
 
   this->ConfigureRegNodePredicate(inputNode);
   this->CheckInputs();
   this->ConfigureMappingControls();
 }
 
 void QmitkMatchPointMapper::OnReferenceNodeSelectionChanged(QList<mitk::DataNode::Pointer> /*nodes*/)
 {
   this->CheckInputs();
   this->ConfigureMappingControls();
 }
 
 void QmitkMatchPointMapper::OnManualRefChecked()
 {
     this->CheckInputs();
     this->ConfigureMappingControls();
 }
 
 void QmitkMatchPointMapper::OnLinkSampleFactorChecked()
 {
     this->m_Controls.m_sbYFactor->setEnabled(!(this->m_Controls.m_cbLinkFactors->isChecked()));
     this->m_Controls.m_sbZFactor->setEnabled(!(this->m_Controls.m_cbLinkFactors->isChecked()));
 
     if (m_Controls.m_cbLinkFactors->isChecked())
     {
         this->m_Controls.m_sbYFactor->setValue(this->m_Controls.m_sbXFactor->value());
         this->m_Controls.m_sbZFactor->setValue(this->m_Controls.m_sbXFactor->value());
     }
 }
 
 
 void QmitkMatchPointMapper::OnMapBtnPushed()
 {
     SpawnMappingJob();
 }
 
 void QmitkMatchPointMapper::OnRefineBtnPushed()
 {
     SpawnMappingJob(true);
 }
 
 void QmitkMatchPointMapper::SpawnMappingJob(bool doGeometryRefinement)
 {
     if (m_Controls.m_checkClearLog->checkState() == Qt::Checked)
     {
         this->m_Controls.m_teLog->clear();
     }
 
     /////////////////////////
     //create job and put it into the thread pool
     QmitkMappingJob* pJob = new QmitkMappingJob();
     pJob->setAutoDelete(true);
 
     pJob->m_spInputData = this->m_spSelectedInputNode->GetData();
     pJob->m_InputDataUID = mitk::EnsureUID(this->m_spSelectedInputNode->GetData());
     pJob->m_doGeometryRefinement = doGeometryRefinement;
 
     pJob->m_spRegNode = m_spSelectedRegNode;
     if (m_spSelectedRegNode.IsNull())
     {
         pJob->m_spRegNode = mitk::DataNode::New();
         pJob->m_spRegNode->SetData(mitk::GenerateIdentityRegistration3D().GetPointer());
         pJob->m_spRegNode->SetName("Auto_Generated_Identity_Transform");
         m_Controls.m_teLog->append(
           QStringLiteral("<font color='gray'><i>No registration selected. Preforming mapping with identity transform</i></font>"));
     }
 
     if (!doGeometryRefinement)
     {
         pJob->m_spRefGeometry = m_spSelectedRefNode->GetData()->GetGeometry()->Clone().GetPointer();
 
         //check for super/sub sampling
         if (m_Controls.m_groupActivateSampling->isChecked())
         {
           pJob->m_spRefGeometry = mitk::ImageMappingHelper::GenerateSuperSampledGeometry(pJob->m_spRefGeometry,
             m_Controls.m_sbXFactor->value(),
             m_Controls.m_sbYFactor->value(),
             m_Controls.m_sbZFactor->value());
         }
     }
 
     pJob->m_MappedName = m_Controls.m_leMappedName->text().toStdString();
     pJob->m_allowUndefPixels = m_Controls.m_groupAllowUndefPixels->isChecked();
     pJob->m_paddingValue = m_Controls.m_sbPaddingValue->value();
     pJob->m_allowUnregPixels = m_Controls.m_groupAllowUnregPixels->isChecked();
     pJob->m_errorValue = m_Controls.m_sbErrorValue->value();
     pJob->m_InterpolatorLabel = m_Controls.m_comboInterpolator->currentText().toStdString();
 
     switch (m_Controls.m_comboInterpolator->currentIndex())
     {
     case 0:
         pJob->m_InterpolatorType = mitk::ImageMappingInterpolator::NearestNeighbor;
         break;
 
     case 1:
         pJob->m_InterpolatorType = mitk::ImageMappingInterpolator::Linear;
         break;
 
     case 2:
         pJob->m_InterpolatorType = mitk::ImageMappingInterpolator::BSpline_3;
         break;
 
     case 3:
         pJob->m_InterpolatorType = mitk::ImageMappingInterpolator::WSinc_Hamming;
         break;
 
     case 4:
         pJob->m_InterpolatorType = mitk::ImageMappingInterpolator::WSinc_Welch;
         break;
     }
 
     connect(pJob, SIGNAL(Error(QString)), this, SLOT(OnMapJobError(QString)));
     connect(pJob, SIGNAL(MapResultIsAvailable(mitk::BaseData::Pointer, const QmitkMappingJob*)), this,
         SLOT(OnMapResultIsAvailable(mitk::BaseData::Pointer, const QmitkMappingJob*)),
         Qt::BlockingQueuedConnection);
     connect(pJob, SIGNAL(AlgorithmInfo(QString)), this, SLOT(OnMappingInfo(QString)));
 
     m_Controls.m_teLog->append(QStringLiteral("<b><font color='blue'>Started mapping job. Name: ") +
         m_Controls.m_leMappedName->text() + QStringLiteral("</font></b>"));
 
     QThreadPool* threadPool = QThreadPool::globalInstance();
     threadPool->start(pJob);
 }
 
 
 
 void QmitkMatchPointMapper::OnMapJobError(QString err)
 {
     Error(err);
 }
 
 void QmitkMatchPointMapper::OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData,
     const QmitkMappingJob* job)
 {
     m_Controls.m_teLog->append(QStringLiteral("<b><font color='blue'>Mapped entity stored. Name: ") +
         QString::fromStdString(job->m_MappedName) + QStringLiteral("</font></b>"));
 
     mitk::DataNode::Pointer spMappedNode = mitk::generateMappedResultNode(job->m_MappedName,
         spMappedData, job->GetRegistration()->getRegistrationUID(), job->m_InputDataUID,
         job->m_doGeometryRefinement, job->m_InterpolatorLabel);
     this->GetDataStorage()->Add(spMappedNode);
 
     auto* renderWindowPart = this->GetRenderWindowPart();
 
     if (nullptr != renderWindowPart)
       renderWindowPart->RequestUpdate();
 
     this->CheckInputs();
     this->ConfigureMappingControls();
 }
 
 void QmitkMatchPointMapper::OnMappingInfo(QString info)
 {
     m_Controls.m_teLog->append(QStringLiteral("<font color='gray'><i>") + info + QStringLiteral("</i></font>"));
 }
 
 void QmitkMatchPointMapper::OnXFactorChanged(double d)
 {
     if (m_Controls.m_cbLinkFactors->isChecked())
     {
         this->m_Controls.m_sbYFactor->setValue(d);
         this->m_Controls.m_sbZFactor->setValue(d);
     }
 }
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 2b39adbb9f..5e2e880d13 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,157 +1,157 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef QmitkMatchPointMapper_h
 #define QmitkMatchPointMapper_h
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include <QSortFilterProxyModel>
 
 #include "ui_QmitkMatchPointMapper.h"
 
 #include "QmitkMappingJob.h"
 
 /*!
   \brief QmitkMatchPointMapper
 
   View class that implements the logic/functionality to map point sets or images based on MatchPoint registration objects.
 
   \ingroup ${plugin_target}_internal
   */
 class QmitkMatchPointMapper : public QmitkAbstractView
 {
     Q_OBJECT
 
 public:
 
     static const std::string VIEW_ID;
 
     /**
      * Creates smartpointer typedefs
      */
     berryObjectMacro(QmitkMatchPointMapper);
 
     QmitkMatchPointMapper();
 
     void CreateQtPartControl(QWidget *parent) override;
 
 protected slots:
 
     /**
      * @brief Connect all GUI elements to its corresponding slots
      */
     virtual void CreateConnections();
 
     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);
 
     void OnRegNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
     void OnInputNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
     void OnReferenceNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
 
 protected:
     void SetFocus() override;
 
     Ui::MatchPointMapperControls m_Controls;
 
 private:
     QWidget *m_Parent;
 
     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;
 
     /** 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.*/
+     * It also sets the info labels 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.
+     * Configures the progress bars accoarding to the chosen algorithm.
      */
     void ConfigureProgressInfos();
 
     /**
     Configure the reg node selector predicates. If a input pointer is passed,
     the predicate will be configured according to the input.
     */
     void ConfigureRegNodePredicate(const mitk::DataNode* input = nullptr);
     /**
     Configure the input and ref node selector predicates. If a reg pointer is passed,
     the predicate will be configured according to the input.
     */
     void ConfigureNodePredicates(const mitk::DataNode* reg = nullptr);
 
 
     /**
      * 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;
 
     /** used for the internal logic to indicate of the current settings
      are set for mapping binary images (used by ConfigureMappingControls()).*/
     bool m_preparedForBinaryInput;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.ui b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.ui
index a1da741298..380289d0e9 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.ui
+++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.ui
@@ -1,565 +1,565 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>MatchPointMapperControls</class>
  <widget class="QWidget" name="MatchPointMapperControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>392</width>
     <height>816</height>
    </rect>
   </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>
     <widget class="QLabel" name="label_4">
      <property name="text">
       <string>Selected registration:</string>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <property name="spacing">
       <number>3</number>
      </property>
      <item>
       <widget class="QmitkSingleNodeSelectionWidget" name="registrationNodeSelector" native="true">
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QLabel" name="label_5">
      <property name="text">
       <string>Input data (images or point sets):</string>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <property name="spacing">
       <number>3</number>
      </property>
      <item>
       <widget class="QmitkSingleNodeSelectionWidget" name="inputNodeSelector" native="true">
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QCheckBox" name="m_cbManualRef">
      <property name="toolTip">
       <string>Select reference manually instat of determined by registration...</string>
      </property>
      <property name="text">
       <string>Select reference image manually:</string>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_4">
      <property name="spacing">
       <number>3</number>
      </property>
      <item>
       <widget class="QmitkSingleNodeSelectionWidget" name="referenceNodeSelector" native="true">
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QTabWidget" name="m_tabs">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <property name="documentMode">
       <bool>false</bool>
      </property>
      <property name="tabsClosable">
       <bool>false</bool>
      </property>
      <property name="movable">
       <bool>false</bool>
      </property>
      <widget class="QWidget" name="m_tabExecution">
       <attribute name="title">
        <string>Execution</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <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>
         <widget class="QLabel" name="label_9">
          <property name="text">
           <string>Mapped data name:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLineEdit" name="m_leMappedName">
          <property name="toolTip">
           <string>Name of the resulting mapped image</string>
          </property>
          <property name="text">
           <string>mappedImage</string>
          </property>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_5">
          <item>
           <widget class="QPushButton" name="m_pbMap">
            <property name="toolTip">
             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Starts the mapping of the input image with the current settings.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
            </property>
            <property name="text">
             <string>Map</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="m_pbRefine">
            <property name="enabled">
             <bool>false</bool>
            </property>
            <property name="toolTip">
-            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Applys the registration by refining the geometry of the data and not by resampling it. This option can only be selected if the chosen registration is 3D and can be decomposed in a rotation matrix and offset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Applies the registration by refining the geometry of the data and not by resampling it. This option can only be selected if the chosen registration is 3D and can be decomposed in a rotation matrix and offset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
            </property>
            <property name="text">
             <string>Refine geometry</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
        <item>
         <widget class="QLabel" name="label_log">
          <property name="text">
           <string>Log:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QTextEdit" name="m_teLog">
          <property name="font">
           <font>
            <pointsize>9</pointsize>
           </font>
          </property>
          <property name="tabChangesFocus">
           <bool>true</bool>
          </property>
          <property name="lineWrapMode">
           <enum>QTextEdit::NoWrap</enum>
          </property>
          <property name="readOnly">
           <bool>true</bool>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QCheckBox" name="m_checkClearLog">
          <property name="text">
           <string>Clear log on mapping start</string>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="m_tabSettings">
       <attribute name="title">
        <string>Settings</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_3">
        <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>
         <widget class="QGroupBox" name="m_groupAllowUndefPixels">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="font">
           <font>
            <weight>50</weight>
            <bold>false</bold>
           </font>
          </property>
          <property name="toolTip">
           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows that pixels may not be defined in the mapped image because they are outside of the field of view of the used input image.&lt;/p&gt;&lt;p&gt;The pixels will be marked with the given padding value.&lt;/p&gt;&lt;p&gt;If unchecked the mapping will be aborted in a case of undefined pixels.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
          <property name="title">
           <string>Allow undefined pixels</string>
          </property>
          <property name="flat">
           <bool>false</bool>
          </property>
          <property name="checkable">
           <bool>true</bool>
          </property>
          <layout class="QHBoxLayout" name="horizontalLayout_6">
           <property name="spacing">
            <number>5</number>
           </property>
           <property name="leftMargin">
            <number>9</number>
           </property>
           <property name="topMargin">
            <number>5</number>
           </property>
           <property name="rightMargin">
            <number>9</number>
           </property>
           <property name="bottomMargin">
            <number>5</number>
           </property>
           <item>
            <widget class="QLabel" name="label_7">
             <property name="text">
              <string>Padding value:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QSpinBox" name="m_sbPaddingValue">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="toolTip">
              <string>Pixel value that indicates pixels that are outside of the input image</string>
             </property>
             <property name="minimum">
              <number>-5000</number>
             </property>
             <property name="maximum">
              <number>5000</number>
             </property>
            </widget>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="m_groupAllowUnregPixels">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="font">
           <font>
            <weight>50</weight>
            <bold>false</bold>
           </font>
          </property>
          <property name="toolTip">
-          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows that pixels may not be registred because they are outside of the field of view of the used registration. The location in the correlated input image pixel(s) are therefore unkown. The pixels will be marked witrh the given error value.&lt;/p&gt;&lt;p&gt;If unchecked the mapping will be aborted in a case of unregistered pixels.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows that pixels may not be registered because they are outside of the field of view of the used registration. The location in the correlated input image pixel(s) are therefore unknown. The pixels will be marked with the given error value.&lt;/p&gt;&lt;p&gt;If unchecked the mapping will be aborted in a case of unregistered pixels.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
          <property name="title">
           <string>Allow unregistered pixels</string>
          </property>
          <property name="flat">
           <bool>false</bool>
          </property>
          <property name="checkable">
           <bool>true</bool>
          </property>
          <layout class="QHBoxLayout" name="horizontalLayout_7">
           <property name="spacing">
            <number>5</number>
           </property>
           <property name="topMargin">
            <number>5</number>
           </property>
           <property name="bottomMargin">
            <number>5</number>
           </property>
           <item>
            <widget class="QLabel" name="label_6">
             <property name="text">
              <string>Error value:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QSpinBox" name="m_sbErrorValue">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="toolTip">
-             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Value of pixels that cannot be registered because of an unsufficient field of view of the selected registration instance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Value of pixels that cannot be registered because of an insufficient field of view of the selected registration instance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
             <property name="minimum">
              <number>-5000</number>
             </property>
             <property name="maximum">
              <number>5000</number>
             </property>
            </widget>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_8">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string>Interpolator:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QComboBox" name="m_comboInterpolator">
          <property name="enabled">
           <bool>true</bool>
          </property>
          <property name="toolTip">
           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Interpolation function that should be used to map the pixel values from the input image into the result image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
          <property name="currentIndex">
           <number>1</number>
          </property>
          <item>
           <property name="text">
            <string>Nearest Neighbor</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Linear</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>BSpline (3rd order)</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Windowed Sinc (Hamming)</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Windowed Sinc (Welch)</string>
           </property>
          </item>
         </widget>
        </item>
        <item>
         <widget class="QGroupBox" name="m_groupActivateSampling">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="title">
           <string>Activate super/sub sampling</string>
          </property>
          <property name="checkable">
           <bool>true</bool>
          </property>
          <property name="checked">
           <bool>false</bool>
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_4">
           <property name="spacing">
            <number>5</number>
           </property>
           <item>
            <widget class="QCheckBox" name="m_cbLinkFactors">
             <property name="toolTip">
              <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check to ensure that x, y and z dimension use the same sampling factor.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
             <property name="text">
              <string>linked factors</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_8">
             <item>
              <widget class="QLabel" name="label_10">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="text">
                <string>x:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbXFactor">
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the sampling factor to change the resolution.&lt;/p&gt;&lt;p&gt;2.0: doubled resolution; e.g. 100 pixels -&amp;gt; 200 pixels and spacing 1 -&amp;gt; spacing 0.5&lt;/p&gt;&lt;p&gt;0.5: half resolution; e.g. 100 pixels -&amp;gt; 50 pixels and spacing 1 -&amp;gt; spacing 2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_12">
               <property name="text">
                <string>y:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbYFactor"/>
             </item>
             <item>
              <widget class="QLabel" name="label_11">
               <property name="text">
                <string>z:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbZFactor"/>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeType">
           <enum>QSizePolicy::Preferred</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>700</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkSingleNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
  <designerdata>
   <property name="gridDeltaX">
    <number>5</number>
   </property>
   <property name="gridDeltaY">
    <number>5</number>
   </property>
   <property name="gridSnapX">
    <bool>true</bool>
   </property>
   <property name="gridSnapY">
    <bool>true</bool>
   </property>
   <property name="gridVisible">
    <bool>true</bool>
   </property>
  </designerdata>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/documentation/UserManual/map_view_visualizer_grid_settings.svg b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/documentation/UserManual/map_view_visualizer_grid_settings.svg
index 22ad383050..9711f6cfdf 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/documentation/UserManual/map_view_visualizer_grid_settings.svg
+++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/documentation/UserManual/map_view_visualizer_grid_settings.svg
@@ -1,379 +1,379 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Created with Inkscape (http://www.inkscape.org/) -->
 
 <svg
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:cc="http://creativecommons.org/ns#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    version="1.1"
    id="svg4485"
    width="804.48956"
    height="124"
    viewBox="0 0 804.48956 124"
    sodipodi:docname="map_view_visualizer_grid_settings.svg"
    inkscape:version="0.92.3 (2405546, 2018-03-11)"
    inkscape:export-filename="D:\Dev\MITK\sMaster\Plugins\org.mitk.gui.qt.matchpoint.visualizer\documentation\UserManual\map_view_visualizer_vis_settings.png"
    inkscape:export-xdpi="96"
    inkscape:export-ydpi="96">
   <metadata
      id="metadata4491">
     <rdf:RDF>
       <cc:Work
          rdf:about="">
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
         <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
   <defs
      id="defs4489">
     <marker
        inkscape:isstock="true"
        style="overflow:visible"
        id="marker5562"
        refX="0"
        refY="0"
        orient="auto"
        inkscape:stockid="DotS">
       <path
          transform="matrix(0.2,0,0,0.2,1.48,0.2)"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          id="path5560"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:isstock="true"
        style="overflow:visible"
        id="marker5474"
        refX="0"
        refY="0"
        orient="auto"
        inkscape:stockid="DotS">
       <path
          transform="matrix(0.2,0,0,0.2,1.48,0.2)"
          style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          id="path5472"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:stockid="DotM"
        orient="auto"
        refY="0"
        refX="0"
        id="marker4945"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          id="path4943"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.4,0,0,0.4,2.96,0.4)"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="DotS"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          id="path4564"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:stockid="DotM"
        orient="auto"
        refY="0"
        refX="0"
        id="DotM"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          id="path4561"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.4,0,0,0.4,2.96,0.4)"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-6"
        style="overflow:visible"
        inkscape:isstock="true"
        inkscape:collect="always">
       <path
          inkscape:connector-curvature="0"
          id="path5279-4"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-5"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-0"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-0"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-3"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-01"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-7"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-9"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-1"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:isstock="true"
        style="overflow:visible"
        id="marker5562-8"
        refX="0"
        refY="0"
        orient="auto"
        inkscape:stockid="DotS">
       <path
          transform="matrix(0.2,0,0,0.2,1.48,0.2)"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          id="path5560-3"
          inkscape:connector-curvature="0" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-9-8"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-1-6"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-3"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-31"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
     <marker
        inkscape:stockid="DotS"
        orient="auto"
        refY="0"
        refX="0"
        id="marker5281-0-4"
        style="overflow:visible"
        inkscape:isstock="true">
       <path
          inkscape:connector-curvature="0"
          id="path5279-5-16"
          d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
          style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
          transform="matrix(0.2,0,0,0.2,1.48,0.2)" />
     </marker>
   </defs>
   <sodipodi:namedview
      pagecolor="#ffffff"
      bordercolor="#666666"
      borderopacity="1"
      objecttolerance="10"
      gridtolerance="10"
      guidetolerance="10"
      inkscape:pageopacity="0"
      inkscape:pageshadow="2"
      inkscape:window-width="1680"
      inkscape:window-height="987"
      id="namedview4487"
      showgrid="false"
      inkscape:zoom="1"
      inkscape:cx="226.92706"
      inkscape:cy="7.1012534"
      inkscape:window-x="-8"
      inkscape:window-y="-8"
      inkscape:window-maximized="1"
      inkscape:current-layer="svg4485" />
   <image
      sodipodi:absref="D:\Dev\MITK\sMaster\Plugins\org.mitk.gui.qt.matchpoint.visualizer\documentation\UserManual\map_view_visualizer_grid_settings_raw.png"
      xlink:href="map_view_visualizer_grid_settings_raw.png"
      y="0"
      x="0"
      id="image4493"
      preserveAspectRatio="none"
      height="124"
      width="329"
      mask="none" />
   <path
      style="fill:#ff0000;stroke:#ff0000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker5281-6)"
      d="M 224.61004,71.1402 H 335.6722 331.70571"
      id="path4495-3"
      inkscape:connector-curvature="0" />
   <path
      style="fill:#ff0000;stroke:#ff0000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker5281-0-9)"
      d="M 147.02514,44.4793 H 335.6722 328.93484"
      id="path4495-7-6"
      inkscape:connector-curvature="0" />
   <text
      xml:space="preserve"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff0000;fill-opacity:1;stroke:none"
      x="338.88538"
      y="50.520752"
      id="text9677-5"><tspan
        sodipodi:role="line"
        id="tspan9675-8"
        x="338.88538"
        y="50.520752"
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ff0000">(9) Set freqency of visible gride frames</tspan></text>
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ff0000">(9) Set frequency of visible grid frames</tspan></text>
   <text
      xml:space="preserve"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff0000;fill-opacity:1;stroke:none"
      x="338.88538"
      y="77.520752"
      id="text9677-1"><tspan
        sodipodi:role="line"
        id="tspan9675-1"
        x="338.88538"
        y="77.520752"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ff0000">(10) Visibility of start grid of the mapping direction</tspan></text>
   <flowRoot
      xml:space="preserve"
      id="flowRoot4717"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
      transform="translate(0,-393)"><flowRegion
        id="flowRegion4719"><rect
          id="rect4721"
          width="337"
          height="48"
          x="353"
          y="188" /></flowRegion><flowPara
        id="flowPara4723" /></flowRoot>  <path
      style="fill:#ff0000;stroke:#ff0000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker5281-0-4)"
      d="M 105.40533,98.0047 H 335.6722 327.44843"
      id="path4495-7-5"
      inkscape:connector-curvature="0" />
   <text
      xml:space="preserve"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff0000;fill-opacity:1;stroke:none"
      x="338.88538"
      y="103.521"
      id="text9677-09-9"><tspan
        sodipodi:role="line"
        id="tspan9675-0-2"
        x="338.88538"
        y="103.521"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ff0000">(11) Color of the start grid</tspan><tspan
        sodipodi:role="line"
        x="338.88538"
        y="153.521"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.33333397px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ff0000"
        id="tspan4725-7" /></text>
   <flowRoot
      xml:space="preserve"
      id="flowRoot6290"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
      transform="translate(0,-392)"><flowRegion
        id="flowRegion6292"><rect
          id="rect6294"
          width="839"
          height="562"
          x="-158"
          y="273" /></flowRegion><flowPara
        id="flowPara6296" /></flowRoot>  <flowRoot
      xml:space="preserve"
      id="flowRoot6719"
      style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion
        id="flowRegion6721"><rect
          id="rect6723"
          width="620"
          height="252"
          x="-129"
          y="-103" /></flowRegion><flowPara
        id="flowPara6725" /></flowRoot></svg>
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.cpp b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.cpp
index 9f9ea6f8ac..3ef952d07d 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.cpp
+++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.cpp
@@ -1,798 +1,798 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "org_mitk_gui_qt_matchpoint_visualizer_Activator.h"
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // Mitk
 #include <mitkStatusBar.h>
 #include <mitkProperties.h>
 #include <mitkColorProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateDataProperty.h>
 #include <mitkNodePredicateFunction.h>
 #include "mitkRegVisDirectionProperty.h"
 #include "mitkRegVisStyleProperty.h"
 #include "mitkRegVisColorStyleProperty.h"
 #include "mitkRegVisPropertyTags.h"
 #include "mitkRegVisHelper.h"
 #include "mitkMatchPointPropertyTags.h"
 #include "mitkRegistrationHelper.h"
 
 // Qmitk
 #include "QmitkMatchPointRegistrationVisualizer.h"
 
 // Qt
 #include <QMessageBox>
 #include <QErrorMessage>
 
 const std::string QmitkMatchPointRegistrationVisualizer::VIEW_ID =
 "org.mitk.views.matchpoint.visualizer";
 
 QmitkMatchPointRegistrationVisualizer::QmitkMatchPointRegistrationVisualizer()
     : m_Parent(nullptr), m_internalUpdateGuard(false), m_spSelectedFOVRefNode(nullptr),
     m_spSelectedRegNode(nullptr)
 {
 }
 
 void QmitkMatchPointRegistrationVisualizer::SetFocus()
 {
 }
 
 void QmitkMatchPointRegistrationVisualizer::CreateConnections()
 {
     connect(m_Controls->registrationNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointRegistrationVisualizer::OnNodeSelectionChanged);
     connect(m_Controls->fovReferenceNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, this, &QmitkMatchPointRegistrationVisualizer::OnNodeSelectionChanged);
 
     connect(m_Controls->m_pbStyleGrid, SIGNAL(clicked()), this, SLOT(OnStyleButtonPushed()));
     connect(m_Controls->m_pbStyleGlyph, SIGNAL(clicked()), this, SLOT(OnStyleButtonPushed()));
     connect(m_Controls->m_pbStylePoints, SIGNAL(clicked()), this, SLOT(OnStyleButtonPushed()));
 
     connect(m_Controls->m_comboDirection, SIGNAL(currentIndexChanged(int)), this,
         SLOT(OnDirectionChanged(int)));
     connect(m_Controls->m_pbUpdateViz, SIGNAL(clicked()), this, SLOT(OnUpdateBtnPushed()));
 
     connect(m_Controls->radioColorUni, SIGNAL(toggled(bool)), m_Controls->btnUniColor,
         SLOT(setEnabled(bool)));
     connect(m_Controls->radioColorVecMag, SIGNAL(toggled(bool)), m_Controls->groupColorCoding,
         SLOT(setEnabled(bool)));
 
     connect(m_Controls->m_pbStyleGrid, SIGNAL(toggled(bool)), m_Controls->tabGrid,
         SLOT(setEnabled(bool)));
 
     connect(m_Controls->cbVevMagInterlolate, SIGNAL(toggled(bool)), this,
         SLOT(OnColorInterpolationChecked(bool)));
 
     connect(m_Controls->m_checkUseRefSize, SIGNAL(clicked()), this, SLOT(TransferFOVRefGeometry()));
     connect(m_Controls->m_checkUseRefSpacing, SIGNAL(clicked()), this, SLOT(TransferFOVRefGeometry()));
     connect(m_Controls->m_checkUseRefOrigin, SIGNAL(clicked()), this, SLOT(TransferFOVRefGeometry()));
     connect(m_Controls->m_checkUseRefOrientation, SIGNAL(clicked()), this, SLOT(TransferFOVRefGeometry()));
 }
 
 void QmitkMatchPointRegistrationVisualizer::Error(QString msg)
 {
     mitk::StatusBar::GetInstance()->DisplayErrorText(msg.toLatin1());
     MITK_ERROR << msg.toStdString().c_str();
 }
 
 void QmitkMatchPointRegistrationVisualizer::CreateQtPartControl(QWidget* parent)
 {
     m_Controls = new Ui::MatchPointRegVisControls;
 
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls->setupUi(parent);
 
     m_Parent = parent;
 
     this->m_Controls->registrationNodeSelector->SetDataStorage(this->GetDataStorage());
     this->m_Controls->registrationNodeSelector->SetSelectionIsOptional(false);
     this->m_Controls->fovReferenceNodeSelector->SetDataStorage(this->GetDataStorage());
     this->m_Controls->fovReferenceNodeSelector->SetSelectionIsOptional(false);
     m_Controls->registrationNodeSelector->SetInvalidInfo("Select registration.");
     m_Controls->registrationNodeSelector->SetPopUpTitel("Select registration.");
     m_Controls->registrationNodeSelector->SetPopUpHint("Select the registration object whose registration visualization should be edited.");
     m_Controls->fovReferenceNodeSelector->SetInvalidInfo("Select a FOV reference image.");
     m_Controls->fovReferenceNodeSelector->SetPopUpTitel("Select a FOV reference image.");
     m_Controls->fovReferenceNodeSelector->SetPopUpHint("Select the the image that should be used to define the field of view (FOV) for the registration visualization. The visualization will use the image geometry (size, orientation, spacing...).");
 
     this->ConfigureNodePredicates();
 
     this->m_Controls->btnVecMagColorSmall->setDisplayColorName(false);
     this->m_Controls->btnVecMagColorMedium->setDisplayColorName(false);
     this->m_Controls->btnVecMagColorLarge->setDisplayColorName(false);
     this->m_Controls->btnVecMagColorNeg->setDisplayColorName(false);
     this->m_Controls->btnUniColor->setDisplayColorName(false);
     this->m_Controls->btnStartGridColor->setDisplayColorName(false);
 
     this->CreateConnections();
 
     this->m_Controls->radioColorUni->setChecked(false);
     this->m_Controls->radioColorVecMag->setChecked(true);
 
     this->CheckInputs();
     this->LoadStateFromNode();
     this->ConfigureVisualizationControls();
 
     //deactivate because currently not an implemented style
     this->m_Controls->m_pbStylePoints->setVisible(false);
 }
 
 void QmitkMatchPointRegistrationVisualizer::ConfigureNodePredicates()
 {
   m_Controls->registrationNodeSelector->SetNodePredicate(mitk::MITKRegistrationHelper::RegNodePredicate());
 
   auto geometryCheck = [](const mitk::DataNode * node)
   {
     return node->GetData() && node->GetData()->GetGeometry();
   };
   mitk::NodePredicateFunction::Pointer hasGeometry = mitk::NodePredicateFunction::New(geometryCheck);
 
   auto nodePredicate = mitk::NodePredicateAnd::New(mitk::MITKRegistrationHelper::ImageNodePredicate().GetPointer(), hasGeometry.GetPointer());
   m_Controls->fovReferenceNodeSelector->SetNodePredicate(nodePredicate.GetPointer());
 }
 
 mitk::MAPRegistrationWrapper* QmitkMatchPointRegistrationVisualizer::GetCurrentRegistration()
 {
     mitk::MAPRegistrationWrapper* result = nullptr;
 
     if (this->m_spSelectedRegNode.IsNotNull())
     {
         result = dynamic_cast<mitk::MAPRegistrationWrapper*>(this->m_spSelectedRegNode->GetData());
         assert(result);
     }
 
     return result;
 }
 
 mitk::DataNode::Pointer QmitkMatchPointRegistrationVisualizer::GetSelectedRegNode() const
 {
     return m_Controls->registrationNodeSelector->GetSelectedNode();
 }
 
 mitk::DataNode::Pointer QmitkMatchPointRegistrationVisualizer::GetRefNodeOfReg(bool target) const
 {
     mitk::DataNode::Pointer spResult = nullptr;
 
     if (this->m_spSelectedRegNode.IsNotNull() && m_spSelectedRegNode->GetData())
     {
         std::string nodeName;
         mitk::BaseProperty* uidProp;
 
         if (target)
         {
           uidProp = m_spSelectedRegNode->GetData()->GetProperty(mitk::Prop_RegAlgTargetData);
         }
         else
         {
           uidProp = m_spSelectedRegNode->GetData()->GetProperty(mitk::Prop_RegAlgMovingData);
         }
 
         if (uidProp)
         {
             //search for the target node
             mitk::NodePredicateDataProperty::Pointer predicate = mitk::NodePredicateDataProperty::New(mitk::Prop_UID,
                 uidProp);
             spResult = this->GetDataStorage()->GetNode(predicate);
         }
     }
 
     return spResult;
 }
 
 mitk::DataNode::Pointer QmitkMatchPointRegistrationVisualizer::GetSelectedDataNode()
 {
   return m_Controls->fovReferenceNodeSelector->GetSelectedNode();
 }
 
 void QmitkMatchPointRegistrationVisualizer::CheckInputs()
 {
   this->m_spSelectedRegNode = this->GetSelectedRegNode();
 
   this->InitRegNode();
 
   this->m_spSelectedFOVRefNode = this->GetSelectedDataNode();
 }
 
 void QmitkMatchPointRegistrationVisualizer::ConfigureVisualizationControls()
 {
     if (!m_internalUpdateGuard)
     {
         m_internalUpdateGuard = true;
         m_Controls->groupViz->setVisible(this->m_spSelectedRegNode.IsNotNull());
 
         m_Controls->m_pbUpdateViz->setEnabled(this->m_spSelectedRegNode.IsNotNull());
         m_Controls->m_boxSettings->setEnabled(this->m_spSelectedRegNode.IsNotNull());
         m_Controls->m_boxStyles->setEnabled(this->m_spSelectedRegNode.IsNotNull());
 
         this->ActualizeRegInfo(this->GetCurrentRegistration());
 
         this->m_Controls->m_checkUseRefSize->setEnabled(this->m_spSelectedRegNode.IsNotNull()
             && this->m_spSelectedFOVRefNode.IsNotNull());
         this->m_Controls->m_checkUseRefOrigin->setEnabled(this->m_spSelectedRegNode.IsNotNull()
             && this->m_spSelectedFOVRefNode.IsNotNull());
         this->m_Controls->m_checkUseRefSpacing->setEnabled(this->m_spSelectedRegNode.IsNotNull()
             && this->m_spSelectedFOVRefNode.IsNotNull());
 
         m_internalUpdateGuard = false;
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::StoreStateInNode()
 {
     if (this->m_spSelectedRegNode.IsNotNull())
     {
         //general
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisDirection,
             mitk::RegVisDirectionProperty::New(this->m_Controls->m_comboDirection->currentIndex()));
 
         this->m_spSelectedRegNode->SetBoolProperty(mitk::nodeProp_RegVisGrid,
             this->m_Controls->m_pbStyleGrid->isChecked());
         this->m_spSelectedRegNode->SetBoolProperty(mitk::nodeProp_RegVisGlyph,
             this->m_Controls->m_pbStyleGlyph->isChecked());
         this->m_spSelectedRegNode->SetBoolProperty(mitk::nodeProp_RegVisPoints,
             this->m_Controls->m_pbStylePoints->isChecked());
 
         //Visualization
         if (this->m_Controls->radioColorUni->isChecked())
         {
             this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisColorStyle,
                 mitk::RegVisColorStyleProperty::New(0));
         }
         else
         {
             this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisColorStyle,
                 mitk::RegVisColorStyleProperty::New(1));
         }
 
         float tmpColor[3];
 
         tmpColor[0] = this->m_Controls->btnUniColor->color().redF();
         tmpColor[1] = this->m_Controls->btnUniColor->color().greenF();
         tmpColor[2] = this->m_Controls->btnUniColor->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColorUni,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
 
         tmpColor[0] = this->m_Controls->btnVecMagColorNeg->color().redF();
         tmpColor[1] = this->m_Controls->btnVecMagColorNeg->color().greenF();
         tmpColor[2] = this->m_Controls->btnVecMagColorNeg->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor1Value,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
 
         tmpColor[0] = this->m_Controls->btnVecMagColorSmall->color().redF();
         tmpColor[1] = this->m_Controls->btnVecMagColorSmall->color().greenF();
         tmpColor[2] = this->m_Controls->btnVecMagColorSmall->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor2Value,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor2Magnitude,
             mitk::DoubleProperty::New(this->m_Controls->sbVecMagSmall->value()), nullptr, true);
 
         tmpColor[0] = this->m_Controls->btnVecMagColorMedium->color().redF();
         tmpColor[1] = this->m_Controls->btnVecMagColorMedium->color().greenF();
         tmpColor[2] = this->m_Controls->btnVecMagColorMedium->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor3Value,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor3Magnitude,
             mitk::DoubleProperty::New(this->m_Controls->sbVecMagMedium->value()), nullptr, true);
 
         tmpColor[0] = this->m_Controls->btnVecMagColorLarge->color().redF();
         tmpColor[1] = this->m_Controls->btnVecMagColorLarge->color().greenF();
         tmpColor[2] = this->m_Controls->btnVecMagColorLarge->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor4Value,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor4Magnitude,
             mitk::DoubleProperty::New(this->m_Controls->sbVecMagLarge->value()), nullptr, true);
 
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColorInterpolate,
             mitk::BoolProperty::New(this->m_Controls->cbVevMagInterlolate->isChecked()), nullptr, true);
 
         //Grid Settings
         this->m_spSelectedRegNode->SetIntProperty(mitk::nodeProp_RegVisGridFrequence,
             this->m_Controls->m_sbGridFrequency->value());
         this->m_spSelectedRegNode->SetBoolProperty(mitk::nodeProp_RegVisGridShowStart,
             this->m_Controls->m_groupShowStartGrid->isChecked());
         tmpColor[0] = this->m_Controls->btnStartGridColor->color().redF();
         tmpColor[1] = this->m_Controls->btnStartGridColor->color().greenF();
         tmpColor[2] = this->m_Controls->btnStartGridColor->color().blueF();
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGridStartColor,
             mitk::ColorProperty::New(tmpColor), nullptr, true);
 
         //FOV
         mitk::Vector3D value;
         value[0] = this->m_Controls->m_sbFOVSizeX->value();
         value[1] = this->m_Controls->m_sbFOVSizeY->value();
         value[2] = this->m_Controls->m_sbFOVSizeZ->value();
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVSize,
             mitk::Vector3DProperty::New(value));
 
         value[0] = this->m_Controls->m_sbGridSpX->value();
         value[1] = this->m_Controls->m_sbGridSpY->value();
         value[2] = this->m_Controls->m_sbGridSpZ->value();
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVSpacing,
             mitk::Vector3DProperty::New(value));
 
         mitk::Point3D origin;
         origin[0] = this->m_Controls->m_sbFOVOriginX->value();
         origin[1] = this->m_Controls->m_sbFOVOriginY->value();
         origin[2] = this->m_Controls->m_sbFOVOriginZ->value();
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVOrigin,
             mitk::Point3dProperty::New(origin));
 
         mitk::Vector3D orientationRow1;
         mitk::Vector3D orientationRow2;
         mitk::Vector3D orientationRow3;
         orientationRow1.SetVnlVector(m_FOVRefOrientation.GetVnlMatrix().get_row(0).as_ref());
         orientationRow2.SetVnlVector(m_FOVRefOrientation.GetVnlMatrix().get_row(1).as_ref());
         orientationRow3.SetVnlVector(m_FOVRefOrientation.GetVnlMatrix().get_row(2).as_ref());
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVOrientation1,
             mitk::Vector3DProperty::New(orientationRow1));
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVOrientation2,
             mitk::Vector3DProperty::New(orientationRow2));
         this->m_spSelectedRegNode->SetProperty(mitk::nodeProp_RegVisFOVOrientation3,
             mitk::Vector3DProperty::New(orientationRow3));
 
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::LoadStateFromNode()
 {
     if (this->m_spSelectedRegNode.IsNotNull())
     {
         mitk::RegVisDirectionProperty* directionProp = nullptr;
 
         if (this->m_spSelectedRegNode->GetProperty(directionProp, mitk::nodeProp_RegVisDirection))
         {
             this->m_Controls->m_comboDirection->setCurrentIndex(directionProp->GetValueAsId());
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisDirection) + QStringLiteral(" has not the assumed type."));
         }
 
         bool styleActive = false;
 
         if (this->m_spSelectedRegNode->GetBoolProperty(mitk::nodeProp_RegVisGrid, styleActive))
         {
             this->m_Controls->m_pbStyleGrid->setChecked(styleActive);
             this->m_Controls->tabGrid->setEnabled(styleActive);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisGrid) + QStringLiteral(" has not the assumed type."));
         }
 
         if (this->m_spSelectedRegNode->GetBoolProperty(mitk::nodeProp_RegVisGlyph, styleActive))
         {
             this->m_Controls->m_pbStyleGlyph->setChecked(styleActive);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisGlyph) + QStringLiteral(" has not the assumed type."));
         }
 
         if (this->m_spSelectedRegNode->GetBoolProperty(mitk::nodeProp_RegVisPoints, styleActive))
         {
             this->m_Controls->m_pbStylePoints->setChecked(styleActive);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisPoints) + QStringLiteral(" has not the assumed type."));
         }
 
         ///////////////////////////////////////////////////////
         //visualization
         mitk::RegVisColorStyleProperty* colorStyleProp = nullptr;
 
         if (this->m_spSelectedRegNode->GetProperty(colorStyleProp, mitk::nodeProp_RegVisColorStyle))
         {
             this->m_Controls->radioColorUni->setChecked(colorStyleProp->GetValueAsId() == 0);
             this->m_Controls->radioColorVecMag->setChecked(colorStyleProp->GetValueAsId() == 1);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisColorStyle) + QStringLiteral(" has not the assumed type."));
         }
 
         QColor tmpColor;
         float colorUni[3] = { 0.0, 0.0, 0.0 };
         this->m_spSelectedRegNode->GetColor(colorUni, nullptr, mitk::nodeProp_RegVisColorUni);
         tmpColor.setRgbF(colorUni[0], colorUni[1], colorUni[2]);
         this->m_Controls->btnUniColor->setColor(tmpColor);
 
         float color1[3] = { 0.0, 0.0, 0.0 };
         this->m_spSelectedRegNode->GetColor(color1, nullptr, mitk::nodeProp_RegVisColor1Value);
         tmpColor.setRgbF(color1[0], color1[1], color1[2]);
         this->m_Controls->btnVecMagColorNeg->setColor(tmpColor);
 
         float color2[3] = { 0.25, 0.25, 0.25 };
         this->m_spSelectedRegNode->GetColor(color2, nullptr, mitk::nodeProp_RegVisColor2Value);
         tmpColor.setRgbF(color2[0], color2[1], color2[2]);
         this->m_Controls->btnVecMagColorSmall->setColor(tmpColor);
 
         float color3[3] = { 0.5, 0.5, 0.5 };
         this->m_spSelectedRegNode->GetColor(color3, nullptr, mitk::nodeProp_RegVisColor3Value);
         tmpColor.setRgbF(color3[0], color3[1], color3[2]);
         this->m_Controls->btnVecMagColorMedium->setColor(tmpColor);
 
         float color4[3] = { 1.0, 1.0, 1.0 };
         this->m_spSelectedRegNode->GetColor(color4, nullptr, mitk::nodeProp_RegVisColor4Value);
         tmpColor.setRgbF(color4[0], color4[1], color4[2]);
         this->m_Controls->btnVecMagColorLarge->setColor(tmpColor);
 
         double mag2 = 0;
         this->m_spSelectedRegNode->GetPropertyValue(mitk::nodeProp_RegVisColor2Magnitude, mag2);
         double mag3 = 0;
         this->m_spSelectedRegNode->GetPropertyValue(mitk::nodeProp_RegVisColor3Magnitude, mag3);
         double mag4 = 0;
         this->m_spSelectedRegNode->GetPropertyValue(mitk::nodeProp_RegVisColor4Magnitude, mag4);
 
         bool interpolate = true;
         this->m_spSelectedRegNode->GetBoolProperty(mitk::nodeProp_RegVisColorInterpolate, interpolate);
 
         this->m_Controls->sbVecMagSmall->setValue(mag2);
         this->m_Controls->sbVecMagMedium->setValue(mag3);
         this->m_Controls->sbVecMagLarge->setValue(mag4);
 
         this->m_Controls->cbVevMagInterlolate->setChecked(interpolate);
 
         ///////////////////////////////////////////////////////
         //Grid general
         bool showStart = false;
 
         if (this->m_spSelectedRegNode->GetBoolProperty(mitk::nodeProp_RegVisGridShowStart, showStart))
         {
             this->m_Controls->m_groupShowStartGrid->setChecked(showStart);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisGridShowStart) + QStringLiteral(" is not correctly defined."));
         }
 
         int gridFrequ = 5;
 
         if (this->m_spSelectedRegNode->GetIntProperty(mitk::nodeProp_RegVisGridFrequence, gridFrequ))
         {
             this->m_Controls->m_sbGridFrequency->setValue(gridFrequ);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisGridFrequence) + QStringLiteral(" is not correctly defined."));
         }
 
         float colorStart[3] = { 0.0, 0.0, 0.0 };
         this->m_spSelectedRegNode->GetColor(colorStart, nullptr, mitk::nodeProp_RegVisGridStartColor);
         tmpColor.setRgbF(colorStart[0], colorStart[1], colorStart[2]);
         this->m_Controls->btnStartGridColor->setColor(tmpColor);
 
         ///////////////////////////////////////////////////////
         //FOV
         mitk::Vector3DProperty* valueProp = nullptr;
 
         if (this->m_spSelectedRegNode->GetProperty(valueProp, mitk::nodeProp_RegVisFOVSize))
         {
             this->m_Controls->m_sbFOVSizeX->setValue(valueProp->GetValue()[0]);
             this->m_Controls->m_sbFOVSizeY->setValue(valueProp->GetValue()[1]);
             this->m_Controls->m_sbFOVSizeZ->setValue(valueProp->GetValue()[2]);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisFOVSize) + QStringLiteral(" is not correctly defined."));
         }
 
         if (this->m_spSelectedRegNode->GetProperty(valueProp, mitk::nodeProp_RegVisFOVSpacing))
         {
             this->m_Controls->m_sbGridSpX->setValue(valueProp->GetValue()[0]);
             this->m_Controls->m_sbGridSpY->setValue(valueProp->GetValue()[1]);
             this->m_Controls->m_sbGridSpZ->setValue(valueProp->GetValue()[2]);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisFOVSpacing) + QStringLiteral(" is not correctly defined."));
         }
 
         mitk::Point3dProperty* originProp = nullptr;
 
         if (this->m_spSelectedRegNode->GetProperty(originProp, mitk::nodeProp_RegVisFOVOrigin))
         {
             this->m_Controls->m_sbFOVOriginX->setValue(originProp->GetValue()[0]);
             this->m_Controls->m_sbFOVOriginY->setValue(originProp->GetValue()[1]);
             this->m_Controls->m_sbFOVOriginZ->setValue(originProp->GetValue()[2]);
         }
         else
         {
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. Node property ") + QString(
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. Node property ") + QString(
                 mitk::nodeProp_RegVisFOVOrigin) + QStringLiteral(" is not correctly defined."));
         }
 
         mitk::Vector3DProperty* orientationProp1;
         mitk::Vector3DProperty* orientationProp2;
         mitk::Vector3DProperty* orientationProp3;
 
         if (this->m_spSelectedRegNode->GetProperty(orientationProp1, mitk::nodeProp_RegVisFOVOrientation1) &&
             this->m_spSelectedRegNode->GetProperty(orientationProp2, mitk::nodeProp_RegVisFOVOrientation2) &&
             this->m_spSelectedRegNode->GetProperty(orientationProp3, mitk::nodeProp_RegVisFOVOrientation3))
         {
             this->m_Controls->m_sbFOVOriginX->setValue(originProp->GetValue()[0]);
             this->m_Controls->m_sbFOVOriginY->setValue(originProp->GetValue()[1]);
             this->m_Controls->m_sbFOVOriginZ->setValue(originProp->GetValue()[2]);
             m_FOVRefOrientation.GetVnlMatrix().set_row(0, orientationProp1->GetValue().GetVnlVector());
             m_FOVRefOrientation.GetVnlMatrix().set_row(1, orientationProp2->GetValue().GetVnlVector());
             m_FOVRefOrientation.GetVnlMatrix().set_row(2, orientationProp3->GetValue().GetVnlVector());
         }
         else
         {
             m_FOVRefOrientation.SetIdentity();
 
-            this->Error(QStringLiteral("Cannot configure plugin controlls correctly. One of the node propertiesy ") +
+            this->Error(QStringLiteral("Cannot configure plugin controls correctly. One of the node propertiesy ") +
                 QString(mitk::nodeProp_RegVisFOVOrientation1) + QString(mitk::nodeProp_RegVisFOVOrientation2) +
                 QString(mitk::nodeProp_RegVisFOVOrientation3) + QStringLiteral(" is not correctly defined."));
         }
 
         this->UpdateOrientationMatrixWidget();
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::CheckAndSetDefaultFOVRef()
 {
     //check if node has a default reference node.
     mitk::DataNode::Pointer defaultRef = this->GetRefNodeOfReg(
         this->m_Controls->m_comboDirection->currentIndex() ==
         1); //direction value 1 = show inverse mapping -> we need the target image used for the registration.
 
     //if there is a default node and no m_spSelectedFOVRefNode is set -> set default node and transfer values
     if (defaultRef.IsNotNull() && this->m_spSelectedFOVRefNode.IsNull())
     {
       //there is a default ref and no ref lock -> select default ref and transfer its values
       this->m_spSelectedFOVRefNode = defaultRef;
       QmitkSingleNodeSelectionWidget::NodeList selection({ defaultRef });
       this->m_Controls->fovReferenceNodeSelector->SetCurrentSelection(selection);
       this->m_Controls->m_checkUseRefSize->setChecked(true);
       this->m_Controls->m_checkUseRefOrigin->setChecked(true);
       this->m_Controls->m_checkUseRefSpacing->setChecked(true);
       this->m_Controls->m_checkUseRefOrientation->setChecked(true);
     }
 
     if (this->m_spSelectedFOVRefNode.IsNotNull())
     {
-      //auto transfere values
+      //auto transfer values
       this->TransferFOVRefGeometry();
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> /*nodes*/)
 {
   this->CheckInputs();
   this->LoadStateFromNode();
   this->CheckAndSetDefaultFOVRef();
   this->ConfigureVisualizationControls();
 }
 
 void QmitkMatchPointRegistrationVisualizer::ActualizeRegInfo(mitk::MAPRegistrationWrapper*
     currentReg)
 {
     std::stringstream descriptionString;
 
     m_Controls->m_teRegInfo->clear();
 
     if (currentReg)
     {
         descriptionString << "Moving dimension: " << currentReg->GetMovingDimensions() << "<br/>";
         descriptionString << "Target dimension: " << currentReg->GetTargetDimensions() << "<br/>";
         descriptionString << "Limited moving representation: " <<
             currentReg->HasLimitedMovingRepresentation() << "<br/>";
         descriptionString << "Limited target representation: " <<
             currentReg->HasLimitedTargetRepresentation() << "<br/>";
 
         mitk::MAPRegistrationWrapper::TagMapType tagMap = currentReg->GetTags();
 
         descriptionString << "<br/><b>Tags:</b><br/>";
 
         for (mitk::MAPRegistrationWrapper::TagMapType::const_iterator pos = tagMap.begin();
             pos != tagMap.end(); ++pos)
         {
             descriptionString << pos->first << " : " << pos->second << "<br/>";
         }
     }
     else
     {
         descriptionString << "<font color='red'>no registration selected!</font>";
     }
 
     m_Controls->m_teRegInfo->insertHtml(QString::fromStdString(descriptionString.str()));
 
 }
 
 void QmitkMatchPointRegistrationVisualizer::OnDirectionChanged(int)
 {
     this->CheckAndSetDefaultFOVRef();
     this->ConfigureVisualizationControls();
 }
 
 void QmitkMatchPointRegistrationVisualizer::OnUpdateBtnPushed()
 {
     this->StoreStateInNode();
 
     mitk::Geometry3D::Pointer gridDesc;
     unsigned int gridFrequ = 5;
 
     mitk::GetGridGeometryFromNode(this->m_spSelectedRegNode, gridDesc, gridFrequ);
 
     this->GetCurrentRegistration()->SetGeometry(gridDesc);
     mitk::RenderingManager::GetInstance()->ForceImmediateUpdateAll();
 }
 
 void QmitkMatchPointRegistrationVisualizer::OnStyleButtonPushed()
 {
 
 }
 
 void QmitkMatchPointRegistrationVisualizer::OnColorInterpolationChecked(bool checked)
 {
     if (checked)
     {
         this->m_Controls->labelVecMagSmall->setText(QStringLiteral("="));
         this->m_Controls->labelVecMagMedium->setText(QStringLiteral("="));
         this->m_Controls->labelVecMagLarge->setText(QStringLiteral("="));
     }
     else
     {
         this->m_Controls->labelVecMagSmall->setText(QStringLiteral(">"));
         this->m_Controls->labelVecMagMedium->setText(QStringLiteral(">"));
         this->m_Controls->labelVecMagLarge->setText(QStringLiteral(">"));
     }
 }
 
 mitk::ScalarType QmitkMatchPointRegistrationVisualizer::GetSaveSpacing(mitk::ScalarType gridRes,
     mitk::ScalarType spacing, unsigned int maxGridRes) const
 {
     mitk::ScalarType newSpacing = spacing;
     mitk::ScalarType scaling = gridRes / maxGridRes;
 
     if (scaling > 1.0)
     {
         newSpacing = spacing * scaling;
     }
 
     return newSpacing;
 }
 
 void QmitkMatchPointRegistrationVisualizer::TransferFOVRefGeometry()
 {
     if (this->m_spSelectedFOVRefNode.IsNotNull())
     {
         assert(this->m_spSelectedFOVRefNode->GetData());
         assert(this->m_spSelectedFOVRefNode->GetData()->GetGeometry());
 
         mitk::BaseGeometry* gridRef = this->m_spSelectedFOVRefNode->GetData()->GetGeometry();
 
         mitk::Vector3D spacing = gridRef->GetSpacing();
         mitk::Point3D origin = gridRef->GetOrigin();
         mitk::Geometry3D::BoundsArrayType bounds = gridRef->GetBounds();
         mitk::AffineTransform3D::ConstPointer fovTransform = gridRef->GetIndexToWorldTransform();
 
 
         if (this->m_Controls->m_checkUseRefSize->isChecked())
         {
             this->m_Controls->m_sbFOVSizeX->setValue((bounds[1] - bounds[0])*spacing[0]);
             this->m_Controls->m_sbFOVSizeY->setValue((bounds[3] - bounds[2])*spacing[1]);
             this->m_Controls->m_sbFOVSizeZ->setValue((bounds[5] - bounds[4])*spacing[2]);
         }
 
         if (this->m_Controls->m_checkUseRefSpacing->isChecked())
         {
 
             this->m_Controls->m_sbGridSpX->setValue(GetSaveSpacing((bounds[1] - bounds[0]), spacing[0], 20));
             this->m_Controls->m_sbGridSpY->setValue(GetSaveSpacing((bounds[3] - bounds[2]), spacing[1], 20));
             this->m_Controls->m_sbGridSpZ->setValue(GetSaveSpacing((bounds[5] - bounds[4]), spacing[2], 20));
 
         }
 
         if (this->m_Controls->m_checkUseRefOrigin->isChecked())
         {
             this->m_Controls->m_sbFOVOriginX->setValue(origin[0]);
             this->m_Controls->m_sbFOVOriginY->setValue(origin[1]);
             this->m_Controls->m_sbFOVOriginZ->setValue(origin[2]);
         }
 
         if (this->m_Controls->m_checkUseRefOrientation->isChecked())
         {
             this->m_FOVRefOrientation = fovTransform->GetMatrix();
             this->UpdateOrientationMatrixWidget();
         }
 
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::UpdateOrientationMatrixWidget()
 {
     for (unsigned int r = 0; r < 3; ++r)
     {
         for (unsigned int c = 0; c < 3; ++c)
         {
             this->m_Controls->m_tableOrientation->item(r,
                 c)->setText(QString::number(this->m_FOVRefOrientation.GetVnlMatrix().get(r, c)));
         }
     }
 }
 
 void QmitkMatchPointRegistrationVisualizer::InitRegNode()
 {
     if (this->m_spSelectedRegNode.IsNotNull())
     {
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGrid, mitk::BoolProperty::New(true));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGlyph, mitk::BoolProperty::New(false));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisPoints, mitk::BoolProperty::New(false));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisDirection,
             mitk::RegVisDirectionProperty::New());
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColorStyle,
             mitk::RegVisColorStyleProperty::New(1));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColorUni, mitk::ColorProperty::New(0,
             0.5, 0));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGridFrequence,
             mitk::IntProperty::New(3));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGridShowStart,
             mitk::BoolProperty::New(false));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisGridStartColor,
             mitk::ColorProperty::New(0.5, 0, 0));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVSize,
             mitk::Vector3DProperty::New(mitk::Vector3D(100.0)));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVSpacing,
             mitk::Vector3DProperty::New(mitk::Vector3D(5.0)));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor1Value, mitk::ColorProperty::New(0,
             0, 0.5));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor2Value, mitk::ColorProperty::New(0,
             0.7, 0));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor2Magnitude,
             mitk::DoubleProperty::New(1));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor3Value, mitk::ColorProperty::New(1,
             1, 0));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor3Magnitude,
             mitk::DoubleProperty::New(5));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor4Value, mitk::ColorProperty::New(1,
             0, 0));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColor4Magnitude,
             mitk::DoubleProperty::New(15));
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisColorInterpolate,
             mitk::BoolProperty::New(true));
 
         mitk::Point3D origin;
         origin.Fill(0.0);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVOrigin,
             mitk::Point3dProperty::New(mitk::Point3D(origin)));
 
         mitk::Vector3D vec(0.0);
         vec.SetElement(0, 1.0);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVOrientation1,
             mitk::Vector3DProperty::New(vec));
         vec.Fill(0.0);
         vec.SetElement(1, 1.0);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVOrientation2,
             mitk::Vector3DProperty::New(vec));
         vec.Fill(0.0);
         vec.SetElement(2, 1.0);
         this->m_spSelectedRegNode->AddProperty(mitk::nodeProp_RegVisFOVOrientation3,
             mitk::Vector3DProperty::New(vec));
 
     }
 }
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 53ce98087c..966fd637ea 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 QmitkMatchPointRegistrationVisualizer_h
 #define QmitkMatchPointRegistrationVisualizer_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.
 
   \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);
 
         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 OnStyleButtonPushed();
     void OnDirectionChanged(int index);
 
     void OnUpdateBtnPushed();
 
     void OnColorInterpolationChecked(bool);
 
     void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
 
     void TransferFOVRefGeometry();
 
 protected:
     void SetFocus() 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();
 
     /**
     Configure the node selectors predicates according to the selected algorithm.
     */
     void ConfigureNodePredicates();
 
     /**
      * 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();*/
+     * avoid update loops by ConfigureVisualizationControls();*/
     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.*/
+    /**Used to store information about the FOV reference orientation. Default is identity matrix.*/
     mitk::AffineTransform3D::MatrixType m_FOVRefOrientation;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.ui b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.ui
index 899b10bbc1..4dc8b4a05e 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.ui
+++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.ui
@@ -1,1570 +1,1570 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>MatchPointRegVisControls</class>
  <widget class="QWidget" name="MatchPointRegVisControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>332</width>
     <height>738</height>
    </rect>
   </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>
     <widget class="QLabel" name="label">
      <property name="palette">
       <palette>
        <active>
         <colorrole role="WindowText">
          <brush brushstyle="SolidPattern">
           <color alpha="255">
            <red>255</red>
            <green>0</green>
            <blue>0</blue>
           </color>
          </brush>
         </colorrole>
        </active>
        <inactive>
         <colorrole role="WindowText">
          <brush brushstyle="SolidPattern">
           <color alpha="255">
            <red>255</red>
            <green>0</green>
            <blue>0</blue>
           </color>
          </brush>
         </colorrole>
        </inactive>
        <disabled>
         <colorrole role="WindowText">
          <brush brushstyle="SolidPattern">
           <color alpha="255">
            <red>120</red>
            <green>120</green>
            <blue>120</blue>
           </color>
          </brush>
         </colorrole>
        </disabled>
       </palette>
      </property>
      <property name="text">
       <string>Warning: This plugin is in an experimental state!</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="label_4">
      <property name="text">
       <string>Registration:</string>
      </property>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <property name="spacing">
       <number>3</number>
      </property>
      <item>
       <widget class="QmitkSingleNodeSelectionWidget" name="registrationNodeSelector" native="true">
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QLabel" name="label_5">
      <property name="text">
       <string>Info:</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QTextEdit" name="m_teRegInfo">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>75</height>
       </size>
      </property>
      <property name="maximumSize">
       <size>
        <width>16777215</width>
        <height>130</height>
       </size>
      </property>
      <property name="readOnly">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupViz">
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="title">
       <string/>
      </property>
      <property name="flat">
       <bool>false</bool>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <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>
        <widget class="QPushButton" name="m_pbUpdateViz">
         <property name="toolTip">
          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Updates the visualization with the current settings.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="text">
          <string>Update visualization</string>
         </property>
         <property name="checkable">
          <bool>false</bool>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QLabel" name="label_13">
         <property name="text">
          <string>Show mapping direction:</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QComboBox" name="m_comboDirection">
         <property name="toolTip">
          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the direction/kernel of the registration you want to visualize:&lt;/p&gt;&lt;p&gt;- &amp;quot;direct&amp;quot;: select to show the direct mapping kernel (used for continuous spaced data like point sets).&lt;/p&gt;&lt;p&gt;- &amp;quot;inverse&amp;quot;: select to show the inverse mapping kernel (used for discrete spaced data like voxel images).&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If the selected registration does not support a direction, you cannot select it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <item>
          <property name="text">
           <string>Direct</string>
          </property>
         </item>
         <item>
          <property name="text">
           <string>Inverse</string>
          </property>
         </item>
        </widget>
       </item>
       <item>
        <widget class="QWidget" name="m_boxStyles" 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>30</height>
          </size>
         </property>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <property name="spacing">
           <number>5</number>
          </property>
          <property name="leftMargin">
           <number>0</number>
          </property>
          <property name="topMargin">
           <number>5</number>
          </property>
          <property name="rightMargin">
           <number>0</number>
          </property>
          <property name="bottomMargin">
           <number>5</number>
          </property>
          <item>
           <widget class="QPushButton" name="m_pbStyleGrid">
            <property name="toolTip">
-            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select to vizualize registration via grid(s).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select to visualize registration via grid(s).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
            </property>
            <property name="text">
             <string>Grid</string>
            </property>
            <property name="checkable">
             <bool>true</bool>
            </property>
            <property name="checked">
             <bool>true</bool>
            </property>
            <property name="autoExclusive">
             <bool>true</bool>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="m_pbStyleGlyph">
            <property name="enabled">
             <bool>true</bool>
            </property>
            <property name="toolTip">
-            <string>Select to vizualize registration via glyphs.</string>
+            <string>Select to visualize registration via glyphs.</string>
            </property>
            <property name="text">
             <string>Glyph</string>
            </property>
            <property name="checkable">
             <bool>true</bool>
            </property>
            <property name="autoExclusive">
             <bool>true</bool>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="m_pbStylePoints">
            <property name="enabled">
             <bool>false</bool>
            </property>
            <property name="toolTip">
-            <string>Select to vizualize registration via a pointset selected from the data manager...</string>
+            <string>Select to visualize registration via a pointset selected from the data manager...</string>
            </property>
            <property name="text">
             <string>Points</string>
            </property>
            <property name="checkable">
             <bool>true</bool>
            </property>
            <property name="autoExclusive">
             <bool>true</bool>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QTabWidget" name="m_boxSettings">
         <property name="currentIndex">
          <number>2</number>
         </property>
         <widget class="QWidget" name="tabViz">
          <attribute name="title">
           <string>Visualization</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_5">
           <property name="leftMargin">
            <number>5</number>
           </property>
           <property name="topMargin">
            <number>5</number>
           </property>
           <property name="rightMargin">
            <number>5</number>
           </property>
           <item>
            <layout class="QVBoxLayout" name="verticalLayout_7">
             <item>
              <widget class="QLabel" name="label_15">
               <property name="text">
                <string>Color style:</string>
               </property>
              </widget>
             </item>
             <item>
              <layout class="QHBoxLayout" name="horizontalLayout_8">
               <item>
                <widget class="QRadioButton" name="radioColorUni">
                 <property name="text">
                  <string>uni color:</string>
                 </property>
                </widget>
               </item>
               <item>
                <widget class="ctkColorPickerButton" name="btnUniColor">
                 <property name="enabled">
                  <bool>false</bool>
                 </property>
                 <property name="minimumSize">
                  <size>
                   <width>60</width>
                   <height>0</height>
                  </size>
                 </property>
                 <property name="autoFillBackground">
                  <bool>false</bool>
                 </property>
                 <property name="text">
                  <string/>
                 </property>
                </widget>
               </item>
               <item>
                <spacer name="horizontalSpacer_6">
                 <property name="orientation">
                  <enum>Qt::Horizontal</enum>
                 </property>
                 <property name="sizeHint" stdset="0">
                  <size>
                   <width>40</width>
                   <height>20</height>
                  </size>
                 </property>
                </spacer>
               </item>
              </layout>
             </item>
             <item>
              <widget class="QRadioButton" name="radioColorVecMag">
               <property name="text">
                <string>vector magnitude:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QGroupBox" name="groupColorCoding">
               <property name="title">
                <string>Color coding:</string>
               </property>
               <layout class="QVBoxLayout" name="verticalLayout_8">
                <item>
                 <layout class="QGridLayout" name="gridLayout_3">
                  <property name="leftMargin">
                   <number>0</number>
                  </property>
                  <property name="rightMargin">
                   <number>0</number>
                  </property>
                  <property name="horizontalSpacing">
                   <number>7</number>
                  </property>
                  <property name="verticalSpacing">
                   <number>3</number>
                  </property>
                  <item row="3" column="7">
                   <spacer name="horizontalSpacer_4">
                    <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 row="2" column="7">
                   <spacer name="horizontalSpacer_3">
                    <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 row="1" column="7">
                   <spacer name="horizontalSpacer_2">
                    <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 row="0" column="7">
                   <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 row="1" column="5">
                   <widget class="QLabel" name="label_29">
                    <property name="text">
                     <string>mm</string>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="1">
                   <widget class="QLabel" name="label_3">
                    <property name="text">
                     <string>small:</string>
                    </property>
                   </widget>
                  </item>
                  <item row="2" column="1">
                   <widget class="QLabel" name="label_2">
                    <property name="text">
                     <string>medium:</string>
                    </property>
                   </widget>
                  </item>
                  <item row="2" column="3">
                   <widget class="QLabel" name="labelVecMagMedium">
                    <property name="maximumSize">
                     <size>
                      <width>30</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string>&gt;</string>
                    </property>
                    <property name="alignment">
                     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="4">
                   <widget class="QDoubleSpinBox" name="sbVecMagSmall">
                    <property name="maximum">
                     <double>999.000000000000000</double>
                    </property>
                    <property name="singleStep">
                     <double>0.100000000000000</double>
                    </property>
                   </widget>
                  </item>
                  <item row="3" column="4">
                   <widget class="QDoubleSpinBox" name="sbVecMagLarge">
                    <property name="maximum">
                     <double>999.000000000000000</double>
                    </property>
                   </widget>
                  </item>
                  <item row="3" column="1">
                   <widget class="QLabel" name="label_9">
                    <property name="text">
                     <string>large:</string>
                    </property>
                   </widget>
                  </item>
                  <item row="3" column="3">
                   <widget class="QLabel" name="labelVecMagLarge">
                    <property name="maximumSize">
                     <size>
                      <width>30</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string>&gt;</string>
                    </property>
                    <property name="alignment">
                     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
                    </property>
                   </widget>
                  </item>
                  <item row="3" column="5">
                   <widget class="QLabel" name="label_30">
                    <property name="text">
                     <string>mm</string>
                    </property>
                   </widget>
                  </item>
                  <item row="2" column="4">
                   <widget class="QDoubleSpinBox" name="sbVecMagMedium">
                    <property name="maximum">
                     <double>999.000000000000000</double>
                    </property>
                   </widget>
                  </item>
                  <item row="2" column="5">
                   <widget class="QLabel" name="label_31">
                    <property name="text">
                     <string>mm</string>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="3">
                   <widget class="QLabel" name="labelVecMagSmall">
                    <property name="maximumSize">
                     <size>
                      <width>30</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string>&gt;</string>
                    </property>
                    <property name="alignment">
                     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
                    </property>
                   </widget>
                  </item>
                  <item row="0" column="1">
                   <widget class="QLabel" name="label_6">
                    <property name="text">
                     <string>negligible:</string>
                    </property>
                   </widget>
                  </item>
                  <item row="3" column="2">
                   <widget class="ctkColorPickerButton" name="btnVecMagColorLarge">
                    <property name="minimumSize">
                     <size>
                      <width>50</width>
                      <height>0</height>
                     </size>
                    </property>
                    <property name="maximumSize">
                     <size>
                      <width>40</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string/>
                    </property>
                   </widget>
                  </item>
                  <item row="2" column="2">
                   <widget class="ctkColorPickerButton" name="btnVecMagColorMedium">
                    <property name="minimumSize">
                     <size>
                      <width>50</width>
                      <height>0</height>
                     </size>
                    </property>
                    <property name="maximumSize">
                     <size>
                      <width>40</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string/>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="2">
                   <widget class="ctkColorPickerButton" name="btnVecMagColorSmall">
                    <property name="minimumSize">
                     <size>
                      <width>50</width>
                      <height>0</height>
                     </size>
                    </property>
                    <property name="maximumSize">
                     <size>
                      <width>40</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string/>
                    </property>
                   </widget>
                  </item>
                  <item row="0" column="2">
                   <widget class="ctkColorPickerButton" name="btnVecMagColorNeg">
                    <property name="minimumSize">
                     <size>
                      <width>50</width>
                      <height>0</height>
                     </size>
                    </property>
                    <property name="maximumSize">
                     <size>
                      <width>40</width>
                      <height>16777215</height>
                     </size>
                    </property>
                    <property name="text">
                     <string/>
                    </property>
                   </widget>
                  </item>
                 </layout>
                </item>
                <item>
                 <widget class="QCheckBox" name="cbVevMagInterlolate">
                  <property name="text">
                   <string>interpolate colors</string>
                  </property>
                 </widget>
                </item>
               </layout>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <spacer name="verticalSpacer_3">
             <property name="orientation">
              <enum>Qt::Vertical</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
               <width>20</width>
               <height>40</height>
              </size>
             </property>
            </spacer>
           </item>
          </layout>
         </widget>
         <widget class="QWidget" name="tabGrid">
          <property name="enabled">
           <bool>true</bool>
          </property>
          <attribute name="title">
           <string>Grid</string>
          </attribute>
          <attribute name="toolTip">
           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;General grid visualization settings.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_3">
           <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="QFormLayout" name="formLayout">
             <property name="fieldGrowthPolicy">
              <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
             </property>
             <property name="horizontalSpacing">
              <number>5</number>
             </property>
             <property name="verticalSpacing">
              <number>5</number>
             </property>
             <item row="0" column="0">
              <widget class="QLabel" name="label_16">
               <property name="text">
                <string>Grid frequency:</string>
               </property>
              </widget>
             </item>
             <item row="0" column="1">
              <widget class="QSpinBox" name="m_sbGridFrequency">
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the frequency of visible gridlines used for visualization.&lt;/p&gt;&lt;p&gt;e.g. 1: every line of the grid is visible; 2: only every second line is visible ...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="maximum">
                <number>200</number>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <widget class="QGroupBox" name="m_groupShowStartGrid">
             <property name="font">
              <font>
               <weight>50</weight>
               <bold>false</bold>
              </font>
             </property>
             <property name="toolTip">
              <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows that pixels may not be defined in the mapped image because they are outside of the field of view of the used input image.&lt;/p&gt;&lt;p&gt;The pixels will be marked with the given padding value.&lt;/p&gt;&lt;p&gt;If unchecked the mapping will be aborted in a case of undefined pixels.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
             <property name="title">
              <string>Show start grid</string>
             </property>
             <property name="flat">
              <bool>false</bool>
             </property>
             <property name="checkable">
              <bool>true</bool>
             </property>
             <property name="checked">
              <bool>false</bool>
             </property>
             <layout class="QHBoxLayout" name="horizontalLayout_3">
              <property name="leftMargin">
               <number>11</number>
              </property>
              <property name="topMargin">
               <number>5</number>
              </property>
              <property name="rightMargin">
               <number>11</number>
              </property>
              <property name="bottomMargin">
               <number>5</number>
              </property>
              <item>
               <widget class="QLabel" name="label_14">
                <property name="text">
                 <string>Color</string>
                </property>
               </widget>
              </item>
              <item>
               <widget class="ctkColorPickerButton" name="btnStartGridColor">
                <property name="minimumSize">
                 <size>
                  <width>60</width>
                  <height>0</height>
                 </size>
                </property>
                <property name="autoFillBackground">
                 <bool>false</bool>
                </property>
                <property name="text">
                 <string/>
                </property>
               </widget>
              </item>
              <item>
               <spacer name="horizontalSpacer_5">
                <property name="orientation">
                 <enum>Qt::Horizontal</enum>
                </property>
                <property name="sizeHint" stdset="0">
                 <size>
                  <width>40</width>
                  <height>20</height>
                 </size>
                </property>
               </spacer>
              </item>
             </layout>
            </widget>
           </item>
           <item>
            <spacer name="verticalSpacer">
             <property name="orientation">
              <enum>Qt::Vertical</enum>
             </property>
             <property name="sizeType">
              <enum>QSizePolicy::Expanding</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
               <width>20</width>
               <height>300</height>
              </size>
             </property>
            </spacer>
           </item>
          </layout>
         </widget>
         <widget class="QWidget" name="tabFOV">
          <attribute name="title">
           <string>FOV</string>
          </attribute>
          <attribute name="toolTip">
           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Field of view settings (FOV) for vizualizing the grid correctly (its origin, size and orientation).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_4">
           <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>
            <widget class="QLabel" name="label_18">
             <property name="text">
              <string>Size (in mm):</string>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_4">
             <property name="spacing">
              <number>0</number>
             </property>
             <item>
              <widget class="QLabel" name="label_20">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="text">
                <string>x:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVSizeX">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the size (in mm) of the grid in the x direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="decimals">
                <number>2</number>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_21">
               <property name="text">
                <string>y:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVSizeY">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the size (in mm) of the grid in the y direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="decimals">
                <number>2</number>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_19">
               <property name="text">
                <string>z:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVSizeZ">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the size (in mm) of the grid in the z direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="decimals">
                <number>2</number>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <widget class="QLabel" name="label_24">
             <property name="text">
              <string>Origin (in mm):</string>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_5">
             <property name="spacing">
              <number>0</number>
             </property>
             <item>
              <widget class="QLabel" name="label_25">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="text">
                <string>x:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVOriginX">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the origin (in mm) of the grid in the x direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>-99999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>99999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_22">
               <property name="text">
                <string>y:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVOriginY">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the origin (in mm) of the grid in the y direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>-99999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>99999.000000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_23">
               <property name="text">
                <string>z:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbFOVOriginZ">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the origin (in mm) of the grid in the z direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>-99999.000000000000000</double>
               </property>
               <property name="maximum">
                <double>99999.000000000000000</double>
               </property>
               <property name="value">
                <double>0.000000000000000</double>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <widget class="QLabel" name="label_17">
             <property name="text">
              <string>Spacing (in mm):</string>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_6">
             <property name="spacing">
              <number>0</number>
             </property>
             <item>
              <widget class="QLabel" name="label_10">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="text">
                <string>x:</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbGridSpX">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the spacing/resolution of the grid in the x direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
               <property name="value">
                <double>0.010000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_12">
               <property name="text">
                <string>y:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbGridSpY">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the spacing/resolution of the grid in the y direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
               <property name="value">
                <double>0.010000000000000</double>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="label_11">
               <property name="text">
                <string>z:</string>
               </property>
               <property name="alignment">
                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QDoubleSpinBox" name="m_sbGridSpZ">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimumSize">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
               <property name="maximumSize">
                <size>
                 <width>50</width>
                 <height>16777215</height>
                </size>
               </property>
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Indicate the spacing/resolution of the grid in the z direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
               <property name="minimum">
                <double>0.010000000000000</double>
               </property>
               <property name="maximum">
                <double>9999.000000000000000</double>
               </property>
               <property name="value">
                <double>0.010000000000000</double>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <widget class="QLabel" name="label_27">
             <property name="text">
              <string>Orientation:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QTableWidget" name="m_tableOrientation">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="sizePolicy">
              <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="maximumSize">
              <size>
               <width>160</width>
               <height>50</height>
              </size>
             </property>
             <property name="font">
              <font>
               <pointsize>7</pointsize>
              </font>
             </property>
             <property name="showDropIndicator" stdset="0">
              <bool>false</bool>
             </property>
             <property name="dragDropOverwriteMode">
              <bool>false</bool>
             </property>
             <property name="wordWrap">
              <bool>false</bool>
             </property>
             <property name="cornerButtonEnabled">
              <bool>false</bool>
             </property>
             <attribute name="horizontalHeaderVisible">
              <bool>false</bool>
             </attribute>
             <attribute name="horizontalHeaderMinimumSectionSize">
              <number>20</number>
             </attribute>
             <attribute name="horizontalHeaderDefaultSectionSize">
              <number>50</number>
             </attribute>
             <attribute name="verticalHeaderVisible">
              <bool>false</bool>
             </attribute>
             <attribute name="verticalHeaderDefaultSectionSize">
              <number>20</number>
             </attribute>
             <row>
              <property name="text">
               <string>R1</string>
              </property>
             </row>
             <row>
              <property name="text">
               <string>R2</string>
              </property>
             </row>
             <row>
              <property name="text">
               <string>R3</string>
              </property>
             </row>
             <column>
              <property name="text">
               <string>C1</string>
              </property>
             </column>
             <column>
              <property name="text">
               <string>C2</string>
              </property>
             </column>
             <column>
              <property name="text">
               <string>C3</string>
              </property>
             </column>
             <item row="0" column="0">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="0" column="1">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="0" column="2">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="1" column="0">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="1" column="1">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="1" column="2">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="2" column="0">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="2" column="1">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
             <item row="2" column="2">
              <property name="text">
               <string>0</string>
              </property>
              <property name="flags">
               <set>ItemIsEnabled</set>
              </property>
             </item>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="label_26">
             <property name="text">
              <string>FOV Reference:</string>
             </property>
            </widget>
           </item>
           <item>
            <layout class="QHBoxLayout" name="horizontalLayout_7">
             <property name="spacing">
              <number>3</number>
             </property>
             <item>
              <widget class="QmitkSingleNodeSelectionWidget" name="fovReferenceNodeSelector" native="true">
               <property name="minimumSize">
                <size>
                 <width>0</width>
                 <height>40</height>
                </size>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QGridLayout" name="gridLayout">
             <item row="0" column="0">
              <widget class="QCheckBox" name="m_checkUseRefSize">
               <property name="text">
                <string>size</string>
               </property>
               <property name="checked">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item row="0" column="1">
              <widget class="QCheckBox" name="m_checkUseRefOrigin">
               <property name="text">
                <string>origin</string>
               </property>
               <property name="checked">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item row="1" column="0">
              <widget class="QCheckBox" name="m_checkUseRefSpacing">
               <property name="text">
                <string>spacing</string>
               </property>
               <property name="checked">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item row="1" column="1">
              <widget class="QCheckBox" name="m_checkUseRefOrientation">
               <property name="text">
                <string>orientation</string>
               </property>
               <property name="checked">
                <bool>true</bool>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item>
            <spacer name="verticalSpacer_2">
             <property name="orientation">
              <enum>Qt::Vertical</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
               <width>20</width>
               <height>40</height>
              </size>
             </property>
            </spacer>
           </item>
          </layout>
         </widget>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer_5">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkSingleNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>ctkColorPickerButton</class>
    <extends>QPushButton</extends>
    <header>ctkColorPickerButton.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
  <designerdata>
   <property name="gridDeltaX">
    <number>5</number>
   </property>
   <property name="gridDeltaY">
    <number>5</number>
   </property>
   <property name="gridSnapX">
    <bool>true</bool>
   </property>
   <property name="gridSnapY">
    <bool>true</bool>
   </property>
   <property name="gridVisible">
    <bool>true</bool>
   </property>
  </designerdata>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/documentation/UserManual/QmitkMeasurement.dox b/Plugins/org.mitk.gui.qt.measurementtoolbox/documentation/UserManual/QmitkMeasurement.dox
index d37a5712c8..1c52d57af5 100644
--- a/Plugins/org.mitk.gui.qt.measurementtoolbox/documentation/UserManual/QmitkMeasurement.dox
+++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/documentation/UserManual/QmitkMeasurement.dox
@@ -1,90 +1,90 @@
 /**
 \page org_mitk_views_measurement The Measurement View
 
 \imageMacro{measurement-dox.svg,"Icon of the Measurement View",2.00}
 
 <h1>Overview</h1>
 
-The Measurement view allows you to measure distances, angles, paths and several geometric figures on 2D images or image slices of 3D and 4D images. The measurement view is repeatedly useable with the same or different measurement figures that are related to the chosen image and can be saved together with it for future use. 
+The Measurement view allows you to measure distances, angles, paths and several geometric figures on 2D images or image slices of 3D and 4D images. The measurement view is repeatedly usable with the same or different measurement figures that are related to the chosen image and can be saved together with it for future use. 
 
 
 \imageMacro{QmitkMeasurementToolbox_BasicScreenEdited.jpg,"Image with measurements",16.00}
 
 
 <h1>Usage</h1>
 
 The first step to perform measurements is to select a reference image on top of the view. All resulting measurements will be assigned as child nodes of the image in the data manager. The standard working plane is 'Axial' but the other standard view planes ('Sagittal' and 'Coronal') are also valid for measurements. 
 
 
 \imageMacro{QmitkMeasurementToolbox_MeasurementView.jpg,"Measurement View",7.60}
 
 After selecting an image, you can click on any of the geometrical symbols. The respective measurement will appear as soon as you click on the image location you want to measure.
 
 The view offers a variety of measurement options that are introduced in the following:
 
 <ul>
 <li> <b>Line:</b>
 
 Draws a line between two set points and returns the distance between these points.
 
 <li> <b>Path:</b>
 
 Draws a line between several set points (two and more) and calculates the overall length, which is all lines length summed up. Add the final point by double left-click.
 
 <li> <b>Angle:</b>
 
 Draws two lines from three set points connected in the second set point and return the inner angle at the second point.
 
 <li> <b>Four Point / Double Angle:</b>
 
 Draws two lines that may but do not have to intersect from four set points. The returned angle is the one depicted in the icon.
 
 <li> <b>Circle:</b>
 
 Draws a circle by setting two points, whereas the first set point is the center and the second the radius of the circle. The measured values are the radius and the included area.
 
 <li> <b>Ellipse:</b>
 
 Draws an ellipse that can be modified by three points. The middle point can be used to move the whole measurement. The lower point modifies the ellipse axes. The right point can be used to modify the radius of the ellipse. The measured values are the major and minor axes and the area.
 
 <li> <b>Double Ellipse:</b>
 
 Draws two ellipses by adjusting four points. The middle point can be used to move the whole measurement. The left point is used to adjust the distance between the two ellipses. The lower point modifies the ellipse axes. The right point can be used to modify the radius of the ellipse. Can be used for measuring e.g. the wall thickness of a vessel. The measured values are the major and minor axes and the thickness.
 
 <li> <b>Rectangle:</b>
 
 Draws a rectangle by setting two points at the opposing edges of the rectangle starting with the upper left corner. The measured values are the circumference and the included area.
 
 <li> <b>Polygon:</b>
 
 Draws a closed polygon that can have an arbitrary number of points. New points are added by left mouse-click. To finish the drawing the user can double click on the last control point. The measured values are circumference and area.
 
 <li> <b>Bezier curve:</b>
 
 Draws a bezier curve by adding some control points with left mouse-click. To finish the drawing the user can double-click on the last control point. The measured value is the length of the bezier curve.
 
 <li> <b>Subdivision Polygon:</b>
 
 Draws a closed subdivision polygon by adding some control points with left mouse-click. To finish the drawing the user can double-click on the last control point. The measured value is the circumference of the polygon.
 </ul>
 
 <h2>Fixed sizes of measurement figures</h2>
 The measurement view offers a fixed size for circle and double ellipses to preset a radius and a thickness. This is useful e.g. for diagnostic studies where you want to derive gray value statistics from a well defined region.
 
 <h2>Modify measurements</h2>
 
 All measurements can be modified later on by moving the respective control points. Note that they can only be modified if the view is open.
 
 <h2>Multiple measurement figures</h2>
 
 When applying more than one measurement figure to the image the actual measurement figure is depicted in red and the displayed values belong to this measurement figure. All other measurement figures appear white. They can be selected by a left-mouse click on the respective node.
 
 
 <h2>Save the measurement information</h2>
 The entire scene containing the image and the measurement figures can be saved for future use. Scenes are saved with a '.mitk' extension by pressing 'Save Project' and contain all nodes and relevant information. Alternatively, you can just save the measurement solely (with file extension '.pf') by right-click on the node in the data manager.
 
 The content of the measurement widget can be copied to the clipboard with the corresponding button for further use in a table calculation program (e.g. Open Office Calc etc.).
 
 <h2>Remove measurement figures or image</h2>
 If the single measurement figures or the image is not needed any longer, it can be removed solely or as an entire group. The image can't be removed without simultaneously removing all the dependent measurement figures that belong to the image tree in the data manager. To remove, just select the wanted items in the data manager list by right-clicking on the respective node or, if several items wanted to be removed, right-click on all wanted by simultaneously holding the ctrl-button pressed.
 */
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.cpp b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.cpp
index ada96a36f3..5fa5a9da06 100644
--- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.cpp
+++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.cpp
@@ -1,469 +1,469 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkImageStatisticsView.h"
 
 #include <utility>
 
 // berry includes
 #include <berryIQtStyleManager.h>
 #include <berryWorkbenchPlugin.h>
 
 #include <QmitkChartWidget.h>
 #include <mitkImageStatisticsContainerNodeHelper.h>
 #include <mitkImageStatisticsPredicateHelper.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkIntensityProfile.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateGeometry.h>
 #include <mitkNodePredicateSubGeometry.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateFunction.h>
 #include <mitkSliceNavigationController.h>
 #include <mitkStatusBar.h>
 #include <mitkPlanarFigure.h>
 #include "mitkPlanarFigureMaskGenerator.h"
 
 #include "QmitkImageStatisticsDataGenerator.h"
 
 #include "mitkImageStatisticsContainerManager.h"
 #include <mitkPlanarFigureInteractor.h>
 
 const std::string QmitkImageStatisticsView::VIEW_ID = "org.mitk.views.imagestatistics";
 
 QmitkImageStatisticsView::~QmitkImageStatisticsView()
 {
 }
 
 void QmitkImageStatisticsView::CreateQtPartControl(QWidget *parent)
 {
   m_Controls.setupUi(parent);
   m_Controls.widget_intensityProfile->SetTheme(GetColorTheme());
   m_Controls.groupBox_histogram->setVisible(true);
   m_Controls.groupBox_intensityProfile->setVisible(false);
   m_Controls.label_currentlyComputingStatistics->setVisible(false);
   m_Controls.sliderWidget_histogram->setPrefix("Time: ");
   m_Controls.sliderWidget_histogram->setDecimals(0);
   m_Controls.sliderWidget_histogram->setVisible(false);
   m_Controls.sliderWidget_intensityProfile->setPrefix("Time: ");
   m_Controls.sliderWidget_intensityProfile->setDecimals(0);
   m_Controls.sliderWidget_intensityProfile->setVisible(false);
   ResetGUI();
 
   m_DataGenerator = new QmitkImageStatisticsDataGenerator(parent);
   m_DataGenerator->SetDataStorage(this->GetDataStorage());
   m_DataGenerator->SetAutoUpdate(true);
   m_Controls.widget_statistics->SetDataStorage(this->GetDataStorage());
 
   m_Controls.imageNodesSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.imageNodesSelector->SetNodePredicate(mitk::GetImageStatisticsImagePredicate());
   m_Controls.imageNodesSelector->SetSelectionCheckFunction(this->CheckForSameGeometry());
   m_Controls.imageNodesSelector->SetSelectionIsOptional(false);
   m_Controls.imageNodesSelector->SetInvalidInfo(QStringLiteral("Please select images for statistics"));
   m_Controls.imageNodesSelector->SetPopUpTitel(QStringLiteral("Select input images"));
   m_Controls.roiNodesSelector->SetPopUpHint(QStringLiteral("You may select multiple images for the statistics computation. But all selected images must have the same geometry."));
 
   m_Controls.roiNodesSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.roiNodesSelector->SetNodePredicate(this->GenerateROIPredicate());
   m_Controls.roiNodesSelector->SetSelectionIsOptional(true);
   m_Controls.roiNodesSelector->SetEmptyInfo(QStringLiteral("Please select ROIs"));
   m_Controls.roiNodesSelector->SetPopUpTitel(QStringLiteral("Select ROIs for statistics computation"));
   m_Controls.roiNodesSelector->SetPopUpHint(QStringLiteral("You may select ROIs (e.g. planar figures, segmentations) that should be used for the statistics computation. The statistics will only computed for the image parts defined by the ROIs."));
 
   CreateConnections();
 
   this->m_TimePointChangeListener.RenderWindowPartActivated(this->GetRenderWindowPart());
   connect(&m_TimePointChangeListener, &QmitkSliceNavigationListener::SelectedTimePointChanged, this, & QmitkImageStatisticsView::OnSelectedTimePointChanged);
 }
 
 void QmitkImageStatisticsView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   this->m_TimePointChangeListener.RenderWindowPartActivated(renderWindowPart);
 }
 
 void QmitkImageStatisticsView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   this->m_TimePointChangeListener.RenderWindowPartDeactivated(renderWindowPart);
 }
 
 void QmitkImageStatisticsView::CreateConnections()
 {
   connect(m_Controls.widget_statistics, &QmitkImageStatisticsWidget::IgnoreZeroValuedVoxelStateChanged,
     this, &QmitkImageStatisticsView::OnIgnoreZeroValuedVoxelStateChanged);
   connect(m_Controls.buttonSelection, &QAbstractButton::clicked,
     this, &QmitkImageStatisticsView::OnButtonSelectionPressed);
 
   connect(m_Controls.widget_histogram, &QmitkHistogramVisualizationWidget::RequestHistogramUpdate,
     this, &QmitkImageStatisticsView::OnRequestHistogramUpdate);
 
   connect(m_DataGenerator, &QmitkImageStatisticsDataGenerator::DataGenerationStarted,
     this, &QmitkImageStatisticsView::OnGenerationStarted);
   connect(m_DataGenerator, &QmitkImageStatisticsDataGenerator::GenerationFinished,
     this, &QmitkImageStatisticsView::OnGenerationFinished);
   connect(m_DataGenerator, &QmitkImageStatisticsDataGenerator::JobError,
     this, &QmitkImageStatisticsView::OnJobError);
 
   connect(m_Controls.imageNodesSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkImageStatisticsView::OnImageSelectionChanged);
   connect(m_Controls.roiNodesSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkImageStatisticsView::OnROISelectionChanged);
 
   connect(m_Controls.sliderWidget_intensityProfile, &ctkSliderWidget::valueChanged, this, &QmitkImageStatisticsView::UpdateIntensityProfile);
 }
 
 void QmitkImageStatisticsView::UpdateIntensityProfile()
 {
   m_Controls.groupBox_intensityProfile->setVisible(false);
 
   const auto selectedImageNodes = m_Controls.imageNodesSelector->GetSelectedNodes();
   const auto selectedROINodes = m_Controls.roiNodesSelector->GetSelectedNodes();
 
   if (selectedImageNodes.size()==1 && selectedROINodes.size()==1)
   { //only supported for one image and roi currently
     auto image = dynamic_cast<mitk::Image*>(selectedImageNodes.front()->GetData());
 
     auto maskPlanarFigure = dynamic_cast<mitk::PlanarFigure*>(selectedROINodes.front()->GetData());
 
     if (maskPlanarFigure != nullptr)
     {
       if (!maskPlanarFigure->IsClosed())
       {
         mitk::Image::Pointer inputImage;
         if (image->GetDimension() == 4)
         {
           m_Controls.sliderWidget_intensityProfile->setVisible(true);
           unsigned int maxTimestep = image->GetTimeSteps();
           m_Controls.sliderWidget_intensityProfile->setMaximum(maxTimestep - 1);
           // Intensity profile can only be calculated on 3D, so extract if 4D
           mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
           int currentTimestep = static_cast<int>(m_Controls.sliderWidget_intensityProfile->value());
           timeSelector->SetInput(image);
           timeSelector->SetTimeNr(currentTimestep);
           timeSelector->Update();
 
           inputImage = timeSelector->GetOutput();
         }
         else
         {
           m_Controls.sliderWidget_intensityProfile->setVisible(false);
           inputImage = image;
         }
 
         auto intensityProfile = mitk::ComputeIntensityProfile(inputImage, maskPlanarFigure);
         m_Controls.groupBox_intensityProfile->setVisible(true);
         m_Controls.widget_intensityProfile->Reset();
         m_Controls.widget_intensityProfile->SetIntensityProfile(intensityProfile.GetPointer(),
           "Intensity Profile of " + selectedImageNodes.front()->GetName());
       }
     }
   }
 }
 
 void QmitkImageStatisticsView::UpdateHistogramWidget()
 {
   m_Controls.groupBox_histogram->setVisible(false);
 
   const auto selectedImageNodes = m_Controls.imageNodesSelector->GetSelectedNodes();
   const auto selectedMaskNodes = m_Controls.roiNodesSelector->GetSelectedNodes();
 
   if (selectedImageNodes.size() == 1 && selectedMaskNodes.size()<=1)
   { //currently only supported for one image and roi due to histogram widget limitations.
     auto imageNode = selectedImageNodes.front();
     const mitk::DataNode* roiNode = nullptr;
     const mitk::PlanarFigure* planarFigure = nullptr;
     if (!selectedMaskNodes.empty())
     {
       roiNode = selectedMaskNodes.front();
       planarFigure = dynamic_cast<const mitk::PlanarFigure*>(roiNode->GetData());
     }
 
     if ((planarFigure == nullptr || planarFigure->IsClosed())
         && imageNode->GetData()->GetTimeGeometry()->IsValidTimePoint(m_TimePointChangeListener.GetCurrentSelectedTimePoint()))
     { //if a planar figure is not closed, we show the intensity profile instead of the histogram.
       auto statisticsNode = m_DataGenerator->GetLatestResult(imageNode, roiNode, true);
 
       if (statisticsNode.IsNotNull())
       {
         auto statistics = dynamic_cast<const mitk::ImageStatisticsContainer*>(statisticsNode->GetData());
 
         if (statistics)
         {
           const auto timeStep = imageNode->GetData()->GetTimeGeometry()->TimePointToTimeStep(m_TimePointChangeListener.GetCurrentSelectedTimePoint());
 
           if (statistics->TimeStepExists(timeStep))
           {
             std::stringstream label;
             label << imageNode->GetName();
             if (imageNode->GetData()->GetTimeSteps() > 1)
             {
               label << "[" << timeStep << "]";
             }
 
             if (roiNode)
             {
               label << " with " << roiNode->GetName();
             }
 
             //Hardcoded labels are currently needed because the current histogram widget (and ChartWidget)
-            //do not allow correct removal or sound update/insertion of serveral charts.
+            //do not allow correct removal or sound update/insertion of several charts.
             //only thing that works for now is always to update/overwrite the same data label
             //This is a quick fix for T28223 and T28221
             m_Controls.widget_histogram->SetHistogram(statistics->GetHistogramForTimeStep(timeStep), "histogram");
             m_Controls.groupBox_histogram->setVisible(true);
           }
         }
       }
     }
   }
 }
 
 QmitkChartWidget::ColorTheme QmitkImageStatisticsView::GetColorTheme() const
 {
   ctkPluginContext *context = berry::WorkbenchPlugin::GetDefault()->GetPluginContext();
   ctkServiceReference styleManagerRef = context->getServiceReference<berry::IQtStyleManager>();
   if (styleManagerRef)
   {
     auto styleManager = context->getService<berry::IQtStyleManager>(styleManagerRef);
     if (styleManager->GetStyle().name == "Dark")
     {
       return QmitkChartWidget::ColorTheme::darkstyle;
     }
     else
     {
       return QmitkChartWidget::ColorTheme::lightstyle;
     }
   }
   return QmitkChartWidget::ColorTheme::darkstyle;
 }
 
 void QmitkImageStatisticsView::ResetGUI()
 {
   m_Controls.widget_statistics->Reset();
   m_Controls.widget_statistics->setEnabled(false);
   m_Controls.widget_histogram->Reset();
   m_Controls.widget_histogram->setEnabled(false);
   m_Controls.widget_histogram->SetTheme(GetColorTheme());
 }
 
 void QmitkImageStatisticsView::OnGenerationStarted(const mitk::DataNode* /*imageNode*/, const mitk::DataNode* /*roiNode*/, const QmitkDataGenerationJobBase* /*job*/)
 {
   m_Controls.label_currentlyComputingStatistics->setVisible(true);
 }
 
 void QmitkImageStatisticsView::OnGenerationFinished()
 {
   m_Controls.label_currentlyComputingStatistics->setVisible(false);
 
   mitk::StatusBar::GetInstance()->Clear();
 
   this->UpdateIntensityProfile();
   this->UpdateHistogramWidget();
 }
 
 void QmitkImageStatisticsView::OnSelectedTimePointChanged(const mitk::TimePointType& /*newTimePoint*/)
 {
   this->UpdateHistogramWidget();
 }
 
 void QmitkImageStatisticsView::OnJobError(QString error, const QmitkDataGenerationJobBase* /*failedJob*/)
 {
   mitk::StatusBar::GetInstance()->DisplayErrorText(error.toStdString().c_str());
   MITK_WARN << "Error when calculating statistics: " << error;
 }
 
 void QmitkImageStatisticsView::OnRequestHistogramUpdate(unsigned int nbins)
 {
   m_Controls.widget_statistics->SetHistogramNBins(nbins);
   m_DataGenerator->SetHistogramNBins(nbins);
   this->UpdateIntensityProfile();
   this->UpdateHistogramWidget();
 }
 
 void QmitkImageStatisticsView::OnIgnoreZeroValuedVoxelStateChanged(int state)
 {
   auto ignoreZeroValueVoxel = (state == Qt::Unchecked) ? false : true;
   m_Controls.widget_statistics->SetIgnoreZeroValueVoxel(ignoreZeroValueVoxel);
   m_DataGenerator->SetIgnoreZeroValueVoxel(ignoreZeroValueVoxel);
   this->UpdateIntensityProfile();
   this->UpdateHistogramWidget();
 }
 
 void QmitkImageStatisticsView::OnImageSelectionChanged(QmitkAbstractNodeSelectionWidget::NodeList /*nodes*/)
 {
   auto images = m_Controls.imageNodesSelector->GetSelectedNodesStdVector();
   m_Controls.widget_statistics->SetImageNodes(images);
 
   m_Controls.widget_statistics->setEnabled(!images.empty());
 
   m_Controls.roiNodesSelector->SetNodePredicate(this->GenerateROIPredicate());
 
   m_DataGenerator->SetAutoUpdate(false);
   m_DataGenerator->SetImageNodes(images);
   m_DataGenerator->Generate();
   m_DataGenerator->SetAutoUpdate(true);
 
   this->UpdateHistogramWidget();
   this->UpdateIntensityProfile();
 }
 
 void QmitkImageStatisticsView::OnROISelectionChanged(QmitkAbstractNodeSelectionWidget::NodeList /*nodes*/)
 {
   auto rois = m_Controls.roiNodesSelector->GetSelectedNodesStdVector();
 
   m_Controls.widget_statistics->SetMaskNodes(rois);
 
   m_DataGenerator->SetAutoUpdate(false);
   m_DataGenerator->SetROINodes(rois);
   m_DataGenerator->Generate();
   m_DataGenerator->SetAutoUpdate(true);
 
   this->UpdateHistogramWidget();
   this->UpdateIntensityProfile();
 }
 
 
 void QmitkImageStatisticsView::OnButtonSelectionPressed()
 {
   QmitkNodeSelectionDialog* dialog = new QmitkNodeSelectionDialog(nullptr, "Select input for the statistic","You may select images and ROIs to compute their statistic. ROIs may be segmentations or planar figures.");
   dialog->SetDataStorage(GetDataStorage());
   dialog->SetSelectionCheckFunction(CheckForSameGeometry());
 
   // set predicates
   auto isPlanarFigurePredicate = mitk::GetImageStatisticsPlanarFigurePredicate();
   auto isMaskPredicate = mitk::GetImageStatisticsMaskPredicate();
   auto isImagePredicate = mitk::GetImageStatisticsImagePredicate();
   auto isMaskOrPlanarFigurePredicate = mitk::NodePredicateOr::New(isPlanarFigurePredicate, isMaskPredicate);
   auto isImageOrMaskOrPlanarFigurePredicate = mitk::NodePredicateOr::New(isMaskOrPlanarFigurePredicate, isImagePredicate);
   dialog->SetNodePredicate(isImageOrMaskOrPlanarFigurePredicate);
   dialog->SetSelectionMode(QAbstractItemView::MultiSelection);
   dialog->SetCurrentSelection(m_Controls.imageNodesSelector->GetSelectedNodes()+m_Controls.roiNodesSelector->GetSelectedNodes());
 
   if (dialog->exec())
   {
     auto selectedNodeList = dialog->GetSelectedNodes();
 
     m_Controls.imageNodesSelector->SetCurrentSelection(selectedNodeList);
     m_Controls.roiNodesSelector->SetCurrentSelection(selectedNodeList);
   }
 
   delete dialog;
 }
 
 QmitkNodeSelectionDialog::SelectionCheckFunctionType QmitkImageStatisticsView::CheckForSameGeometry() const
 {
   auto isMaskPredicate = mitk::GetImageStatisticsMaskPredicate();
 
   auto lambda = [isMaskPredicate](const QmitkNodeSelectionDialog::NodeList& nodes)
   {
     if (nodes.empty())
     {
       return std::string();
     }
 
     const mitk::Image* imageNodeData = nullptr;
     for (auto& node : nodes)
     {
       auto castedData = dynamic_cast<const mitk::Image*>(node->GetData());
       if (castedData != nullptr && !isMaskPredicate->CheckNode(node))
       {
         imageNodeData = castedData;
         break;
       }
     }
 
     if (imageNodeData == nullptr)
     {
       std::stringstream ss;
       ss << "<font class=\"warning\"><p>Select at least one image.</p></font>";
       return ss.str();
     }
 
     auto imageGeoPredicate = mitk::NodePredicateGeometry::New(imageNodeData->GetGeometry());
     auto maskGeoPredicate = mitk::NodePredicateSubGeometry::New(imageNodeData->GetGeometry());
 
     for (auto& rightNode : nodes)
     {
       if (imageNodeData != rightNode->GetData())
       {
         bool validGeometry = true;
 
         if (isMaskPredicate->CheckNode(rightNode))
         {
           validGeometry = maskGeoPredicate->CheckNode(rightNode);
         }
         else if (dynamic_cast<const mitk::Image*>(rightNode->GetData()))
         {
           validGeometry = imageGeoPredicate->CheckNode(rightNode);
         }
         else
         {
           const mitk::PlanarFigure* planar2 = dynamic_cast<const mitk::PlanarFigure*>(rightNode->GetData());
           if (planar2)
           {
             validGeometry = mitk::PlanarFigureMaskGenerator::CheckPlanarFigureIsNotTilted(planar2->GetPlaneGeometry(), imageNodeData->GetGeometry());
           }
         }
 
         if (!validGeometry)
         {
           std::stringstream ss;
           ss << "<font class=\"warning\"><p>Invalid selection: All selected nodes must have the same geometry.</p><p>Differing node i.a.: \"";
           ss << rightNode->GetName() <<"\"</p></font>";
           return ss.str();
         }
       }
     }
 
     return std::string();
   };
 
   return lambda;
 }
 
 mitk::NodePredicateBase::Pointer QmitkImageStatisticsView::GenerateROIPredicate() const
 {
   auto isPlanarFigurePredicate = mitk::GetImageStatisticsPlanarFigurePredicate();
   auto isMaskPredicate = mitk::GetImageStatisticsMaskPredicate();
   auto isMaskOrPlanarFigurePredicate = mitk::NodePredicateOr::New(isPlanarFigurePredicate, isMaskPredicate);
 
   mitk::NodePredicateBase::Pointer result = isMaskOrPlanarFigurePredicate.GetPointer();
 
   if(!m_Controls.imageNodesSelector->GetSelectedNodes().empty())
   {
     auto image = m_Controls.imageNodesSelector->GetSelectedNodes().front()->GetData();
     auto imageGeoPredicate = mitk::NodePredicateSubGeometry::New(image->GetGeometry());
 
     auto lambda = [image, imageGeoPredicate](const mitk::DataNode* node)
     {
       bool sameGeometry = true;
 
       if (dynamic_cast<const mitk::Image*>(node->GetData()) != nullptr)
       {
         sameGeometry = imageGeoPredicate->CheckNode(node);
       }
       else
       {
         const auto planar2 = dynamic_cast<const mitk::PlanarFigure*>(node->GetData());
         if (planar2)
         {
           sameGeometry = mitk::PlanarFigureMaskGenerator::CheckPlanarFigureIsNotTilted(planar2->GetPlaneGeometry(), image->GetGeometry());
         }
       }
 
       return sameGeometry;
     };
 
     result = mitk::NodePredicateAnd::New(isMaskOrPlanarFigurePredicate, mitk::NodePredicateFunction::New(lambda)).GetPointer();
   }
 
   return result;
 }
diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h
index 8ae94926fa..83a0bbea8b 100644
--- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h
+++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.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 QmitkMitkWorkbenchIntroPart_h
 #define QmitkMitkWorkbenchIntroPart_h
 
 #include <QtCore/qconfig.h>
 
 #include <berryQtIntroPart.h>
 #include <ui_QmitkWelcomeScreenViewControls.h>
 
 
 /**
  * \ingroup org_mitk_gui_qt_welcomescreen_internal
  * \brief QmitkMitkWorkbenchIntroPart
  * The WelcomeView Module is an helpful feature to people new to MITK. The main idea is to provide first
  * information about the MITK Workbench.
  * The WelcomeView is realized by making use of the QTWebKit Module. The Qt WebKit module
  * provides an HTML browser engine that makes it easy to embed web content into native applications, and to enhance
  * web content with native controls.
  * For the welcome view of the application the QWebView, QWebPage classes have been used. The shown WelcomeView
  * html start page is styled by an external css stylesheet. The required resources as well as the html pages are integrated
  * into the QtResource system. The QT resource system allows the storage of files like html pages, css pages, jpgs etc.
  * as binaries within the executable.
- * This minimizes the risk of loosing resource files as well as the risk of getting files deleted. In order to use the Qt
+ * This minimizes the risk of losing resource files as well as the risk of getting files deleted. In order to use the Qt
  * resource system the resource files have to be added to the associated qrt resource file list.
  *
  * The foundation is set to design more complex html pages. The Q::WebPage gives options to set a
  * LinkDelegationPolicy. The used policy defines how links to external or internal resources are handled. To fit our needs
  * the delegate all links policy is used. This requires all external as well as internal links of the html pages to be handle
  * explicitly. In order to change mitk working modes (perspectives) a mitk url scheme has been designed. The url scheme
  * is set to mitk. The url host provides information about what's next to do. In our case, the case of switching to a
  * particular working mode the host is set to perspectives. The followed path provides information about the perspective id.
  * (e.g. mitk//::mitk.perspectives/org.mitk.qt.defaultperspective) The the generic design of the mitk url scheme allows to
  * execute other task depending on the mitk url host.
  * \sa QmitkWelcomePage Editor
  */
 
 class QmitkMitkWorkbenchIntroPart : public berry::QtIntroPart
 {
 
 // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
   Q_OBJECT
 
 public:
 
   QmitkMitkWorkbenchIntroPart();
  ~QmitkMitkWorkbenchIntroPart() override;
 
   void CreateQtPartControl(QWidget *parent) override;
   void StandbyStateChanged(bool) override;
   void SetFocus() override;
   void ReloadPage();
 
 private:
   void CreateConnections();
   void OnLoadFinished(bool ok);
 
   Ui::QmitkWelcomeScreenViewControls* m_Controls;
 
   class Impl;
   Impl* m_Impl;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox
index e36ba450a7..06ca9f1d18 100644
--- a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox
+++ b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox
@@ -1,67 +1,67 @@
 /**
 \page org_mitk_views_moviemaker The Movie Maker View
 
 \imageMacro{moviemakericon_black.svg,"Icon of the Movie Maker Plugin.",2.00}
 
 \tableofcontents
 
 \section org_mitk_views_moviemakerOverview Overview
 
 The Movie Maker View allows you to create basic animations of your scene and to record them to video files.
 Individual animations are arranged in a timeline and can be played back sequentially or in parallel.
 
 The Movie Maker View uses the external FFmpeg command-line application to write compressed video files.
 
 <b>You must install FFmpeg and set its corresponding path in the "Movie Maker" preferences (Ctrl+P) to be able to record your movies to video files.</b>
 
 \imageMacro{QmitkMovieMaker_Preferences.png,"The Movie Maker preferences page.",12.00}
 
 \section org_mitk_views_moviemakerUsage Usage
 
 \imageMacro{QmitkMovieMaker_MovieMakerView.png,"The Movie Maker View.",16.00}
 
 To create a movie, add an animation to the timeline by clicking the "Add animation" button.
 You can choose between the available types of animations, e.g., Orbit or Slice.
 
-The bottons sourroundng the timeline allow you to arrange, remove, or add further animations to your movie.
+The buttons surroundng the timeline allow you to arrange, remove, or add further animations to your movie.
 
 Each animation can be set to either begin with the previous animation, i.e., run in parallel, or to start after the previous animation, i.e., run sequentially.
 In combination with delays, rather complex animation arrangements are possible.
 
 To set animation specific parameters, select the corresponding animation in the timeline first.
 
 You can play back, pause and stop your movie with the controls at the bottom of the Movie Maker View.
 Click the "Record" button to finally record your movie to a video file with the specified frame rate resp. number of frames per second.
 Choose the render window that you want to record.
 
 By default, movies are recorded into *.webm files using the open and royalty-free VP9 video codec.
 You can switch to the widespread *.mp4 file format using the non-free H.264 video codec in the Movie Maker preferences.
 
 \subsection org_mitk_views_moviemakerOrbitUsage Orbit Animation
 
 The Orbit animation rotates the camera in the 3D window around the scene.
-Align the camera directly in the 3D window and enter the number of degrees for the orbitting.
+Align the camera directly in the 3D window and enter the number of degrees for the orbiting.
 If you are planning to have a specific view in the middle of your movie you can play the movie and pause it at the specific frame of interest.
 Adjust the camera in the 3D window and restart the animation.
 
 \imageMacro{QmitkMovieMaker_Orbit.png,"The Orbit animation.",12.00}
 
 \subsection org_mitk_views_moviemakerSliceUsage Slice Animation
 
 The Slice animation slices through an image.
 You can choose the image plane (axial, sagittal, or coronal), as well as the start and end points of the slicing.
 Look at the Image Navigator View to get an idea of the desired values.
 Toggle "Reverse" to slice from the higher slice number to the lower slice number.
 
 \imageMacro{QmitkMovieMaker_Slice.png,"The Slice animation.",12.00}
 
 \subsection org_mitk_views_moviemakerTimeUsage Time Animation
 
 The Time animation steps through the individual time steps of the current scene.
 You can specify the range of the animated time steps.
 Look at the Image Navigator View to get an idea of the desired values.
 Toggle "Reverse" to step from later time steps to previous time steps.
 
 \imageMacro{QmitkMovieMaker_Time.gif,"The Time animation.",12.00}
 
 */
diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.cpp
index 22adac61e4..81fdc308ee 100644
--- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.cpp
+++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.cpp
@@ -1,512 +1,512 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkScreenshotMaker.h"
 //#include "QmitkMovieMakerControls.h"
 #include "QmitkStepperAdapter.h"
 
 #include "mitkVtkPropRenderer.h"
 #include <QmitkRenderWindow.h>
 #include <QmitkRenderWindowWidget.h>
 
 #include <iostream>
 
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 
 #include <QAction>
 #include <QFileDialog>
 #include <QTimer>
 #include <QDateTime>
 #include <QSpinBox>
 #include <QComboBox>
 #include <QColor>
 #include <QColorDialog>
 
 #include <QApplication>
 
 #include "vtkImageWriter.h"
 #include "vtkJPEGWriter.h"
 #include "vtkPNGWriter.h"
 #include "vtkRenderLargeImage.h"
 #include "vtkRenderWindowInteractor.h"
 #include "vtkRenderer.h"
 #include "vtkTestUtilities.h"
 
 #include <vtkActor.h>
 #include "vtkMitkRenderProp.h"
 
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 #include "vtkRenderWindowInteractor.h"
 #include <qradiobutton.h>
 
 #include "mitkSliceNavigationController.h"
 #include "mitkPlanarFigure.h"
 #include <mitkWorkbenchUtil.h>
 #include <mitkImage.h>
 #include <itksys/SystemTools.hxx>
 
 QmitkScreenshotMaker::QmitkScreenshotMaker(QObject *parent, const char * /*name*/)
   : QmitkAbstractView(),
     m_Controls(nullptr),
     m_BackgroundColor(QColor(0,0,0)),
     m_SelectedNode(nullptr)
 {
   parentWidget = parent;
 }
 
 QmitkScreenshotMaker::~QmitkScreenshotMaker()
 {
 }
 
 void QmitkScreenshotMaker::CreateConnections()
 {
   if (m_Controls)
   {
     connect((QObject*) m_Controls->m_AllViews, SIGNAL(clicked()), (QObject*) this, SLOT(GenerateMultiplanar3DHighresScreenshot()));
     connect((QObject*) m_Controls->m_Shot, SIGNAL(clicked()), (QObject*) this, SLOT(GenerateMultiplanarScreenshots()));
     connect((QObject*) m_Controls->m_BackgroundColor, SIGNAL(clicked()), (QObject*) this, SLOT(SelectBackgroundColor()));
     connect((QObject*) m_Controls->btnScreenshot, SIGNAL(clicked()), this, SLOT(GenerateScreenshot()));
     connect((QObject*) m_Controls->m_HRScreenshot, SIGNAL(clicked()), this, SLOT(Generate3DHighresScreenshot()));
 
     QString styleSheet = "background-color:rgb(0,0,0)";
     m_Controls->m_BackgroundColor->setStyleSheet(styleSheet);
   }
 }
 
 mitk::DataNode::Pointer QmitkScreenshotMaker::GetTopLayerNode()
 {
   mitk::DataNode::Pointer out = nullptr;
 
   int layer = -1;
   auto nodes = GetDataStorage()->GetAll();
   for (auto node = nodes->begin(); node!=nodes->end(); ++node)
   {
     if (!(*node)->IsVisible(nullptr))
       continue;
     int current_layer;
     (*node)->GetIntProperty("layer", current_layer);
     if (current_layer>layer)
     {
       out = (*node);
       layer = current_layer;
     }
   }
 
   return out;
 }
 
 void QmitkScreenshotMaker::MultichannelScreenshot(mitk::VtkPropRenderer* renderer, QString fileName, QString filter)
 {
   auto node = GetTopLayerNode();
   if (node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()))
   {
     auto image = dynamic_cast<mitk::Image*>(node->GetData());
 
     std::string fname = itksys::SystemTools::GetFilenamePath(fileName.toStdString()) + "/" + itksys::SystemTools::GetFilenameWithoutExtension(fileName.toStdString());
     std::string ext = itksys::SystemTools::GetFilenameExtension(fileName.toStdString());
 
     mitk::PixelType chPixelType = image->GetImageDescriptor()->GetChannelTypeById(0);
     if (image->GetDimension() == 4)
     {
-      MITK_INFO << "LOOPING THROUGH FOURTH DIMESNION IS NOT IMPLEMENTED";
+      MITK_INFO << "LOOPING THROUGH FOURTH DIMENSION IS NOT IMPLEMENTED";
     }
     else if (chPixelType.GetNumberOfComponents()>1)
     {
       for(int unsigned c=0; c<chPixelType.GetNumberOfComponents(); ++c)
       {
         node->SetProperty("Image.Displayed Component", mitk::IntProperty::New(c));
         this->TakeScreenshot(renderer->GetVtkRenderer(), 1, QString(fname.c_str()) + "_" + QString::number(c) + QString(ext.c_str()), filter);
       }
     }
     else
       this->TakeScreenshot(renderer->GetVtkRenderer(), 1, fileName, filter);
   }
   else
     this->TakeScreenshot(renderer->GetVtkRenderer(), 1, fileName, filter);
 }
 
 void QmitkScreenshotMaker::GenerateScreenshot()
 {
   if (m_LastFile.size()==0)
     m_LastFile = QDir::currentPath()+"/screenshot.png";
 
   QString filter;
   QString fileName = QFileDialog::getSaveFileName(nullptr, "Save screenshot to...", m_LastFile, m_PNGExtension + ";;" + m_JPGExtension, &filter);
 
   if (fileName.size()>0)
     m_LastFile = fileName;
 
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
 
   auto* renderer = renderWindowPart->GetQmitkRenderWindow(m_Controls->m_DirectionBox->currentText())->GetRenderer();
   if (renderer == nullptr)
     return;
 
   if (m_Controls->m_AllChannelsBox->isChecked())
     MultichannelScreenshot(renderer, fileName, filter);
   else
     this->TakeScreenshot(renderer->GetVtkRenderer(), 1, fileName, filter);
 }
 
 void QmitkScreenshotMaker::GenerateMultiplanarScreenshots()
 {
   if (m_LastPath.size()==0)
     m_LastPath = QDir::currentPath();
   QString filePath = QFileDialog::getExistingDirectory(nullptr, "Save screenshots to...", m_LastPath);
   if (filePath.size()>0)
     m_LastPath = filePath;
 
   if( filePath.isEmpty() )
   {
     return;
   }
 
   //emit StartBlockControls();
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
   renderWindowPart->EnableDecorations(false, QStringList{mitk::IRenderWindowPart::DECORATION_CORNER_ANNOTATION});
 
   auto windowCount = m_Controls->m_DirectionBox->count();
   for (int i = 0; i < windowCount; ++i)
   {
     auto windowName = m_Controls->m_DirectionBox->itemText(i);
     QString fileName = QDir::separator() + windowName + QString::fromStdString(".png");
     int c = 1;
     while (QFile::exists(filePath + fileName))
     {
       fileName = QDir::separator() + windowName + QString::fromStdString("_");
       fileName += QString::number(c);
       fileName += ".png";
       c++;
     }
     vtkRenderer* renderer = renderWindowPart->GetQmitkRenderWindow(windowName)->GetRenderer()->GetVtkRenderer();
     if (renderer != nullptr)
     {
       if (m_Controls->m_AllChannelsBox->isChecked())
         MultichannelScreenshot(renderWindowPart->GetQmitkRenderWindow(windowName)->GetRenderer(), filePath + fileName, m_PNGExtension);
       else
         this->TakeScreenshot(renderer, 1, filePath + fileName);
     }
   }
 
   /// TODO I do not find a simple way of doing this through the render window part API,
   /// however, I am also not convinced that this code is needed at all. The colour
   /// of the crosshair planes is never set to any colour other than these.
   /// I suggest a new 'mitk::DataNode* mitk::ILinkedRendererPart::GetSlicingPlane(const std::string& name) const'
   /// function to introduce that could return the individual ("axial", "sagittal" or
   /// "coronal" crosshair planes.
 
   //    mitk::DataNode* n = renderWindowPart->GetSlicingPlane("axial");
   //    if (n)
   //    {
   //        n->SetProperty( "color", mitk::ColorProperty::New( 1,0,0 ) );
   //    }
   //
   //    n = renderWindowPart->GetSlicingPlane("sagittal");
   //    if (n)
   //    {
   //        n->SetProperty( "color", mitk::ColorProperty::New( 0,1,0 ) );
   //    }
   //
   //    n = renderWindowPart->GetSlicingPlane("coronal");
   //    if (n)
   //    {
   //        n->SetProperty( "color", mitk::ColorProperty::New( 0,0,1 ) );
   //    }
 
   renderWindowPart->EnableDecorations(true, QStringList{mitk::IRenderWindowPart::DECORATION_CORNER_ANNOTATION});
 }
 
 void QmitkScreenshotMaker::Generate3DHighresScreenshot()
 {
   if (m_LastFile.size()==0)
     m_LastFile = QDir::currentPath()+"/3D_screenshot.png";
 
   QString filter;
   QString fileName = QFileDialog::getSaveFileName(nullptr, "Save screenshot to...", m_LastFile, m_PNGExtension + ";;" + m_JPGExtension, &filter);
 
   if (fileName.size()>0)
     m_LastFile = fileName;
   GenerateHR3DAtlasScreenshots(fileName, filter);
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkScreenshotMaker::GenerateMultiplanar3DHighresScreenshot()
 {
   if (m_LastPath.size()==0)
     m_LastPath = QDir::currentPath();
   QString filePath = QFileDialog::getExistingDirectory( nullptr, "Save screenshots to...", m_LastPath);
   if (filePath.size()>0)
     m_LastPath = filePath;
 
   if( filePath.isEmpty() )
   {
     return;
   }
 
   QString fileName = "/3D_View1.png";
   int c = 1;
   while (QFile::exists(filePath+fileName))
   {
     fileName = QString("/3D_View1_");
     fileName += QString::number(c);
     fileName += ".png";
     c++;
   }
   GetCam()->Azimuth( -7.5 );
   GetCam()->Roll(-4);
   GenerateHR3DAtlasScreenshots(filePath+fileName);
   GetCam()->Roll(4);
 
   fileName = "/3D_View2.png";
   c = 1;
   while (QFile::exists(filePath+fileName))
   {
     fileName = QString("/3D_View2_");
     fileName += QString::number(c);
     fileName += ".png";
     c++;
   }
   GetCam()->Azimuth( 90 );
   GetCam()->Elevation( 4 );
   GenerateHR3DAtlasScreenshots(filePath+fileName);
 
   fileName = "/3D_View3.png";
   c = 1;
   while (QFile::exists(filePath+fileName))
   {
     fileName = QString("/3D_View3_");
     fileName += QString::number(c);
     fileName += ".png";
     c++;
   }
   GetCam()->Elevation( 90 );
   GetCam()->Roll( -2.5 );
   GenerateHR3DAtlasScreenshots(filePath+fileName);
 
   GetCam()->Roll( 2.5 );
   // not negative because direction of elevation has flipped
   GetCam()->Elevation( 94 );
   GetCam()->Azimuth( -82.5 );
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkScreenshotMaker::GenerateHR3DAtlasScreenshots(QString fileName, QString filter)
 {
   // only works correctly for 3D RenderWindow
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
   auto* renderer = renderWindowPart->GetQmitkRenderWindow("3d")->GetRenderer()->GetVtkRenderer();
 
   if (nullptr != renderer)
   {
     renderWindowPart->EnableDecorations(false);
     this->TakeScreenshot(renderer, this->m_Controls->m_MagFactor->text().toFloat(), fileName, filter);
     renderWindowPart->EnableDecorations(true);
   }
 }
 
 vtkCamera* QmitkScreenshotMaker::GetCam()
 {
   auto* renderer = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetQmitkRenderWindow("3d")->GetRenderer();
   vtkCamera* cam = nullptr;
   const mitk::VtkPropRenderer *propRenderer = dynamic_cast<const mitk::VtkPropRenderer * >( renderer );
   if (propRenderer)
   {
     // get vtk renderer
     vtkRenderer* vtkrenderer = propRenderer->GetVtkRenderer();
     if (vtkrenderer)
     {
       // get vtk camera
       vtkCamera* vtkcam = vtkrenderer->GetActiveCamera();
       if (vtkcam)
       {
         // vtk smart pointer handling
         cam = vtkcam;
         cam->Register( nullptr );
       }
     }
   }
   return cam;
 }
 
 void QmitkScreenshotMaker::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*part*/, const QList<mitk::DataNode::Pointer>& nodes)
 {
   if(nodes.size())
     m_SelectedNode = nodes[0];
 }
 
 void QmitkScreenshotMaker::UpdateDirectionBox(mitk::IRenderWindowPart* renderWindowPart)
 {
   m_Controls->m_DirectionBox->clear();
 
   auto renderWindows = renderWindowPart->GetQmitkRenderWindows();
   bool has3DWindow = false;
   for (auto name : renderWindows.keys())
   {
     auto window = renderWindows[name];
     if (window->GetRenderer()->GetMapperID() == mitk::BaseRenderer::Standard3D)
     {
       has3DWindow = true;
     }
     else
     {
       auto windowName = name;
       auto renderWindowWidget = dynamic_cast<QmitkRenderWindowWidget*>(window->parentWidget());
       if (renderWindowWidget)
       {
         windowName = QString::fromStdString(renderWindowWidget->GetCornerAnnotationText());
       }
       m_Controls->m_DirectionBox->insertItem(m_Controls->m_DirectionBox->count() + 1, windowName);
     }
   }
 
   renderWindows = renderWindowPart->GetQmitkRenderWindows();
 
   m_Controls->groupBox->setEnabled(has3DWindow);
 }
 
 void QmitkScreenshotMaker::CreateQtPartControl(QWidget *parent)
 {
   if (!m_Controls)
   {
     m_Parent = parent;
     m_Controls = new Ui::QmitkScreenshotMakerControls;
     m_Controls->setupUi(parent);
 
     auto renderWindowPart = this->GetRenderWindowPart();
     if (renderWindowPart)
     {
       this->UpdateDirectionBox(renderWindowPart);
     }
 
     // Initialize "Selected Window" combo box
     const mitk::RenderingManager::RenderWindowVector rwv =
         mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows();
 
   }
 
   this->CreateConnections();
 
 }
 
 void QmitkScreenshotMaker::SetFocus()
 {
   m_Controls->btnScreenshot->setFocus();
 }
 
 void QmitkScreenshotMaker::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   m_Parent->setEnabled(true);
   this->UpdateDirectionBox(renderWindowPart);
 }
 
 void QmitkScreenshotMaker::RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart)
 {
   this->UpdateDirectionBox(renderWindowPart);
 }
 
 void QmitkScreenshotMaker::RenderWindowPartDeactivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
 {
   m_Parent->setEnabled(false);
   m_Controls->m_DirectionBox->clear();
 }
 
 void QmitkScreenshotMaker::TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName, QString filter)
 {
   if ((renderer == nullptr) ||(magnificationFactor < 1) || fileName.isEmpty())
     return;
 
   bool doubleBuffering( renderer->GetRenderWindow()->GetDoubleBuffer() );
   renderer->GetRenderWindow()->DoubleBufferOff();
 
   vtkImageWriter* fileWriter = nullptr;
 
   QFileInfo fi(fileName);
   QString suffix = fi.suffix().toLower();
 
   if (suffix.isEmpty() || (suffix != "png" && suffix != "jpg" && suffix != "jpeg"))
   {
     if (filter == m_PNGExtension)
     {
       suffix = "png";
     }
     else if (filter == m_JPGExtension)
     {
       suffix = "jpg";
     }
     fileName += "." + suffix;
   }
 
   if (suffix.compare("jpg", Qt::CaseInsensitive) == 0 || suffix.compare("jpeg", Qt::CaseInsensitive) == 0)
   {
     vtkJPEGWriter* w = vtkJPEGWriter::New();
     w->SetQuality(100);
     w->ProgressiveOff();
     fileWriter = w;
   }
   else //default is png
   {
     fileWriter = vtkPNGWriter::New();
   }
 
   vtkRenderLargeImage* magnifier = vtkRenderLargeImage::New();
   magnifier->SetInput(renderer);
   magnifier->SetMagnification(magnificationFactor);
   //magnifier->Update();
   fileWriter->SetInputConnection(magnifier->GetOutputPort());
   fileWriter->SetFileName(fileName.toLatin1());
 
   // vtkRenderLargeImage has problems with different layers, therefore we have to
   // temporarily deactivate all other layers.
   // we set the background to white, because it is nicer than black...
   double oldBackground[3];
   renderer->GetBackground(oldBackground);
 
 
   //  QColor color = QColorDialog::getColor();
   double bgcolor[] = {m_BackgroundColor.red()/255.0, m_BackgroundColor.green()/255.0, m_BackgroundColor.blue()/255.0};
   renderer->SetBackground(bgcolor);
 
   mitk::IRenderWindowPart* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
 
   renderWindowPart->EnableDecorations(false);
 
   fileWriter->Write();
   fileWriter->Delete();
 
   renderWindowPart->EnableDecorations(true);
 
   renderer->SetBackground(oldBackground);
 
   renderer->GetRenderWindow()->SetDoubleBuffer(doubleBuffering);
 }
 
 void QmitkScreenshotMaker::SelectBackgroundColor()
 {
   m_BackgroundColor = QColorDialog::getColor();
 
   m_Controls->m_BackgroundColor->setAutoFillBackground(true);
 
 
   QString styleSheet = "background-color:rgb(";
   styleSheet.append(QString::number(m_BackgroundColor.red()));
   styleSheet.append(",");
   styleSheet.append(QString::number(m_BackgroundColor.green()));
   styleSheet.append(",");
   styleSheet.append(QString::number(m_BackgroundColor.blue()));
   styleSheet.append(")");
   m_Controls->m_BackgroundColor->setStyleSheet(styleSheet);
 }
diff --git a/Plugins/org.mitk.gui.qt.overlaymanager/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.overlaymanager/documentation/doxygen/modules.dox
index 82586ab590..1fdb12fbbf 100644
--- a/Plugins/org.mitk.gui.qt.overlaymanager/documentation/doxygen/modules.dox
+++ b/Plugins/org.mitk.gui.qt.overlaymanager/documentation/doxygen/modules.dox
@@ -1,16 +1,16 @@
 /**
   \defgroup org_mitk_gui_qt_overlaymanager org.mitk.gui.qt.overlaymanager
   \ingroup MITKPlugins
 
-  \brief This is the overlaymanager plugin. Annotations that have been addded to the OverlayManager can be viewed and modified. The plugin also allows to add new annotations.
+  \brief This is the overlaymanager plugin. Annotations that have been added to the OverlayManager can be viewed and modified. The plugin also allows to add new annotations.
 
 */
 
 /**
   \defgroup org_mitk_gui_qt_overlaymanager_internal Internal
   \ingroup org_mitk_gui_qt_overlaymanager
 
   \brief This subcategory includes the internal classes of the org.mitk.gui.qt.overlaymanager plugin. Other
   plugins must not rely on these classes. They contain implementation details and their interface
   may change at any time. We mean it.
 */
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/documentation/UserManual/Manual.dox
index 1ed993e8e2..dc7a2ebaa9 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/documentation/UserManual/Manual.dox
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/documentation/UserManual/Manual.dox
@@ -1,105 +1,103 @@
 /**
 
 \page org_mitk_views_pharmacokinetics_mri The DCE MR Perfusion DataFit View
 
 
 \imageMacro{pharmacokinetics_mri_doc.svg,"Icon of the DCE MR Perfusion View",3.0}
 
 \tableofcontents
 
 \section FIT_DCE_Introduction Introduction
 In dynamic contrast-enhanced (DCE) MRI, pharmacokinetic (PK) modeling can be used to quantify tissue physiology.
 Parameters describing the tissue microvasculature can be derived by fitting a pharmacokinetic model, e.g. a compartment model, to the dynamic data.
 This view offers a comprehensive set of tools to perform pharmacokinetic analysis.
 
 \section FIT_DCE_Contact Contact information
 If you have any questions, need support, find a bug or have a feature request, feel free to contact us at www.mitk.org.
 
 \subsection FIT_DCE_Cite Citation information
 If you use the view for your research please cite our work as reference:\n\n
 Debus C and Floca R, Ingrisch M, Kompan I, Maier-Hein K, Abdollahi A, Nolden M, <i>MITK-ModelFit: generic open-source framework for model fits and their exploration in medical imaging – design, implementation and application on the example of DCE-MRI</i>. https://doi.org/10.1186/s12859-018-2588-1 (BMC Bioinformatics 2019 20:31)
 
 \section FIT_DCE_Data_and_ROI_Selection Time series and mask selection
 \imageMacro{dce_mri_maskAndFittingStrategy.png, "Time series and mask selection.", 10}
 In principle, every model can be fitted on the entire image. However, for model configuration reasons (e.g. AIF required) and computational time cost, this is often not advisable.
 Therefore, apart from the image to be fitted (<i>Selected Time Series</i>), a ROI segmentation can be defined (<i>Selected Mask</i>), within which model fitting is performed.
 The view currently offers <i>Pixel based</i> and/or <i>ROI based</i> averaged fits of time-varying curves. The <i>ROI based</i> fitting option becomes enabled, if a mask is selected.
 
 
 \section FIT_DCE_General_models Supported models
 Currently the following pharmacokinetic models for gadolinium-based contrast agent are available:
 -	The Descriptive Brix model \ref FIT_DCE_lit_ref1 "[1]"
--	A semi-quantitative two/three segment linear model (2SL/3SL)
 -	The standard tofts model \ref FIT_DCE_lit_ref2 "[2]"
 -	The extended Tofts model \ref FIT_DCE_lit_ref3 "[3]"
 -	The two compartment exchange model (2CXM) \ref FIT_DCE_lit_ref4 "[4, 5]"
 
 \section FIT_DCE_Settings Model settings
 \imageMacro{dce_mri_modelSettings.png, "Model settings of the view for the standard Tofts model.", 10}
 
 \subsection FIT_DCE_Settings_model Model specific settings
 Selecting one of the \ref FIT_DCE_General_models "supported models" will open below tabs for further configuration of the model.
 - The descriptive Brix model requires only definition of the duration of the bolus, i.e. the overall time of the injection (<i>Injection Time [min]</i>).
-- The 3SL is a semi-quantitative descriptive model that distinguishes three different segments of the signal: A constant baseline, the initial fast rise (wash-in) and the final slow rise / signal decrease (washout). Each of these segments is approximated by a linear curve, with change points in-between. It requires no further configuration.
 - The standard Tofts model, the extended Tofts model and the 2CXM are compartment models that require the input of the concentration time curve in the tissue feeding artery, the arterial input function (AIF).
 In the DCE MR Perfusion Datafit View, the arterial input function can be defined in several ways. For patient individual image derived AIFs, select the radio button <i>Select AIF from Image</i>.
 In that case, a segmentation ROI for the artery has to be selected. This can be done by clicking on the <i>AIF Mask</i> selection widget and selecting a suitable AIF segmentation from the data loaded in the Data Manager. In cases where the respective artery does not lie in the same image as the investigated tissue (e.g. in animal experiments, where a slice through the heart is used for AIF extraction), a dedicated AIF image can be selected using the corresponding <i>Dedicated AIF image</i> selection widget.
 An alternative option is to define the AIF via an external file by selecting <i>Select AIF from File</i> (e.g. for population derived AIFs or AIFs from blood sampling). By clicking the <i>Browse</i> button, one can select a csv file that holds the AIF values and corresponding timepoints (in tuple format (Time, Value)).
 Caution: the file must not contain a header line, but the first line must start with Time and Intensity values.
 Furthermore, the <i>Hematocrit Level</i> has to be set (from 0 to 1) for conversion from whole blood to plasma concentration. It is set as default to the literature value of 0.45.
 
 \subsection FIT_DCE_Settings_start Start parameter
 \imageMacro{dce_mri_start.png, "Example screenshot for start parameter settings.", 10}
 In cases of noisy data it can be useful to define the initial starting values of the parameter estimates, at which optimization starts, in order to prevent optimization results in local optima.
 Each model has default scalar values (applied to every voxel) for initial values of each parameter, however these can be adjusted.
 Moreover, initial values can also be defined locally for each individual voxel via starting value images. To load a starting value image, change the <i>Type</i> from <i>scalar</i> to <i>image</i>. This can be done by double-clicking on the type cell.
 In the <i>Value</i> column, selection of a starting value image will be available.
 
 \subsection FIT_DCE_Settings_constraint Constraints settings
 \imageMacro{dce_mri_constraints.png, "Example screenshot for constraints settings.", 10}
 To limit the fitting search space and to exclude unphysical/illogical results for model parameter estimates, constraints to individual parameters as well as combinations can be imposed.
 Each model has default constraints, however, new ones can be defined or removed by the + and – buttons in the table.
 The first column specifies the parameter(s) involved in the constraint (if multiple parameters are selected, their sum will be used) by selection in the drop down menu.
 The second column <i>Type</i> defines whether the constraint defines an upper or lower boundary.
 <i>Value</i> defines the actual constraint value, that should not be crossed, and <i>Width</i> allows for a certain tolerance width.
 
 \subsection FIT_DCE_Settings_concentration Signal to concentration conversion settings
 \imageMacro{dce_mri_concentration.png, "Example screenshot for concentration conversion settings.", 10}
 Most models require contrast agent concentration values as input rather than raw signal intensities (i.e. all compartment models).
 The DCE MR Perfusion DataFit View offers a variety of tools for the conversion from signal to concentration:
 by means of relative and absolute signal enhancement, via a T1-map calculated by the variable flip angle method, as well as a special conversion for turbo flash sequences.
 A more detailed description of these conversion methods, for example the exact formulas used for the absolute and relative signal enhancement calculations, can be found here: \ref org_mitk_views_pharmacokinetics_concentration_mri.
 For the conversion methods, a baseline image prior to contrast agent arrival is required.
 In many data sets, multiple baseline images are available. The <i>Baseline Range Selection</i> allows for selection of a range of time frames, from which the average image (along the time dimension) is calculated and set as baseline input image.
 Remark: The number of the first time frame is 0.
 
 \section FIT_DCE_Fitting Executing a fit
 
 In order to distinguish results from different model fits to the data, a <i>Fitting name</i> can be defined.
 As default, the name of the model and the fitting strategy (pixel/ROI) are given. This name will then be appended by the respective parameter name.\n\n
 
 For development purposes and evaluation of the fits, the option <i>Generate debug parameter images</i> is available.
 Enabling this option will result in additional parameter maps displaying the status of the optimizer at fit termination.
 In the following definitions, an <i>evaluation</i> describes the process of cost function calculation and evaluation by the optimizer for a given parameter set.
 
 - <i>Stop condition</i>: Reasons for the fit termination, i.e. criterion reached, maximum number of iterations,...
 - <i>Optimization time</i>: The overall time from fitting start to termination.
 - <i>Number of iterations</i>: The number of iterations from fitting start to termination.
 - <i>Constraint penalty ratio</i>: Ratio between evaluations that were penalized and all evaluations. 0.0 means no evaluation was penalized; 1.0 all evaluations were. Evaluations that hit the failure threshold count as penalized, too.
 - <i>Constraint last failed parameter</i>: Ratio between evaluations that were beyond the failure threshold. 0.0 means no evaluation was a failure (but some may be penalized).
 - <i>Constraint failure ratio</i>: Index of the first (in terms of index position) parameter, which failed the constraints in the last evaluation.
 
 After all necessary configurations are set, the button <i>Start Modelling</i> is enabled, which starts the fitting routine.
 Progress can be seen in the message box on the bottom. Resulting parameter maps will afterwards be added to the Data Manager as sub-nodes of the analyzed 4D image.
 
 \section FIT_DCE_lit References/Literature
 - \anchor FIT_DCE_lit_ref1 [1] Brix G, Semmler W, Port R, Schad LR, Layer G, Lorenz WJ. Pharmacokinetic parameters in CNS Gd-DTPA enhanced MR imaging. J Comput Assist Tomogr. 1991;15:621–8.
 - \anchor FIT_DCE_lit_ref2 [2] Tofts PS, Kermode AG. Measurement of the blood-brain barrier permeability and leakage space using dynamic MR imaging. 1. Fundamental concepts. Magn Reson Med. 1991;17:357–67.
 - \anchor FIT_DCE_lit_ref3 [3] Sourbron SP, Buckley DL. On the scope and interpretation of the Tofts models for DCE-MRI. Magn Reson Med. 2011;66:735–45.
 - \anchor FIT_DCE_lit_ref4 [4] Brix G, Kiessling F, Lucht R, Darai S, Wasser K, Delorme S, et al. Microcirculation and microvasculature in breast tumors: Pharmacokinetic analysis of dynamic MR image series. Magn Reson Med. 2004;52:420–9.
 - \anchor FIT_DCE_lit_ref5 [5] Sourbron, Buckley. Tracer kinetic modelling in MRI: estimating perfusion and capillary permeability - pdf. Phys Med Biol. 2012. https://iopscience.iop.org/article/10.1088/0031-9155/57/2/R1/pdf. Accessed 1 May 2016.
 
 
 
 */
 
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.cpp b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.cpp
index 5158170817..95b4584c78 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.cpp
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.cpp
@@ -1,1485 +1,1362 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "MRPerfusionView.h"
 
 #include "boost/tokenizer.hpp"
 #include "boost/math/constants/constants.hpp"
 #include <iostream>
 
 #include "mitkWorkbenchUtil.h"
 
 #include "mitkAterialInputFunctionGenerator.h"
 #include "mitkConcentrationCurveGenerator.h"
 
 #include <mitkDescriptivePharmacokineticBrixModelFactory.h>
 #include <mitkDescriptivePharmacokineticBrixModelParameterizer.h>
 #include <mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h>
-#include "mitkThreeStepLinearModelFactory.h"
-#include "mitkThreeStepLinearModelParameterizer.h"
-#include "mitkTwoStepLinearModelFactory.h"
-#include "mitkTwoStepLinearModelParameterizer.h"
 #include <mitkExtendedToftsModelFactory.h>
 #include <mitkExtendedToftsModelParameterizer.h>
 #include <mitkStandardToftsModelFactory.h>
 #include <mitkStandardToftsModelParameterizer.h>
 #include "mitkTwoCompartmentExchangeModelFactory.h"
 #include "mitkTwoCompartmentExchangeModelParameterizer.h"
-#include "mitkNumericTwoCompartmentExchangeModelFactory.h"
-#include "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
 #include <mitkInitialParameterizationDelegateBase.h>
 
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateDimension.h>
 #include "mitkNodePredicateFunction.h"
 #include <mitkPixelBasedParameterFitImageGenerator.h>
 #include <mitkROIBasedParameterFitImageGenerator.h>
 #include <mitkLevenbergMarquardtModelFitFunctor.h>
 #include <mitkSumOfSquaredDifferencesFitCostFunction.h>
 #include <mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 #include <mitkModelFitResultHelper.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkMaskedDynamicImageStatisticsGenerator.h>
 #include <mitkExtractTimeGrid.h>
 #include <mitkModelFitResultRelationRule.h>
 
 #include <QMessageBox>
 #include <QThreadPool>
 #include <QFileDialog>
 
 
 // Includes for image casting between ITK and MITK
 #include <mitkImage.h>
 #include "mitkImageCast.h"
 #include "mitkITKImageImport.h"
 #include <itkImage.h>
 #include <itkImageRegionIterator.h>
 
 
 
 
 const std::string MRPerfusionView::VIEW_ID = "org.mitk.views.pharmacokinetics.mri";
 
 inline double convertToDouble(const std::string& data)
 {
   std::istringstream stepStream(data);
   stepStream.imbue(std::locale("C"));
   double value = 0.0;
 
   if (!(stepStream >> value) || !(stepStream.eof()))
   {
     mitkThrow() << "Cannot convert string to double. String: " << data;
   }
   return value;
 }
 
 void MRPerfusionView::SetFocus()
 {
   m_Controls.btnModelling->setFocus();
 }
 
 void MRPerfusionView::CreateQtPartControl(QWidget* parent)
 {
   m_Controls.setupUi(parent);
 
   m_Controls.btnModelling->setEnabled(false);
 
   this->InitModelComboBox();
 
   m_Controls.timeSeriesNodeSelector->SetNodePredicate(this->m_isValidTimeSeriesImagePredicate);
   m_Controls.timeSeriesNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.timeSeriesNodeSelector->SetSelectionIsOptional(false);
   m_Controls.timeSeriesNodeSelector->SetInvalidInfo("Please select time series.");
   m_Controls.timeSeriesNodeSelector->SetAutoSelectNewNodes(true);
 
   m_Controls.maskNodeSelector->SetNodePredicate(this->m_IsMaskPredicate);
   m_Controls.maskNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.maskNodeSelector->SetSelectionIsOptional(true);
   m_Controls.maskNodeSelector->SetEmptyInfo("Please select (optional) mask.");
   connect(m_Controls.btnModelling, SIGNAL(clicked()), this, SLOT(OnModellingButtonClicked()));
 
   connect(m_Controls.comboModel, SIGNAL(currentIndexChanged(int)), this, SLOT(OnModellSet(int)));
   connect(m_Controls.radioPixelBased, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.timeSeriesNodeSelector,
           &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
           this,
           &MRPerfusionView::OnNodeSelectionChanged);
 
   connect(m_Controls.maskNodeSelector,
     &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this,
     &MRPerfusionView::OnNodeSelectionChanged);
 
   connect(m_Controls.AIFMaskNodeSelector,
     &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this,
     &MRPerfusionView::UpdateGUIControls);
 
   connect(m_Controls.AIFImageNodeSelector,
     &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
     this,
     &MRPerfusionView::UpdateGUIControls);
 
   //AIF setting
   m_Controls.groupAIF->hide();
   m_Controls.btnAIFFile->setEnabled(false);
   m_Controls.btnAIFFile->setEnabled(false);
   m_Controls.radioAIFImage->setChecked(true);
   m_Controls.AIFMaskNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.AIFMaskNodeSelector->SetNodePredicate(m_IsMaskPredicate);
   m_Controls.AIFMaskNodeSelector->setVisible(true);
   m_Controls.AIFMaskNodeSelector->setEnabled(true);
   m_Controls.AIFMaskNodeSelector->SetAutoSelectNewNodes(true);
   m_Controls.AIFImageNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.AIFImageNodeSelector->SetNodePredicate(this->m_isValidTimeSeriesImagePredicate);
   m_Controls.AIFImageNodeSelector->setEnabled(false);
 
   m_Controls.checkDedicatedAIFImage->setEnabled(true);
   m_Controls.HCLSpinBox->setValue(mitk::AterialInputFunctionGenerator::DEFAULT_HEMATOCRIT_LEVEL);
   m_Controls.spinBox_baselineEndTimeStep->setMinimum(0);
   m_Controls.spinBox_baselineStartTimeStep->setMinimum(0);
 
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.AIFMaskNodeSelector, SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.labelAIFMask, SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage, SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.AIFMaskNodeSelector, SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage, SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage, SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.AIFImageNodeSelector, SLOT(setVisible(bool)));
   connect(m_Controls.checkDedicatedAIFImage, SIGNAL(toggled(bool)), m_Controls.AIFImageNodeSelector, SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), m_Controls.btnAIFFile, SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), m_Controls.aifFilePath, SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.btnAIFFile, SIGNAL(clicked()), this, SLOT(LoadAIFfromFile()));
 
   //Brix setting
   m_Controls.groupDescBrix->hide();
   connect(m_Controls.injectiontime, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
 
   //Num2CX setting
   m_Controls.groupNum2CXM->hide();
   connect(m_Controls.odeStepSize, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
 
   //Model fit configuration
   m_Controls.groupBox_FitConfiguration->hide();
 
   m_Controls.checkBox_Constraints->setEnabled(false);
   m_Controls.constraintManager->setEnabled(false);
   m_Controls.initialValuesManager->setEnabled(false);
   m_Controls.initialValuesManager->setDataStorage(this->GetDataStorage());
 
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.initialValuesManager, SIGNAL(initialValuesChanged(void)), this, SLOT(UpdateGUIControls()));
 
 
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)), m_Controls.initialValuesManager, SLOT(setEnabled(bool)));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager, SLOT(setEnabled(bool)));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager, SLOT(setVisible(bool)));
 
   //Concentration
   m_Controls.groupConcentration->hide();
   m_Controls.groupBoxEnhancement->hide();
   m_Controls.groupBoxTurboFlash->hide();
   m_Controls.radioButtonNoConversion->setChecked(true);
   m_Controls.groupBox_T1MapviaVFA->hide();
 
   m_Controls.spinBox_baselineStartTimeStep->setValue(0);
   m_Controls.spinBox_baselineEndTimeStep->setValue(0);
 
   connect(m_Controls.radioButtonTurboFlash, SIGNAL(toggled(bool)), m_Controls.groupBoxTurboFlash, SLOT(setVisible(bool)));
   connect(m_Controls.radioButtonTurboFlash, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.relaxationtime, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.recoverytime, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.relaxivity, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.radioButton_absoluteEnhancement, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.radioButton_relativeEnchancement, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.radioButton_absoluteEnhancement, SIGNAL(toggled(bool)), m_Controls.groupBoxEnhancement, SLOT(setVisible(bool)));
   connect(m_Controls.radioButton_relativeEnchancement, SIGNAL(toggled(bool)), m_Controls.groupBoxEnhancement, SLOT(setVisible(bool)));
 
   connect(m_Controls.factorSpinBox, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.spinBox_baselineStartTimeStep, SIGNAL(valueChanged(int)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.spinBox_baselineEndTimeStep, SIGNAL(valueChanged(int)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.radioButtonUsingT1viaVFA, SIGNAL(toggled(bool)), m_Controls.groupBox_T1MapviaVFA, SLOT(setVisible(bool)));
   connect(m_Controls.radioButtonUsingT1viaVFA, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.FlipangleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.RelaxivitySpinBox, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.TRSpinBox, SIGNAL(valueChanged(double)), this, SLOT(UpdateGUIControls()));
 
   m_Controls.PDWImageNodeSelector->SetNodePredicate(m_isValidPDWImagePredicate);
   m_Controls.PDWImageNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.PDWImageNodeSelector->SetInvalidInfo("Please select PDW Image.");
   m_Controls.PDWImageNodeSelector->setEnabled(false);
 
   connect(m_Controls.radioButtonUsingT1viaVFA, SIGNAL(toggled(bool)), m_Controls.PDWImageNodeSelector, SLOT(setEnabled(bool)));
 
   UpdateGUIControls();
 }
 
 bool MRPerfusionView::IsTurboFlashSequenceFlag() const
 {
   return this->m_Controls.radioButtonTurboFlash->isChecked();
 };
 
 
 
 void MRPerfusionView::UpdateGUIControls()
 {
   m_Controls.lineFitName->setPlaceholderText(QString::fromStdString(this->GetDefaultFitName()));
   m_Controls.lineFitName->setEnabled(!m_FittingInProgress);
 
   m_Controls.checkBox_Constraints->setEnabled(m_modelConstraints.IsNotNull());
 
   bool isDescBrixFactory = dynamic_cast<mitk::DescriptivePharmacokineticBrixModelFactory*>
                            (m_selectedModelFactory.GetPointer()) != nullptr;
   bool isToftsFactory = dynamic_cast<mitk::StandardToftsModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr ||
                          dynamic_cast<mitk::ExtendedToftsModelFactory*>
                                   (m_selectedModelFactory.GetPointer()) != nullptr;
   bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>
-                       (m_selectedModelFactory.GetPointer()) != nullptr ||
-                       dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>
                        (m_selectedModelFactory.GetPointer()) != nullptr;
 
-  bool isNum2CXMFactory = dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>
-                          (m_selectedModelFactory.GetPointer()) != nullptr;
 
-  bool isSLFactory = dynamic_cast<mitk::ThreeStepLinearModelFactory*>
-    (m_selectedModelFactory.GetPointer()) != nullptr ||
-    dynamic_cast<mitk::TwoStepLinearModelFactory*>
-    (m_selectedModelFactory.GetPointer()) != nullptr;
 
   m_Controls.groupAIF->setVisible(isToftsFactory || is2CXMFactory);
   m_Controls.groupDescBrix->setVisible(isDescBrixFactory);
-  m_Controls.groupNum2CXM->setVisible(isNum2CXMFactory);
-  m_Controls.groupConcentration->setVisible(isToftsFactory || is2CXMFactory || isSLFactory);
+  m_Controls.groupConcentration->setVisible(isToftsFactory || is2CXMFactory );
 
   m_Controls.groupBox_FitConfiguration->setVisible(m_selectedModelFactory);
 
   m_Controls.groupBox->setEnabled(!m_FittingInProgress);
   m_Controls.comboModel->setEnabled(!m_FittingInProgress);
   m_Controls.groupAIF->setEnabled(!m_FittingInProgress);
   m_Controls.groupDescBrix->setEnabled(!m_FittingInProgress);
   m_Controls.groupNum2CXM->setEnabled(!m_FittingInProgress);
   m_Controls.groupConcentration->setEnabled(!m_FittingInProgress);
   m_Controls.groupBox_FitConfiguration->setEnabled(!m_FittingInProgress);
 
   m_Controls.radioROIbased->setEnabled(m_selectedMask.IsNotNull());
 
   m_Controls.btnModelling->setEnabled(m_selectedImage.IsNotNull()
                                       && m_selectedModelFactory.IsNotNull() && !m_FittingInProgress && CheckModelSettings());
 
   m_Controls.spinBox_baselineStartTimeStep->setEnabled(m_Controls.radioButtonTurboFlash->isChecked() || m_Controls.radioButton_absoluteEnhancement->isChecked() || m_Controls.radioButton_relativeEnchancement->isChecked() || m_Controls.radioButtonUsingT1viaVFA->isChecked());
   m_Controls.spinBox_baselineEndTimeStep->setEnabled(m_Controls.radioButton_absoluteEnhancement->isChecked() || m_Controls.radioButton_relativeEnchancement->isChecked() || m_Controls.radioButtonUsingT1viaVFA->isChecked() || m_Controls.radioButtonTurboFlash->isChecked());
 
 
 }
 
 void MRPerfusionView::OnModellSet(int index)
 {
   m_selectedModelFactory = nullptr;
 
   if (index > 0)
   {
     if (static_cast<ModelFactoryStackType::size_type>(index) <= m_FactoryStack.size() )
     {
         m_selectedModelFactory = m_FactoryStack[index - 1];
     }
     else
     {
         MITK_WARN << "Invalid model index. Index outside of the factory stack. Factory stack size: "<< m_FactoryStack.size() << "; invalid index: "<< index;
     }
   }
 
   if (m_selectedModelFactory)
   {
     this->m_modelConstraints = dynamic_cast<mitk::SimpleBarrierConstraintChecker*>
                                (m_selectedModelFactory->CreateDefaultConstraints().GetPointer());
 
     m_Controls.initialValuesManager->setInitialValues(m_selectedModelFactory->GetParameterNames(),
         m_selectedModelFactory->GetDefaultInitialParameterization());
 
     if (this->m_modelConstraints.IsNull())
     {
       this->m_modelConstraints = mitk::SimpleBarrierConstraintChecker::New();
     }
 
     m_Controls.constraintManager->setChecker(this->m_modelConstraints,
         this->m_selectedModelFactory->GetParameterNames());
 
   }
 
   UpdateGUIControls();
 }
 
 std::string MRPerfusionView::GetFitName() const
 {
   std::string fitName = m_Controls.lineFitName->text().toStdString();
   if (fitName.empty())
   {
     fitName = m_Controls.lineFitName->placeholderText().toStdString();
   }
   return fitName;
 }
 
 std::string MRPerfusionView::GetDefaultFitName() const
 {
     std::string defaultName = "undefined model";
 
     if (this->m_selectedModelFactory.IsNotNull())
     {
         defaultName = this->m_selectedModelFactory->GetClassID();
     }
 
     if (this->m_Controls.radioPixelBased->isChecked())
     {
         defaultName += "_pixel";
     }
     else
     {
         defaultName += "_roi";
     }
 
     return defaultName;
 }
 
 void MRPerfusionView::OnModellingButtonClicked()
 {
   //check if all static parameters set
   if (m_selectedModelFactory.IsNotNull() && CheckModelSettings())
   {
     m_HasGeneratedNewInput = false;
     m_HasGeneratedNewInputAIF = false;
 
     mitk::ParameterFitImageGeneratorBase::Pointer generator = nullptr;
     mitk::modelFit::ModelFitInfo::Pointer fitSession = nullptr;
 
     bool isDescBrixFactory = dynamic_cast<mitk::DescriptivePharmacokineticBrixModelFactory*>
                              (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool is3LinearFactory = dynamic_cast<mitk::ThreeStepLinearModelFactory*>
-                             (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool is2LinearFactory = dynamic_cast<mitk::TwoStepLinearModelFactory*>
-                             (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isExtToftsFactory = dynamic_cast<mitk::ExtendedToftsModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isStanToftsFactory = dynamic_cast<mitk::StandardToftsModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
     bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>
                          (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isNum2CXMFactory = dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>
-                            (m_selectedModelFactory.GetPointer()) != nullptr;
 
     if (isDescBrixFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateDescriptiveBrixModel_PixelBased(fitSession, generator);
       }
       else
       {
         GenerateDescriptiveBrixModel_ROIBased(fitSession, generator);
       }
     }
-    else if (is2LinearFactory)
-    {
-      if (this->m_Controls.radioPixelBased->isChecked())
-      {
-        GenerateLinearModelFit_PixelBased<mitk::TwoStepLinearModelParameterizer>(fitSession, generator);
-      }
-      else
-      {
-        GenerateLinearModelFit_ROIBased<mitk::TwoStepLinearModelParameterizer>(fitSession, generator);
-      }
-    }
-    else if (is3LinearFactory)
-    {
-      if (this->m_Controls.radioPixelBased->isChecked())
-      {
-        GenerateLinearModelFit_PixelBased<mitk::ThreeStepLinearModelParameterizer>(fitSession, generator);
-      }
-      else
-      {
-        GenerateLinearModelFit_ROIBased<mitk::ThreeStepLinearModelParameterizer>(fitSession, generator);
-      }
-    }
     else if (isStanToftsFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateAIFbasedModelFit_PixelBased<mitk::StandardToftsModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateAIFbasedModelFit_ROIBased<mitk::StandardToftsModelParameterizer>(fitSession, generator);
       }
     }
     else if (isExtToftsFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateAIFbasedModelFit_PixelBased<mitk::ExtendedToftsModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateAIFbasedModelFit_ROIBased<mitk::ExtendedToftsModelParameterizer>(fitSession, generator);
       }
     }
     else if (is2CXMFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateAIFbasedModelFit_PixelBased<mitk::TwoCompartmentExchangeModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateAIFbasedModelFit_ROIBased<mitk::TwoCompartmentExchangeModelParameterizer>(fitSession, generator);
       }
     }
-    else if (isNum2CXMFactory)
-    {
-      if (this->m_Controls.radioPixelBased->isChecked())
-      {
-        GenerateAIFbasedModelFit_PixelBased<mitk::NumericTwoCompartmentExchangeModelParameterizer>(fitSession,
-            generator);
-      }
-      else
-      {
-        GenerateAIFbasedModelFit_ROIBased<mitk::NumericTwoCompartmentExchangeModelParameterizer>(fitSession,
-            generator);
-      }
-    }
 
     //add other models with else if
 
     if (generator.IsNotNull() && fitSession.IsNotNull())
     {
       m_FittingInProgress = true;
       UpdateGUIControls();
       DoFit(fitSession, generator);
     }
     else
     {
       QMessageBox box;
       box.setText("Fitting error!");
       box.setInformativeText("Could not establish fitting job. Error when setting ab generator, model parameterizer or session info.");
       box.setStandardButtons(QMessageBox::Ok);
       box.setDefaultButton(QMessageBox::Ok);
       box.setIcon(QMessageBox::Warning);
       box.exec();
     }
 
   }
   else
   {
     QMessageBox box;
     box.setText("Static parameters for model are not set!");
     box.setInformativeText("Some static parameters, that are needed for calculation are not set and equal to zero. Modeling not possible");
     box.setStandardButtons(QMessageBox::Ok);
     box.setDefaultButton(QMessageBox::Ok);
     box.setIcon(QMessageBox::Warning);
     box.exec();
   }
 }
 
 
 
 void MRPerfusionView::OnNodeSelectionChanged(QList<mitk::DataNode::Pointer>/*nodes*/)
 {
   m_selectedMaskNode = nullptr;
   m_selectedMask = nullptr;
 
   if (m_Controls.timeSeriesNodeSelector->GetSelectedNode().IsNotNull())
   {
     this->m_selectedNode = m_Controls.timeSeriesNodeSelector->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
 
     if (m_selectedImage)
     {
       this->m_Controls.initialValuesManager->setReferenceImageGeometry(m_selectedImage->GetGeometry());
     }
     else
     {
       this->m_Controls.initialValuesManager->setReferenceImageGeometry(nullptr);
     }
   }
   else
   {
     this->m_selectedNode = nullptr;
     this->m_selectedImage = nullptr;
     this->m_Controls.initialValuesManager->setReferenceImageGeometry(nullptr);
   }
 
 
   if (m_Controls.maskNodeSelector->GetSelectedNode().IsNotNull())
   {
     this->m_selectedMaskNode = m_Controls.maskNodeSelector->GetSelectedNode();
       this->m_selectedMask = dynamic_cast<mitk::Image*>(m_selectedMaskNode->GetData());
 
       if (this->m_selectedMask.IsNotNull() && this->m_selectedMask->GetTimeSteps() > 1)
       {
         MITK_INFO <<
                   "Selected mask has multiple timesteps. Only use first timestep to mask model fit. Mask name: " <<
                   m_Controls.maskNodeSelector->GetSelectedNode()->GetName();
         mitk::ImageTimeSelector::Pointer maskedImageTimeSelector = mitk::ImageTimeSelector::New();
         maskedImageTimeSelector->SetInput(this->m_selectedMask);
         maskedImageTimeSelector->SetTimeNr(0);
         maskedImageTimeSelector->UpdateLargestPossibleRegion();
         this->m_selectedMask = maskedImageTimeSelector->GetOutput();
       }
   }
 
   if (m_selectedMask.IsNull())
   {
     this->m_Controls.radioPixelBased->setChecked(true);
   }
 
   if (this->m_selectedImage.IsNotNull())
   {
     m_Controls.spinBox_baselineStartTimeStep->setMaximum((this->m_selectedImage->GetDimension(3))-1);
     m_Controls.spinBox_baselineEndTimeStep->setMaximum((this->m_selectedImage->GetDimension(3)) - 1);
   }
 
   UpdateGUIControls();
 }
 
 bool MRPerfusionView::CheckModelSettings() const
 {
   bool ok = true;
 
-  //check wether any model is set at all. Otherwise exit with false
+  //check whether any model is set at all. Otherwise exit with false
   if (m_selectedModelFactory.IsNotNull())
   {
     bool isDescBrixFactory = dynamic_cast<mitk::DescriptivePharmacokineticBrixModelFactory*>
                              (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool is3LinearFactory = dynamic_cast<mitk::ThreeStepLinearModelFactory*>
-                             (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool is2LinearFactory = dynamic_cast<mitk::TwoStepLinearModelFactory*>
-                             (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isToftsFactory = dynamic_cast<mitk::StandardToftsModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr||
                           dynamic_cast<mitk::ExtendedToftsModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
     bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>
                          (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isNum2CXMFactory = dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>
-                            (m_selectedModelFactory.GetPointer()) != nullptr;
 
     if (isDescBrixFactory)
     {
       //if all static parameters for this model are set, exit with true, Otherwise exit with false
       ok = m_Controls.injectiontime->value() > 0;
     }
-    else if (is3LinearFactory || is2LinearFactory)
-    {
-        if (this->m_Controls.radioButtonTurboFlash->isChecked() )
-        {
-          ok = ok && (m_Controls.recoverytime->value() > 0);
-          ok = ok && (m_Controls.relaxationtime->value() > 0);
-          ok = ok && (m_Controls.relaxivity->value() > 0);
-          ok = ok && (m_Controls.AifRecoverytime->value() > 0);
-          ok = ok && CheckBaselineSelectionSettings();
-
-        }
-        else if (this->m_Controls.radioButton_absoluteEnhancement->isChecked()
-                 || this->m_Controls.radioButton_relativeEnchancement->isChecked() )
-        {
-          ok = ok && (m_Controls.factorSpinBox->value() > 0);
-          ok = ok && CheckBaselineSelectionSettings();
-        }
-        else if (this->m_Controls.radioButtonUsingT1viaVFA->isChecked() )
-        {
-          ok = ok && (m_Controls.FlipangleSpinBox->value() > 0);
-          ok = ok && (m_Controls.TRSpinBox->value() > 0);
-          ok = ok && (m_Controls.RelaxivitySpinBox->value() > 0);
-          ok = ok && (m_Controls.PDWImageNodeSelector->GetSelectedNode().IsNotNull());
-          ok = ok && CheckBaselineSelectionSettings();
-        }
-        else if (this->m_Controls.radioButtonNoConversion->isChecked())
-        {
-          ok = true;
-        }
-        else
-        {
-          ok = false;
-        }
-    }
-    else if (isToftsFactory || is2CXMFactory || isNum2CXMFactory)
+    else if (isToftsFactory || is2CXMFactory)
     {
       if (this->m_Controls.radioAIFImage->isChecked())
       {
         ok = ok && m_Controls.AIFMaskNodeSelector->GetSelectedNode().IsNotNull();
 
         if (this->m_Controls.checkDedicatedAIFImage->isChecked())
         {
           ok = ok && m_Controls.AIFImageNodeSelector->GetSelectedNode().IsNotNull();
         }
       }
       else if (this->m_Controls.radioAIFFile->isChecked())
       {
         ok = ok && (this->AIFinputGrid.size() != 0) && (this->AIFinputFunction.size() != 0);
       }
       else
       {
         ok = false;
       }
 
       if (this->m_Controls.radioButtonTurboFlash->isChecked() )
       {
         ok = ok && (m_Controls.recoverytime->value() > 0);
         ok = ok && (m_Controls.relaxationtime->value() > 0);
         ok = ok && (m_Controls.relaxivity->value() > 0);
         ok = ok && (m_Controls.AifRecoverytime->value() > 0);
         ok = ok && CheckBaselineSelectionSettings();
 
       }
       else if (this->m_Controls.radioButton_absoluteEnhancement->isChecked()
                || this->m_Controls.radioButton_relativeEnchancement->isChecked() )
       {
         ok = ok && (m_Controls.factorSpinBox->value() > 0);
         ok = ok && CheckBaselineSelectionSettings();
       }
       else if (this->m_Controls.radioButtonUsingT1viaVFA->isChecked() )
       {
         ok = ok && (m_Controls.FlipangleSpinBox->value() > 0);
         ok = ok && (m_Controls.TRSpinBox->value() > 0);
         ok = ok && (m_Controls.RelaxivitySpinBox->value() > 0);
         ok = ok && (m_Controls.PDWImageNodeSelector->GetSelectedNode().IsNotNull());
         ok = ok && CheckBaselineSelectionSettings();
       }
       else if (this->m_Controls.radioButtonNoConversion->isChecked())
       {
         ok = ok && true;
       }
       else
       {
         ok = false;
       }
 
-      if (isNum2CXMFactory)
-      {
-        ok = ok && (this->m_Controls.odeStepSize->value() > 0);
-      }
-
     }
-    //add other models as else if and check wether all needed static parameters are set
+    //add other models as else if and check whether all needed static parameters are set
     else
     {
       ok = false;
     }
 
     if (this->m_Controls.radioButton_StartParameters->isChecked() && !this->m_Controls.initialValuesManager->hasValidInitialValues())
     {
       std::string warning = "Warning. Invalid start parameters. At least one parameter as an invalid image setting as source.";
       MITK_ERROR << warning;
       m_Controls.infoBox->append(QString("<font color='red'><b>") + QString::fromStdString(warning) + QString("</b></font>"));
 
       ok = false;
     };
   }
   else
   {
     ok = false;
   }
 
   return ok;
 }
 
 bool MRPerfusionView::CheckBaselineSelectionSettings() const
 {
   return m_Controls.spinBox_baselineStartTimeStep->value() <= m_Controls.spinBox_baselineEndTimeStep->value();
 }
 
 void MRPerfusionView::ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase*
     parameterizer) const
 {
   if (m_Controls.radioButton_StartParameters->isChecked())
   {
     //use user defined initial parameters
     mitk::InitialParameterizationDelegateBase::Pointer paramDelegate = m_Controls.initialValuesManager->getInitialParametrizationDelegate();
     parameterizer->SetInitialParameterizationDelegate(paramDelegate);
   }
 }
 
 void MRPerfusionView::GenerateDescriptiveBrixModel_PixelBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::PixelBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::PixelBasedParameterFitImageGenerator::New();
 
   mitk::DescriptivePharmacokineticBrixModelParameterizer::Pointer modelParameterizer =
     mitk::DescriptivePharmacokineticBrixModelParameterizer::New();
 
   //Model configuration (static parameters) can be done now
   modelParameterizer->SetTau(m_Controls.injectiontime->value());
 
   mitk::ImageTimeSelector::Pointer imageTimeSelector =	mitk::ImageTimeSelector::New();
   imageTimeSelector->SetInput(this->m_selectedImage);
   imageTimeSelector->SetTimeNr(0);
   imageTimeSelector->UpdateLargestPossibleRegion();
 
   mitk::DescriptivePharmacokineticBrixModelParameterizer::BaseImageType::Pointer baseImage;
   mitk::CastToItkImage(imageTimeSelector->GetOutput(), baseImage);
 
   modelParameterizer->SetBaseImage(baseImage);
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   std::string roiUID = "";
 
   if (m_selectedMask.IsNotNull())
   {
     fitGenerator->SetMask(m_selectedMask);
     roiUID = m_selectedMask->GetUID();
   }
 
   fitGenerator->SetDynamicImage(m_selectedImage);
   fitGenerator->SetFitFunctor(fitFunctor);
 
   generator = fitGenerator.GetPointer();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED(), this->GetFitName(), roiUID);
 }
 
 void MRPerfusionView::GenerateDescriptiveBrixModel_ROIBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   if (m_selectedMask.IsNull())
   {
     return;
   }
 
   mitk::ROIBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::ROIBasedParameterFitImageGenerator::New();
 
   mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::Pointer modelParameterizer =
     mitk::DescriptivePharmacokineticBrixModelValueBasedParameterizer::New();
 
   //Compute ROI signal
   mitk::MaskedDynamicImageStatisticsGenerator::Pointer signalGenerator =
     mitk::MaskedDynamicImageStatisticsGenerator::New();
   signalGenerator->SetMask(m_selectedMask);
   signalGenerator->SetDynamicImage(m_selectedImage);
   signalGenerator->Generate();
 
   mitk::MaskedDynamicImageStatisticsGenerator::ResultType roiSignal = signalGenerator->GetMean();
 
   //Model configuration (static parameters) can be done now
   modelParameterizer->SetTau(m_Controls.injectiontime->value());
   modelParameterizer->SetBaseValue(roiSignal[0]);
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   fitGenerator->SetMask(m_selectedMask);
   fitGenerator->SetFitFunctor(fitFunctor);
   fitGenerator->SetSignal(roiSignal);
   fitGenerator->SetTimeGrid(mitk::ExtractTimeGrid(m_selectedImage));
 
   generator = fitGenerator.GetPointer();
 
   std::string roiUID = this->m_selectedMask->GetUID();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_ROIBASED(), this->GetFitName(), roiUID);
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::MaskedDynamicImageStatisticsGenerator::ResultType::const_iterator pos =
          roiSignal.begin(); pos != roiSignal.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("ROI", infoSignal);
 }
 
 template <typename TParameterizer>
 void MRPerfusionView::GenerateLinearModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::PixelBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::PixelBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer = TParameterizer::New();
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   std::string roiUID = "";
 
   if (m_selectedMask.IsNotNull())
   {
     fitGenerator->SetMask(m_selectedMask);
     roiUID = this->m_selectedMask->GetUID();
   }
 
   fitGenerator->SetDynamicImage(m_selectedImage);
   fitGenerator->SetFitFunctor(fitFunctor);
 
   generator = fitGenerator.GetPointer();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED(), this->GetFitName(), roiUID);
 }
 
 template <typename TParameterizer>
 void MRPerfusionView::GenerateLinearModelFit_ROIBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   if (m_selectedMask.IsNull())
   {
     return;
   }
 
   mitk::ROIBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::ROIBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer = TParameterizer::New();
 
   //Compute ROI signal
   mitk::MaskedDynamicImageStatisticsGenerator::Pointer signalGenerator =
     mitk::MaskedDynamicImageStatisticsGenerator::New();
   signalGenerator->SetMask(m_selectedMask);
   signalGenerator->SetDynamicImage(m_selectedImage);
   signalGenerator->Generate();
 
   mitk::MaskedDynamicImageStatisticsGenerator::ResultType roiSignal = signalGenerator->GetMean();
 
   //Model configuration (static parameters) can be done now
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   fitGenerator->SetMask(m_selectedMask);
   fitGenerator->SetFitFunctor(fitFunctor);
   fitGenerator->SetSignal(roiSignal);
   fitGenerator->SetTimeGrid(mitk::ExtractTimeGrid(m_selectedImage));
 
   generator = fitGenerator.GetPointer();
 
   std::string roiUID = this->m_selectedMask->GetUID();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_ROIBASED(), this->GetFitName(), roiUID);
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::MaskedDynamicImageStatisticsGenerator::ResultType::const_iterator pos =
          roiSignal.begin(); pos != roiSignal.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("ROI", infoSignal);
 }
 
 template <typename TParameterizer>
 void MRPerfusionView::GenerateAIFbasedModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer&
     modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::PixelBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::PixelBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
   PrepareConcentrationImage();
 
   mitk::AIFBasedModelBase::AterialInputFunctionType aif;
   mitk::AIFBasedModelBase::AterialInputFunctionType aifTimeGrid;
   GetAIF(aif, aifTimeGrid);
 
   modelParameterizer->SetAIF(aif);
   modelParameterizer->SetAIFTimeGrid(aifTimeGrid);
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
-  mitk::NumericTwoCompartmentExchangeModelParameterizer* numTCXParametrizer =
-    dynamic_cast<mitk::NumericTwoCompartmentExchangeModelParameterizer*>
-    (modelParameterizer.GetPointer());
-
-  if (numTCXParametrizer)
-  {
-    numTCXParametrizer->SetODEINTStepSize(this->m_Controls.odeStepSize->value());
-  }
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   std::string roiUID = "";
 
   if (m_selectedMask.IsNotNull())
   {
     fitGenerator->SetMask(m_selectedMask);
     roiUID = this->m_selectedMask->GetUID();
   }
 
   fitGenerator->SetDynamicImage(this->m_inputImage);
   fitGenerator->SetFitFunctor(fitFunctor);
 
   generator = fitGenerator.GetPointer();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     this->m_inputImage, mitk::ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED(), this->GetFitName(),
                  roiUID);
 
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::AIFBasedModelBase::AterialInputFunctionType::const_iterator pos =
          aif.begin(); pos != aif.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("AIF", infoSignal);
 }
 
 template <typename TParameterizer>
 void MRPerfusionView::GenerateAIFbasedModelFit_ROIBased(
   mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo,
   mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   if (m_selectedMask.IsNull())
   {
     return;
   }
 
   mitk::ROIBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::ROIBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
   PrepareConcentrationImage();
 
   mitk::AIFBasedModelBase::AterialInputFunctionType aif;
   mitk::AIFBasedModelBase::AterialInputFunctionType aifTimeGrid;
   GetAIF(aif, aifTimeGrid);
 
   modelParameterizer->SetAIF(aif);
   modelParameterizer->SetAIFTimeGrid(aifTimeGrid);
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
-  mitk::NumericTwoCompartmentExchangeModelParameterizer* numTCXParametrizer =
-    dynamic_cast<mitk::NumericTwoCompartmentExchangeModelParameterizer*>
-    (modelParameterizer.GetPointer());
-
-  if (numTCXParametrizer)
-  {
-    numTCXParametrizer->SetODEINTStepSize(this->m_Controls.odeStepSize->value());
-  }
 
   //Compute ROI signal
   mitk::MaskedDynamicImageStatisticsGenerator::Pointer signalGenerator =
     mitk::MaskedDynamicImageStatisticsGenerator::New();
   signalGenerator->SetMask(m_selectedMask);
   signalGenerator->SetDynamicImage(this->m_inputImage);
   signalGenerator->Generate();
 
   mitk::MaskedDynamicImageStatisticsGenerator::ResultType roiSignal = signalGenerator->GetMean();
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   fitGenerator->SetMask(m_selectedMask);
   fitGenerator->SetFitFunctor(fitFunctor);
   fitGenerator->SetSignal(roiSignal);
   fitGenerator->SetTimeGrid(mitk::ExtractTimeGrid(this->m_inputImage));
 
   generator = fitGenerator.GetPointer();
 
   std::string roiUID = this->m_selectedMask->GetUID();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     this->m_inputImage, mitk::ModelFitConstants::FIT_TYPE_VALUE_ROIBASED(), this->GetFitName(),
                  roiUID);
 
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::MaskedDynamicImageStatisticsGenerator::ResultType::const_iterator pos =
          roiSignal.begin(); pos != roiSignal.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("ROI", infoSignal);
 
   infoSignal.clear();
 
   for (mitk::AIFBasedModelBase::AterialInputFunctionType::const_iterator pos =
          aif.begin(); pos != aif.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("AIF", infoSignal);
 }
 
 
 void MRPerfusionView::DoFit(const mitk::modelFit::ModelFitInfo* fitSession,
                             mitk::ParameterFitImageGeneratorBase* generator)
 {
   this->m_Controls.infoBox->append(QString("<font color='green'>" + QString("Fitting Data Set . . .") + QString ("</font>")));
 
 
   /////////////////////////
   //create job and put it into the thread pool
   mitk::modelFit::ModelFitResultNodeVectorType additionalNodes;
   if (m_HasGeneratedNewInput)
   {
     additionalNodes.push_back(m_inputNode);
   }
   if (m_HasGeneratedNewInputAIF)
   {
     additionalNodes.push_back(m_inputAIFNode);
   }
 
   ParameterFitBackgroundJob* pJob = new ParameterFitBackgroundJob(generator, fitSession,
       this->m_selectedNode, additionalNodes);
   pJob->setAutoDelete(true);
 
   connect(pJob, SIGNAL(Error(QString)), this, SLOT(OnJobError(QString)));
   connect(pJob, SIGNAL(Finished()), this, SLOT(OnJobFinished()));
   connect(pJob, SIGNAL(ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                        const ParameterFitBackgroundJob*)), this,
           SLOT(OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                                         const ParameterFitBackgroundJob*)), Qt::BlockingQueuedConnection);
 
   connect(pJob, SIGNAL(JobProgress(double)), this, SLOT(OnJobProgress(double)));
   connect(pJob, SIGNAL(JobStatusChanged(QString)), this, SLOT(OnJobStatusChanged(QString)));
 
   QThreadPool* threadPool = QThreadPool::globalInstance();
   threadPool->start(pJob);
 }
 
 MRPerfusionView::MRPerfusionView() : m_FittingInProgress(false), m_HasGeneratedNewInput(false), m_HasGeneratedNewInputAIF(false)
 {
   m_selectedImage = nullptr;
   m_selectedMask = nullptr;
 
   mitk::ModelFactoryBase::Pointer factory =
     mitk::DescriptivePharmacokineticBrixModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
-  factory = mitk::TwoStepLinearModelFactory::New().GetPointer();
-  m_FactoryStack.push_back(factory);
-  factory = mitk::ThreeStepLinearModelFactory::New().GetPointer();
-  m_FactoryStack.push_back(factory);
   factory = mitk::StandardToftsModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
   factory = mitk::ExtendedToftsModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
   factory = mitk::TwoCompartmentExchangeModelFactory::New().GetPointer();
   m_FactoryStack.push_back(factory);
-  factory = mitk::NumericTwoCompartmentExchangeModelFactory::New().GetPointer();
-  m_FactoryStack.push_back(factory);
 
   mitk::NodePredicateDataType::Pointer isLabelSet = mitk::NodePredicateDataType::New("LabelSetImage");
   mitk::NodePredicateDataType::Pointer isImage = mitk::NodePredicateDataType::New("Image");
   mitk::NodePredicateProperty::Pointer isBinary = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
   mitk::NodePredicateAnd::Pointer isLegacyMask = mitk::NodePredicateAnd::New(isImage, isBinary);
   mitk::NodePredicateDimension::Pointer is3D = mitk::NodePredicateDimension::New(3);
   mitk::NodePredicateOr::Pointer isMask = mitk::NodePredicateOr::New(isLegacyMask, isLabelSet);
   mitk::NodePredicateAnd::Pointer isNoMask = mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isMask));
   mitk::NodePredicateAnd::Pointer is3DImage = mitk::NodePredicateAnd::New(isImage, is3D, isNoMask);
 
   this->m_IsMaskPredicate = mitk::NodePredicateAnd::New(isMask, mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 
   this->m_IsNoMaskImagePredicate = mitk::NodePredicateAnd::New(isNoMask, mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 
   auto isDynamicData = mitk::NodePredicateFunction::New([](const mitk::DataNode* node)
   {
     return  (node && node->GetData() && node->GetData()->GetTimeSteps() > 1);
   });
 
   auto modelFitResultRelationRule = mitk::ModelFitResultRelationRule::New();
   auto isNoModelFitNodePredicate = mitk::NodePredicateNot::New(modelFitResultRelationRule->GetConnectedSourcesDetector());
 
   this->m_isValidPDWImagePredicate = mitk::NodePredicateAnd::New(is3DImage, isNoModelFitNodePredicate);
   this->m_isValidTimeSeriesImagePredicate = mitk::NodePredicateAnd::New(isDynamicData, isImage, isNoMask);
 }
 
 void MRPerfusionView::OnJobFinished()
 {
   this->m_Controls.infoBox->append(QString("Fitting finished."));
   this->m_FittingInProgress = false;
   this->UpdateGUIControls();
 };
 
 void MRPerfusionView::OnJobError(QString err)
 {
   MITK_ERROR << err.toStdString().c_str();
 
   m_Controls.infoBox->append(QString("<font color='red'><b>") + err + QString("</b></font>"));
 };
 
 void MRPerfusionView::OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results,
     const ParameterFitBackgroundJob* pJob)
 {
   //Store the resulting parameter fit image via convenience helper function in data storage
   //(handles the correct generation of the nodes and their properties)
 
   mitk::modelFit::StoreResultsInDataStorage(this->GetDataStorage(), results, pJob->GetParentNode());
   //this stores the concentration image and AIF concentration image, if generated for this fit in the storage.
   //if not generated for this fit, relevant nodes are empty.
   mitk::modelFit::StoreResultsInDataStorage(this->GetDataStorage(), pJob->GetAdditionalRelevantNodes(), pJob->GetParentNode());
 
 
 
 };
 
 void MRPerfusionView::OnJobProgress(double progress)
 {
   QString report = QString("Progress. ") + QString::number(progress);
   this->m_Controls.infoBox->append(report);
 };
 
 void MRPerfusionView::OnJobStatusChanged(QString info)
 {
   this->m_Controls.infoBox->append(info);
 }
 
 
 void MRPerfusionView::InitModelComboBox() const
 {
   this->m_Controls.comboModel->clear();
   this->m_Controls.comboModel->addItem(tr("No model selected"));
 
   for (ModelFactoryStackType::const_iterator pos = m_FactoryStack.begin();
        pos != m_FactoryStack.end(); ++pos)
   {
     this->m_Controls.comboModel->addItem(QString::fromStdString((*pos)->GetClassID()));
   }
 
   this->m_Controls.comboModel->setCurrentIndex(0);
 };
 
 mitk::DataNode::Pointer MRPerfusionView::GenerateConcentrationNode(mitk::Image* image,
     const std::string& nodeName) const
 {
   if (!image)
   {
     mitkThrow() << "Cannot generate concentration node. Passed image is null. parameter name: ";
   }
 
   mitk::DataNode::Pointer result = mitk::DataNode::New();
 
   result->SetData(image);
   result->SetName(nodeName);
   result->SetVisibility(true);
 
   return result;
 };
 
 
 mitk::Image::Pointer MRPerfusionView::ConvertConcentrationImage(bool AIFMode)
 {
   //Compute Concentration image
   mitk::ConcentrationCurveGenerator::Pointer concentrationGen =
     mitk::ConcentrationCurveGenerator::New();
 
   if (m_Controls.checkDedicatedAIFImage->isChecked() && AIFMode)
   {
     concentrationGen->SetDynamicImage(this->m_selectedAIFImage);
   }
   else
   {
     concentrationGen->SetDynamicImage(this->m_selectedImage);
   }
 
   concentrationGen->SetisTurboFlashSequence(IsTurboFlashSequenceFlag());
   concentrationGen->SetAbsoluteSignalEnhancement(m_Controls.radioButton_absoluteEnhancement->isChecked());
   concentrationGen->SetRelativeSignalEnhancement(m_Controls.radioButton_relativeEnchancement->isChecked());
   concentrationGen->SetUsingT1Map(m_Controls.radioButtonUsingT1viaVFA->isChecked());
 
   if (IsTurboFlashSequenceFlag())
   {
     if (AIFMode)
     {
       concentrationGen->SetRecoveryTime(m_Controls.AifRecoverytime->value());
     }
     else
     {
       concentrationGen->SetRecoveryTime(m_Controls.recoverytime->value());
     }
 
     concentrationGen->SetRelaxationTime(m_Controls.relaxationtime->value());
     concentrationGen->SetRelaxivity(m_Controls.relaxivity->value());
     concentrationGen->SetBaselineStartTimeStep(m_Controls.spinBox_baselineStartTimeStep->value());
     concentrationGen->SetBaselineEndTimeStep(m_Controls.spinBox_baselineEndTimeStep->value());
 
   }
   else if (this->m_Controls.radioButtonUsingT1viaVFA->isChecked())
   {
       concentrationGen->SetRecoveryTime(m_Controls.TRSpinBox->value());
       concentrationGen->SetRelaxivity(m_Controls.RelaxivitySpinBox->value());
       concentrationGen->SetT10Image(dynamic_cast<mitk::Image*>(m_Controls.PDWImageNodeSelector->GetSelectedNode()->GetData()));
       concentrationGen->SetBaselineStartTimeStep(m_Controls.spinBox_baselineStartTimeStep->value());
       concentrationGen->SetBaselineEndTimeStep(m_Controls.spinBox_baselineEndTimeStep->value());
       //Convert Flipangle from degree to radiant
       double alpha = m_Controls.FlipangleSpinBox->value()/360*2* boost::math::constants::pi<double>();
       concentrationGen->SetFlipAngle(alpha);
   }
   else
   {
     concentrationGen->SetFactor(m_Controls.factorSpinBox->value());
     concentrationGen->SetBaselineStartTimeStep(m_Controls.spinBox_baselineStartTimeStep->value());
     concentrationGen->SetBaselineEndTimeStep(m_Controls.spinBox_baselineEndTimeStep->value());
   }
 
 
   mitk::Image::Pointer concentrationImage = concentrationGen->GetConvertedImage();
 
   return concentrationImage;
 }
 
 void MRPerfusionView::GetAIF(mitk::AIFBasedModelBase::AterialInputFunctionType& aif,
                              mitk::AIFBasedModelBase::AterialInputFunctionType& aifTimeGrid)
 {
   if (this->m_Controls.radioAIFFile->isChecked())
   {
     aif.clear();
     aifTimeGrid.clear();
 
     aif.SetSize(AIFinputFunction.size());
     aifTimeGrid.SetSize(AIFinputGrid.size());
 
     aif.fill(0.0);
     aifTimeGrid.fill(0.0);
 
     itk::Array<double>::iterator aifPos = aif.begin();
 
     for (std::vector<double>::const_iterator pos = AIFinputFunction.begin();
          pos != AIFinputFunction.end(); ++pos, ++aifPos)
     {
       *aifPos = *pos;
     }
 
     itk::Array<double>::iterator gridPos = aifTimeGrid.begin();
 
     for (std::vector<double>::const_iterator pos = AIFinputGrid.begin(); pos != AIFinputGrid.end();
          ++pos, ++gridPos)
     {
       *gridPos = *pos;
     }
   }
   else if (this->m_Controls.radioAIFImage->isChecked())
   {
     aif.clear();
     aifTimeGrid.clear();
 
     mitk::AterialInputFunctionGenerator::Pointer aifGenerator =
       mitk::AterialInputFunctionGenerator::New();
 
     //Hematocrit level
     aifGenerator->SetHCL(this->m_Controls.HCLSpinBox->value());
 
     //mask settings
     this->m_selectedAIFMaskNode = m_Controls.AIFMaskNodeSelector->GetSelectedNode();
     this->m_selectedAIFMask = dynamic_cast<mitk::Image*>(this->m_selectedAIFMaskNode->GetData());
 
     if (this->m_selectedAIFMask->GetTimeSteps() > 1)
     {
       MITK_INFO <<
                 "Selected AIF mask has multiple timesteps. Only use first timestep to mask model fit. AIF Mask name: "
                 <<
                 m_selectedAIFMaskNode->GetName() ;
       mitk::ImageTimeSelector::Pointer maskedImageTimeSelector = mitk::ImageTimeSelector::New();
       maskedImageTimeSelector->SetInput(this->m_selectedAIFMask);
       maskedImageTimeSelector->SetTimeNr(0);
       maskedImageTimeSelector->UpdateLargestPossibleRegion();
       this->m_selectedAIFMask = maskedImageTimeSelector->GetOutput();
     }
 
     if (this->m_selectedAIFMask.IsNotNull())
     {
       aifGenerator->SetMask(this->m_selectedAIFMask);
     }
 
     //image settings
     if (this->m_Controls.checkDedicatedAIFImage->isChecked())
     {
       this->m_selectedAIFImageNode = m_Controls.AIFImageNodeSelector->GetSelectedNode();
       this->m_selectedAIFImage = dynamic_cast<mitk::Image*>(this->m_selectedAIFImageNode->GetData());
     }
     else
     {
       this->m_selectedAIFImageNode = m_selectedNode;
       this->m_selectedAIFImage = m_selectedImage;
     }
 
     this->PrepareAIFConcentrationImage();
 
     aifGenerator->SetDynamicImage(this->m_inputAIFImage);
 
     aif = aifGenerator->GetAterialInputFunction();
     aifTimeGrid = aifGenerator->GetAterialInputFunctionTimeGrid();
   }
   else
   {
-    mitkThrow() << "Cannot generate AIF. View is in a invalide state. No AIF mode selected.";
+    mitkThrow() << "Cannot generate AIF. View is in a invalid state. No AIF mode selected.";
   }
 }
 
 
 void MRPerfusionView::LoadAIFfromFile()
 {
   QFileDialog dialog;
   dialog.setNameFilter(tr("Images (*.csv"));
 
   QString fileName = dialog.getOpenFileName();
 
   m_Controls.aifFilePath->setText(fileName);
 
   std::string m_aifFilePath = fileName.toStdString();
   //Read Input
   typedef boost::tokenizer< boost::escaped_list_separator<char> > Tokenizer;
   /////////////////////////////////////////////////////////////////////////////////////////////////
   //AIF Data
 
   std::ifstream in1(m_aifFilePath.c_str());
 
   if (!in1.is_open())
   {
     this->m_Controls.infoBox->append(QString("Could not open AIF File!"));
   }
 
 
   std::vector< std::string > vec1;
   std::string line1;
 
   while (getline(in1, line1))
   {
     Tokenizer tok(line1);
     vec1.assign(tok.begin(), tok.end());
 
     this->AIFinputGrid.push_back(convertToDouble(vec1[0]));
     this->AIFinputFunction.push_back(convertToDouble(vec1[1]));
   }
 }
 
 void MRPerfusionView::PrepareConcentrationImage()
 {
   mitk::Image::Pointer concentrationImage = this->m_selectedImage;
   mitk::DataNode::Pointer concentrationNode = this->m_selectedNode;
   m_HasGeneratedNewInput = false;
 
   if (!this->m_Controls.radioButtonNoConversion->isChecked())
   {
     concentrationImage = this->ConvertConcentrationImage(false);
     concentrationNode = GenerateConcentrationNode(concentrationImage, "Concentration");
     m_HasGeneratedNewInput = true;
   }
 
   m_inputImage = concentrationImage;
   m_inputNode = concentrationNode;
 }
 
 void MRPerfusionView::PrepareAIFConcentrationImage()
 {
   mitk::Image::Pointer concentrationImage = this->m_selectedImage;
   mitk::DataNode::Pointer concentrationNode = this->m_selectedNode;
   m_HasGeneratedNewInputAIF = false;
 
   if (this->m_Controls.checkDedicatedAIFImage->isChecked())
   {
     concentrationImage = this->m_selectedAIFImage;
     concentrationNode = this->m_selectedAIFImageNode;
   }
 
   if (!this->m_Controls.radioButtonNoConversion->isChecked())
   {
     if (!IsTurboFlashSequenceFlag() && !this->m_Controls.checkDedicatedAIFImage->isChecked())
     {
       if (m_inputImage.IsNull())
       {
         mitkThrow() <<
           "Cannot get AIF concentration image. Invalid view state. Input image is not defined yet, but should be.";
       }
 
       //we can directly use the concentration input image/node (generated by GetConcentrationImage) also for the AIF
       concentrationImage = this->m_inputImage;
       concentrationNode = this->m_inputNode;
     }
     else
     {
       concentrationImage = this->ConvertConcentrationImage(true);
       concentrationNode = GenerateConcentrationNode(concentrationImage, "AIF Concentration");
       m_HasGeneratedNewInputAIF = true;
     }
   }
 
   m_inputAIFImage = concentrationImage;
   m_inputAIFNode = concentrationNode;
 }
 
 
 
 mitk::ModelFitFunctorBase::Pointer MRPerfusionView::CreateDefaultFitFunctor(
   const mitk::ModelParameterizerBase* parameterizer) const
 {
   mitk::LevenbergMarquardtModelFitFunctor::Pointer fitFunctor =
     mitk::LevenbergMarquardtModelFitFunctor::New();
 
   mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::Pointer chi2 =
     mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::New();
   fitFunctor->RegisterEvaluationParameter("Chi^2", chi2);
 
   if (m_Controls.checkBox_Constraints->isChecked())
   {
     fitFunctor->SetConstraintChecker(m_modelConstraints);
   }
 
   mitk::ModelBase::Pointer refModel = parameterizer->GenerateParameterizedModel();
 
   ::itk::LevenbergMarquardtOptimizer::ScalesType scales;
   scales.SetSize(refModel->GetNumberOfParameters());
   scales.Fill(1.0);
   fitFunctor->SetScales(scales);
 
   fitFunctor->SetDebugParameterMaps(m_Controls.checkDebug->isChecked());
 
   return fitFunctor.GetPointer();
 }
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionViewControls.ui b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionViewControls.ui
index be5a4f0665..b4e0cb396d 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionViewControls.ui
@@ -1,745 +1,745 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>MRPerfusionViewControls</class>
  <widget class="QWidget" name="MRPerfusionViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>489</width>
     <height>1124</height>
    </rect>
   </property>
   <property name="sizePolicy">
    <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </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="sizeConstraint">
     <enum>QLayout::SetDefaultConstraint</enum>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <property name="spacing">
       <number>4</number>
      </property>
      <property name="sizeConstraint">
       <enum>QLayout::SetDefaultConstraint</enum>
      </property>
      <item>
       <layout class="QGridLayout" name="gridLayout_6">
        <item row="0" column="0">
         <widget class="QLabel" name="timeSeriesLabel">
          <property name="text">
           <string>Selected Time Series:</string>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="maskLabel">
          <property name="text">
           <string>Selected Mask:</string>
          </property>
         </widget>
        </item>
        <item row="0" column="1">
         <widget class="QmitkSingleNodeSelectionWidget" name="timeSeriesNodeSelector" native="true">
          <property name="minimumSize">
           <size>
            <width>0</width>
            <height>40</height>
           </size>
          </property>
         </widget>
        </item>
        <item row="1" column="1">
         <widget class="QmitkSingleNodeSelectionWidget" name="maskNodeSelector" native="true">
          <property name="minimumSize">
           <size>
            <width>0</width>
            <height>40</height>
           </size>
          </property>
         </widget>
        </item>
       </layout>
      </item>
      <item>
       <widget class="QGroupBox" name="groupBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
        <property name="title">
         <string>Fitting strategy</string>
        </property>
        <layout class="QHBoxLayout" name="horizontalLayout_3">
         <property name="spacing">
          <number>5</number>
         </property>
         <property name="sizeConstraint">
          <enum>QLayout::SetMinAndMaxSize</enum>
         </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>
          <widget class="QRadioButton" name="radioPixelBased">
           <property name="minimumSize">
            <size>
             <width>0</width>
             <height>0</height>
            </size>
           </property>
           <property name="text">
            <string>Pixel based</string>
           </property>
           <property name="checked">
            <bool>true</bool>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QRadioButton" name="radioROIbased">
           <property name="minimumSize">
            <size>
             <width>0</width>
             <height>0</height>
            </size>
           </property>
           <property name="text">
            <string>ROI based</string>
           </property>
          </widget>
         </item>
        </layout>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QComboBox" name="comboModel">
      <item>
       <property name="text">
-       <string>Select pharmacokinetic modell...</string>
+       <string>Select pharmacokinetic model...</string>
       </property>
      </item>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupAIF">
      <property name="title">
       <string>AIF Mask:</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_5">
       <item>
        <widget class="QRadioButton" name="radioAIFImage">
         <property name="text">
          <string>Select AIF from Image:</string>
         </property>
        </widget>
       </item>
       <item>
        <layout class="QGridLayout" name="gridLayout_3">
         <property name="leftMargin">
          <number>20</number>
         </property>
         <item row="0" column="0">
          <widget class="QLabel" name="labelAIFMask">
           <property name="text">
            <string>AIF Mask:</string>
           </property>
          </widget>
         </item>
         <item row="2" column="0">
          <widget class="QCheckBox" name="checkDedicatedAIFImage">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Dedicated AIF Image:</string>
           </property>
          </widget>
         </item>
         <item row="0" column="2">
          <widget class="QmitkSingleNodeSelectionWidget" name="AIFMaskNodeSelector" native="true">
           <property name="minimumSize">
            <size>
             <width>0</width>
             <height>40</height>
            </size>
           </property>
          </widget>
         </item>
         <item row="2" column="2">
          <widget class="QmitkSingleNodeSelectionWidget" name="AIFImageNodeSelector" native="true">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="minimumSize">
            <size>
             <width>0</width>
             <height>40</height>
            </size>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout_5">
         <property name="spacing">
          <number>0</number>
         </property>
         <item>
          <widget class="QRadioButton" name="radioAIFFile">
           <property name="text">
            <string>Select AIF from File: </string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLineEdit" name="aifFilePath"/>
         </item>
         <item>
          <widget class="QPushButton" name="btnAIFFile">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Browse</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout_6">
         <property name="topMargin">
          <number>5</number>
         </property>
         <item>
          <widget class="QLabel" name="label">
           <property name="text">
            <string>Hematocrit Level [  ]:</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QDoubleSpinBox" name="HCLSpinBox">
           <property name="maximum">
            <double>1.000000000000000</double>
           </property>
           <property name="singleStep">
            <double>0.010000000000000</double>
           </property>
          </widget>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupDescBrix">
      <property name="title">
       <string>Descriptive Brix-Model Parameters:</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
       <property name="fieldGrowthPolicy">
        <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
       </property>
       <item row="0" column="0">
        <widget class="QLabel" name="lableInjectionTime">
         <property name="text">
          <string>Injection Time [min]: </string>
         </property>
        </widget>
       </item>
       <item row="0" column="1">
        <widget class="QDoubleSpinBox" name="injectiontime"/>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupNum2CXM">
      <property name="title">
       <string>Numeric Two Compartment Exchange Model Parameters:</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_2">
       <item row="0" column="0">
        <widget class="QLabel" name="Label">
         <property name="text">
          <string>ODE Int Step Size [s]: </string>
         </property>
        </widget>
       </item>
       <item row="0" column="1">
        <widget class="QDoubleSpinBox" name="odeStepSize">
         <property name="decimals">
          <number>3</number>
         </property>
         <property name="singleStep">
          <double>0.001000000000000</double>
         </property>
         <property name="value">
          <double>0.050000000000000</double>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox_FitConfiguration">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="title">
       <string>Model Fit Configuration</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QToolBox" name="toolboxConfiguration">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <widget class="QWidget" name="groupStartParameter">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>459</width>
            <height>84</height>
           </rect>
          </property>
          <attribute name="label">
           <string>Start parameter</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_6">
           <item>
            <widget class="QRadioButton" name="radioButton_StartParameters">
             <property name="text">
              <string>Enter Fit Starting Parameters</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QmitkInitialValuesManagerWidget" name="initialValuesManager" native="true">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
            </widget>
           </item>
          </layout>
         </widget>
         <widget class="QWidget" name="groupConstraints">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>459</width>
            <height>232</height>
           </rect>
          </property>
          <attribute name="label">
           <string>Constraints</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_9">
           <item>
            <widget class="QCheckBox" name="checkBox_Constraints">
             <property name="text">
              <string>Enter Constraints for Fit Parameters</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QmitkSimpleBarrierManagerWidget" name="constraintManager" native="true">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="minimumSize">
              <size>
               <width>0</width>
               <height>200</height>
              </size>
             </property>
            </widget>
           </item>
          </layout>
         </widget>
         <widget class="QWidget" name="groupConcentration">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>449</width>
            <height>397</height>
           </rect>
          </property>
          <attribute name="label">
           <string>Conversion: Signal to Concentration</string>
          </attribute>
          <layout class="QHBoxLayout" name="horizontalLayout_8">
           <item>
            <layout class="QVBoxLayout" name="concentrationOptionsLayout">
             <property name="topMargin">
              <number>10</number>
             </property>
             <item>
              <widget class="QRadioButton" name="radioButtonNoConversion">
               <property name="text">
                <string>No Signal Conversion</string>
               </property>
               <property name="checked">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QRadioButton" name="radioButton_absoluteEnhancement">
               <property name="text">
                <string>Absolute Signal Enhancement</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QRadioButton" name="radioButton_relativeEnchancement">
               <property name="text">
                <string>Relative Signal Enhancement</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QRadioButton" name="radioButtonUsingT1viaVFA">
               <property name="text">
                <string>Using T1 Map via Variable Flip Angle</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QRadioButton" name="radioButtonTurboFlash">
               <property name="text">
                <string>TurboFLASH Sequence</string>
               </property>
              </widget>
             </item>
             <item>
              <spacer name="verticalSpacer_2">
               <property name="orientation">
                <enum>Qt::Vertical</enum>
               </property>
               <property name="sizeHint" stdset="0">
                <size>
                 <width>20</width>
                 <height>40</height>
                </size>
               </property>
              </spacer>
             </item>
            </layout>
           </item>
           <item>
            <layout class="QVBoxLayout" name="concentrationSettingsLayout">
             <item>
              <widget class="QGroupBox" name="groupBoxEnhancement">
               <property name="title">
                <string>Enhancement Parameters:</string>
               </property>
               <layout class="QVBoxLayout" name="verticalLayout_7">
                <item>
                 <widget class="QLabel" name="label_Faktor">
                  <property name="text">
                   <string>Conversion Factor k:</string>
                  </property>
                 </widget>
                </item>
                <item>
                 <widget class="QDoubleSpinBox" name="factorSpinBox"/>
                </item>
                <item>
                 <widget class="QLabel" name="label_baselineRange">
                  <property name="text">
                   <string>Baseline Range Selection:</string>
                  </property>
                  <property name="alignment">
                   <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
                  </property>
                 </widget>
                </item>
                <item>
                 <layout class="QGridLayout" name="gridLayout_4">
                  <item row="0" column="1">
                   <widget class="QSpinBox" name="spinBox_baselineStartTimeStep"/>
                  </item>
                  <item row="0" column="0">
                   <widget class="QLabel" name="label_baselineStartTimeStep">
                    <property name="text">
                     <string>Start Time Frame</string>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="0">
                   <widget class="QLabel" name="label_baselineEndTimeStep">
                    <property name="text">
                     <string>End Time Frame</string>
                    </property>
                   </widget>
                  </item>
                  <item row="1" column="1">
                   <widget class="QSpinBox" name="spinBox_baselineEndTimeStep"/>
                  </item>
                 </layout>
                </item>
               </layout>
              </widget>
             </item>
             <item>
              <widget class="QGroupBox" name="groupBox_T1MapviaVFA">
               <property name="title">
                <string>T1 Map via Variable Flip Angle Parameters:</string>
               </property>
               <layout class="QGridLayout" name="gridLayout_5">
                <item row="1" column="0">
                 <widget class="QLabel" name="label_7">
                  <property name="text">
                   <string>Flip Angle [ ° ] : </string>
                  </property>
                 </widget>
                </item>
                <item row="0" column="0">
                 <widget class="QLabel" name="label_6">
                  <property name="text">
                   <string>Repetition Time TR [ms] :</string>
                  </property>
                 </widget>
                </item>
                <item row="2" column="0">
                 <widget class="QLabel" name="label_9">
                  <property name="text">
                   <string>Relaxivity [mM⁻¹ s⁻¹] : </string>
                  </property>
                 </widget>
                </item>
                <item row="1" column="1">
                 <widget class="QDoubleSpinBox" name="FlipangleSpinBox"/>
                </item>
                <item row="2" column="1">
                 <widget class="QDoubleSpinBox" name="RelaxivitySpinBox"/>
                </item>
                <item row="3" column="0">
                 <widget class="QLabel" name="label_8">
                  <property name="text">
                   <string>Proton Density Weighted Image :</string>
                  </property>
                 </widget>
                </item>
                <item row="0" column="1">
                 <widget class="QDoubleSpinBox" name="TRSpinBox">
                  <property name="maximum">
                   <double>10000.000000000000000</double>
                  </property>
                 </widget>
                </item>
                <item row="3" column="1">
                 <widget class="QmitkSingleNodeSelectionWidget" name="PDWImageNodeSelector" native="true"/>
                </item>
               </layout>
              </widget>
             </item>
             <item>
              <widget class="QGroupBox" name="groupBoxTurboFlash">
               <property name="enabled">
                <bool>true</bool>
               </property>
               <property name="title">
                <string>Turbo FLASH Parameters:</string>
               </property>
               <layout class="QGridLayout" name="gridLayout">
                <item row="1" column="0">
                 <widget class="QLabel" name="lable_TRec">
                  <property name="text">
                   <string>Recovery Time [s]:</string>
                  </property>
                 </widget>
                </item>
                <item row="2" column="1">
                 <widget class="QDoubleSpinBox" name="relaxationtime"/>
                </item>
                <item row="0" column="0">
                 <widget class="QLabel" name="label_25">
                  <property name="text">
                   <string>AIF Recovery Time [s]:</string>
                  </property>
                 </widget>
                </item>
                <item row="0" column="1">
                 <widget class="QDoubleSpinBox" name="AifRecoverytime"/>
                </item>
                <item row="3" column="1">
                 <widget class="QDoubleSpinBox" name="relaxivity"/>
                </item>
                <item row="2" column="0">
                 <widget class="QLabel" name="label_T10">
                  <property name="text">
                   <string>Relaxation Time [s]:</string>
                  </property>
                 </widget>
                </item>
                <item row="1" column="1">
                 <widget class="QDoubleSpinBox" name="recoverytime"/>
                </item>
                <item row="3" column="0">
                 <widget class="QLabel" name="label__alpha">
                  <property name="text">
                   <string>Relaxivity [ ]:</string>
                  </property>
                 </widget>
                </item>
               </layout>
              </widget>
             </item>
            </layout>
           </item>
          </layout>
         </widget>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_7">
      <property name="topMargin">
       <number>5</number>
      </property>
      <item>
       <widget class="QLabel" name="label_5">
        <property name="text">
         <string>Fitting name:</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLineEdit" name="lineFitName">
        <property name="toolTip">
         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name/prefix that should be used for the fitting results.&lt;/p&gt;&lt;p&gt;May be explicitly defined by the user.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
        <property name="statusTip">
         <string/>
        </property>
        <property name="placeholderText">
         <string>default fit name</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QPushButton" name="btnModelling">
      <property name="text">
       <string>Start Modelling</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QCheckBox" name="checkDebug">
      <property name="text">
       <string>Generate debug parameter images</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QTextEdit" name="infoBox">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="readOnly">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeType">
       <enum>QSizePolicy::Expanding</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkSimpleBarrierManagerWidget</class>
    <extends>QWidget</extends>
    <header>QmitkSimpleBarrierManagerWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkInitialValuesManagerWidget</class>
    <extends>QWidget</extends>
    <header>QmitkInitialValuesManagerWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header>QmitkSingleNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.cpp b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.cpp
index 9e4a74c8c1..5b5eadb97b 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.cpp
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.cpp
@@ -1,946 +1,923 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "PETDynamicView.h"
 
 #include "mitkWorkbenchUtil.h"
 
 
 #include "mitkAterialInputFunctionGenerator.h"
 
 #include "mitkOneTissueCompartmentModelFactory.h"
 #include "mitkOneTissueCompartmentModelParameterizer.h"
 #include "mitkExtendedOneTissueCompartmentModelFactory.h"
 #include "mitkExtendedOneTissueCompartmentModelParameterizer.h"
 #include "mitkTwoTissueCompartmentFDGModelFactory.h"
 #include "mitkTwoTissueCompartmentFDGModelParameterizer.h"
 #include "mitkTwoTissueCompartmentModelFactory.h"
 #include "mitkTwoTissueCompartmentModelParameterizer.h"
-#include "mitkNumericTwoTissueCompartmentModelFactory.h"
-#include "mitkNumericTwoTissueCompartmentModelParameterizer.h"
-
 
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkPixelBasedParameterFitImageGenerator.h>
 #include <mitkROIBasedParameterFitImageGenerator.h>
 #include <mitkLevenbergMarquardtModelFitFunctor.h>
 #include <mitkSumOfSquaredDifferencesFitCostFunction.h>
 #include <mitkSquaredDifferencesFitCostFunction.h>
 #include <mitkChiSquareFitCostFunction.h>
 #include <mitkReducedChiSquareFitCostFunction.h>
 #include <mitkSimpleBarrierConstraintChecker.h>
 #include <mitkModelFitResultHelper.h>
 #include <mitkImageTimeSelector.h>
 #include <mitkMaskedDynamicImageStatisticsGenerator.h>
 #include <mitkExtractTimeGrid.h>
 #include <mitkInitialParameterizationDelegateBase.h>
 
 #include <QMessageBox>
 #include <QThreadPool>
 #include <QmitkDataStorageComboBox.h>
 #include <QFileDialog>
 #include <boost/tokenizer.hpp>
 
 
 // Includes for image casting between ITK and MITK
 #include <mitkImage.h>
 #include "mitkImageCast.h"
 #include "mitkITKImageImport.h"
 #include <itkImage.h>
 #include <itkImageRegionIterator.h>
 #include <iostream>
 
 
 const std::string PETDynamicView::VIEW_ID = "org.mitk.views.pharmacokinetics.pet";
 
 inline double convertToDouble(const std::string& data)
 {
   std::istringstream stepStream(data);
   double value = 0.0;
   stepStream >> value;
   return value;
 }
 
 void PETDynamicView::SetFocus()
 {
   m_Controls.btnModelling->setFocus();
 }
 
 void PETDynamicView::CreateQtPartControl(QWidget* parent)
 {
   m_Controls.setupUi(parent);
 
   m_Controls.btnModelling->setEnabled(false);
   m_Controls.errorMessageLabel->hide();
 
   this->InitModelComboBox();
 
   connect(m_Controls.btnModelling, SIGNAL(clicked()), this, SLOT(OnModellingButtonClicked()));
 
   connect(m_Controls.comboModel, SIGNAL(currentIndexChanged(int)), this, SLOT(OnModellSet(int)));
   connect(m_Controls.radioPixelBased, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
 
   //AIF setting
   m_Controls.groupAIF->hide();
   m_Controls.btnAIFFile->setEnabled(false);
   m_Controls.btnAIFFile->setEnabled(false);
   m_Controls.radioAIFImage->setChecked(true);
   m_Controls.comboAIFMask->SetDataStorage(this->GetDataStorage());
   m_Controls.comboAIFMask->SetPredicate(m_IsMaskPredicate);
   m_Controls.comboAIFMask->setVisible(true);
   m_Controls.comboAIFMask->setEnabled(true);
   m_Controls.comboAIFImage->SetDataStorage(this->GetDataStorage());
   m_Controls.comboAIFImage->SetPredicate(m_IsNoMaskImagePredicate);
   m_Controls.comboAIFImage->setEnabled(false);
   m_Controls.checkDedicatedAIFImage->setEnabled(true);
   m_Controls.HCLSpinBox->setValue(0.0);
 
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.comboAIFMask,
           SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.labelAIFMask,
           SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage,
           SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.comboAIFMask,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.checkDedicatedAIFImage,
           SLOT(setVisible(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), m_Controls.comboAIFImage,
           SLOT(setVisible(bool)));
   connect(m_Controls.checkDedicatedAIFImage, SIGNAL(toggled(bool)), m_Controls.comboAIFImage,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFImage, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), m_Controls.btnAIFFile,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), m_Controls.aifFilePath,
           SLOT(setEnabled(bool)));
   connect(m_Controls.radioAIFFile, SIGNAL(toggled(bool)), this, SLOT(UpdateGUIControls()));
 
   connect(m_Controls.btnAIFFile, SIGNAL(clicked()), this, SLOT(LoadAIFfromFile()));
 
   //Model fit configuration
   m_Controls.groupBox_FitConfiguration->hide();
 
   m_Controls.checkBox_Constraints->setEnabled(false);
   m_Controls.constraintManager->setEnabled(false);
   m_Controls.initialValuesManager->setEnabled(false);
   m_Controls.initialValuesManager->setDataStorage(this->GetDataStorage());
 
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)), this,
           SLOT(UpdateGUIControls()));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), this,
           SLOT(UpdateGUIControls()));
   connect(m_Controls.initialValuesManager, SIGNAL(initialValuesChanged(void)), this, SLOT(UpdateGUIControls()));
 
 
   connect(m_Controls.radioButton_StartParameters, SIGNAL(toggled(bool)),
           m_Controls.initialValuesManager,
           SLOT(setEnabled(bool)));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager,
           SLOT(setEnabled(bool)));
   connect(m_Controls.checkBox_Constraints, SIGNAL(toggled(bool)), m_Controls.constraintManager,
           SLOT(setVisible(bool)));
 
 
   UpdateGUIControls();
 
 }
 
 void PETDynamicView::UpdateGUIControls()
 {
   m_Controls.lineFitName->setPlaceholderText(QString::fromStdString(this->GetDefaultFitName()));
   m_Controls.lineFitName->setEnabled(!m_FittingInProgress);
 
   m_Controls.checkBox_Constraints->setEnabled(m_modelConstraints.IsNotNull());
 
    bool is1TCMFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
    bool isExt1TCMFactory = dynamic_cast<mitk::ExtendedOneTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
    bool isFDGCMFactory = dynamic_cast<mitk::TwoTissueCompartmentFDGModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
 
   bool is2TCMFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>
-                       (m_selectedModelFactory.GetPointer()) != nullptr ||
-                       dynamic_cast<mitk::NumericTwoTissueCompartmentModelFactory*>
                        (m_selectedModelFactory.GetPointer()) != nullptr;
 
 
   m_Controls.groupAIF->setVisible(is1TCMFactory || isExt1TCMFactory || isFDGCMFactory || is2TCMFactory);
 
   m_Controls.groupBox_FitConfiguration->setVisible(m_selectedModelFactory);
 
   m_Controls.groupBox->setEnabled(!m_FittingInProgress);
   m_Controls.comboModel->setEnabled(!m_FittingInProgress);
   m_Controls.groupAIF->setEnabled(!m_FittingInProgress);
   m_Controls.groupBox_FitConfiguration->setEnabled(!m_FittingInProgress);
 
   m_Controls.radioROIbased->setEnabled(m_selectedMask.IsNotNull());
 
   m_Controls.btnModelling->setEnabled(m_selectedImage.IsNotNull()
                                       && m_selectedModelFactory.IsNotNull() && !m_FittingInProgress && CheckModelSettings());
 }
 
 //void PETDynamicView::OnModelSettingChanged()
 //{
 //  bool ok = m_selectedImage.IsNotNull() && m_selectedModelFactory.IsNotNull() && !m_FittingInProgress && CheckModelSettings();
 
 //  m_Controls.btnModelling->setEnabled(ok);
 //}
 
 
 void PETDynamicView::OnModellSet(int index)
 {
   m_selectedModelFactory = nullptr;
 
   if (index > 0)
   {
     if (static_cast<ModelFactoryStackType::size_type>(index) <= m_FactoryStack.size() )
     {
         m_selectedModelFactory = m_FactoryStack[index - 1];
     }
     else
     {
         MITK_WARN << "Invalid model index. Index outside of the factory stack. Factory stack size: "<< m_FactoryStack.size() << "; invalid index: "<< index;
     }
   }
 
   if (m_selectedModelFactory)
   {
     this->m_modelConstraints = dynamic_cast<mitk::SimpleBarrierConstraintChecker*>
                                (m_selectedModelFactory->CreateDefaultConstraints().GetPointer());
 
     m_Controls.initialValuesManager->setInitialValues(m_selectedModelFactory->GetParameterNames(),
         m_selectedModelFactory->GetDefaultInitialParameterization());
 
     if (this->m_modelConstraints.IsNull())
     {
       this->m_modelConstraints = mitk::SimpleBarrierConstraintChecker::New();
     }
 
     m_Controls.constraintManager->setChecker(this->m_modelConstraints,
         this->m_selectedModelFactory->GetParameterNames());
   }
 
   m_Controls.checkBox_Constraints->setEnabled(m_modelConstraints.IsNotNull());
 
 
   UpdateGUIControls();
 }
 
 std::string PETDynamicView::GetFitName() const
 {
   std::string fitName = m_Controls.lineFitName->text().toStdString();
   if (fitName.empty())
   {
     fitName = m_Controls.lineFitName->placeholderText().toStdString();
   }
   return fitName;
 }
 
 std::string PETDynamicView::GetDefaultFitName() const
 {
     std::string defaultName = "undefined model";
 
     if (this->m_selectedModelFactory.IsNotNull())
     {
         defaultName = this->m_selectedModelFactory->GetClassID();
     }
 
     if (this->m_Controls.radioPixelBased->isChecked())
     {
         defaultName += "_pixel";
     }
     else
     {
         defaultName += "_roi";
     }
 
     return defaultName;
 }
 
 
 void PETDynamicView::OnModellingButtonClicked()
 {
   //check if all static parameters set
   if (m_selectedModelFactory.IsNotNull() && CheckModelSettings())
   {
     mitk::ParameterFitImageGeneratorBase::Pointer generator = nullptr;
     mitk::modelFit::ModelFitInfo::Pointer fitSession = nullptr;
 
 
     bool isOTCFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isextOTCFactory = dynamic_cast<mitk::ExtendedOneTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
 
     bool isFDGFactory = dynamic_cast<mitk::TwoTissueCompartmentFDGModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
 
     bool isTTCFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isNumTTCFactory = dynamic_cast<mitk::NumericTwoTissueCompartmentModelFactory*>
-                           (m_selectedModelFactory.GetPointer()) != nullptr;
 
 
     if (isOTCFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::OneTissueCompartmentModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::OneTissueCompartmentModelParameterizer>(fitSession, generator);
       }
     }
 
     else if (isextOTCFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::ExtendedOneTissueCompartmentModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::ExtendedOneTissueCompartmentModelParameterizer>(fitSession, generator);
       }
     }
     else if (isFDGFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::TwoTissueCompartmentFDGModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::TwoTissueCompartmentFDGModelParameterizer>(fitSession, generator);
       }
     }
 
 
     else if (isTTCFactory)
     {
       if (this->m_Controls.radioPixelBased->isChecked())
       {
         GenerateModelFit_PixelBased<mitk::TwoTissueCompartmentModelParameterizer>(fitSession, generator);
       }
       else
       {
         GenerateModelFit_ROIBased<mitk::TwoTissueCompartmentModelParameterizer>(fitSession, generator);
       }
     }
 
-    else if (isNumTTCFactory)
-    {
-      if (this->m_Controls.radioPixelBased->isChecked())
-      {
-        GenerateModelFit_PixelBased<mitk::NumericTwoTissueCompartmentModelParameterizer>(fitSession,
-            generator);
-      }
-      else
-      {
-        GenerateModelFit_ROIBased<mitk::NumericTwoTissueCompartmentModelParameterizer>(fitSession,
-            generator);
-      }
-    }
 
     //add other models with else if
 
     if (generator.IsNotNull() && fitSession.IsNotNull())
     {
       m_FittingInProgress = true;
       DoFit(fitSession, generator);
     }
     else
     {
       QMessageBox box;
       box.setText("Fitting error!");
       box.setInformativeText("Could not establish fitting job. Error when setting ab generator, model parameterizer or session info.");
       box.setStandardButtons(QMessageBox::Ok);
       box.setDefaultButton(QMessageBox::Ok);
       box.setIcon(QMessageBox::Warning);
       box.exec();
     }
 
   }
   else
   {
     QMessageBox box;
     box.setText("Static parameters for model are not set!");
     box.setInformativeText("Some static parameters, that are needed for calculation are not set and equal to zero. Modeling not possible");
     box.setStandardButtons(QMessageBox::Ok);
     box.setDefaultButton(QMessageBox::Ok);
     box.setIcon(QMessageBox::Warning);
     box.exec();
   }
 }
 
 
 void PETDynamicView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/,
                                         const QList<mitk::DataNode::Pointer>& selectedNodes)
 {
     m_selectedMaskNode = nullptr;
     m_selectedMask = nullptr;
 
     m_Controls.errorMessageLabel->setText("");
     m_Controls.masklabel->setText("No (valid) mask selected.");
     m_Controls.timeserieslabel->setText("No (valid) series selected.");
 
     QList<mitk::DataNode::Pointer> nodes = selectedNodes;
 
     if (nodes.size() > 0 && this->m_IsNoMaskImagePredicate->CheckNode(nodes.front()))
     {
       this->m_selectedNode = nodes.front();
       auto selectedImage = dynamic_cast<mitk::Image*>(this->m_selectedNode->GetData());
       m_Controls.timeserieslabel->setText((this->m_selectedNode->GetName()).c_str());
 
       if (selectedImage != this->m_selectedImage)
       {
         if (selectedImage)
         {
           this->m_Controls.initialValuesManager->setReferenceImageGeometry(selectedImage->GetGeometry());
         }
         else
         {
           this->m_Controls.initialValuesManager->setReferenceImageGeometry(nullptr);
         }
       }
       this->m_selectedImage = selectedImage;
       nodes.pop_front();
     }
     else
     {
       this->m_selectedNode = nullptr;
       this->m_selectedImage = nullptr;
       this->m_Controls.initialValuesManager->setReferenceImageGeometry(nullptr);
     }
 
     if (nodes.size() > 0 && this->m_IsMaskPredicate->CheckNode(nodes.front()))
     {
         this->m_selectedMaskNode = nodes.front();
         this->m_selectedMask = dynamic_cast<mitk::Image*>(this->m_selectedMaskNode->GetData());
 
         if (this->m_selectedMask->GetTimeSteps() > 1)
         {
           MITK_INFO <<
                     "Selected mask has multiple timesteps. Only use first timestep to mask model fit. Mask name: " <<
                     m_selectedMaskNode->GetName();
           mitk::ImageTimeSelector::Pointer maskedImageTimeSelector = mitk::ImageTimeSelector::New();
           maskedImageTimeSelector->SetInput(this->m_selectedMask);
           maskedImageTimeSelector->SetTimeNr(0);
           maskedImageTimeSelector->UpdateLargestPossibleRegion();
           this->m_selectedMask = maskedImageTimeSelector->GetOutput();
         }
 
         m_Controls.masklabel->setText((this->m_selectedMaskNode->GetName()).c_str());
     }
 
     if (m_selectedMask.IsNull())
     {
       this->m_Controls.radioPixelBased->setChecked(true);
     }
 
     m_Controls.errorMessageLabel->show();
 
     UpdateGUIControls();
 }
 
 bool PETDynamicView::CheckModelSettings() const
 {
   bool ok = true;
 
-  //check wether any model is set at all. Otherwise exit with false
+  //check whether any model is set at all. Otherwise exit with false
   if (m_selectedModelFactory.IsNotNull())
   {
 
     bool isOTCFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isextOTCFactory = dynamic_cast<mitk::ExtendedOneTissueCompartmentModelFactory*>
                           (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isFDGFactory = dynamic_cast<mitk::TwoTissueCompartmentFDGModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
     bool isTTCFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>
                         (m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isNumTTCFactory = dynamic_cast<mitk::NumericTwoTissueCompartmentModelFactory*>
-                           (m_selectedModelFactory.GetPointer()) != nullptr;
 
-    if (isOTCFactory || isextOTCFactory || isFDGFactory || isTTCFactory || isNumTTCFactory)
+    if (isOTCFactory || isextOTCFactory || isFDGFactory || isTTCFactory)
     {
         if (this->m_Controls.radioAIFImage->isChecked())
         {
           ok = ok && m_Controls.comboAIFMask->GetSelectedNode().IsNotNull();
 
           if (this->m_Controls.checkDedicatedAIFImage->isChecked())
           {
             ok = ok && m_Controls.comboAIFImage->GetSelectedNode().IsNotNull();
           }
         }
         else if (this->m_Controls.radioAIFFile->isChecked())
         {
           ok = ok && (this->AIFinputGrid.size() != 0) && (this->AIFinputFunction.size() != 0);
         }
         else
         {
           ok = false;
         }
 
      }
-    //add other models as else if and check wether all needed static parameters are set
+    //add other models as else if and check whether all needed static parameters are set
     else
     {
       ok = false;
     }
 
     if (this->m_Controls.radioButton_StartParameters->isChecked() && !this->m_Controls.initialValuesManager->hasValidInitialValues())
     {
       std::string warning = "Warning. Invalid start parameters. At least one parameter as an invalid image setting as source.";
       MITK_ERROR << warning;
       m_Controls.infoBox->append(QString("<font color='red'><b>") + QString::fromStdString(warning) + QString("</b></font>"));
 
       ok = false;
     };
   }
   else
   {
     ok = false;
   }
 
   return ok;
 }
 
 void PETDynamicView::ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase*
     parameterizer) const
 {
   if (m_Controls.radioButton_StartParameters->isChecked())
   {
     //use user defined initial parameters
     mitk::InitialParameterizationDelegateBase::Pointer paramDelegate = m_Controls.initialValuesManager->getInitialParametrizationDelegate();
     parameterizer->SetInitialParameterizationDelegate(paramDelegate);
   }
 }
 
 template <typename TParameterizer>
 void PETDynamicView::GenerateModelFit_PixelBased(
   mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo,
   mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::PixelBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::PixelBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
 
   mitk::AIFBasedModelBase::AterialInputFunctionType aif;
   mitk::AIFBasedModelBase::TimeGridType aifTimeGrid;
 
   GetAIF(aif, aifTimeGrid);
 
   //Model configuration (static parameters) can be done now
   modelParameterizer->SetAIF(aif);
   modelParameterizer->SetAIFTimeGrid(aifTimeGrid);
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   std::string roiUID = "";
 
   if (m_selectedMask.IsNotNull())
   {
     fitGenerator->SetMask(m_selectedMask);
     roiUID = m_selectedMask->GetUID();
   }
 
   fitGenerator->SetDynamicImage(this->m_selectedImage);
   fitGenerator->SetFitFunctor(fitFunctor);
 
   generator = fitGenerator.GetPointer();
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_PIXELBASED(), this->GetFitName(), roiUID);
 
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::AIFBasedModelBase::AterialInputFunctionType::const_iterator pos = aif.begin();
        pos != aif.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("AIF", infoSignal);
 }
 
 
 template <typename TParameterizer>
 void PETDynamicView::GenerateModelFit_ROIBased(
   mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo,
   mitk::ParameterFitImageGeneratorBase::Pointer& generator)
 {
   mitk::ROIBasedParameterFitImageGenerator::Pointer fitGenerator =
     mitk::ROIBasedParameterFitImageGenerator::New();
 
   typename TParameterizer::Pointer modelParameterizer =
     TParameterizer::New();
 
 
   //Compute AIF
   mitk::AterialInputFunctionGenerator::Pointer aifGenerator =
     mitk::AterialInputFunctionGenerator::New();
   aifGenerator->SetDynamicImage(this->m_selectedImage);
   aifGenerator->SetMask(this->m_selectedAIFMask);
 
   mitk::AIFBasedModelBase::AterialInputFunctionType aif = aifGenerator->GetAterialInputFunction();
   mitk::AIFBasedModelBase::TimeGridType aifTimeGrid = aifGenerator->GetAterialInputFunctionTimeGrid();
 
   //Model configuration (static parameters) can be done now
   modelParameterizer->SetAIF(aif);
   modelParameterizer->SetAIFTimeGrid(aifTimeGrid);
 
   this->ConfigureInitialParametersOfParameterizer(modelParameterizer);
 
   //Compute ROI signal
   mitk::MaskedDynamicImageStatisticsGenerator::Pointer signalGenerator =
     mitk::MaskedDynamicImageStatisticsGenerator::New();
   signalGenerator->SetMask(m_selectedMask);
   signalGenerator->SetDynamicImage(m_selectedImage);
   signalGenerator->Generate();
 
   mitk::MaskedDynamicImageStatisticsGenerator::ResultType roiSignal = signalGenerator->GetMean();
 
   //Specify fitting strategy and criterion parameters
   mitk::ModelFitFunctorBase::Pointer fitFunctor = CreateDefaultFitFunctor(modelParameterizer);
 
   //Parametrize fit generator
   fitGenerator->SetModelParameterizer(modelParameterizer);
   fitGenerator->SetMask(m_selectedMask);
   fitGenerator->SetFitFunctor(fitFunctor);
   fitGenerator->SetSignal(roiSignal);
   fitGenerator->SetTimeGrid(mitk::ExtractTimeGrid(m_selectedImage));
 
   generator = fitGenerator.GetPointer();
 
   std::string roiUID = "";
   if (m_selectedMask.IsNotNull())
   {
     roiUID = m_selectedMask->GetUID();
   }
 
   //Create model info
   modelFitInfo = mitk::modelFit::CreateFitInfoFromModelParameterizer(modelParameterizer,
     m_selectedNode->GetData(), mitk::ModelFitConstants::FIT_TYPE_VALUE_ROIBASED(), this->GetFitName(), roiUID);
 
   mitk::ScalarListLookupTable::ValueType infoSignal;
 
   for (mitk::MaskedDynamicImageStatisticsGenerator::ResultType::const_iterator pos =
          roiSignal.begin(); pos != roiSignal.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("ROI", infoSignal);
 
   infoSignal.clear();
 
   for (mitk::AIFBasedModelBase::AterialInputFunctionType::const_iterator pos = aif.begin();
        pos != aif.end(); ++pos)
   {
     infoSignal.push_back(*pos);
   }
 
   modelFitInfo->inputData.SetTableValue("AIF", infoSignal);
 }
 
 void PETDynamicView::DoFit(const mitk::modelFit::ModelFitInfo* fitSession,
                            mitk::ParameterFitImageGeneratorBase* generator)
 {
   std::stringstream message;
   message << "<font color='green'>" << "Fitting Data Set . . ." << "</font>";
   m_Controls.errorMessageLabel->setText(message.str().c_str());
   m_Controls.errorMessageLabel->show();
 
   /////////////////////////
   //create job and put it into the thread pool
   ParameterFitBackgroundJob* pJob = new ParameterFitBackgroundJob(generator, fitSession,
       this->m_selectedNode);
 
   pJob->setAutoDelete(true);
 
   connect(pJob, SIGNAL(Error(QString)), this, SLOT(OnJobError(QString)));
   connect(pJob, SIGNAL(Finished()), this, SLOT(OnJobFinished()));
   connect(pJob, SIGNAL(ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                        const ParameterFitBackgroundJob*)), this,
           SLOT(OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType,
                                         const ParameterFitBackgroundJob*)), Qt::BlockingQueuedConnection);
 
   connect(pJob, SIGNAL(JobProgress(double)), this, SLOT(OnJobProgress(double)));
   connect(pJob, SIGNAL(JobStatusChanged(QString)), this, SLOT(OnJobStatusChanged(QString)));
 
   QThreadPool* threadPool = QThreadPool::globalInstance();
   threadPool->start(pJob);
 }
 
 PETDynamicView::PETDynamicView() : m_FittingInProgress(false)
 {
   m_selectedImage = nullptr;
   m_selectedMask = nullptr;
 
   mitk::ModelFactoryBase::Pointer factory =
     mitk::OneTissueCompartmentModelFactory::New().GetPointer();
     m_FactoryStack.push_back(factory);
     factory = mitk::ExtendedOneTissueCompartmentModelFactory::New().GetPointer();
     m_FactoryStack.push_back(factory);
     factory = mitk::TwoTissueCompartmentModelFactory::New().GetPointer();
     m_FactoryStack.push_back(factory);
     factory = mitk::TwoTissueCompartmentFDGModelFactory::New().GetPointer();
     m_FactoryStack.push_back(factory);
-    factory = mitk::NumericTwoTissueCompartmentModelFactory::New().GetPointer();
-    m_FactoryStack.push_back(factory);
+
 
   mitk::NodePredicateDataType::Pointer isLabelSet = mitk::NodePredicateDataType::New("LabelSetImage");
   mitk::NodePredicateDataType::Pointer isImage = mitk::NodePredicateDataType::New("Image");
   mitk::NodePredicateProperty::Pointer isBinary = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
   mitk::NodePredicateAnd::Pointer isLegacyMask = mitk::NodePredicateAnd::New(isImage, isBinary);
 
   mitk::NodePredicateOr::Pointer isMask = mitk::NodePredicateOr::New(isLegacyMask, isLabelSet);
   mitk::NodePredicateAnd::Pointer isNoMask = mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isMask));
 
   this->m_IsMaskPredicate = mitk::NodePredicateAnd::New(isMask, mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 
   this->m_IsNoMaskImagePredicate = mitk::NodePredicateAnd::New(isNoMask, mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 
 }
 
 void PETDynamicView::OnJobFinished()
 {
   this->m_Controls.infoBox->append(QString("Fitting finished"));
   this->m_FittingInProgress = false;
 };
 
 void PETDynamicView::OnJobError(QString err)
 {
   MITK_ERROR << err.toStdString().c_str();
 
   m_Controls.infoBox->append(QString("<font color='red'><b>") + err + QString("</b></font>"));
 
 };
 
 void PETDynamicView::OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results,
     const ParameterFitBackgroundJob* pJob)
 {
   //Store the resulting parameter fit image via convenience helper function in data storage
   //(handles the correct generation of the nodes and their properties)
   mitk::modelFit::StoreResultsInDataStorage(this->GetDataStorage(), results, pJob->GetParentNode());
 
   m_Controls.errorMessageLabel->setText("");
   m_Controls.errorMessageLabel->hide();
 };
 
 void PETDynamicView::OnJobProgress(double progress)
 {
   QString report = QString("Progress. ") + QString::number(progress);
   this->m_Controls.infoBox->append(report);
 };
 
 void PETDynamicView::OnJobStatusChanged(QString info)
 {
   this->m_Controls.infoBox->append(info);
 }
 
 
 void PETDynamicView::InitModelComboBox() const
 {
   this->m_Controls.comboModel->clear();
   this->m_Controls.comboModel->addItem(tr("No model selected"));
 
   for (ModelFactoryStackType::const_iterator pos = m_FactoryStack.begin();
        pos != m_FactoryStack.end(); ++pos)
   {
     this->m_Controls.comboModel->addItem(QString::fromStdString((*pos)->GetClassID()));
   }
 
   this->m_Controls.comboModel->setCurrentIndex(0);
 };
 
 mitk::ModelFitFunctorBase::Pointer PETDynamicView::CreateDefaultFitFunctor(
   const mitk::ModelParameterizerBase* parameterizer) const
 {
   mitk::LevenbergMarquardtModelFitFunctor::Pointer fitFunctor =
     mitk::LevenbergMarquardtModelFitFunctor::New();
   mitk::SumOfSquaredDifferencesFitCostFunction::Pointer evaluation =
     mitk::SumOfSquaredDifferencesFitCostFunction::New();
 
   fitFunctor->RegisterEvaluationParameter("sum_diff^2", evaluation);
 
   mitk::ChiSquareFitCostFunction::Pointer chi2 =
           mitk::ChiSquareFitCostFunction::New();
   fitFunctor->RegisterEvaluationParameter("Chi^2", chi2);
 
   mitk::ReducedChiSquareFitCostFunction::Pointer redchi2 =
           mitk::ReducedChiSquareFitCostFunction::New();
   fitFunctor->RegisterEvaluationParameter("redChi^2", redchi2);
 
 
 
   if (m_Controls.checkBox_Constraints->isChecked())
   {
     fitFunctor->SetConstraintChecker(m_modelConstraints);
   }
 
   mitk::ModelBase::Pointer refModel = parameterizer->GenerateParameterizedModel();
 
   ::itk::LevenbergMarquardtOptimizer::ScalesType scales;
   scales.SetSize(refModel->GetNumberOfParameters());
   scales.Fill(1.0);
   fitFunctor->SetScales(scales);
 
   return fitFunctor.GetPointer();
 }
 
 void PETDynamicView::GetAIF(mitk::AIFBasedModelBase::AterialInputFunctionType& aif,
                              mitk::AIFBasedModelBase::AterialInputFunctionType& aifTimeGrid)
 {
   if (this->m_Controls.radioAIFFile->isChecked())
   {
     aif.clear();
     aifTimeGrid.clear();
 
     aif.SetSize(AIFinputFunction.size());
     aifTimeGrid.SetSize(AIFinputGrid.size());
 
     aif.fill(0.0);
     aifTimeGrid.fill(0.0);
 
     itk::Array<double>::iterator aifPos = aif.begin();
 
     for (std::vector<double>::const_iterator pos = AIFinputFunction.begin();
          pos != AIFinputFunction.end(); ++pos, ++aifPos)
     {
       *aifPos = *pos;
     }
 
     itk::Array<double>::iterator gridPos = aifTimeGrid.begin();
 
     for (std::vector<double>::const_iterator pos = AIFinputGrid.begin(); pos != AIFinputGrid.end();
          ++pos, ++gridPos)
     {
       *gridPos = *pos;
     }
   }
   else if (this->m_Controls.radioAIFImage->isChecked())
   {
     aif.clear();
     aifTimeGrid.clear();
 
     mitk::AterialInputFunctionGenerator::Pointer aifGenerator =
       mitk::AterialInputFunctionGenerator::New();
 
     //Hematocrit level
     aifGenerator->SetHCL(this->m_Controls.HCLSpinBox->value());
 
     //mask settings
     this->m_selectedAIFMaskNode = m_Controls.comboAIFMask->GetSelectedNode();
     this->m_selectedAIFMask = dynamic_cast<mitk::Image*>(this->m_selectedAIFMaskNode->GetData());
 
     if (this->m_selectedAIFMask->GetTimeSteps() > 1)
     {
       MITK_INFO <<
                 "Selected AIF mask has multiple timesteps. Only use first timestep to mask model fit. AIF Mask name: "
                 <<
                 m_selectedAIFMaskNode->GetName() ;
       mitk::ImageTimeSelector::Pointer maskedImageTimeSelector = mitk::ImageTimeSelector::New();
       maskedImageTimeSelector->SetInput(this->m_selectedAIFMask);
       maskedImageTimeSelector->SetTimeNr(0);
       maskedImageTimeSelector->UpdateLargestPossibleRegion();
       this->m_selectedAIFMask = maskedImageTimeSelector->GetOutput();
     }
 
     if (this->m_selectedAIFMask.IsNotNull())
     {
       aifGenerator->SetMask(this->m_selectedAIFMask);
     }
 
     //image settings
     if (this->m_Controls.checkDedicatedAIFImage->isChecked())
     {
       this->m_selectedAIFImageNode = m_Controls.comboAIFImage->GetSelectedNode();
       this->m_selectedAIFImage = dynamic_cast<mitk::Image*>(this->m_selectedAIFImageNode->GetData());
     }
     else
     {
       this->m_selectedAIFImageNode = m_selectedNode;
       this->m_selectedAIFImage = m_selectedImage;
     }
 
 
     aifGenerator->SetDynamicImage(this->m_selectedAIFImage);
 
     aif = aifGenerator->GetAterialInputFunction();
     aifTimeGrid = aifGenerator->GetAterialInputFunctionTimeGrid();
   }
   else
   {
-    mitkThrow() << "Cannot generate AIF. View is in a invalide state. No AIF mode selected.";
+    mitkThrow() << "Cannot generate AIF. View is in a invalid state. No AIF mode selected.";
   }
 
 }
 
 
 void PETDynamicView::LoadAIFfromFile()
 {
   QFileDialog dialog;
   dialog.setNameFilter(tr("Images (*.csv"));
 
   QString fileName = dialog.getOpenFileName();
 
   m_Controls.aifFilePath->setText(fileName);
 
   std::string m_aifFilePath = fileName.toStdString();
   //Read Input
   typedef boost::tokenizer< boost::escaped_list_separator<char> > Tokenizer;
   /////////////////////////////////////////////////////////////////////////////////////////////////
   //AIF Data
 
   std::ifstream in1(m_aifFilePath.c_str());
 
   if (!in1.is_open())
   {
     m_Controls.errorMessageLabel->setText("Could not open AIF File!");
   }
 
 
   std::vector< std::string > vec1;
   std::string line1;
 
   while (getline(in1, line1))
   {
     Tokenizer tok(line1);
     vec1.assign(tok.begin(), tok.end());
 
     //        if (vec1.size() < 3) continue;
 
     this->AIFinputGrid.push_back(convertToDouble(vec1[0]));
     this->AIFinputFunction.push_back(convertToDouble(vec1[1]));
 
   }
 
 }
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicViewControls.ui b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicViewControls.ui
index 7d15ec19da..ab1f608646 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicViewControls.ui
@@ -1,325 +1,325 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>PETDynamicViewControls</class>
  <widget class="QWidget" name="PETDynamicViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>745</width>
     <height>898</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">
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
       <layout class="QHBoxLayout" name="horizontalLayout">
        <item>
         <widget class="QLabel" name="label_2">
          <property name="text">
           <string>Selected Time Series:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="timeserieslabel">
          <property name="text">
           <string>No series selected.</string>
          </property>
         </widget>
        </item>
       </layout>
      </item>
      <item>
       <layout class="QHBoxLayout" name="horizontalLayout_2">
        <item>
         <widget class="QLabel" name="label_3">
          <property name="text">
           <string>Selected Mask:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="masklabel">
          <property name="text">
           <string>No mask selected.</string>
          </property>
         </widget>
        </item>
       </layout>
      </item>
      <item>
       <widget class="QGroupBox" name="groupBox">
        <property name="title">
         <string>Fitting strategy</string>
        </property>
        <layout class="QHBoxLayout" name="horizontalLayout_3">
         <property name="spacing">
          <number>5</number>
         </property>
         <property name="margin">
          <number>5</number>
         </property>
         <item>
          <widget class="QRadioButton" name="radioPixelBased">
           <property name="text">
            <string>Pixel based</string>
           </property>
           <property name="checked">
            <bool>true</bool>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QRadioButton" name="radioROIbased">
           <property name="text">
            <string>ROI based</string>
           </property>
          </widget>
         </item>
        </layout>
       </widget>
      </item>
      <item>
       <layout class="QHBoxLayout" name="horizontalLayout_4">
        <item>
         <widget class="QLabel" name="label_4">
          <property name="text">
           <string>Message</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="errorMessageLabel">
          <property name="text">
           <string>-</string>
          </property>
         </widget>
        </item>
       </layout>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QComboBox" name="comboModel">
      <item>
       <property name="text">
-       <string>Select pharmacokinetic modell...</string>
+       <string>Select pharmacokinetic model...</string>
       </property>
      </item>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupAIF">
      <property name="title">
       <string>AIF Mask:</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_5">
       <item>
        <widget class="QRadioButton" name="radioAIFImage">
         <property name="text">
          <string>Select AIF from Image:</string>
         </property>
        </widget>
       </item>
       <item>
        <layout class="QGridLayout" name="gridLayout">
         <item row="0" column="0">
          <widget class="QLabel" name="labelAIFMask">
           <property name="text">
            <string>AIF Mask:</string>
           </property>
          </widget>
         </item>
         <item row="1" column="0">
          <widget class="QCheckBox" name="checkDedicatedAIFImage">
           <property name="text">
            <string>Dedicated AIF Image:</string>
           </property>
          </widget>
         </item>
         <item row="0" column="1">
          <widget class="QmitkDataStorageComboBox" name="comboAIFMask" native="true"/>
         </item>
         <item row="1" column="1">
          <widget class="QmitkDataStorageComboBox" name="comboAIFImage" native="true"/>
         </item>
        </layout>
       </item>
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout_5">
         <item>
          <widget class="QRadioButton" name="radioAIFFile">
           <property name="text">
            <string>Select AIF from File:</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLineEdit" name="aifFilePath"/>
         </item>
         <item>
          <widget class="QPushButton" name="btnAIFFile">
           <property name="text">
            <string>Browse</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout_6">
         <item>
          <widget class="QLabel" name="label">
           <property name="text">
            <string>Whole Blood to Plasma Correction:</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QDoubleSpinBox" name="HCLSpinBox"/>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox_FitConfiguration">
      <property name="title">
       <string>Model Fit Configuration</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QToolBox" name="toolBox">
         <property name="currentIndex">
          <number>1</number>
         </property>
         <widget class="QWidget" name="groupStartParameter">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>701</width>
            <height>129</height>
           </rect>
          </property>
          <property name="toolTip">
           <string/>
          </property>
          <property name="whatsThis">
           <string/>
          </property>
          <attribute name="label">
           <string>Start Parameters</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_6">
           <item>
            <widget class="QRadioButton" name="radioButton_StartParameters">
             <property name="text">
              <string>Enter parameter starting values manually:</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QmitkInitialValuesManagerWidget" name="initialValuesManager" native="true"/>
           </item>
          </layout>
         </widget>
         <widget class="QWidget" name="groupConstraints">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>701</width>
            <height>129</height>
           </rect>
          </property>
          <attribute name="label">
           <string>Constraints</string>
          </attribute>
          <layout class="QVBoxLayout" name="verticalLayout_7">
           <item>
            <widget class="QCheckBox" name="checkBox_Constraints">
             <property name="text">
              <string>Enter Constraints for Fit Parameters</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QmitkSimpleBarrierManagerWidget" name="constraintManager" native="true"/>
           </item>
          </layout>
         </widget>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_7">
      <property name="leftMargin">
       <number>0</number>
      </property>
      <property name="topMargin">
       <number>0</number>
      </property>
      <item>
       <widget class="QLabel" name="label_5">
        <property name="text">
         <string>Fitting name:</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLineEdit" name="lineFitName"/>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QPushButton" name="btnModelling">
      <property name="text">
       <string>Start Modelling</string>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QTextEdit" name="infoBox">
      <property name="readOnly">
       <bool>true</bool>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkSimpleBarrierManagerWidget</class>
    <extends>QWidget</extends>
    <header>QmitkSimpleBarrierManagerWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkInitialValuesManagerWidget</class>
    <extends>QWidget</extends>
    <header>QmitkInitialValuesManagerWidget.h</header>
   </customwidget>
   <customwidget>
    <class>QmitkDataStorageComboBox</class>
    <extends>QWidget</extends>
    <header location="global">QmitkDataStorageComboBox.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.cpp b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.cpp
index 9a250cb94a..64cef01de2 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.cpp
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.cpp
@@ -1,1000 +1,880 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 <QMessageBox>
 
 #include "mitkWorkbenchUtil.h"
 
 #include "PerfusionDataSimulationView.h"
 
 #include "itkUnaryFunctorImageFilter.h"
 #include <boost/tokenizer.hpp>
 #include "mitkImageCast.h"
 #include "mitkImageTimeSelector.h"
 #include "mitkITKImageImport.h"
 #include "mitkGaussianNoiseFunctor.h"
 #include "mitkTwoCompartmentExchangeModel.h"
 #include "mitkTwoCompartmentExchangeModelParameterizer.h"
 #include "mitkTwoCompartmentExchangeModelFactory.h"
-#include "mitkNumericTwoCompartmentExchangeModel.h"
-#include "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
-#include "mitkNumericTwoCompartmentExchangeModelFactory.h"
 #include "mitkExtendedToftsModel.h"
 #include "mitkExtendedToftsModelFactory.h"
 #include "mitkExtendedToftsModelParameterizer.h"
 #include "mitkTwoTissueCompartmentModel.h"
 #include "mitkTwoTissueCompartmentModelParameterizer.h"
 #include "mitkTwoTissueCompartmentModelFactory.h"
 #include "mitkOneTissueCompartmentModel.h"
 #include "mitkOneTissueCompartmentModelParameterizer.h"
 #include "mitkOneTissueCompartmentModelFactory.h"
 #include "mitkModelSignalImageGenerator.h"
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateProperty.h>
 #include <mitkNodePredicateDataType.h>
 #include "mitkSimpleFunctorBase.h"
 #include "mitkArbitraryTimeGeometry.h"
 #include <iostream>
  #include <QFileDialog>
 
 const std::string PerfusionDataSimulationView::VIEW_ID = "org.mitk.views.pharmacokinetics.simulation";
 
 inline double convertToDouble(const std::string& data)
 {
   std::istringstream stepStream(data);
   stepStream.imbue(std::locale("C"));
   double value = 0.0;
 
   if (!(stepStream >> value) || !(stepStream.eof()))
   {
     mitkThrow() << "Cannot convert string to double. String: " << data;
   }
   return value;
 }
 
 inline double FindeMaxConcentration(std::vector<double> Concentration)
 {
     double maximum = Concentration[0];
     for (std::vector<double>::size_type i =0; i<Concentration.size(); ++i)
     {
         maximum = std::max(maximum, Concentration[i]);
     }
 return maximum;
 }
 
 void PerfusionDataSimulationView::SetFocus()
 {
     m_Controls.GenerateBtn->setFocus();
 }
 
 void PerfusionDataSimulationView::CreateQtPartControl(QWidget* parent)
 {
 	m_Controls.setupUi(parent);
     m_Controls.GenerateBtn->setEnabled(false);
 
     m_Controls.groupBox_TM->hide();
     m_Controls.groupBox_2CXM->hide();
     m_Controls.groupBox_2TCM->hide();
     m_Controls.groupBox_1TCM->hide();
     m_Controls.groupBox_CNR->hide();
 
     this->InitModelComboBox();
     /** #2 @todo Reduce code ?
      */
 
     m_Controls.comboBox_F->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_F->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_PS->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_PS->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_fp->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_fp->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_fi->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_fi->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_Ktrans->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_Ktrans->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_vp->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_vp->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_ve->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_ve->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_K1->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_K1->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_K2->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_K2->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_K3->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_K3->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_K4->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_K4->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_VB->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_VB->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_k1->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_k1->SetPredicate(m_IsNotABinaryImagePredicate);
 
     m_Controls.comboBox_k2->SetDataStorage(this->GetDataStorage());
     m_Controls.comboBox_k2->SetPredicate(m_IsNotABinaryImagePredicate);
 
     connect(m_Controls.AifFileBtn, SIGNAL(clicked()), this, SLOT(LoadAIFFile()));
     connect(m_Controls.ModelSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(OnModellSet(int)));
     connect(m_Controls.GenerateBtn, SIGNAL(clicked()), this, SLOT(OnGenerateDataButtonClicked()));
     connect(m_Controls.comboBox_F, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_PS, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_fp, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_fi, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_VB, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_K1, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_K2, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_K3, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_K4, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_k1, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_k2, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_Ktrans, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_vp, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.comboBox_ve, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.CNRSpinBox, SIGNAL(valueChanged(double)),this, SLOT(OnSimulationConfigurationChanged()));
     connect(m_Controls.NoiseCheckBox, SIGNAL(stateChanged(int)),this, SLOT(OnSimulationConfigurationChanged()));
 
 //    UpdateDataSelection();
 
   }
 
 void PerfusionDataSimulationView::UpdateDataSelection()
 {
 
 
 }
 
 //void PerfusionDataSimulationView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/,
 //    const QList<mitk::DataNode::Pointer>& selectedNodes)
 //{
 //    UpdateDataSelection();
 //    m_Controls.GenerateBtn->setEnabled(CheckModelSettings());
 
 //}
 
 void PerfusionDataSimulationView::OnSimulationConfigurationChanged()
 {
 //    UpdateDataSelection();
 
     m_Controls.groupBox_CNR->setVisible(m_Controls.NoiseCheckBox->isChecked());
 
     this->m_CNR = m_Controls.CNRSpinBox->value();
 
     m_Controls.GenerateBtn->setEnabled( CheckModelSettings() );
 
 
 }
 
 
 void PerfusionDataSimulationView::OnModellSet(int index)
 {
   m_selectedModelFactory = nullptr;
 
   if (index > 0)
   {
     if (static_cast<ModelFactoryStackType::size_type>(index) <= m_FactoryStack.size() )
     {
         m_selectedModelFactory = m_FactoryStack[index - 1];
     }
     else
     {
         MITK_WARN << "Invalid model index. Index outside of the factory stack. Factory stack size: "<< m_FactoryStack.size() << "; invalid index: "<< index;
     }
   }
 
   bool isToftsFactory = dynamic_cast<mitk::ExtendedToftsModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
-  bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr || dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
+  bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
   bool is2TCMFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
   bool is1TCMFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
 
   m_Controls.groupBox_TM->setVisible(isToftsFactory);
   m_Controls.groupBox_2CXM->setVisible(is2CXMFactory );
   m_Controls.groupBox_2TCM->setVisible(is2TCMFactory );
   m_Controls.groupBox_1TCM->setVisible(is1TCMFactory );
 
 
   m_Controls.GenerateBtn->setEnabled( CheckModelSettings() );
 //  UpdateDataSelection();
 
 
 }
 
 bool PerfusionDataSimulationView::CheckModelSettings()
 {
     bool ok = true;
     if(m_selectedModelFactory.IsNull())
     {
         return false;
     }
 
     if(this->m_AterialInputFunction.GetSize() == 0 || this->m_TimeGrid.GetSize() == 0)
     {
         return false;
 
     }
 
     bool isToftsFactory = dynamic_cast<mitk::ExtendedToftsModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
-    bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr || dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
+    bool is2CXMFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
     bool is2TCMFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
     bool is1TCMFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
 
 
     if(isToftsFactory)
     {
         ok = ok && m_Controls.comboBox_Ktrans->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_vp->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_ve->GetSelectedNode().IsNotNull();
     }
     else if(is2CXMFactory)
     {
         ok = ok && m_Controls.comboBox_F->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_PS->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_fp->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_fi->GetSelectedNode().IsNotNull();
     }
 
     else if(is2TCMFactory)
     {
         ok = ok && m_Controls.comboBox_K1->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_K2->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_K3->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_K4->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_VB->GetSelectedNode().IsNotNull();
     }
     else if(is1TCMFactory)
     {
         ok = ok && m_Controls.comboBox_k1->GetSelectedNode().IsNotNull();
         ok = ok && m_Controls.comboBox_k2->GetSelectedNode().IsNotNull();
      }
 
     else
     {
         return false;
 
     }
     if(m_Controls.NoiseCheckBox->isChecked())
     {
         if(m_CNR !=0 && m_MaxConcentration !=0)
         {
             this->m_Sigma = m_MaxConcentration/m_CNR;
         }
         if(m_Sigma==0)
         {
             return false;
         }
     }
 
 
 
     return ok;
 
 }
 
 
 void PerfusionDataSimulationView::InitModelComboBox() const
 {
   this->m_Controls.ModelSelection->clear();
   this->m_Controls.ModelSelection->addItem(tr("No model selected"));
 
   for (ModelFactoryStackType::const_iterator pos = m_FactoryStack.begin(); pos != m_FactoryStack.end(); ++pos)
   {
     this->m_Controls.ModelSelection->addItem(QString::fromStdString((*pos)->GetClassID()));
   }
   this->m_Controls.ModelSelection->setCurrentIndex(0);
 };
 
 
 void PerfusionDataSimulationView::LoadAIFFile()
 {
   QFileDialog dialog;
   dialog.setNameFilter(tr("Images (*.csv"));
 
   QString fileName = dialog.getOpenFileName();
 
   m_Controls.AifFilePath->setText( fileName );
 
   std::string aifFilePath = fileName.toStdString();
 
   //Read Input
   typedef boost::tokenizer< boost::escaped_list_separator<char> > Tokenizer;
   /////////////////////////////////////////////////////////////////////////////////////////////////
   //AIF Data
 
   std::vector<double> inputFunction;
   std::vector<double> inputGrid;
 
   std::ifstream in1(aifFilePath.c_str());
 
   if(!in1.is_open())
   {
       m_Controls.errorMessageLabel->setText("Could not open AIF File!");
   }
 
 
   std::vector< std::string > vec1;
   std::string line1;
 
   while (getline(in1,line1))
   {
       Tokenizer tok(line1);
       vec1.assign(tok.begin(),tok.end());
 
 //        if (vec1.size() < 3) continue;
 
       inputGrid.push_back(convertToDouble(vec1[0]));
       inputFunction.push_back(convertToDouble(vec1[1]));
 
   }
 
   this->m_MaxConcentration = FindeMaxConcentration(inputFunction);
 
   itk::Array<double> aif;
   itk::Array<double> grid;
 
   aif.SetSize(inputFunction.size());
   grid.SetSize(inputGrid.size());
 
   aif.fill(0.0);
   grid.fill(0.0);
 
   itk::Array<double>::iterator aifPos = aif.begin();
   for(std::vector<double>::const_iterator pos = inputFunction.begin(); pos != inputFunction.end(); ++pos, ++aifPos)
   {
       *aifPos = *pos;
   }
   itk::Array<double>::iterator gridPos = grid.begin();
   for(std::vector<double>::const_iterator pos = inputGrid.begin(); pos != inputGrid.end(); ++pos, ++gridPos)
   {
       *gridPos = *pos;
   }
 
   this->m_AterialInputFunction = aif;
   this->m_TimeGrid = grid;
 
 
   m_Controls.GenerateBtn->setEnabled( CheckModelSettings() );
 //  UpdateDataSelection();
 
 
 
 }
-/** @todo #2 Same function for Numeric and analytic version of FillParameterMap2CXM
+/** @todo #2 Same function for analytic version of FillParameterMap2CXM
  */
 void PerfusionDataSimulationView::FillParameterMap2CXM()
 {
     ParameterMapType stack;
 
     mitk::DataNode::Pointer m_selectedNode = m_Controls.comboBox_F->GetSelectedNode();
     mitk::Image::Pointer m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_F,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_PS->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_PS,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_fp->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_vp,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_fi->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_ve,m_selectedImage));
 
     this->m_ParameterImageMap = stack;
 
 }
 
 
-void PerfusionDataSimulationView::FillParameterMapNumeric2CXM()
-{
-    ParameterMapType stack;
-
-    mitk::DataNode::Pointer m_selectedNode = m_Controls.comboBox_F->GetSelectedNode();
-    mitk::Image::Pointer m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_F,m_selectedImage));
-
-    m_selectedNode = m_Controls.comboBox_PS->GetSelectedNode();
-    m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_PS,m_selectedImage));
-
-    m_selectedNode = m_Controls.comboBox_fp->GetSelectedNode();
-    m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_vp,m_selectedImage));
-
-    m_selectedNode = m_Controls.comboBox_fi->GetSelectedNode();
-    m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_ve,m_selectedImage));
-
-    this->m_ParameterImageMap = stack;
-
-}
 
 
 void PerfusionDataSimulationView::FillParameterMapETM()
 {
     ParameterMapType stack;
 
     mitk::DataNode::Pointer m_selectedNode = m_Controls.comboBox_Ktrans->GetSelectedNode();
     mitk::Image::Pointer m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::ExtendedToftsModel::NAME_PARAMETER_Ktrans,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_vp->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::ExtendedToftsModel::NAME_PARAMETER_vp,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_ve->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::ExtendedToftsModel::NAME_PARAMETER_ve,m_selectedImage));
 
 
     this->m_ParameterImageMap = stack;
 
 }
 
 void PerfusionDataSimulationView::FillParameterMap2TCM()
 {
     ParameterMapType stack;
 
     mitk::DataNode::Pointer m_selectedNode = m_Controls.comboBox_K1->GetSelectedNode();
     mitk::Image::Pointer m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_K1,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_K2->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k2,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_K3->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k3,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_K4->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k4,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_VB->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_VB,m_selectedImage));
+    stack.insert(std::make_pair(mitk::TwoTissueCompartmentModel::NAME_PARAMETER_vb,m_selectedImage));
 
     this->m_ParameterImageMap = stack;
 
 }
 
 void PerfusionDataSimulationView::FillParameterMap1TCM()
 {
     ParameterMapType stack;
 
     mitk::DataNode::Pointer m_selectedNode = m_Controls.comboBox_k1->GetSelectedNode();
     mitk::Image::Pointer m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
-    stack.insert(std::make_pair(mitk::OneTissueCompartmentModel::NAME_PARAMETER_k1,m_selectedImage));
+    stack.insert(std::make_pair(mitk::OneTissueCompartmentModel::NAME_PARAMETER_K1,m_selectedImage));
 
     m_selectedNode = m_Controls.comboBox_k2->GetSelectedNode();
     m_selectedImage = dynamic_cast<mitk::Image*>(m_selectedNode->GetData());
     stack.insert(std::make_pair(mitk::OneTissueCompartmentModel::NAME_PARAMETER_k2,m_selectedImage));
 
     this->m_ParameterImageMap = stack;
 
 }
 
 void PerfusionDataSimulationView::OnGenerateDataButtonClicked()
 {
     mitk::Image::Pointer m_DynamicImage = mitk::Image::New();
 
     bool isToftsFactory = dynamic_cast<mitk::ExtendedToftsModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
     bool isPhysBrixFactory = dynamic_cast<mitk::TwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
-    bool isNumPhysBrixFactory = dynamic_cast<mitk::NumericTwoCompartmentExchangeModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
     bool is2TCMFactory = dynamic_cast<mitk::TwoTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
     bool is1TCMFactory = dynamic_cast<mitk::OneTissueCompartmentModelFactory*>(m_selectedModelFactory.GetPointer()) != nullptr;
 
 
     if(isToftsFactory)
     {
        this->FillParameterMapETM();
         m_DynamicImage = this->GenerateETModelData();
     }
 
     if (isPhysBrixFactory)
     {
         this->FillParameterMap2CXM();
         m_DynamicImage = this->Generate2CXModelData();
     }
 
-    if (isNumPhysBrixFactory)
-    {
-        this->FillParameterMapNumeric2CXM();
-        m_DynamicImage = this->GenerateNumeric2CXModelData();
-    }
 
     if (is2TCMFactory)
     {
         this->FillParameterMap2TCM();
         m_DynamicImage = this->Generate2TCModelData();
     }
     if (is1TCMFactory)
     {
         this->FillParameterMap1TCM();
         m_DynamicImage = this->Generate1TCModelData();
     }
 
 
 
     mitk::DataNode::Pointer resultNode = mitk::DataNode::New();
     std::string nameOfResultImage = "SimulationData_";
     nameOfResultImage.append(m_selectedModelFactory->GetModelDisplayName());
     resultNode->SetProperty("name", mitk::StringProperty::New(nameOfResultImage) );
     resultNode->SetData(m_DynamicImage); // set data of new node
     this->GetDataStorage()->Add(resultNode);
 
 
 }
 
 mitk::Image::Pointer PerfusionDataSimulationView::Generate2CXModelData()
 {
 mitk::ModelSignalImageGenerator::Pointer generator = mitk::ModelSignalImageGenerator::New();
 mitk::TwoCompartmentExchangeModelParameterizer::Pointer modelParameterizer = mitk::TwoCompartmentExchangeModelParameterizer::New();
 
 /** @todo #2  necessary? Generator need to have a map with Parameters in order of Model in order to pass vector parameters correctly to Model.
- * I wanted to make it independend from the order the images are passed on
+ * I wanted to make it independent from the order the images are passed on
  */
 for(ParameterMapType::const_iterator pos = this->m_ParameterImageMap.begin(); pos != this->m_ParameterImageMap.end(); ++pos)
 {
     if(pos->first == mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_F)
     {
         generator->SetParameterInputImage(mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_F, pos->second);
     }
     if(pos->first == mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_PS)
     {
         generator->SetParameterInputImage(mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_PS, pos->second);
     }
     if(pos->first == mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_ve)
     {
         generator->SetParameterInputImage(mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_ve, pos->second);
     }
     if(pos->first == mitk::TwoCompartmentExchangeModel::NAME_PARAMETER_vp)
     {
         generator->SetParameterInputImage(mitk::TwoCompartmentExchangeModel::POSITION_PARAMETER_vp, pos->second);
     }
 }
 
 modelParameterizer->SetAIF(this->m_AterialInputFunction);
 modelParameterizer->SetAIFTimeGrid(this->m_TimeGrid);
 modelParameterizer->SetDefaultTimeGrid(this->m_TimeGrid);
 
 generator->SetParameterizer(modelParameterizer);
 
 mitk::Image::Pointer generatedImage = generator->GetGeneratedImage();
 
  mitk::Image::Pointer resultImage = mitk::Image::New();
 if(m_Controls.NoiseCheckBox->isChecked())
 {
     typedef itk::Image<double,3> ImageType;
 
     mitk::Image::Pointer tempImage = mitk::Image::New();
     tempImage->Initialize(generatedImage);
 
     mitk::ArbitraryTimeGeometry* timeGeometry = dynamic_cast<mitk::ArbitraryTimeGeometry*> (generatedImage->GetTimeGeometry());
 
     tempImage->SetTimeGeometry(timeGeometry);
 
     ImageType::Pointer itkImage = ImageType::New();
     mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
     imageTimeSelector->SetInput(generatedImage);
 
     for(unsigned int i = 0; i< generatedImage->GetTimeSteps(); ++i)
     {
         imageTimeSelector->SetTimeNr(i);
         imageTimeSelector->UpdateLargestPossibleRegion();
 
         mitk::Image::Pointer mitkInputImage = imageTimeSelector->GetOutput();
 
         mitk::CastToItkImage(mitkInputImage, itkImage );
 
         typedef mitk::GaussianNoiseFunctor<double,double> NoiseFunctorType;
         typedef itk::UnaryFunctorImageFilter<ImageType,ImageType, NoiseFunctorType > NoiseFilterType;
         NoiseFilterType::Pointer noiseFilter = NoiseFilterType::New();
         NoiseFunctorType noiseFunctor;
         noiseFunctor.SetMean(0.0);
         noiseFunctor.SetSigma(this->m_Sigma);
         noiseFilter->SetFunctor(noiseFunctor);
 
         noiseFilter->SetInput(itkImage);
 
         mitk::Image::Pointer outputImage = mitk::ImportItkImage(noiseFilter->GetOutput())->Clone();
 
         mitk::ImageReadAccessor accessor(outputImage);
         tempImage->SetVolume(accessor.GetData(), i);
     }
 
    resultImage = tempImage->Clone();
 }
 else
 {
     resultImage = generatedImage;
 }
 return resultImage;
 }
 
 
-/** @todo #2  Synergie? Function implementation for every Model to complicated?
- */
-mitk::Image::Pointer PerfusionDataSimulationView::GenerateNumeric2CXModelData()
-{
-mitk::ModelSignalImageGenerator::Pointer generator = mitk::ModelSignalImageGenerator::New();
-mitk::NumericTwoCompartmentExchangeModelParameterizer::Pointer modelParameterizer = mitk::NumericTwoCompartmentExchangeModelParameterizer::New();
-
-for(ParameterMapType::const_iterator pos = this->m_ParameterImageMap.begin(); pos != this->m_ParameterImageMap.end(); ++pos)
-{
-    if(pos->first == mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_F)
-    {
-        generator->SetParameterInputImage(mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_F, pos->second);
-    }
-    if(pos->first == mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_PS)
-    {
-        generator->SetParameterInputImage(mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_PS, pos->second);
-    }
-    if(pos->first == mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_ve)
-    {
-        generator->SetParameterInputImage(mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_ve, pos->second);
-    }
-    if(pos->first == mitk::NumericTwoCompartmentExchangeModel::NAME_PARAMETER_vp)
-    {
-        generator->SetParameterInputImage(mitk::NumericTwoCompartmentExchangeModel::POSITION_PARAMETER_vp, pos->second);
-    }
-}
-
-modelParameterizer->SetAIF(this->m_AterialInputFunction);
-modelParameterizer->SetAIFTimeGrid(this->m_TimeGrid);
-modelParameterizer->SetDefaultTimeGrid(this->m_TimeGrid);
-modelParameterizer->SetODEINTStepSize(0.05);
-
-generator->SetParameterizer(modelParameterizer);
-
-mitk::Image::Pointer generatedImage = generator->GetGeneratedImage();
-
-
-mitk::Image::Pointer resultImage = mitk::Image::New();
-if(m_Controls.NoiseCheckBox->isChecked())
-{
-   typedef itk::Image<double,3> ImageType;
-
-   mitk::Image::Pointer tempImage = mitk::Image::New();
-   tempImage->Initialize(generatedImage);
-
-   mitk::ArbitraryTimeGeometry* timeGeometry = dynamic_cast<mitk::ArbitraryTimeGeometry*> (generatedImage->GetTimeGeometry());
-
-   tempImage->SetTimeGeometry(timeGeometry);
-
-   ImageType::Pointer itkImage = ImageType::New();
-   mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
-   imageTimeSelector->SetInput(generatedImage);
-
-   for(unsigned int i = 0; i< generatedImage->GetTimeSteps(); ++i)
-   {
-       imageTimeSelector->SetTimeNr(i);
-       imageTimeSelector->UpdateLargestPossibleRegion();
-
-       mitk::Image::Pointer mitkInputImage = imageTimeSelector->GetOutput();
-
-       mitk::CastToItkImage(mitkInputImage, itkImage );
-
-       typedef mitk::GaussianNoiseFunctor<double,double> NoiseFunctorType;
-       typedef itk::UnaryFunctorImageFilter<ImageType,ImageType, NoiseFunctorType > NoiseFilterType;
-       NoiseFilterType::Pointer noiseFilter = NoiseFilterType::New();
-       NoiseFunctorType noiseFunctor;
-       noiseFunctor.SetMean(0.0);
-       noiseFunctor.SetSigma(this->m_Sigma);
-       noiseFilter->SetFunctor(noiseFunctor);
-
-       noiseFilter->SetInput(itkImage);
-
-       mitk::Image::Pointer outputImage = mitk::ImportItkImage(noiseFilter->GetOutput())->Clone();
-
-       mitk::ImageReadAccessor accessor(outputImage);
-       tempImage->SetVolume(accessor.GetData(), i);
-   }
-
-  resultImage = tempImage->Clone();
-}
-else
-{
-   resultImage = generatedImage;
-}
-return resultImage;
-}
 
 mitk::Image::Pointer PerfusionDataSimulationView::GenerateETModelData()
 {
 mitk::ModelSignalImageGenerator::Pointer generator = mitk::ModelSignalImageGenerator::New();
 mitk::ExtendedToftsModelParameterizer::Pointer modelParameterizer = mitk::ExtendedToftsModelParameterizer::New();
 
 for(ParameterMapType::const_iterator pos = this->m_ParameterImageMap.begin(); pos != this->m_ParameterImageMap.end(); ++pos)
 {
     if(pos->first == mitk::ExtendedToftsModel::NAME_PARAMETER_Ktrans)
     {
         generator->SetParameterInputImage(mitk::ExtendedToftsModel::POSITION_PARAMETER_Ktrans, pos->second);
     }
     if(pos->first == mitk::ExtendedToftsModel::NAME_PARAMETER_vp)
     {
         generator->SetParameterInputImage(mitk::ExtendedToftsModel::POSITION_PARAMETER_vp, pos->second);
     }
     if(pos->first == mitk::ExtendedToftsModel::NAME_PARAMETER_ve)
     {
         generator->SetParameterInputImage(mitk::ExtendedToftsModel::POSITION_PARAMETER_ve, pos->second);
     }
 
 }
 
 modelParameterizer->SetAIF(this->m_AterialInputFunction);
 modelParameterizer->SetAIFTimeGrid(this->m_TimeGrid);
 modelParameterizer->SetDefaultTimeGrid(this->m_TimeGrid);
 
 generator->SetParameterizer(modelParameterizer);
 
 mitk::Image::Pointer generatedImage = generator->GetGeneratedImage();
 
 
 mitk::Image::Pointer resultImage = mitk::Image::New();
 if(m_Controls.NoiseCheckBox->isChecked())
 {
    typedef itk::Image<double,3> ImageType;
 
    mitk::Image::Pointer tempImage = mitk::Image::New();
    tempImage->Initialize(generatedImage);
 
    mitk::ArbitraryTimeGeometry* timeGeometry = dynamic_cast<mitk::ArbitraryTimeGeometry*> (generatedImage->GetTimeGeometry());
 
    tempImage->SetTimeGeometry(timeGeometry);
 
    ImageType::Pointer itkImage = ImageType::New();
    mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
    imageTimeSelector->SetInput(generatedImage);
 
    for(unsigned int i = 0; i< generatedImage->GetTimeSteps(); ++i)
    {
        imageTimeSelector->SetTimeNr(i);
        imageTimeSelector->UpdateLargestPossibleRegion();
 
        mitk::Image::Pointer mitkInputImage = imageTimeSelector->GetOutput();
 
        mitk::CastToItkImage(mitkInputImage, itkImage );
 
        typedef mitk::GaussianNoiseFunctor<double,double> NoiseFunctorType;
        typedef itk::UnaryFunctorImageFilter<ImageType,ImageType, NoiseFunctorType > NoiseFilterType;
        NoiseFilterType::Pointer noiseFilter = NoiseFilterType::New();
        NoiseFunctorType noiseFunctor;
        noiseFunctor.SetMean(0.0);
        noiseFunctor.SetSigma(this->m_Sigma);
        noiseFilter->SetFunctor(noiseFunctor);
 
        noiseFilter->SetInput(itkImage);
 
        mitk::Image::Pointer outputImage = mitk::ImportItkImage(noiseFilter->GetOutput())->Clone();
 
        mitk::ImageReadAccessor accessor(outputImage);
        tempImage->SetVolume(accessor.GetData(), i);
    }
 
   resultImage = tempImage->Clone();
 }
 else
 {
    resultImage = generatedImage;
 }
 return resultImage;
 }
 
 
 mitk::Image::Pointer PerfusionDataSimulationView::Generate2TCModelData()
 {
 mitk::ModelSignalImageGenerator::Pointer generator = mitk::ModelSignalImageGenerator::New();
 mitk::TwoTissueCompartmentModelParameterizer::Pointer modelParameterizer = mitk::TwoTissueCompartmentModelParameterizer::New();
 
 
 for(ParameterMapType::const_iterator pos = this->m_ParameterImageMap.begin(); pos != this->m_ParameterImageMap.end(); ++pos)
 {
     if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_K1)
     {
         generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_K1, pos->second);
     }
     if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k2)
     {
         generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k2, pos->second);
     }
     if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k3)
     {
         generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k3, pos->second);
     }
     if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_k4)
     {
         generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_k4, pos->second);
     }
-    if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_VB)
+    if(pos->first == mitk::TwoTissueCompartmentModel::NAME_PARAMETER_vb)
     {
-        generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_VB, pos->second);
+        generator->SetParameterInputImage(mitk::TwoTissueCompartmentModel::POSITION_PARAMETER_vb, pos->second);
     }
 
 }
 
 modelParameterizer->SetAIF(this->m_AterialInputFunction);
 modelParameterizer->SetAIFTimeGrid(this->m_TimeGrid);
 modelParameterizer->SetDefaultTimeGrid(this->m_TimeGrid);
 
 generator->SetParameterizer(modelParameterizer);
 
 mitk::Image::Pointer generatedImage = generator->GetGeneratedImage();
 
  mitk::Image::Pointer resultImage = mitk::Image::New();
 if(m_Controls.NoiseCheckBox->isChecked())
 {
     typedef itk::Image<double,3> ImageType;
 
     mitk::Image::Pointer tempImage = mitk::Image::New();
     tempImage->Initialize(generatedImage);
 
     mitk::ArbitraryTimeGeometry* timeGeometry = dynamic_cast<mitk::ArbitraryTimeGeometry*> (generatedImage->GetTimeGeometry());
 
     tempImage->SetTimeGeometry(timeGeometry);
 
     ImageType::Pointer itkImage = ImageType::New();
     mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
     imageTimeSelector->SetInput(generatedImage);
 
     for(unsigned int i = 0; i< generatedImage->GetTimeSteps(); ++i)
     {
         imageTimeSelector->SetTimeNr(i);
         imageTimeSelector->UpdateLargestPossibleRegion();
 
         mitk::Image::Pointer mitkInputImage = imageTimeSelector->GetOutput();
 
         mitk::CastToItkImage(mitkInputImage, itkImage );
 
         typedef mitk::GaussianNoiseFunctor<double,double> NoiseFunctorType;
         typedef itk::UnaryFunctorImageFilter<ImageType,ImageType, NoiseFunctorType > NoiseFilterType;
         NoiseFilterType::Pointer noiseFilter = NoiseFilterType::New();
         NoiseFunctorType noiseFunctor;
         noiseFunctor.SetMean(0.0);
         noiseFunctor.SetSigma(this->m_Sigma);
         noiseFilter->SetFunctor(noiseFunctor);
 
         noiseFilter->SetInput(itkImage);
 
         mitk::Image::Pointer outputImage = mitk::ImportItkImage(noiseFilter->GetOutput())->Clone();
 
         mitk::ImageReadAccessor accessor(outputImage);
         tempImage->SetVolume(accessor.GetData(), i);
     }
 
    resultImage = tempImage->Clone();
 }
 else
 {
     resultImage = generatedImage;
 }
 return resultImage;
 }
 
 
 mitk::Image::Pointer PerfusionDataSimulationView::Generate1TCModelData()
 {
 mitk::ModelSignalImageGenerator::Pointer generator = mitk::ModelSignalImageGenerator::New();
 mitk::OneTissueCompartmentModelParameterizer::Pointer modelParameterizer = mitk::OneTissueCompartmentModelParameterizer::New();
 
 
 for(ParameterMapType::const_iterator pos = this->m_ParameterImageMap.begin(); pos != this->m_ParameterImageMap.end(); ++pos)
 {
-    if(pos->first == mitk::OneTissueCompartmentModel::NAME_PARAMETER_k1)
+    if(pos->first == mitk::OneTissueCompartmentModel::NAME_PARAMETER_K1)
     {
-        generator->SetParameterInputImage(mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k1, pos->second);
+        generator->SetParameterInputImage(mitk::OneTissueCompartmentModel::POSITION_PARAMETER_K1, pos->second);
     }
     if(pos->first == mitk::OneTissueCompartmentModel::NAME_PARAMETER_k2)
     {
         generator->SetParameterInputImage(mitk::OneTissueCompartmentModel::POSITION_PARAMETER_k2, pos->second);
     }
 
 }
 
 modelParameterizer->SetAIF(this->m_AterialInputFunction);
 modelParameterizer->SetAIFTimeGrid(this->m_TimeGrid);
 modelParameterizer->SetDefaultTimeGrid(this->m_TimeGrid);
 
 generator->SetParameterizer(modelParameterizer);
 
 mitk::Image::Pointer generatedImage = generator->GetGeneratedImage();
 
  mitk::Image::Pointer resultImage = mitk::Image::New();
 if(m_Controls.NoiseCheckBox->isChecked())
 {
     typedef itk::Image<double,3> ImageType;
 
     mitk::Image::Pointer tempImage = mitk::Image::New();
     tempImage->Initialize(generatedImage);
 
     mitk::ArbitraryTimeGeometry* timeGeometry = dynamic_cast<mitk::ArbitraryTimeGeometry*> (generatedImage->GetTimeGeometry());
 
     tempImage->SetTimeGeometry(timeGeometry);
 
     ImageType::Pointer itkImage = ImageType::New();
     mitk::ImageTimeSelector::Pointer imageTimeSelector = mitk::ImageTimeSelector::New();
     imageTimeSelector->SetInput(generatedImage);
 
     for(unsigned int i = 0; i< generatedImage->GetTimeSteps(); ++i)
     {
         imageTimeSelector->SetTimeNr(i);
         imageTimeSelector->UpdateLargestPossibleRegion();
 
         mitk::Image::Pointer mitkInputImage = imageTimeSelector->GetOutput();
 
         mitk::CastToItkImage(mitkInputImage, itkImage );
 
         typedef mitk::GaussianNoiseFunctor<double,double> NoiseFunctorType;
         typedef itk::UnaryFunctorImageFilter<ImageType,ImageType, NoiseFunctorType > NoiseFilterType;
         NoiseFilterType::Pointer noiseFilter = NoiseFilterType::New();
         NoiseFunctorType noiseFunctor;
         noiseFunctor.SetMean(0.0);
         noiseFunctor.SetSigma(this->m_Sigma);
         noiseFilter->SetFunctor(noiseFunctor);
 
         noiseFilter->SetInput(itkImage);
 
         mitk::Image::Pointer outputImage = mitk::ImportItkImage(noiseFilter->GetOutput())->Clone();
 
         mitk::ImageReadAccessor accessor(outputImage);
         tempImage->SetVolume(accessor.GetData(), i);
     }
 
    resultImage = tempImage->Clone();
 }
 else
 {
     resultImage = generatedImage;
 }
 return resultImage;
 }
 
 
 PerfusionDataSimulationView::PerfusionDataSimulationView()
 {
      m_Sigma = 0;
      m_CNR=0;
      m_MaxConcentration=0;
      m_selectedModelFactory = nullptr;
 
 
      mitk::ModelFactoryBase::Pointer factory = mitk::ExtendedToftsModelFactory::New().GetPointer();
      m_FactoryStack.push_back(factory);
      factory = mitk::TwoCompartmentExchangeModelFactory::New().GetPointer();
      m_FactoryStack.push_back(factory);
-     factory = mitk::NumericTwoCompartmentExchangeModelFactory::New().GetPointer();
-     m_FactoryStack.push_back(factory);
      factory = mitk::TwoTissueCompartmentModelFactory::New().GetPointer();
      m_FactoryStack.push_back(factory);
      factory = mitk::OneTissueCompartmentModelFactory::New().GetPointer();
      m_FactoryStack.push_back(factory);
 
 
 
      m_IsNotABinaryImagePredicate = mitk::NodePredicateAnd::New(
                  mitk::TNodePredicateDataType<mitk::Image>::New(),
                  mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true))),
                  mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))).GetPointer();
 
 }
diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h
index 7956d413f1..27cf365e0a 100644
--- a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h
+++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h
@@ -1,114 +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 PerfusionDataSimulationView_h
 #define PerfusionDataSimulationView_h
 
 #include <QString>
 
 #include <QmitkAbstractView.h>
 #include "ui_PerfusionDataSimulationViewControls.h"
 #include "mitkModelBase.h"
 #include <mitkModelFactoryBase.h>
 
 #include "itkArray.h"
 #include "mitkImage.h"
 
 #include <mitkImage.h>
 
 /*!
  *	@brief Test Plugin for SUV calculations of PET images
  */
 class PerfusionDataSimulationView : public QmitkAbstractView
 {
 	Q_OBJECT
 
 public:
 
 	/*! @brief The view's unique ID - required by MITK */
 	static const std::string VIEW_ID;
 
   PerfusionDataSimulationView();
 
 protected slots:
 
 	/*!
 	 *	@brief	Is triggered of the update button is clicked and the selected node should get the (new) iso level set.
 	 */
     void OnGenerateDataButtonClicked();
     void LoadAIFFile();
     void OnModellSet(int);
 
     void OnSimulationConfigurationChanged();
 
     void UpdateDataSelection();
 
 protected:
     typedef std::map<std::string, mitk::Image::Pointer> ParameterMapType;
 
 	// Overridden base class functions
 
 	/*!
 	 *	@brief					Sets up the UI controls and connects the slots and signals. Gets
 	 *							called by the framework to create the GUI at the right time.
 	 *	@param[in,out] parent	The parent QWidget, as this class itself is not a QWidget
 	 *							subclass.
 	 */
 	void CreateQtPartControl(QWidget* parent) override;
 
 	/*!
 	 *	@brief	Sets the focus to the plot curve button. Gets called by the framework to set the
 	 *			focus on the right widget.
 	 */
 	void SetFocus() override;
 
   void InitModelComboBox() const;
 
   mitk::Image::Pointer Generate2CXModelData();
-  mitk::Image::Pointer GenerateNumeric2CXModelData();
   mitk::Image::Pointer GenerateETModelData();
   void FillParameterMap2CXM();
-  void FillParameterMapNumeric2CXM();
   void FillParameterMapETM();
 
   ///////////////////// dynamic PET Models///////////////
   mitk::Image::Pointer Generate2TCModelData();
   mitk::Image::Pointer Generate1TCModelData();
   void FillParameterMap2TCM();
   void FillParameterMap1TCM();
 
 
   bool CheckModelSettings();
 
 	// Variables
 
 	/*! @brief The view's UI controls */
     Ui::PerfusionDataSimulationViewControls m_Controls;
     mitk::DataNode::Pointer m_selectedNode;
 
     ParameterMapType m_ParameterImageMap;
     itk::Array<double> m_AterialInputFunction;
     itk::Array<double> m_TimeGrid;
 
     mitk::ModelFactoryBase::Pointer m_selectedModelFactory;
 
 private:
 
     typedef std::vector<mitk::ModelFactoryBase::Pointer> ModelFactoryStackType;
     ModelFactoryStackType m_FactoryStack;
     mitk::NodePredicateBase::Pointer m_IsNotABinaryImagePredicate;
 
     double m_CNR, m_MaxConcentration, m_Sigma;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.cpp b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.cpp
index e3911c8ce6..e7bec0d4df 100644
--- a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.cpp
+++ b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.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.
 
 ============================================================================*/
 
 // Blueberry
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 // Qmitk
 #include "PointSetInteractionMultispectrum.h"
 #include "QmitkPointListWidget.h"
 #include "QmitkRenderWindow.h"
 
 // Qt
 #include <QMessageBox>
 #include <QApplication>
 #include <qwt_plot.h>
 #include <qwt_plot_curve.h>
 #include <qwt_plot_grid.h>
 #include <qwt_symbol.h>
 #include <qwt_legend.h>
 #include <QColor>
 #include <QString>
 
 //mitk image
 #include <mitkImage.h>
 #include <mitkImagePixelReadAccessor.h>
 
 // MITK
 #include "mitkITKImageImport.h"
 #include "mitkProperties.h"
 #include "mitkColorProperty.h"
 #include "mitkImageCast.h"
 #include <mitkVector.h>
 #include <mitkPoint.h>
 #include <mitkImageStatisticsHolder.h>
 // ITK
 #include <itkConnectedThresholdImageFilter.h>
 
 const std::string PointSetInteractionMultispectrum::VIEW_ID =
     "org.mitk.views.pointsetinteractionmultispectrum";
 
 PointSetInteractionMultispectrum::PointSetInteractionMultispectrum() :
                     m_PointListWidget(nullptr)
 {
 
 }
 
 void PointSetInteractionMultispectrum::SetFocus()
 {
   m_Controls.buttonPerformImageProcessing->setFocus();
 }
 
 void PointSetInteractionMultispectrum::CreateQtPartControl(QWidget *parent)
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi(parent);
   connect(m_Controls.buttonPerformImageProcessing, SIGNAL(clicked()), this,
       SLOT(DoImageProcessing()));
 
   //! [cpp-createqtpartcontrol]
   // create a QmitkPointListWidget and add it to the widget created from .ui file
   m_PointListWidget = new QmitkPointListWidget();
   m_Controls.verticalLayout->addWidget(m_PointListWidget, 1);
 
   // retrieve a possibly existing IRenderWindowPart
   if (mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart())
   {
     // let the point set widget know about the render window part (crosshair updates)
     RenderWindowPartActivated(renderWindowPart);
   }
 
   // create a new DataNode containing a PointSet with some interaction
   m_PointSet = mitk::PointSet::New();
   mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
   pointSetNode->SetData(m_PointSet);
   pointSetNode->SetName("points for displaying reflectance.");
   pointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true));
   pointSetNode->SetProperty("layer", mitk::IntProperty::New(1024));
 
   // add the pointset to the data storage (for rendering and access by other modules)
   GetDataStorage()->Add(pointSetNode);
 
   // tell the GUI widget about the point set
   m_PointListWidget->SetPointSetNode(pointSetNode);
   //! [cpp-createqtpartcontrol]
 
   m_Plot = new QwtPlot();
 }
 
 
 void PointSetInteractionMultispectrum::OnSelectionChanged(
     berry::IWorkbenchPart::Pointer /*source*/,
     const QList<mitk::DataNode::Pointer>& nodes) {
   // iterate all selected objects, adjust warning visibility
   foreach( mitk::DataNode::Pointer node, nodes ){
     if( node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()) )
     {
       m_Controls.labelWarning->setVisible( false );
       m_Controls.buttonPerformImageProcessing->setEnabled( true );
       return;
     }
   }
 
   m_Controls.labelWarning->setVisible( true );
   m_Controls.buttonPerformImageProcessing->setEnabled( false );
 }
 
 
 void PointSetInteractionMultispectrum::RenderWindowPartActivated(
     mitk::IRenderWindowPart* renderWindowPart)
 {
   // let the point set widget know about the slice navigation controllers
   // in the active render window part (crosshair updates)
   foreach(QmitkRenderWindow* renderWindow, renderWindowPart->GetQmitkRenderWindows().values())
                 {
     m_PointListWidget->AddSliceNavigationController(renderWindow->GetSliceNavigationController());
                 }
 }
 
 void PointSetInteractionMultispectrum::RenderWindowPartDeactivated(
     mitk::IRenderWindowPart* renderWindowPart)
 {
   foreach(QmitkRenderWindow* renderWindow, renderWindowPart->GetQmitkRenderWindows().values())
                 {
     m_PointListWidget->RemoveSliceNavigationController(renderWindow->GetSliceNavigationController());
                 }
 }
 
 void PointSetInteractionMultispectrum::DoImageProcessing()
 {
   QList<mitk::DataNode::Pointer> DataManagerNodes =
       this->GetDataManagerSelection();
   if (DataManagerNodes.empty())
     return;
 
   mitk::DataNode* DataManagerNode = DataManagerNodes.front();
 
   if (!DataManagerNode)
   {
     // Nothing selected. Inform the user and return
     QMessageBox::information( nullptr, "Template",
         "Please load and select an image before starting image processing.");
     return;
   }
 
   // here we have a valid mitk::DataNode
   // a node itself is not very useful, we need its data item (the image).
   // notice that this is the 'BaseData' type.
 
   mitk::BaseData* data = DataManagerNode->GetData();
   if (data)
   {
     // test if this data item is an image or not (could also be a surface or something totally different)
     mitk::Image* image = dynamic_cast<mitk::Image*>(data);
     if (image)
     {
       //! [cpp-doimageprocessing]
       // So we have an image. Let's see if the user has set some seed points already
       if (m_PointSet->GetSize() == 0)
       {
         // no points there. Not good for region growing
         QMessageBox::information( nullptr,
             "Reflectance display functionality",
             "Please set some points inside the image first.\n"
             "(hold Shift key and click left mouse button inside the image.)");
         return;
       }
 
       // plot the reflectances //
       PlotReflectance(m_PointSet, DataManagerNodes);
 
       //! [cpp-doimageprocessing]
     }
   }
 }
 
 
 void PointSetInteractionMultispectrum::PlotReflectance(mitk::PointSet::Pointer m_PointSet, QList<mitk::DataNode::Pointer> dataManagerNodes)
 {
-  mitk::PointSet::PointsIterator PtIterator; // The point iterator in the PointSet, which gets accesss to each point.
+  mitk::PointSet::PointsIterator PtIterator; // The point iterator in the PointSet, which gets access to each point.
   mitk::Point3D Point; // The extracted point. Notice that a point has three components (x, y, z).
   itk::Index<3> index; // The 3D index, which is converted from the world coordinate
-  itk::Index<2> index2; // The truncated version of the 3D index, for which only the first two componets are extracted.
+  itk::Index<2> index2; // The truncated version of the 3D index, for which only the first two components are extracted.
   itk::VectorImage<double, 2>::Pointer itkImage; // The itk vector image. This is used since the mitk::Image could not handle multi-channel images well.
 
 
   //    ////////////////  Qwt window configuration  /////////////////////////////////////////////
   delete m_Plot;
   m_Plot = new QwtPlot();                             // create a new plot               //
   m_Plot->setAxisAutoScale(QwtPlot::xBottom);         // automatical scale -x            //
   m_Plot->setAxisAutoScale(QwtPlot::yLeft);           // automatical scale -y            //
   m_Plot->setTitle("Multispectral Reflectance");     // set the plot title              //
   m_Plot->setCanvasBackground(Qt::white);             // set the background color        //
   m_Plot->insertLegend(new QwtLegend());              // set the legend                  //
   QwtPlotGrid* grid = new QwtPlotGrid();              // set the grid                    //
   grid->attach(m_Plot);                               // set the grid                    //
   m_Controls.verticalLayout->addWidget(m_Plot, 1);    // put the plot into the workbench //
 
   // the number of the plotted curve
   int curveIdx = 0;
 
   // iterate selected datanodes:
   for (auto node = dataManagerNodes.begin(); node != dataManagerNodes.end(); ++node)
   {
     mitk::BaseData* data = node->GetPointer()->GetData();
 
     // the current number of examined data point:
     int pointIdx = 0;
 
     if (data)
     {
       std::string curveNameString = "";
 
       node->GetPointer()->GetStringProperty("name", curveNameString);
 
       curveNameString += " point ";
 
       // test if this data item is an image or not (could also be a surface or something totally different)
       mitk::Image* image = dynamic_cast<mitk::Image*>(data);
       if (image)
       {
         // convert the MITK image to the ITK image //
         mitk::CastToItkImage(image, itkImage);
 
 
         ////////////////////////// main loop /////////////////////////////////
         int reflectanceIdx;
         itk::VariableLengthVector<double> reflectance;
         int channels;
 
         //  The loop goes through each point in the point set  //
         for (PtIterator = m_PointSet->Begin(0); PtIterator != m_PointSet->End(0); PtIterator++)
         {
 
           //  extract the reflectance on a given pixel  //
           Point = PtIterator.Value();
           image->GetGeometry(0)->WorldToIndex(Point, index);
           index2[0] = index[0];
           index2[1] = index[1];
           reflectance = itkImage->GetPixel(index2);
           channels = reflectance.GetNumberOfElements();
 
           //  plot the reflectance dynamically  //
           // create colors for each element in pointset.
           // "randomly" select colors for each added point by multiplying with prime.
           QColor curveColor((200 + (41 * curveIdx)) % 255, (89 * curveIdx) % 255,
               (37 * curveIdx) % 255);
 
           QString curveName(curveNameString.c_str());
           curveName.append(QString::number(pointIdx));
 
           QPolygonF qwtPoints;
           QwtPlotCurve* curve = new QwtPlotCurve();
           curve->setTitle(curveName);
           curve->setPen(curveColor, 4);
           curve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
           QwtSymbol *symbol = new QwtSymbol(QwtSymbol::Ellipse,
               QBrush(Qt::yellow), QPen(Qt::black, 2), QSize(10, 10));
 
           for (reflectanceIdx = 0; reflectanceIdx < channels; reflectanceIdx++)
           {
             qwtPoints<< QPointF((double) reflectanceIdx,reflectance.GetElement(reflectanceIdx));
           }
 
           curve->setSamples(qwtPoints);
           curve->setSymbol(symbol);
           curve->attach(m_Plot);
           m_Plot->show();
 
           ++curveIdx;
           ++pointIdx;
         }
       }
     }
   }
 
 }
 
diff --git a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.cpp b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.cpp
index 8927b738ff..653fa848a0 100644
--- a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.cpp
+++ b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.cpp
@@ -1,453 +1,453 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkPreprocessingResamplingView.h"
 
 // QT includes (GUI)
 #include <qlabel.h>
 #include <qspinbox.h>
 #include <qpushbutton.h>
 #include <qcheckbox.h>
 #include <qgroupbox.h>
 #include <qradiobutton.h>
 #include <qmessagebox.h>
 
 // Berry includes (selection service)
 #include <berryISelectionService.h>
 #include <berryIWorkbenchWindow.h>
 
 // MITK includes (GUI)
 #include "QmitkDataNodeSelectionProvider.h"
 #include "mitkDataNodeObject.h"
 
 // MITK includes (general)
 #include "mitkNodePredicateDataType.h"
 #include "mitkNodePredicateDimension.h"
 #include "mitkNodePredicateAnd.h"
 #include "mitkImageTimeSelector.h"
 #include "mitkVectorImageMapper2D.h"
 #include "mitkProperties.h"
 #include "mitkLevelWindowProperty.h"
 #include <mitkTimeNavigationController.h>
 
 // Includes for image casting between ITK and MITK
 #include "mitkImageCast.h"
 #include "mitkITKImageImport.h"
 
 // ITK includes (general)
 #include <itkVectorImage.h>
 #include <itkImageFileWriter.h>
 
 // Resampling
 #include <itkResampleImageFilter.h>
 #include <itkNearestNeighborInterpolateImageFunction.h>
 #include <itkBSplineInterpolateImageFunction.h>
 #include <itkCastImageFilter.h>
 #include <itkLinearInterpolateImageFunction.h>
 
 #include <itkRescaleIntensityImageFilter.h>
 #include <itkShiftScaleImageFilter.h>
 
 // STD
 #include <cmath>
 
 
 // Convenient Definitions
 typedef itk::Image<double, 3>                                                           ImageType;
 typedef itk::Image<unsigned char, 3>                                                    SegmentationImageType;
 typedef itk::Image<double, 3>                                                           DoubleImageType;
 typedef itk::Image<itk::Vector<float,3>, 3>                                             VectorImageType;
 
 typedef itk::ResampleImageFilter< ImageType, ImageType >                                ResampleImageFilterType;
 typedef itk::ResampleImageFilter< ImageType, ImageType >                                ResampleImageFilterType2;
 typedef itk::CastImageFilter< ImageType, DoubleImageType >                               ImagePTypeToFloatPTypeCasterType;
 
 typedef itk::LinearInterpolateImageFunction< ImageType, double >                        LinearInterpolatorType;
 typedef itk::NearestNeighborInterpolateImageFunction< ImageType, double >               NearestInterpolatorType;
 typedef itk::BSplineInterpolateImageFunction<ImageType, double>                         BSplineInterpolatorType;
 
 
 QmitkPreprocessingResampling::QmitkPreprocessingResampling()
 : QmitkAbstractView(),
   m_Controls(nullptr),
   m_SelectedImageNode(nullptr),
   m_TimeStepperAdapter(nullptr)
 {
 }
 
 QmitkPreprocessingResampling::~QmitkPreprocessingResampling()
 {
 }
 
 void QmitkPreprocessingResampling::CreateQtPartControl(QWidget *parent)
 {
   if (m_Controls == nullptr)
   {
     m_Controls = new Ui::QmitkPreprocessingResamplingViewControls;
     m_Controls->setupUi(parent);
     this->CreateConnections();
 
     mitk::NodePredicateDimension::Pointer dimensionPredicate = mitk::NodePredicateDimension::New(3);
     mitk::NodePredicateDataType::Pointer imagePredicate = mitk::NodePredicateDataType::New("Image");
   }
 
   m_SelectedImageNode = mitk::DataStorageSelection::New(this->GetDataStorage(), false);
 
   // Setup Controls
   this->m_Controls->cbParam4->clear();
   this->m_Controls->cbParam4->insertItem(LINEAR, "Linear");
   this->m_Controls->cbParam4->insertItem(NEAREST, "Nearest neighbor");
   this->m_Controls->cbParam4->insertItem(SPLINE, "B-Spline");
 
 }
 
 void QmitkPreprocessingResampling::CreateConnections()
 {
   if ( m_Controls )
   {
     connect((QObject*)(m_Controls->btnDoIt), SIGNAL(clicked()), (QObject*) this, SLOT(StartButtonClicked()));
     connect((QObject*)(m_Controls->buttonExecuteOnMultipleImages), SIGNAL(clicked()), (QObject*) this, SLOT(StartMultipleImagesButtonClicked()));
     connect( (QObject*)(m_Controls->cbParam4), SIGNAL( activated(int) ), this, SLOT( SelectInterpolator(int) ) );
   }
 }
 
 void QmitkPreprocessingResampling::InternalGetTimeNavigationController()
 {
   auto* timeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
   if(nullptr != timeNavigationController)
   {
     m_TimeStepperAdapter = new QmitkStepperAdapter(m_Controls->timeSliceNavigationWidget, timeNavigationController->GetStepper());
   }
 }
 
 void QmitkPreprocessingResampling::SetFocus()
 {
 }
 
 //datamanager selection changed
 void QmitkPreprocessingResampling::OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>& nodes)
 {
   ResetOneImageOpPanel();
   //any nodes there?
   if (!nodes.empty())
   {
     // reset GUI
     m_Controls->timeSliceNavigationWidget->setEnabled(false);
     m_Controls->leImage1->setText(tr("Select an Image in Data Manager"));
 
     m_SelectedNodes.clear();
 
     for (mitk::DataNode* _DataNode : nodes)
     {
       m_SelectedImageNode->RemoveAllNodes();
       *m_SelectedImageNode = _DataNode;
       mitk::Image::Pointer tempImage = dynamic_cast<mitk::Image*>(m_SelectedImageNode->GetNode()->GetData());
 
       //no image
       if (tempImage.IsNull() || (tempImage->IsInitialized() == false))
       {
         if (m_SelectedNodes.size() < 1)
         {
           m_Controls->leImage1->setText(tr("Not an image."));
         }
         continue;
       }
 
       //2D image
       if (tempImage->GetDimension() < 3)
       {
         if (m_SelectedNodes.size() < 1)
         {
           m_Controls->leImage1->setText(tr("2D images are not supported."));
         }
         continue;
       }
 
       if (m_SelectedNodes.size() < 1)
       {
         m_Controls->leImage1->setText(QString(m_SelectedImageNode->GetNode()->GetName().c_str()));
         mitk::Vector3D aSpacing = tempImage->GetGeometry()->GetSpacing();
         std::string text("x-spacing (" + std::to_string(aSpacing[0]) + ")");
         m_Controls->tlParam1->setText(text.c_str());
         text = "y-spacing (" + std::to_string(aSpacing[1]) + ")";
         m_Controls->tlParam2->setText(text.c_str());
         text = "z-spacing (" + std::to_string(aSpacing[2]) + ")";
         m_Controls->tlParam3->setText(text.c_str());
 
         if (tempImage->GetDimension() > 3)
         {
           // try to retrieve the TNC (for 4-D Processing )
           this->InternalGetTimeNavigationController();
 
           m_Controls->timeSliceNavigationWidget->setEnabled(true);
           m_Controls->tlTime->setEnabled(true);
         }
       }
       m_SelectedNodes.push_back(_DataNode);
     }
     if (m_SelectedNodes.size() > 0)
     {
       *m_SelectedImageNode = m_SelectedNodes[0];
     }
     ResetParameterPanel();
   }
 }
 
 void QmitkPreprocessingResampling::ResetOneImageOpPanel()
 {
   m_Controls->tlTime->setEnabled(false);
   m_Controls->btnDoIt->setEnabled(false);
   m_Controls->buttonExecuteOnMultipleImages->setEnabled(false);
   m_Controls->cbHideOrig->setEnabled(false);
   m_Controls->leImage1->setText(tr("Select an Image in Data Manager"));
   m_Controls->tlParam1->setText("x-spacing");
   m_Controls->tlParam1->setText("y-spacing");
   m_Controls->tlParam1->setText("z-spacing");
 }
 
 void QmitkPreprocessingResampling::ResetParameterPanel()
 {
   m_Controls->btnDoIt->setEnabled(true);
   m_Controls->buttonExecuteOnMultipleImages->setEnabled(true);
   m_Controls->cbHideOrig->setEnabled(true);
 }
 
 void QmitkPreprocessingResampling::ResetTwoImageOpPanel()
 {
 }
 
 void QmitkPreprocessingResampling::StartMultipleImagesButtonClicked()
 {
   for (auto currentSelectedNode : m_SelectedNodes)
   {
     m_SelectedImageNode->RemoveAllNodes();
     *m_SelectedImageNode = currentSelectedNode;
     StartButtonClicked();
   }
 }
 
 void QmitkPreprocessingResampling::StartButtonClicked()
 {
   if(!m_SelectedImageNode->GetNode()) return;
 
   this->BusyCursorOn();
 
   mitk::Image::Pointer newImage;
 
   try
   {
     newImage = dynamic_cast<mitk::Image*>(m_SelectedImageNode->GetNode()->GetData());
   }
   catch ( std::exception &e )
   {
-  QString exceptionString = tr("An error occured during image loading:\n");
+  QString exceptionString = tr("An error occurred during image loading:\n");
   exceptionString.append( e.what() );
     QMessageBox::warning( nullptr, "Preprocessing - Resampling: ", exceptionString , QMessageBox::Ok, QMessageBox::NoButton );
     this->BusyCursorOff();
     return;
   }
 
   // check if input image is valid, casting does not throw exception when casting from 'NULL-Object'
   if ( (! newImage) || (newImage->IsInitialized() == false) )
   {
     this->BusyCursorOff();
 
     QMessageBox::warning( nullptr, "Preprocessing - Resampling", tr("Input image is broken or not initialized. Returning."), QMessageBox::Ok, QMessageBox::NoButton );
     return;
   }
 
   // check if operation is done on 4D a image time step
   if(newImage->GetDimension() > 3)
   {
     mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
     timeSelector->SetInput(newImage);
     timeSelector->SetTimeNr(m_Controls->timeSliceNavigationWidget->GetPos());
     timeSelector->Update();
     newImage = timeSelector->GetOutput();
   }
 
   // check if image or vector image
   ImageType::Pointer itkImage = ImageType::New();
   VectorImageType::Pointer itkVecImage = VectorImageType::New();
 
   int isVectorImage = newImage->GetPixelType().GetNumberOfComponents();
 
   if(isVectorImage > 1)
   {
     CastToItkImage( newImage, itkVecImage );
   }
   else
   {
     CastToItkImage( newImage, itkImage );
   }
 
   std::stringstream nameAddition("");
 
   double dparam1 = m_Controls->dsbParam1->value();
   double dparam2 = m_Controls->dsbParam2->value();
   double dparam3 = m_Controls->dsbParam3->value();
 
   try{
 
       std::string selectedInterpolator;
       ResampleImageFilterType::Pointer resampler = ResampleImageFilterType::New();
       switch (m_SelectedInterpolation)
       {
       case LINEAR:
         {
           LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Linear";
           break;
         }
       case NEAREST:
         {
           NearestInterpolatorType::Pointer interpolator = NearestInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Nearest";
           break;
       }
       case SPLINE:
       {
         BSplineInterpolatorType::Pointer interpolator = BSplineInterpolatorType::New();
         interpolator->SetSplineOrder(3);
         resampler->SetInterpolator(interpolator);
         selectedInterpolator = "B-Spline";
         break;
       }
       default:
         {
           LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New();
           resampler->SetInterpolator(interpolator);
           selectedInterpolator = "Linear";
           break;
         }
       }
       resampler->SetInput( itkImage );
       resampler->SetOutputOrigin( itkImage->GetOrigin() );
 
       ImageType::SizeType input_size = itkImage->GetLargestPossibleRegion().GetSize();
       ImageType::SpacingType input_spacing = itkImage->GetSpacing();
 
       ImageType::SizeType output_size;
       ImageType::SpacingType output_spacing;
 
       if (dparam1 > 0)
       {
         output_size[0] = std::ceil(input_size[0] * (input_spacing[0] / dparam1));
         output_spacing[0] = dparam1;
       }
       else
       {
         output_size[0] = std::ceil(input_size[0] * (-1.0 / dparam1));
         output_spacing[0] = -1.0*input_spacing[0] * dparam1;
       }
       if (dparam2 > 0)
       {
         output_size[1] = std::ceil(input_size[1] * (input_spacing[1] / dparam2));
         output_spacing[1] = dparam2;
       }
       else
       {
         output_size[1] = std::ceil(input_size[1] * (-1.0 / dparam2));
         output_spacing[1] = -1.0*input_spacing[1] * dparam2;
       }
       if (dparam3 > 0)
       {
         output_size[2] = std::ceil(input_size[2] * (input_spacing[2] / dparam3));
         output_spacing[2] = dparam3;
       }
       else
       {
         output_size[2] = std::ceil(input_size[2] * (-1.0 / dparam3));
         output_spacing[2] = -1.0*input_spacing[2] * dparam3;
       }
 
       resampler->SetSize( output_size );
       resampler->SetOutputSpacing( output_spacing );
       resampler->SetOutputDirection( itkImage->GetDirection() );
 
       resampler->UpdateLargestPossibleRegion();
 
       ImageType::Pointer resampledImage = resampler->GetOutput();
 
       newImage = mitk::ImportItkImage( resampledImage )->Clone();
       nameAddition << "_Resampled_" << selectedInterpolator;
       std::cout << "Resampling successful." << std::endl;
   }
   catch (...)
   {
     this->BusyCursorOff();
     QMessageBox::warning(nullptr, "Warning", "Problem when applying filter operation. Check your input...");
     return;
   }
 
   newImage->DisconnectPipeline();
 
   // adjust level/window to new image
   mitk::LevelWindow levelwindow;
   levelwindow.SetAuto( newImage );
   mitk::LevelWindowProperty::Pointer levWinProp = mitk::LevelWindowProperty::New();
   levWinProp->SetLevelWindow( levelwindow );
 
   // compose new image name
   std::string name = m_SelectedImageNode->GetNode()->GetName();
   if (name.find(".nrrd") == name.size() -5 )
   {
     name = name.substr(0,name.size() -5);
   }
   name.append( nameAddition.str() );
 
   // create final result MITK data storage node
   mitk::DataNode::Pointer result = mitk::DataNode::New();
   result->SetProperty( "levelwindow", levWinProp );
   result->SetProperty( "name", mitk::StringProperty::New( name.c_str() ) );
   result->SetData( newImage );
 
   // for vector images, a different mapper is needed
   if(isVectorImage > 1)
   {
     mitk::VectorImageMapper2D::Pointer mapper =
       mitk::VectorImageMapper2D::New();
     result->SetMapper(1,mapper);
   }
 
   // add new image to data storage and set as active to ease further processing
   GetDataStorage()->Add( result, m_SelectedImageNode->GetNode() );
   if ( m_Controls->cbHideOrig->isChecked() == true )
     m_SelectedImageNode->GetNode()->SetProperty( "visible", mitk::BoolProperty::New(false) );
 
   // show the results
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   this->BusyCursorOff();
 }
 
 void QmitkPreprocessingResampling::SelectInterpolator(int interpolator)
 {
   switch (interpolator)
   {
   case 0:
     {
       m_SelectedInterpolation = LINEAR;
       break;
     }
   case 1:
     {
       m_SelectedInterpolation = NEAREST;
       break;
     }
   case 2:
   {
     m_SelectedInterpolation = SPLINE;
   }
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.properties/documentation/UserManual/PropertiesView.dox b/Plugins/org.mitk.gui.qt.properties/documentation/UserManual/PropertiesView.dox
index 2450b2f9c7..407d6d01d7 100644
--- a/Plugins/org.mitk.gui.qt.properties/documentation/UserManual/PropertiesView.dox
+++ b/Plugins/org.mitk.gui.qt.properties/documentation/UserManual/PropertiesView.dox
@@ -1,57 +1,57 @@
 /**
 \page org_mitk_views_properties The Properties View
 
 \imageMacro{properties-dox.svg,"Icon of the Properties View.",2.00}
 
 \tableofcontents
 
 \section org_mitk_views_propertiesOverview Overview
 
 The Properties View allows you to inspect and change properties of a selected data node and its attached data.
 This View is only for advanced users and developers, as it is easy to alter the program state in unexpected ways.
 It can be considered as a complete exposure of parts of the backend that are usually supposed to be accessed only through dedicated frontend components like the color or opacity widgets in the context menu of a data node in the Data Manager View.
 
 \section org_mitk_views_propertiesUsage Usage
 
 \imageMacro{view.png,"The Properties View.",12.00}
 
 \subsection org_mitk_views_propertiesUsagePropertyListTypes Property list types
 
 After you selected a data node, the Property View allows you to switch between several property lists that are attached to the selected data node and its actual data.
 By default, you see the common data node property list.
 
 There are two types of property lists: data node property lists and data property lists.
 
 Data node property lists consist of properties that the application attaches mainly for rendering settings.
 They are not intrinsically part of the actual data and are only persisted when saving the MITK scene as a whole.
 A typical example of such a property is "visible", which decides if the data should be rendered or hidden.
 
 The common data node property list is applied to all render windows but there are also render window specific data node property lists.
-Any property that is found in both the common list and a render window specific list is overriden by the latter one.
+Any property that is found in both the common list and a render window specific list is overridden by the latter one.
 For example, if you want to hide an image only in the 3d render window but show it in all other render windows, you check "visible" in the common list, add the same property to the 3d render window specific list, and uncheck it there.
 
 There is only a single data property list.
 It represents the true metadata of the selected data like DICOM tags of a DICOM image.
 When saving specific data, most data properties are written to the data file, as long as the selected file format supports metadata.
 A popular example is the NRRD image format that allows to save custom key value pairs in text format in the file header.
 Not all data properties are meant for persistence, though.
 To check if a certain data property will be written to a metadata-enabled file format, click on it in the properties tree view and check if there is a save icon at the bottom in the additional property info box.
 
 \subsection org_mitk_views_propertiesUsageFilter Filter
 
 Property lists can be quite large and complex, shown as a tree structure in the Properties View.
 To quickly find properties of interest you can use the filter text box, which will filter the properties while you type.
 
 \subsection org_mitk_views_propertiesUsageEditProperties Edit properties
 
 Most property value types like numbers, strings, boolean values, or colors can be edited by either clicking or double-clicking in the Value column.
 For example, to edit color properties, double-click on the colored Value cell.
 You can either enter a color by name like "yellow", in hex notation like "#ffff00" (or abbreviated "#ff0"), or click on the "..." button to open a color picker dialog.
 
 \subsection org_mitk_views_propertiesUsagePropertyInfos Additional property information
 
 Some properties have additional information attached like a description, aliases, or a persistence flag.
 This information is shown at the bottom of the Properties View.
 When no additional information is available, the additional property info box is hidden.
 
 */
diff --git a/Plugins/org.mitk.gui.qt.python/documentation/UserManual/QmitkPython.dox b/Plugins/org.mitk.gui.qt.python/documentation/UserManual/QmitkPython.dox
index 73d1ecb6af..836355173e 100644
--- a/Plugins/org.mitk.gui.qt.python/documentation/UserManual/QmitkPython.dox
+++ b/Plugins/org.mitk.gui.qt.python/documentation/UserManual/QmitkPython.dox
@@ -1,33 +1,33 @@
 /**
 \page org_mitk_views_python The Python Plugin
 
 Available sections:
   - \ref org_mitk_views_pythonOverview
   - \ref org_mitk_views_pythonUsage
   - \ref org_mitk_views_pythonConsole
   - \ref org_mitk_views_pythonSnippets
 
 \section org_mitk_views_pythonOverview Overview
 The Python view provides the graphical front end to run Python code through the mitkPython module. Furthermore the SimpleITK/VTK/OpenCV Python wrapping can be used.
 Images and surfaces in the DataManager can be transferred via a drag & drop mechanism into the MITK Python Console.
 
 \section org_mitk_views_pythonUsage Transfer data
-Images and surfaces can be tranferred from the data manger into the python console. To transfer an image or
+Images and surfaces can be transferred from the data manager into the python console. To transfer an image or
 surface simply drag it from the data manager into the Variable Stack view, as shown in Figure.
 A new entry will appear in the Variable Stack, as soon as the data is transferred. As soon as the
 entry is available the object can be accessed and modified in the python console. Three dimensional
 images will be copied in-memory to python via numpy and a SimpleITK image object is created with the
 same properties. When a two dimensional image is transferred the user can choose to transfer it as an OpenCV
 image object. Surfaces are fully memory mapped as a vtkPolyData object. To transfer an image or surface
 from the python runtime to the data manager just double click on the corresponding entry in the Variable Stack View.
 
 \imageMacro{MitkPythonPluginView.png,"Screenshot of the MITK Python Plugin",6}
 
 \section org_mitk_views_pythonConsole Console
 The Python console can be used for interactive programming. All items in the data storage can be accessed
 in the python console. The console can also be used to load python scripts and run them.
 
 \section org_mitk_views_pythonSnippets Snippets
 The python plugin contains some code snippets of SimpleITK/VTK/OpenCV that can be run in the python console.
 Snippets can be modified and saved by the user.
 */
diff --git a/Plugins/org.mitk.gui.qt.python/plugin.xml b/Plugins/org.mitk.gui.qt.python/plugin.xml
index 9629c07384..bf93663d87 100644
--- a/Plugins/org.mitk.gui.qt.python/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.python/plugin.xml
@@ -1,21 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
   <extension point="org.blueberry.ui.views">
     <view
       id="org.mitk.views.python"
       name="Python Console"
       category="General"
       icon="resources/Python.png"
       class="QmitkPythonView" >
-      <description>Allow the acces of python from MITK</description>
+      <description>Allow the access of python from MITK</description>
       <keywordReference id="org.mitk.views.python.Keyword"/>
     </view>
   </extension>
   <extension point="org.blueberry.ui.keywords">
     <keyword label="Python" id="org.mitk.views.python.Keyword"/>
     <keyword label="Scripting" id="org.mitk.views.python.Keyword"/>
     <keyword label="Programming" id="org.mitk.views.python.Keyword"/>
     <keyword label="Automatic" id="org.mitk.views.python.Keyword"/>
   </extension>
 </plugin>
diff --git a/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingViewControls.ui b/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingViewControls.ui
index 105b8e2ba4..fd84d7772f 100644
--- a/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingViewControls.ui
@@ -1,244 +1,244 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkRemeshingViewControls</class>
  <widget class="QWidget" name="QmitkRemeshingViewControls">
   <property name="enabled">
    <bool>true</bool>
   </property>
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>253</width>
     <height>573</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Remeshing</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="surfaceLabel">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Surface</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1" colspan="2">
       <widget class="QmitkSingleNodeSelectionWidget" name="selectionWidget" native="true">
        <property name="minimumSize">
         <size>
          <width>0</width>
          <height>40</height>
         </size>
        </property>
       </widget>
      </item>
      <item row="1" column="0">
       <widget class="QLabel" name="densityLabel">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Density</string>
        </property>
       </widget>
      </item>
      <item row="1" column="1">
       <widget class="QSlider" name="densitySlider">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="minimum">
         <number>1</number>
        </property>
        <property name="maximum">
         <number>100</number>
        </property>
        <property name="pageStep">
         <number>10</number>
        </property>
        <property name="value">
         <number>100</number>
        </property>
        <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
       </widget>
      </item>
      <item row="1" column="2">
       <widget class="QSpinBox" name="densitySpinBox">
        <property name="suffix">
         <string>%</string>
        </property>
        <property name="minimum">
         <number>1</number>
        </property>
        <property name="maximum">
         <number>100</number>
        </property>
        <property name="singleStep">
         <number>1</number>
        </property>
        <property name="value">
         <number>100</number>
        </property>
       </widget>
      </item>
      <item row="2" column="0">
       <widget class="QLabel" name="remeshingLabel">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Remeshing</string>
        </property>
       </widget>
      </item>
      <item row="2" column="1" colspan="2">
       <widget class="QComboBox" name="remeshingComboBox">
        <item>
         <property name="text">
          <string>Adaptive</string>
         </property>
        </item>
        <item>
         <property name="text">
          <string>Regular</string>
         </property>
        </item>
       </widget>
      </item>
      <item row="3" column="0">
       <widget class="QLabel" name="qualityLabel">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Quality</string>
        </property>
       </widget>
      </item>
      <item row="3" column="1" colspan="2">
       <widget class="QComboBox" name="qualityComboBox">
        <property name="currentIndex">
         <number>0</number>
        </property>
        <item>
         <property name="text">
          <string>Medium (fast)</string>
         </property>
        </item>
        <item>
         <property name="text">
          <string>High (slow)</string>
         </property>
        </item>
        <item>
         <property name="text">
          <string>Maximum (very slow)</string>
         </property>
        </item>
       </widget>
      </item>
      <item row="4" column="1" colspan="2">
       <widget class="QCheckBox" name="preserveEdgesCheckBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text">
         <string>Preserve Edges</string>
        </property>
        <property name="checked">
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QPushButton" name="remeshPushButton">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="text">
       <string>Remesh</string>
      </property>
      <property name="icon">
       <iconset resource="../../resources/Remeshing.qrc">
        <normaloff>:/Remeshing/RemeshingIcon.svg</normaloff>:/Remeshing/RemeshingIcon.svg</iconset>
      </property>
      <property name="iconSize">
       <size>
        <width>24</width>
        <height>24</height>
       </size>
      </property>
     </widget>
    </item>
    <item>
     <widget class="QLabel" name="explanationLabel">
      <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Density:&lt;/span&gt; The density of the resulting surface compared to the input surface. For example, a density of 50% will effectively halve the number of vertices. It's not uncommen to choose values as low as 10% for overly dense input surfaces. The minimum number of output vertices is at least 100, though.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Remeshing:&lt;/span&gt; Adaptive remeshing results in higher density in curvy areas and less density in flat areas. This remeshing strategy can preserve fine shape details even when the overall density is heavily reduced. Regular remeshing evenly distributes the density regardless of the local shape of the surface.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Quality&lt;/span&gt;: While medium quality is sufficient for the vast majority of use cases, you can increase this setting to further optimize the mesh quality in terms of uniformly shaped triangles. However, computation time and memory consumption increase dramatically compared to very small improvements.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Preserve Edges:&lt;/span&gt; If the input surface contains holes or edges, they will be preserved very accurately by default at the cost of less uniform triangles at their direct neighborhood.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Density:&lt;/span&gt; The density of the resulting surface compared to the input surface. For example, a density of 50% will effectively halve the number of vertices. It's not uncommon to choose values as low as 10% for overly dense input surfaces. The minimum number of output vertices is at least 100, though.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Remeshing:&lt;/span&gt; Adaptive remeshing results in higher density in curvy areas and less density in flat areas. This remeshing strategy can preserve fine shape details even when the overall density is heavily reduced. Regular remeshing evenly distributes the density regardless of the local shape of the surface.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Quality&lt;/span&gt;: While medium quality is sufficient for the vast majority of use cases, you can increase this setting to further optimize the mesh quality in terms of uniformly shaped triangles. However, computation time and memory consumption increase dramatically compared to very small improvements.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Preserve Edges:&lt;/span&gt; If the input surface contains holes or edges, they will be preserved very accurately by default at the cost of less uniform triangles at their direct neighborhood.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkSingleNodeSelectionWidget</class>
    <extends>QWidget</extends>
    <header location="global">QmitkSingleNodeSelectionWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>densitySpinBox</tabstop>
   <tabstop>preserveEdgesCheckBox</tabstop>
   <tabstop>remeshPushButton</tabstop>
  </tabstops>
  <resources>
   <include location="../../resources/Remeshing.qrc"/>
  </resources>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation.dox b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation.dox
index 1e18045728..a50a2fa578 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation.dox
+++ b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation.dox
@@ -1,439 +1,467 @@
 /**
 \page org_mitk_views_segmentation The Segmentation View
 
 \imageMacro{segmentation-dox.svg,"Icon of the Segmentation View",2.00}
 
 \tableofcontents
 
 \section org_mitk_views_segmentationoverview Overview
 
 Segmentation is the act of separating an image into foreground and background subsets by manual or automated delineation, while the foreground is defined to be part of the segmentation.
 Such a segmented image subset is also called a label as it typically labels a specific region of interest.
 A multilabel segmentation may contain multiple labels organized in distinct groups.
 You can create multiple labels for different regions of interest contained within a single segmentation image.
 Labels in the same group cannot overlap each other but labels from different groups may overlap.
 
 The MITK <b>Segmentation Plugin</b> allows you to create multilabel segmentations of anatomical and pathological structures in medical images.
 The plugin consists of three views:
 <ul>
   <li> <b>Segmentation View</b>: Manual and (semi-)automatic segmentation
   <li> \subpage org_mitk_views_segmentationutilities : Post-processing of segmentations
   <li> \subpage org_mitk_views_segmentationtasklist : Optimized workflow for batches of segmentation tasks based on a user-defined task list
 </ul>
 In this user guide, the features of the <b>Segmentation View</b> are described.
 For an introduction to the Segmentation Utilities or Segmentation Task List, refer to the respective user guides.
 
 \imageMacro{QmitkSegmentationPlugin_Overview.png,"Segmentation View", 16.00}
 
 \section org_mitk_views_segmentationtechnicalissues Image and segmentation prerequisites
 
 The Segmentation View has a few prerequisites regarding segmentations and their reference image:
 <ul>
   <li> Images must be two or three-dimensional and may be either static or dynamic, e.g., are time-resolved resp. have different pixel values for different time steps.
   <li> Images must be single-valued, i.e. CT, MRI or ultrasound. Images from color doppler or photographic (RGB) images are only partially supported (please be aware that some tools might not be compatible with this image type).
   <li> Segmentations must be congruent to their reference images.
 </ul>
 
 \section org_mitk_views_segmentationdataselection Image selection and creating new segmentations
 
 To select a reference image for a new segmentation, click on the <i>Image</i> widget in the Data selection section at the very top of the Segmentation View.
 Choose an image from the displayed list of Data Manager images.
 Once an image is selected, a new segmentation for this reference image can be created by clicking the button right next to the <i>Segmentation</i> widget in the Data selection section.
 A new multilabel segmentation with an initial, empty label is automatically generated if not set otherwise in the preferences.
 The new segmentation will be added to the Data Manager as a child node of its reference image node.
 It is automatically selected and can be edited in the Segmentation View right away.
 
 Instead of creating a new segmentation, an existing segmentation can be selected and edited as well.
 The selection list of existing segmentations for a certain reference image consists of matching/congruent segmentations only.
 
 \imageMacro{"QmitkSegmentation_DataSelection.png","Data selection and creating new segmentations",12}
 
 \section org_mitk_views_segmentationgroups Groups
 
 Segmentation images consist of at least a single group called "Group 0" in which the first default label is created.
 More groups can be added and removed but there will always be at least a single group.
 Labels of the same group cannot overlap each other.
 Labels of different groups may overlap each other.
 
 For example, you could segment the whole heart as "Heart" label in "Group 0", add "Group 1" and create multiple labels of the anatomical details of the heart in that group.
 Naturally, all these labels lie within the extents of the "Heart" label of "Group 0" but in principle they are completely independent of "Group 0".
 Some pixels are now labelled twice, e.g., as "Heart" and "Left ventricle".
 Since the labels of "Group 1" cannot overlap each other, it is impossible to accidentally label a pixel as both "Left ventricle" and "Right ventricle".
 
 If you would like to segment even more details you could create "Group 2" to have up to three labels per pixel.
 Nevertheless, groups are technically a flat data structure and cannot contain nested groups.
 It is all about possibly overlapping labels from distinct groups and spatially exclusive, non-overlapping labels within the same group.
 
 \imageMacro{"QmitkSegmentation_Groups.png","Groups",10}
 
 \section org_mitk_views_segmentationlabelinstances Labels vs. label instances
 
 The Segmentation View supports label instances.
 That is, segmenting multiple distributed entities of the same thing like metastases for example.
 
 A label, as we used the term before, is already a single instance of itself but it may consist of multiple label instances.
 
 If a label consists of multiple label instances, they each show their own distinct pixel value in square brackets as a clue for distinction and identification.
 
 It is important to understand that this number is not a separate, consequtive index for each label.
 It is just the plain pixel value of the label instance, which is unique across all label instances of the whole segmentation.
 
 \imageMacro{"QmitkSegmentation_LabelInstances.png","Label instances",10}
 
 \section org_mitk_views_segmentationlock_color_visibility Unlocking, changing color of, and hiding label instances
 
 Label instances are locked by default: label instances from the same group cannot accidentally override pixels from other label instances.
 Locked label instances behave like cookie cutters for other label instances of the same group.
 You can unlock label instances to remove that protection from other label instances of the same group.
 Their pixel contents can then be overridden by other label instances of the same group.
 
 Remember that label instances from distinct groups do not interact with each other.
 They can always overlap (not override) each other.
 
 You can also change the color of label instances as well as show (default) or hide their pixel contents.
 The icons at the right side of the rows of the groups and labels widget reflect their state in all these regards.
 
 Renaming of labels and label instances can be found in their content menu as shown further below.
 
 \imageMacro{"QmitkSegmentation_LockColorVisibility.png","Unlocking\, changing color of\, and hiding label instances",10}
 
 \section org_mitk_views_segmentationcontextmenus Context menus
 
 Actions for organization of groups, labels, and label instances (as well as other operations) can be also found in their right-click context menus.
 
 \imageMacro{"QmitkSegmentation_ContextMenus.png","Context menus of groups\, labels\, and label instances",12}
 
 Most actions available in these context menus are self-explanatory or were already described above by other means of access like the tool button bar for adding and removing groups, labels, and label instances.
 
 Labels and label instances can be <b>renamed</b>, while groups have fixed names.
 Note that renaming a label instance will make a separate label out of it, since all instances of the same label share a single common name.
 
 <b>Clear content</b> only clears the pixels of a label instance but won't delete the actual label instance.
 
 Groups can be <b>locked</b> and <b>unlocked</b> as a whole from their context menu, while label instances can be directly locked and unlocked outside the context menu as decribed further below.
 
 \section org_mitk_views_segmentationlabelsuggestions Label name and color suggestions
 
 When renaming label instances or creating new label instances with enforced manual naming in the Segmentation preferences, entering names is supported by auto-completion for common label names.
-The list of predefined label names and colors for the auto-completion feature can be either extented or replaced by a custom list of label name and color suggestions.
+The list of predefined label names and colors for the auto-completion feature can be either extended or replaced by a custom list of label name and color suggestions.
 This custom list must be specified as a JSON file, just containing an array of objects, each with a mandatory "name" string and an optional "color" string.
 The JSON file can be set in the Segmentation preferences as well as a few options on how to apply these suggestions.
 
 \section org_mitk_views_segmentationlabelpresets Saving and loading label set presets
 
 Label set presets are useful to share a certain style or scheme between different segmentation sessions or to provide templates for new segmentation sessions.
 
 The properties of all label instances in all groups like their names, colors, and visibilities are saved as a label set preset by clicking on the 'Save label set preset' button.
 Label set presets are applied to any segmentation session by clicking on the 'Load label set preset' button.
 If a label instance for a certain value already exists, its properties are overridden by the preset.
 If a label instance for a certain value does not yet exist, an empty label instance with the label properties of the preset is created.
 The actual pixel contents of label instances are unaffected as label set presets only store label properties.
 
 \imageMacro{QmitkSegmentation_Preset.png,"Saving and loading label set presets", 10.00}
 
-\subsection org_mitk_views_segmentationdefaultlabelpresets Applying label set presets by default
+If you work on a repetitive segmentation task, manually loading the same label set preset for each and every new segmentation can be tedious.
+To streamline your workflow, you can set a default label set preset in the Segmentation preferences (Ctrl+P). When set, this label set preset will be applied to all new segmentations instead of creating the default red "Label 1" label instance.
 
-If you work on a repetetive segmentation task, manually loading the same label set preset for each and every new segmentation can be tedious.
+If you work on a repetitive segmentation task, manually loading the same label set preset for each and every new segmentation can be tedious.
 To streamline your workflow, you can set a default label set preset in the Segmentation preferences (Ctrl+P). When set, this label set preset will be applied to all new segmentations instead of creating the default red "Label 1" label instance.
 
 \section org_mitk_views_segmentationpreferences Preferences
 
 The Segmentation Plugin offers a number of preferences which can be set via the MITK Workbench application preferences (Ctrl+P):
 
 \imageMacro{QmitkSegmentationPreferences.png,"Segmentation preferences", 10.00}
 
 <ul>
   <li> <b>Compact view:</b> Hide the tool button texts to save some space on screen (6 instead of 4 buttons per row)
   <li> <b>2D display:</b> Draw segmentations as as outlines or transparent overlays
   <li> <b>Data node selection mode:</b> Hide everything but the selected segmentation and its reference image
   <li> <b>Default label set preset:</b> Start a new segmentation with this preset instead of a default label
   <li> <b>Label creation:</b> Assign default names and colors to new label instances or ask users for name and color
   <li> <b>Label suggestions:</b> Specify custom suggestions for label names and colors
 </ul>
 
 \section org_mitk_views_segmentationtooloverview Segmentation tool overview
 
 MITK offers a comprehensive set of slice-based 2D and (semi-)automated 3D segmentation tools.
 The manual 2D tools require some user interaction and can only be applied to a single image slice whereas the 3D tools operate on the whole image.
 The 3D tools usually only require a small amount of user interaction, i.e. placing seed points or setting / adjusting parameters.
 You can switch between the different toolsets by selecting the 2D or 3D tab in the segmentation view.
 
 \imageMacro{QmitkSegmentation_ToolOverview.png,"An overview of the existing 2D and 3D tools in MITK.",5.50}
 
 \section org_mitk_views_segmentation2dsegmentation 2D segmentation tools
 
 With 2D manual contouring you define which voxels are part of the segmentation and which are not. This allows you to create segmentations of any structures of interest in an image.
 You can also use manual contouring to correct segmentations that result from sub-optimal automatic methods.
 The drawback of manual contouring is that you might need to define contours on many 2D slices. However, this is mitigated by the interpolation feature, which will make suggestions for a segmentation.
 
 To start using one of the editing tools, click its button from the displayed toolbox.
 The selected editing tool will be active and its corresponding button will stay pressed until you click the button again.
 Selecting a different tool also deactivates the previous one.\n
 If you have to delineate a lot of images, shortcuts to switch between tools becomes convenient.
 For that, just hit the first letter of each tool to activate it (A for Add, S for Subtract, etc.).
 
 All of the editing tools work by the same principle: using the mouse (left button) to click anywhere in a 2D window (any of the orientations axial, sagittal, or coronal),
 moving the mouse while holding the mouse button and releasing the button to finish the editing action.
 Multi-step undo and redo is fully supported by all editing tools by using the application-wide undo / redo buttons in the toolbar.
 
 <i>Remark</i>: Clicking and moving the mouse in any of the 2D render windows will move the crosshair that defines what part of the image is displayed.
 This behavior is disabled as long as any of the manual segmentation tools are active - otherwise you might have a hard time concentrating on the contour you are drawing.
 
 \subsection org_mitk_views_segmentationaddsubtracttools Add and subtract tools
 \imageMacro{QmitkSegmentation_IMGIconAddSubtract.png,"Add and subtract tools",7.70}
 
 Use the left mouse button to draw a closed contour. When releasing the mouse button, the contour will be added (Add tool) to or removed (Subtract tool) from the current segmentation.
 Adding and subtracting voxels can be iteratively repeated for the same segmentation. Holding CTRL / CMD while drawing will invert the current tool's behavior (i.e. instead of adding voxels, they will be subtracted).
 
 \subsection org_mitk_views_segmentationlassotool Lasso tool
 \imageMacro{QmitkSegmentation_Lasso.png,"Lasso tool",7.70}
 
 The tool is a more advanced version of the add/subtract tool. It offers you the following features:
 <ol>
   <li> Generating a polygon segmentation (click left mouse button to set ancor point)
   <li> Freehand contouring (like the add tool; press left mouse button while moving the mouse)
   <li> Move ancor points (select an ancor point, press left mouse button while moving the mouse)
   <li> Add new ancor points (press CTRL while click left mouse to add an ancor to the contour)
   <li> Delete an ancor point (press Del while ancor point is selected)
   <li> Segmentation can be added to the label (Add mode) or subtracted (Subtract mode)
 </ol>
 To start a segmentation double left click where the first ancor point should be. To end the segmentation double left click where the last ancor point should be.
 Please note that:
 <ul>
   <li> feature 3-6 are only available, if auto confirm is *not* activated
   <li> feature 3-5 is not available for freehand contour segments
 </ul>
 
 \subsection org_mitk_views_segmentationpaintwipetools Paint and wipe tools
 \imageMacro{QmitkSegmentation_IMGIconPaintWipe.png,"Paint and wipe tools",7.68}
 
 Use the <i>Size</i> slider to change the radius of the round paintbrush tool. Move the mouse in any 2D window and press the left button to draw or erase pixels.
 Holding CTRL / CMD while drawing will invert the current tool's behavior (i.e. instead of painting voxels, they will be wiped).
 
 \subsection org_mitk_views_segmentationregiongrowingtool Region growing tool
 \imageMacro{QmitkSegmentation_IMGIconRegionGrowing.png,"Region growing tool",3.81}
 
 Click at one point in a 2D slice widget to add an image region to the segmentation with the region growing tool.
 Region Growing selects all pixels around the mouse cursor that have a similar gray value as the pixel below the mouse cursor.
 This allows to quickly create segmentations of structures that have a good contrast to surrounding tissue.
 The tool operates based on the current level window, so changing the level window to optimize the contrast for the ROI is encouraged.
 Moving the mouse up / down is different from left / right:
 Moving up the cursor while holding the left mouse button widens the range for the included grey values; moving it down narrows it.
 Moving the mouse left and right will shift the range.
 The tool will select more or less pixels, corresponding to the changing gray value range.
 
 \if THISISNOTIMPLEMENTEDATTHEMOMENT
 A common issue with region growing is the so called "leakage" which happens when the structure of interest is connected to other pixels, of similar gray values, through a narrow "bridge" at the border of the structure.
 The Region Growing tool comes with a "leakage detection/removal" feature. If leakage happens, you can left-click into the leakage region and the tool will try to automatically remove this region (see illustration below).
 
 \imageMacro{QmitkSegmentation_Leakage.png,"Leakage correction feature of the region growing tool",11.28}
 \endif
 
 \subsection org_mitk_views_segmentationfilltool Fill tool
 \imageMacro{QmitkSegmentation_IMGIconFill.png,"Fill tool",3.81}
 
 Left-click inside a region/segmentation to flood fill all connected pixels that have the same label with the active label. This tool will only work on regions of unlocked labels or on regions that are not labeled at all.
 
 \subsection org_mitk_views_segmentationerasetool Erase tool
 \imageMacro{QmitkSegmentation_IMGIconErase.png,"Erase tool",3.79}
 
 This tool removes a connected part of pixels that form a segmentation.
 You may use it to remove single segmented regions (left-click on specific segmentation) or to clear a whole slice at once (left-click at the non-labeled background).
 This tool will only work and regions of unlocked labels or on regions of the active label.
 
 \subsection org_mitk_views_segmentationclosetool Close tool
 \imageMacro{QmitkSegmentation_IMGIconClose.png,"Close tool",3.79}
 
 Left-click inside the region/segmentation to fill all "holes" (pixels labelled with another label or no label) inside the region.
 Therefore this tool behaves like a local closing operation. This tool will not work, when a non-labeled region is selected and holes of locked labels will not be filled.
 \remark This tool always uses the label of the selected region (even if this label is not the active label). Therefore you can use this tool on regions of the active label and of none locked labels (without the need to change the active label). 
 
 \subsection org_mitk_views_segmentationlivewiretool Live wire tool
 
 \imageMacro{QmitkSegmentation_IMGIconLiveWire.png,"Live wire tool",3.01}
 
 The Live Wire Tool acts as a magnetic lasso with a contour snapping to edges of objects.
 
 \imageMacro{QmitkSegmentation_IMGLiveWireUsage.PNG,"Steps for using the Live Wire Tool",16.00}
 
 The tool handling is the same like the Lasso tool (see for more info), except it generates live wire contours instead of straight lines.
 
+\subsection org_mitk_views_segmentationSegmentAnything Segment Anything Tool
+
+\imageMacro{QmitkSegmentation_nnUnetTool.png,"Segment Anything tool",10.00}
+
+\imageMacro{QmitkSegmentation_SAMTool.png,"Segment Anything tool",10.00}
+
+The Segment Anything Tool is a deep learning-based interactive segmentation tool. Originally created by MetaAI, MITK presents this model for medical image segmentation tasks.
+The tool requires that you have Python 3 installed and available on your machine. Note: On Debian/Ubuntu systems, you need to install git, python3-pip, python3-venv package using the following command: `apt install git python3-pip python3-venv`. For best experience, your machine should be ideally equipped with a CUDA-enabled GPU. 
+For a detailed explanation of what this algorithm is able to, please refer to https://ai.facebook.com/research/publications/segment-anything/ <br>
+Any adjustments to the \subpage org_mitk_editors_stdmultiwidget_Levelwindow setting impacts the segmentation. However, any applied color maps are ignored.
+
+\subsubsection org_mitk_views_segmentationSegmentAnythingWorkflow Workflow:
+    -# Install Segment Anything: Goto Preferences (Cntl+P) > Segment Anything and click "Install Segment Anything" to install Segment Anything (version: 1.0). 
+    The installation process implicitly creates a python virtual environment using the Python located in "System Python" in an MITK mainitained directory. Make sure you have a working internet connection. This might take a while. It is a one time job, though.
+    Once installed, the "Install Segment Anything" button is grayed out.
+    \imageMacro{QmitkSegmentation_SAMTool_Preferences.png,"Segment Anything Preferences",10.00}
+
+    -# Note: If Python is not listed by MITK in "System Python", click "Select..." in the dropdown to choose an unlisted installation of Python. Note that, while selecting an arbitrary environment folder, only select the base folder, e.g. "/usr/bin/".
+    No need to navigate all the way into "../usr/bin/python3", for example.
+    -# Select a specific model type in the "Model Type" dropdown. The default is "vit_b" for low memory footprint. However, more larger models "vit_l" and "vit_h" are also available for selection.
+    -# Select inference hardware, i.e. any GPU or CPU. This is internally equivalent to setting the <b>CUDA_VISIBLE_DEVICES</b> environment variable.
+    -# Click "OK" to save the preference settings.
+    -# Goto Segmentation View > 2D tools > Segment Anything.
+    -# Click "Initialize Segment Anything" to start the tool backend. This will invoke downloading of the selected model type from the internet. This might take a while. It is a one time job, though.
+    -# Once the tool is initialized, Press SHIFT+Left Click on any of the 3 render windows to start click guided segmentation on that slice.
+    -# Press SHIFT+Right Click for negative clicks to adjust the preview mask on the render window.
+
 \subsection org_mitk_views_segmentationinterpolation 2D and 3D Interpolation
 
 Creating segmentations using 2D manual contouring for large image volumes may be very time-consuming, because structures of interest may cover a large range of slices.
 The segmentation view offers two helpful features to mitigate this drawback:
 
 <ul>
   <li> 2D Interpolation
   <li> 3D Interpolation
 </ul>
 
 The <b>2D Interpolation</b> creates suggestions for a segmentation whenever you have a slice that
 
 <ul>
   <li> has got neighboring slices with segmentations (these do not need to be direct neighbors but could also be a couple of slices away) AND
   <li> is completely clear of a manual segmentation, i.e. there will be no suggestion if there is even only a single pixel of segmentation in the current slice.
 </ul>
 
 \imageMacro{QmitkSegmentation_2DInterpolation.png,"2D interpolation usage",3.01}
 
 Interpolated suggestions are displayed as outlines, until you confirm them as part of the segmentation.
 To confirm single slices, click the <i>Confirm for single slice</i> button below the toolbox. You may also review the interpolations visually and then accept all of them at once by selecting <i>Confirm for all slices</i>.
 
 The <b>3D interpolation</b> creates suggestions for 3D segmentations. That means if you start contouring, from the second contour onwards, the surface of the segmented area will be interpolated based on the given contour information.
 The interpolation works with all available manual tools. Please note that this is currently a pure mathematical interpolation, i.e. image intensity information is not taken into account.
 With each further contour the interpolation result will be improved, but the more contours you provide the longer the recalculation will take.
 To achieve an optimal interpolation result and in this way a most accurate segmentation you should try to describe the surface with sparse contours by segmenting in arbitrary
 oriented planes. The 3D interpolation is not meant to be used for parallel slice-wise segmentation, but rather segmentations in i.e. the axial, coronal and sagittal plane.
 
 \imageMacro{QmitkSegmentation_3DInterpolationWrongRight.png,"3D interpolation usage",16.00}
 
 You can accept the interpolation result by clicking the <i>Confirm</i>-button below the tool buttons.
 In this case the 3D interpolation will be deactivated automatically so that the result can be post-processed without any interpolation running in the background.
 
 Additional to the surface, black contours are shown in the 3D render window, which mark all the drawn contours used for the interpolation.
 You can navigate between the drawn contours by clicking on the corresponding <i>position</i> nodes in the data manager which are stored as sub-nodes of the selected segmentation.
 If you do not want to see these nodes just uncheck the <i>Show Position Nodes</i> checkbox and these nodes will be hidden.
 
 If you want to delete a drawn contour we recommend to use the Erase-Tool since undo / redo is not yet working for 3D interpolation.
 The current state of the 3D interpolation can be saved across application restart. For that, just click on save project during the interpolation is active.
 After restarting the application and load your project you can click on "Reinit Interpolation" within the 3D interpolation GUI area.
 
 \section org_mitk_views_segmentation3dsegmentation 3D segmentation tools
 
 The 3D tools operate on the whole image and require usually a small amount of interaction like placing seed-points or specifying certain parameters. All 3D tools provide
 an immediate segmentation feedback, which is displayed as a transparent green overlay. For accepting a preview you have to press the <i>Confirm</i> button of the selected tool.
 The following 3D tools are available:
 
 \subsection org_mitk_views_segmentation3dthresholdtool 3D Threshold tool
 
 The thresholding tool simply applies a 3D threshold to the patient image. All pixels with values equal or above the selected threshold are labeled as part of the segmentation.
 You can change the threshold by either moving the slider of setting a certain value in the spinbox.
 
 \imageMacro{QmitkSegmentation_3DThresholdTool.png,"3D Threshold tool",10.00}
 
 \subsection org_mitk_views_segmentation3dulthresholdTool 3D upper / lower threshold tool
 
 The Upper/Lower Thresholding tool works similar to the simple 3D threshold tool but allows you to define an upper and lower threshold. All pixels with
 values within this threshold interval will be labeled as part of the segmentation.
 
 \imageMacro{QmitkSegmentation_3DULThresholdTool.png,"3D upper / lower threshold tool",10.00}
 
 \subsection org_mitk_views_segmentation3dotsutool 3D Otsu tool
 
 The 3D Otsu tool provides a more sophisticated thresholding algorithm. It allows you to define a number of regions. Based on the image histogram the pixels will
 then be divided into different regions. The more regions you define the longer the calculation will take. You can select afterwards which of these regions you want to confirm as segmentation.
 \imageMacro{QmitkSegmentation_3DOtsuTool.png,"3D Otsu tool",10.00}
 
 \subsection org_mitk_views_segmentation3dgrowcuttool 3D GrowCut tool
 
 The 3D GrowCut tool uses previously created segmentation labels (e.g. by the "Add"-tool) stored in the segmentation layer 0.
 The GrowCut tool will use these segmentation labels to create a seedimage that will serve as input to the algorithm.
 As an advanced setting option, a Distance penalty can be set, which increases the cohesion in the immediate surroundings of the initial labels.
 Based on the seedimage and the Distance penalty, a growing is started, which includes all areas that are not initially assigned to a specific label.
 During this process, initially unassigned areas are assigned to the best fitting labels.
 After the segmentation process, the user can decide which newly generated labels should be confirmed.
 
 \imageMacro{QmitkSegmentation_3DGrowCutTool.png,"3D GrowCut tool",16.00}
 
 \subsection org_mitk_views_segmentationpickingtool Picking Tool
 
 The Picking tool offers two modes that allow you to manipulate "islands" within your segmentation. This is especially useful if e.g. a thresholding provided you with several areas within
 your image but you are just interested in one special region.
 - Picking mode: Allows you to select certain "islands". When the pick is confirmed, the complete content of the active label will be removed except the pick. This mode is beneficial if you have a lot segmentation noise and want to pick the relevant parts and dismiss the rest. Hint: You can also pick from other labels, but this will only work if these labels are unlocked.
 - Relabel mode: Allows you to select certain "islands". When the pick is confirmed, it will be relabeled and added to the active label content. Hint: This mode ignores the locks of other labels, hence you do not need to unlock them explicitly.
 
 \imageMacro{QmitkSegmentation_PickingTool.png,"Picking tool",10.00}
 
 \subsection org_mitk_views_segmentationnnUNetTool nnU-Net Tool (Ubuntu only)
 
 \imageMacro{QmitkSegmentation_nnUnetTool.png,"nnUNet tool",10.00}
 
 This tool provides a GUI to the deep learning-based segmentation algorithm called the nnU-Net v1. With this tool, you can get a segmentation mask predicted for the loaded image in MITK. Be ready with the pre-trained weights (a.k.a <b>RESULTS_FOLDER</b>)
 for your organ or task concerned, before using the tool. For a detailed explanation of the parameters and pre-trained weights folder structure etc., please refer to https://github.com/MIC-DKFZ/nnUNet. <br>
 Remark: The tool assumes that you have a Python3 environment with nnU-Net v1 (pip) installed. Your machine should be also equipped with a CUDA enabled GPU.
 
 \subsubsection org_mitk_views_segmentationnnUNetToolWorkflow Workflow:
     -# Select the "Python Path" drop-down to see if MITK has automatically detected other Python environments.
     Click on a fitting environment for the nnUNet inference or click "Select" in the dropdown to choose an unlisted python environment. Note that, while selecting an arbitrary environment folder, only select the base folder, e.g. "myenv".
     No need to select all the way until "../myenv/bin/python", for example.
     -# Click on the "nnUNet Results Folder" directory icon to navigate to the results folder on your hard disk. This is equivalent to setting the <b>RESULTS_FOLDER</b> environment variable. If your results folder is as
     per the nnUNet required folder structure, the configuration, trainers, tasks and folds are automatically parsed and correspondingly loaded in the drop-down boxes as shown below. Note that MITK automatically checks for the
     <b>RESULTS_FOLDER</b> environment variable value and, if found, auto parses that directory when the tool is started.
     \imageMacro{QmitkSegmentation_nnUNet_Settings.png,"nnUNet Segmentation Settings",10}
     -# Choose your required Task-Configuration-Trainer-Planner-Fold parameters, sequentially. By default, all entries are selected inside the "Fold" dropdown (shown: "All").
     Note that, even if you uncheck all entries from the "Fold" dropdown (shown: "None"), then too,  all folds would be considered for inferencing.
     -# For ensemble predictions, you will get the option to select parameters irrespective on postprocessing files available in the ensembles folder of <b>RESULTS_FOLDER</b>.
     Note that, if a postprocessing json file exists for the selected combination then it will used for ensembling, by default. To choose not to, uncheck the "Use PostProcessing JSON" in the "Advanced" section.
     \imageMacro{QmitkSegmentation_nnUNet_ensemble.png,"nnUNet Segmentation Settings",10}
     -# If your task is trained with multi-modal inputs, then "Multi-Modal" checkbox is checked and the no.of modalities are preloaded and shown next to "Required Modalities".
     Instantly, as much node selectors with corresponding modality names should appear below to select the Data Manager along including a selector with preselected with the reference node.
     Now, select the image nodes in the node selectors accordingly for accurate inferencing.
     \imageMacro{QmitkSegmentation_nnUNet_multimodal.png,"nnUNet Multi Modal Settings",10.00}
     -# Click on "Preview".
     -# In the "Advanced" section, you can also activate other options like "Mixed Precision" and "Enable Mirroring" (for test time data augmentation) pertaining to nnUNet.
     \imageMacro{QmitkSegmentation_nnUNet_Advanced.png,"nnUNet Advanced Settings",10.00}
     -# Use "Advanced" > "GPU Id" combobox to change the preferred GPU for inferencing. This is internally equivalent to setting the <b>CUDA_VISIBLE_DEVICES</b> environment variable.
     -# Every inferred segmentation is cached to prevent a redundant computation. In case, a user doesn't wish to cache a Preview, uncheck the "Enable Caching" in the "Advanced" section. This will ensure that the
     current parameters will neither be checked against the existing cache nor a segmentation be loaded from it when Preview is clicked.
     -# You may always clear all the cached segmentations by clicking "Clear Cache" button.
 
 \subsubsection org_mitk_views_segmentationnnUNetToolMisc Miscellaneous:
     -# In case you want to reload/reparse the folders in the "nnUNet Results Folder", eg. after adding new tasks into it, you may do so without reselecting the folder again by clicking the "Refresh Results Folder" button.
     -# The "Advanced" > "GPU Id" combobox lists the Nvidia GPUs available by parsing the <tt>nvidia-smi</tt> utility output. In case your machine has Nvidia CUDA enabled GPUs but the <tt>nvidia-smi</tt> fails for some reason, the "GPU Id" combobox will show no entries.
     In such a situation, it's still possible to execute inferencing by manually entering the preferred GPU Id, eg. 0 in the combobox.
     -# The "Advanced" > "Available Models" lists the available pre-trained tasks for download. Make sure you have internet connection. Then, choose a Task from the dropdown and click the Download button. The pre-trained models for the selected Task
     will be downloaded and placed to the <b>RESULTS_FOLDER</b> directory automatically.
     -# In the <b>RESULTS_FOLDER</b> directory, inside the trainer-planner folder of every task, MITK keeps a "mitk_export.json" file for fast loading for multi-modal information. It is recommended not to delete this file(s) for a fast responsive UI.
     Tip: If multi-modal information shown on MITK is not correct for a given task, you may modify this JSON file and try again.
   
 \subsection org_mitk_views_segmentationTotalSegmentator TotalSegmentator Tool
 
 \imageMacro{QmitkSegmentation_nnUnetTool.png,"TotalSegmentator tool",10.00}
 
 This tool provides a GUI to the deep learning-based segmentation algorithm called the TotalSegmentator. With this tool, you can get a segmentation mask predicted for 104 classes in CT images, loaded in MITK. 
 For a detailed explanation on tasks and supported classes etc., please refer to https://github.com/wasserth/TotalSegmentator <br>
 The tool assumes that you have Python 3 installed and available on your machine. We recommend to install TotalSegmentator via MITK. The "Install TotalSegmentator" action implicitly creates a python virtual environment in an MITK mainitained
 directory. Note: on Debian/Ubuntu systems, you need to install the python3-venv package using the following command:  `apt install python3-venv`. For best results, your machine should be ideally equipped with a CUDA-enabled GPU. 
 \imageMacro{QmitkSegmentation_TotalsegmentatorTool.png, "TotalSegmentator Settings",5}
 
 \subsubsection org_mitk_views_segmentationTotalSegmentatorWorkflow Workflow:
     -# Install TotalSegmentator: Click "Install TotalSegmentator" to install TotalSegmentator (version: 1.5.5) in a virtual environment. Make sure you have a working internet connection. This might take a while. It is a one time job, though.
     Once installed, the "Install TotalSegmentator" button is grayed out.
     -# If Python is not found by MITK goto "Install Options" & select the "System Python Path" drop-down to see if MITK has automatically detected other Python environments.
     Click on a fitting Python installation for TotalSegmentator to use or click "Select" in the dropdown to choose an unlisted installation of Python. Note that, while selecting an arbitrary environment folder, only select the base folder, e.g. "/usr/bin/".
     No need to navigate all the way into "../usr/bin/python3", for example.
     -# Select a specific subtask in the "Tasks" drop-downs. The default is "total" for non-specific total segmentation.
     -# Click on "Run TotalSegmentator" for a preview.
     -# In the "Advanced" section, you can also activate other options like "Fast" for faster runtime and less memory requirements. Use "Fast" if you only have a CPU for inferencing.
     -# Use "Advanced" > "GPU Id" combobox to change the preferred GPU for inferencing. This is internally equivalent to setting the <b>CUDA_VISIBLE_DEVICES</b> environment variable.
     -# In case you want to use your own virtual environment containing TotalSegmentator, goto "Install Options" & check "Use Custom Installation" checkbox. Then, select the environment of your choice by using "Custom Env. Path".
 
 \section org_mitk_views_segmentationpostprocessing Additional things you can do with segmentations
 
 Segmentations are never an end in themselves. Consequently, the segmentation view adds a couple of "post-processing" actions, accessible through the context-menu of the data manager.
 
 \imageMacro{QmitkSegmentation_IMGDataManagerContextMenu.png,"Context menu items for segmentations",10.58}
 
 <ul>
 <li> <b>Create polygon %model</b> applies the marching cubes algorithm to the segmentation. This polygon %model can be used for visualization in 3D or other applications such as stereolithography (3D printing).
 <li> <b>Create smoothed polygon %model</b> uses smoothing in addition to the marching cubes algorithm, which creates models that do not follow the exact outlines of the segmentation, but look smoother.
 <li> <b>Autocrop</b> can save memory. Manual segmentations have the same extent as the patient image, even if the segmentation comprises only a small sub-volume. This invisible and meaningless margin is removed by autocropping.
 </ul>
 
 \section org_mitk_views_segmentationof3dtimages Segmentation of 3D+t images
 
 For segmentation of 3D+t images, some tools give you the option to choose between creating dynamic and static masks.
 <ul>
   <li> Dynamic masks can be created on each time frame individually.
   <li> Static masks will be defined on one time frame and will be the same for all other time frames.
 </ul>
 
 In general, segmentation is applied on the time frame that is selected when execution is performed.
 If you alter the time frame, the segmentation preview is adapted.
 
 \section org_mitk_views_segmentationtechnicaldetail Technical information for developers
 
 For technical specifications see \subpage QmitkSegmentationTechnicalPage and for information on the extensions of the tools system \subpage toolextensions.
 
 */
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentationUtilities.dox b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentationUtilities.dox
index 2801ca67e4..a55ac22c09 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentationUtilities.dox
+++ b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentationUtilities.dox
@@ -1,84 +1,84 @@
 /**
 \page org_mitk_views_segmentationutilities The Segmentation Utilities View
 
 \imageMacro{segmentation_utilities-dox.svg,"Icon of the Segmentation Utilities View",5.00}
 
 \imageMacro{QmitkSegmentationUtilities_Overview.png,"The Segmentation Utilities View",16.00}
 
 \tableofcontents
 
 \section org_mitk_views_segmentationUtilitiesManualOverview Overview
 
 The <b>Segmentation Utilities View</b> allows to postprocess existing segmentations. Currently five different operations exist:
 
 <ul>
 	<li> \ref org_mitk_views_segmentationUtilitiesBooleanOperations
 	<li> \ref org_mitk_views_segmentationUtilitiesContourToImage
 	<li> \ref org_mitk_views_segmentationUtilitiesImageMasking
 	<li> \ref org_mitk_views_segmentationUtilitiesMorphologicalOperations
 	<li> \ref org_mitk_views_segmentationUtilitiesSurfaceToImage
 </ul>
 
 \section org_mitk_views_segmentationUtilitiesDataSelection Data Selection
 
 All postprocessing operations provide one or more selection widgets, which allow to select the data for the operation.
 
 \section org_mitk_views_segmentationUtilitiesBooleanOperations Boolean operations
 
 Boolean operations allows to perform the following fundamental operations on two segmentations:
 
 <ul>
 	<li> <b>Difference:</b> Subtracts the second segmentation from the first segmentation.
 	<li> <b>Intersection:</b> Extracts the overlapping areas of the two selected segmentations.
 	<li> <b>Union:</b> Combines the two existing segmentations.
 </ul>
 
 The selected segmentations must have the same geometry (size, spacing, ...) in order for the operations to work correctly.
 The result will be stored in a new data node as a child node of the first selected segmentation.
 
 \imageMacro{QmitkSegmentationUtilities_BooleanOperations.png,"Boolean operations",6.00}
 
 \section org_mitk_views_segmentationUtilitiesContourToImage Contour to image
 
 Contour to image allows to create a segmentation out of a given contour-model.
 The operation requires a contour model set and a reference image.
 The created segmentation image will have the same geometrical properties like the reference image (dimension, size and Geometry3D).
 
 \imageMacro{QmitkSegmentationUtilities_ContourToImage.png,"Contour to image",6.00}
 
 \section org_mitk_views_segmentationUtilitiesImageMasking Image masking
 
 Image masking allows to mask an image with either an existing segmentation or a surface.
 The operation requires an image and a segmentation or a surface.
 The result will be an image containing only the pixels that are covered by the respective mask.
 
 The default background pixel value is zero.
 It can be changed to the minimum existing pixel value of the image or to a custom pixel value.
 If the custom pixel value is out of the valid bounds of the pixel type, it is optionally clamped accordingly.
 
 \imageMacro{QmitkSegmentationUtilities_ImageMasking.png,"Image masking",6.00}
 
 \section org_mitk_views_segmentationUtilitiesMorphologicalOperations Morphological operations
 
-Morphological operations are applied to a single segmentation image. Based on a given structuring element the underlying segmentation will be modfied.
+Morphological operations are applied to a single segmentation image. Based on a given structuring element the underlying segmentation will be modified.
 The plugin provides a <b>ball</b> and a <b>cross</b> as structuring elements. The follow operations are available:
 
 <ul>
 	<li> <b>Dilation:</b> Each labeled pixel within the segmentation will be dilated based on the selected structuring element.
 	<li> <b>Erosion:</b> Each labeled pixel within the segmentation will be eroded based on the selected structuring element.
 	<li> <b>Opening:</b> A dilation followed by an erosion, used for smoothing edges or eliminating small objects.
 	<li> <b>Closing:</b> An erosion followed by an dilation, used for filling small holes.
 	<li> <b>Fill Holes:</b> Fills bigger holes within a segmentation.
 </ul>
 
 \imageMacro{QmitkSegmentationUtilities_MorphologicalOperations.png,"Morphological operations",6.00}
 
 \section org_mitk_views_segmentationUtilitiesSurfaceToImage Surface to image
 
 Surface to image allows to create a segmentation out of a given surface.
 The operation requires a surface and a reference image.
 The created segmentation image will have the same geometrical properties like the reference image (dimension, size and Geometry3D).
 
 \imageMacro{QmitkSegmentationUtilities_SurfaceToImage.png,"Surface to image",6.00}
 
 **/
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool.png b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool.png
new file mode 100644
index 0000000000..e0cb76269d
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool.png differ
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool_Preferences.png b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool_Preferences.png
new file mode 100644
index 0000000000..06a07774e6
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_SAMTool_Preferences.png differ
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_Technical.dox b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_Technical.dox
index 346754a8f0..d8b04fb961 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_Technical.dox
+++ b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_Technical.dox
@@ -1,98 +1,98 @@
 /**
 
 \page QmitkSegmentationTechnicalPage Technical design of QmitkSegmentation
 
 \li \ref QmitkSegmentationTechnicalPage2
 \li \ref QmitkSegmentationTechnicalPage3
 \li \ref QmitkSegmentationTechnicalPage4
 
 \section QmitkSegmentationTechnicalPage2 Introduction
 
 QmitkSegmentation was designed for the liver resection planning
 project "ReLiver".
 The goal was a stable, well-documented, extensible, and testable
 re-implementation of a functionality called "ERIS", which was used for manual
 segmentation in 2D slices of 3D or 3D+t images.
 Re-implementation was chosen because it seemed to be easier to write
 documentation and tests for newly developed code. In addition, the old code had
 some design weaknesses (e.g. a monolithic class), which would be hard to
 maintain in the future.
 
 By now Segmentation is a well tested and easily extensible vehicle for all kinds of interactive
 segmentation applications. A separate page describes how you can extend Segmentation with new
 tools in a shared object (DLL): \ref toolextensions.
 
 \section QmitkSegmentationTechnicalPage3 Overview of tasks
 
 We identified the following major tasks:
 
 <ol>
 <li> <b>Management of images</b>: what is the original patient image, what
 images are the active segmentations?
 <li> <b>Management of drawing tools</b>: there is a set of drawing tools, one at
 a time is active, that is, someone has to decide which tool will receive mouse
 (and other) events.
 <li> <b>Drawing tools</b>: each tool can modify a segmentation in reaction to
 user interaction. To do so, the tools have to know about the relevant images.
 <li> <b>Slice manipulation</b>: drawing tools need to have means to extract a
 single slice from an image volume and to write a single slice back into an image
 volume.
 <li> <b>Interpolation of unsegmented slices</b>: some class has to keep track of
 all the segmentations in a volume and generate suggestions for missing slices.
 This should be possible in all three orthogonal slice direction.
 <li> <b>Undo</b>: Slice manipulations should be undoable, no matter whether a
 tool or the interpolation mechanism changed something.
 <li> <b>GUI</b>: Integration of everything.
 </ol>
 
 
 \section QmitkSegmentationTechnicalPage4 Classes involved
 
 The above blocks correspond to a number of classes. Here is an overview of all
 related classes with their responsibilities and relations:
 
 \imageMacro{QmitkSegmentation_InteractiveSegmentationClasses.png,"",16.00}
 
 <ol>
 <li> <b>Management of images</b>: mitk::ToolManager has a set of reference
 data (original images) and a second set of working data (segmentations).
 mitk::Tool objects know a ToolManager and can ask the manager for the currently
 relevant images. GUI and non-GUI
 classes are coupled by itk::Events (non-GUI to GUI) and direct method calls (GUI
 to non-GUI).
 <li> <b>Management of drawing tools</b>: As a second task, ToolManager manages all available tools and makes sure that one at a time is able to receive MITK events.
 The GUI for selecting tools is implemented in QmitkToolSelectionBox.
 <li> <b>Drawing tools</b>: Drawing tools all inherit from mitk::Tool, which is a
 mitk::StateMachine. There is a number of derivations from Tool, each offering
 some helper methods for specific sub-classes, like manipulation of 2D slices.
 Tools are instantiated through the itk::ObjectFactory, which means that there is
 also one factory for each tool (e.g. mitk::AddContourToolFactory). For the GUI representation, each tool has an
 identification, consisting of a name and an icon (XPM). The actual drawing
 methods are mainly implemented in mitk::SegTool2D (helper methods) and its
 sub-classes for region growing, freehand drawing, etc.
 <li> <b>Slice manipulation</b>: There are two ways to manipulate slices
 inside a 3D image volume. mitk::ExtractImageFilter retrieves a single 2D slice
 from a 3D volume. mitkVtkImageOverwrite replaces a slice inside a 3D
 volume with a second slice. These classes are used extensively by most of the tools
 to fulfill their task.
 <li> <b>Interpolation of unsegmented slices</b>: There are two classes involved
 in interpolation: mitk::SegmentationInterpolationController knows a mitk::Image (the
 segmentation) and scans its contents for slices with non-zero pixels. It keeps
 track of changes in the image and is always able to tell, which neighbors of a
 slice (in the three orthogonal slice directions) contain segmentations. The
 class also performs this interpolation for single slices on demand.
 Again, we have a second class responsible for the GUI:
 QmitkSlicesInterpolator enables/disables interpolation and offers to
 accept interpolations for one or all slices.
 <li> <b>Undo</b>: Undo functionality is implemented using mitk::DiffSliceOperation.
 mitk::SegTool2D::WriteSliceToVolume stores the original image and the modified slice to the undo stack as an
 mitk::DiffSliceOperation. When the user requests undo, this mitk::DiffSliceOperation will be executed by a singleton
 class DiffSliceOperationApplier. The operation itself observes the image, which it refers to, for itk::DeleteEvent,
 so no undo operation will be executed on/for images that have already been destroyed.
 <li> <b>GUI</b>: The top-level GUI is the view
 QmitkSegmentation, which is very thin in comparison to ERIS. There are
-separate widgets for image and tool selection, for interpolation. Additionaly,
+separate widgets for image and tool selection, for interpolation. Additionally,
 there are some methods to create, delete, crop, load and save segmentations.
 </ol>
 
 **/
diff --git a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_ToolExtensionsGeneralOverview.dox b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_ToolExtensionsGeneralOverview.dox
index 47b868ad49..97e995e9bd 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_ToolExtensionsGeneralOverview.dox
+++ b/Plugins/org.mitk.gui.qt.segmentation/documentation/UserManual/QmitkSegmentation_ToolExtensionsGeneralOverview.dox
@@ -1,182 +1,182 @@
 /**
 
 \page toolextensions How to extend the Segmentation view with external tools
 
 \warning This documentation is outdated (see bug 19726).
 
 <ul>
 <li> \ref ToolExtensionsGeneralOverview2 </li>
 <li> \ref ToolExtensionsGeneralOverview3 </li>
   <ul>
   <li> \ref ToolExtensionsGeneralOverview31 </li>
   <li> \ref ToolExtensionsGeneralOverview32 </li>
   <li> \ref ToolExtensionsGeneralOverview33 </li>
   </ul>
 <li> \ref ToolExtensionsGeneralOverview4 </li>
 <li> \ref ToolExtensionsGeneralOverview5 </li>
 <li> \ref ToolExtensionsGeneralOverview6 </li>
 </ul>
 
 \section ToolExtensionsGeneralOverview2 Introduction
 
 The application for manual segmentation in MITK (Segmentation view) comes
 with a tool class framework that is extensible with new tools (description at
 \ref QmitkSegmentationTechnicalPage). The usual way
 to create new tools (since it is mostly used inside DKFZ) is to just add new
 files to the MITK source code tree. However, this requires to be familiar with
 the MITK build system and turnaround time during development might be long
 (recompiling parts of MITK again and again).
 
 For external users who just want to use
 MITK as a library and application, there is a way to create new segmentation
 tools in an MITK external project, which will compile the new tools into a
 shared object (DLL). Such shared objects can be loaded via the ITK object factory
 and its autoload feature on application startup. This document describes
 how to build such external extensions.
 
 <b>Example files can be found</b> in the MITK source code in the directory
 <tt>${MITK_SOURCE_DIR}/QApplications/ToolExtensionsExample/</tt>.
 
 \section ToolExtensionsGeneralOverview3 What might be part of an extension
 
 The extension concept assumes that you want to create one or several new
 interactive segmentation tools for Segmentation or another MITK
 view that uses the tools infrastructure. In the result you
 will create a shared object (DLL), which contains several tools and their GUI
 counterparts, plus optional code that your extension requires. The following
 sections shortly describe each of these parts.
 
 \subsection ToolExtensionsGeneralOverview31 Tool classes
 
 A tool is basically any subclass of mitk::Tool. Tools are created at runtime
 through the ITK object factory (so they inherit from itk::Object). Tools
 should handle the interaction part of a segmentation method, i.e. create
 seed points, draw contours, etc., in order to parameterize segmentation algorithms.
 Simple algorithms can even be part of a tool. A tools is identified by icon (XPM format),
 name (short string) and optionally a group name (e.g. the group name for Segmentation
 is "default").
 
 <b>There is a naming convention</b>: you should put a tool called \c mitk::ExternalTool into
 files called \c mitkExternalTool.h and \c mitkExternalTool.cpp. This is \e required if
 you use the convenience macros described below, because there need to be ITK factories,
 which names are directly derived from the file names of the tools. For the example of mitk::ExternalTool
 there would be a factory called \c mitk::ExternalToolFactory in a file named \c mitkExternalToolFactory.cpp.
 
 \subsection ToolExtensionsGeneralOverview32 GUI classes for tools
 
 Tools are non-graphical classes that only implement interactions in renderwindows. However,
 some tools will need a means to allow the user to set some parameters -- a graphical user interface, GUI.
 In the Qt3 case, tool GUIs inherit from QmitkToolGUI, which is a mixture of QWidget and itk::Object.
 Tool GUIs are also created through the ITK object factory.
 
 Tools inform their GUIs about state changes by messages. Tool GUIs communicate with their associated tools
 via direct method calls (they know their tools). See mitk::BinaryThresholdTool for examples.
 
 <b>Again a naming convention</b>: if the convenience macros for tool extension shared objects are used,
 you have to put a tool GUI called \c QmitkExternalToolGUI into a files named \c QmitkExternalToolGUI.cpp
 and \c QmitkExternalToolGUI.h. The convenience macro will create a factory called \c QmitkExternalToolGUIFactory
 into a file named \c QmitkExternalToolGUIFactory.cpp.
 
 \subsection ToolExtensionsGeneralOverview33 Additional files
 
 If you are writing tools MITK externally, these tools might depend on additional files, e.g.
 segmentation algorithms. These can also be compiled into a tool extension shared object.
 
 \section ToolExtensionsGeneralOverview4 Writing a CMake file for a tool extension
 
 Summing up the last section, an example tool extension could comprise the following files:
 \verbatim
 mitkExternalTool.h      \
 mitkExternalTool.png     >--- implementing mitk::ExternalTool (header, icon, implementation)
 mitkExternalTool.cpp    /
 
 QmitkExternalToolGUI.h    ,-- implementing a GUI for mitk::ExternalTool
 QmitkExternalToolGUI.cpp /
 
 externalalgorithm.h         \
 externalalgorithm.cpp        \
 externalalgorithmsolver.h     >-- a couple of files (not related to MITK tools)
 externalalgorithmsolver.cpp  /
 \endverbatim
 
 This should all be compiled into one shared object. Just like ITK, VTK and MITK we
 will use CMake for this purpose (I assume you either know or are willing to learn about
 <a href="htpp://www.cmake.org">www.cmake.org</a>)
 A CMake file for the above example would look like this:
 
 \code
 project( ExternalTool )
 
 find_package(ITK)
 find_package(MITK)
 find_package(Qt3)
 
 add_definitions(${QT_DEFINITIONS})
 
 set( TOOL_QT3GUI_FILES
      QmitkExternalToolGUI.cpp
    )
 
 set( TOOL_FILES
      mitkExternalTool.cpp
    )
 
 set( TOOL_ADDITIONAL_CPPS
      externalalgorithm.cpp
      externalalgorithmsolver.cpp
    )
 
 set( TOOL_ADDITIONAL_MOC_H
 )
 
 MITK_GENERATE_TOOLS_LIBRARY(mitkExternalTools)
 \endcode
 
 Basically, you only have to change the definitions of \c TOOL_FILES and, optionally,
 \c TOOL_QT3GUI_FILES, \c TOOL_ADDITIONAL_CPPS and \c TOOL_ADDITIONAL_MOC_H.
 For all .cpp files in \c TOOL_FILES and \c TOOL_QT3GUI_FILES there will be factories
 created assuming the naming conventions described in the sections above.
 Files listed in \c TOOL_ADDITIONAL_CPPS will just be compiled. Files listed in
 \c TOOL_ADDITIONAL_MOC_H will be run through Qts meta object compiler \c moc --
-this is neccessary for all objects that have the Q_OBJECT macro in their declaration.
+this is necessary for all objects that have the Q_OBJECT macro in their declaration.
 \c moc will create new files that will also be compiled into the library.
 
 \section ToolExtensionsGeneralOverview5 Compiling the extension
 
 For compiling a tool extension, you will need a compiled version of MITK. We will
 assume MITK was compiled into /home/user/mitk/debug. You need to build MITK with
 <b>BUILD_SHARED_CORE</b> turned on!
 
 You build the tool extension just like any other CMake based project:
 \li know where your source code is (e.g. /home/user/mitk/tool-extension-src)
 \li change into the directory, where you want to compile the shared object (e.g. /home/user/mitk/tool-extension-debug)
 \li invoke cmake: <tt>ccmake /home/user/mitk/tool-extension-src</tt>
 \li configure (press c or the "configure" button)
 \li set the ITK_DIR variable to the directory, where you compiled ITK
 \li set the MITK_DIR variable to the directory, where you compiled MITK: <tt>/home/user/mitk/debug</tt>
 \li configure (press "c" or the "configure" button)
 \li generate (press "g" or the "generate" button)
 
 This should do it and leave you with a or project file or Makefile that you can compile (using make or VisualStudio).
 
 \section ToolExtensionsGeneralOverview6 Configuring ITK autoload
 
 If the compile succeeds, you will get a library mitkExternalTools.dll or libmitkExternalTools.so.
 This library exports a symbol \c itkLoad which is expected by the ITK object factory.
 
 On application startup the ITK object factory will search a list of directories from
 the environment variable \c ITK_AUTOLOAD_PATH. Set this environment variable to your binary directory (<tt>/home/user/mitk/tool-extension-debug</tt>).
 
 The ITK object factory will load all shared objects that it finds in the specified directories
 and will test if they contain a symbol (function pointer) \c itkLoad, which is expected
 to return a pointer to a itk::ObjectFactoryBase instance. If such a symbol is found, the
 returned factory will be registered with the ITK object factory.
 
 If you successfully followed all the steps above, MITK will find your mitk::ExternalTool on
 application startup, when the ITK object factory is asked to create all known instances of
 mitk::Tool. Furthermore, if your mitk::ExternalTool claims to be part of the "default" group,
 there will be a new icon in Segmentation, which activates your tool.
 
 <b>Have fun!</b> (And Windows users: welcome to the world of DLLs)
 
 **/
diff --git a/Plugins/org.mitk.gui.qt.segmentation/files.cmake b/Plugins/org.mitk.gui.qt.segmentation/files.cmake
index c92f6fd02d..38abb65df5 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/files.cmake
+++ b/Plugins/org.mitk.gui.qt.segmentation/files.cmake
@@ -1,78 +1,81 @@
 set(SRC_CPP_FILES
   QmitkSegmentationPreferencePage.cpp
   QmitkNewSegmentationDialog.cpp
   QmitkLabelSetWidget.cpp
+  QmitkSegmentAnythingPreferencePage.cpp
 )
 
 set(INTERNAL_CPP_FILES
   mitkPluginActivator.cpp
   QmitkSegmentationView.cpp
   QmitkSegmentationUtilitiesView.cpp
   QmitkSegmentationTaskListView.cpp
   QmitkAutocropAction.cpp
   QmitkAutocropLabelSetImageAction.cpp
   QmitkCreatePolygonModelAction.cpp
   QmitkLoadMultiLabelPresetAction.cpp
   QmitkSaveMultiLabelPresetAction.cpp
   QmitkConvertSurfaceToLabelAction.cpp
   QmitkConvertMaskToLabelAction.cpp
   QmitkConvertToMultiLabelSegmentationAction.cpp
   QmitkCreateMultiLabelSegmentationAction.cpp
   Common/QmitkLabelsWidget.cpp
   Common/QmitkLayersWidget.cpp
 )
 
 set(UI_FILES
   src/QmitkSegmentationPreferencePageControls.ui
+  src/QmitkSegmentAnythingPreferencePage.ui
   src/QmitkNewSegmentationDialog.ui
   src/QmitkLabelSetWidgetControls.ui
   src/internal/QmitkSegmentationViewControls.ui
   src/internal/QmitkSegmentationUtilitiesViewControls.ui
   src/internal/QmitkSegmentationTaskListView.ui
   src/internal/Common/QmitkLabelsWidgetControls.ui
   src/internal/Common/QmitkLayersWidgetControls.ui
 )
 
 set(MOC_H_FILES
   src/QmitkSegmentationPreferencePage.h
+  src/QmitkSegmentAnythingPreferencePage.h
   src/QmitkNewSegmentationDialog.h
   src/QmitkLabelSetWidget.h
   src/internal/mitkPluginActivator.h
   src/internal/QmitkSegmentationView.h
   src/internal/QmitkSegmentationUtilitiesView.h
   src/internal/QmitkSegmentationTaskListView.h
   src/internal/QmitkAutocropAction.h
   src/internal/QmitkAutocropLabelSetImageAction.h
   src/internal/QmitkCreatePolygonModelAction.h
   src/internal/QmitkLoadMultiLabelPresetAction.h
   src/internal/QmitkSaveMultiLabelPresetAction.h
   src/internal/QmitkConvertSurfaceToLabelAction.h
   src/internal/QmitkConvertMaskToLabelAction.h
   src/internal/QmitkConvertToMultiLabelSegmentationAction.h
   src/internal/QmitkCreateMultiLabelSegmentationAction.h
   src/internal/Common/QmitkLabelsWidget.h
   src/internal/Common/QmitkLayersWidget.h
 )
 
 set(CACHED_RESOURCE_FILES
   resources/segmentation.svg
   resources/segmentation_utilities.svg
   resources/SegmentationTaskListIcon.svg
   plugin.xml
 )
 
 set(QRC_FILES
   resources/segmentation.qrc
   resources/SegmentationUtilities.qrc
   resources/SegmentationTaskList.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.segmentation/plugin.xml b/Plugins/org.mitk.gui.qt.segmentation/plugin.xml
index 70faf41d0e..d585f47707 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.segmentation/plugin.xml
@@ -1,102 +1,105 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
 
   <extension point="org.blueberry.ui.views">
     <view id="org.mitk.views.segmentation"
       name="Segmentation"
       category="Segmentation"
       icon="resources/segmentation.svg"
       class="QmitkSegmentationView" >
       <description>Allows the segmentation of images using different tools.</description>
       <keywordReference id="org.mitk.views.segmentation.ViewKeyword"/>
     </view>
     <view
       id="org.mitk.views.segmentationutilities"
       name="Segmentation Utilities"
       category="Segmentation"
       class="QmitkSegmentationUtilitiesView"
       icon="resources/segmentation_utilities.svg" >
       <description>Edit segmentations using standard operations. </description>
       <keywordReference id="org.mitk.views.segmentationutilities.ViewKeyword"/>
     </view>
     <view
       id="org.mitk.views.segmentationtasklist"
       name="Segmentation Task List"
       category="Segmentation"
       class="QmitkSegmentationTaskListView"
       icon="resources/SegmentationTaskListIcon.svg" >
       <description>Create or edit a batch of segmentations according to a task list in a streamlined workflow.</description>
       <keywordReference id="org.mitk.views.segmentationtasklist.ViewKeyword"/>
     </view>
   </extension>
 
   <extension point="org.blueberry.ui.preferencePages">
     <page id="org.mitk.gui.qt.application.SegmentationPreferencePage" name="Segmentation" class="QmitkSegmentationPreferencePage">
       <keywordreference id="org.mitk.gui.qt.application.SegmentationPreferencePageKeywords"></keywordreference>
+    </page>
+    	<page id="org.mitk.gui.qt.application.SegmentAnythingPreferencePage" name="Segment Anything" class="QmitkSegmentAnythingPreferencePage" category="org.mitk.gui.qt.application.SegmentationPreferencePage">
+      <keywordreference id="org.mitk.gui.qt.application.SegmentationPreferencePageKeywords"></keywordreference>
     </page>
   </extension>
 
    <extension point="org.blueberry.ui.keywords">
     <keyword id="org.mitk.gui.qt.application.SegmentationPreferencePageKeywords" label="data manager"></keyword>
   </extension>
 
   <extension point="org.mitk.gui.qt.datamanager.contextMenuActions">
     <contextMenuAction nodeDescriptorName="Image" label="Create Segmentation" icon="" class="QmitkCreateMultiLabelSegmentationAction" />
     <contextMenuAction nodeDescriptorName="Image" label="Convert to Segmentation" icon="" class="QmitkConvertToMultiLabelSegmentationAction" />
     <contextMenuAction nodeDescriptorName="ImageMask" label="Create polygon model" icon="" smoothed="false" class="QmitkCreatePolygonModelAction" />
     <contextMenuAction nodeDescriptorName="ImageMask" label="Create smoothed polygon model" icon="" smoothed = "true" class="QmitkCreatePolygonModelAction" />
     <contextMenuAction nodeDescriptorName="ImageMask" label="Autocrop" icon="" class="QmitkAutocropAction" />
     <contextMenuAction nodeDescriptorName="ImageMask" label="Convert to Label" icon="" class="QmitkConvertMaskToLabelAction" />
     <contextMenuAction nodeDescriptorName="LabelSetImage" label="Create polygon model" icon="" smoothed="false" class="QmitkCreatePolygonModelAction" />
     <contextMenuAction nodeDescriptorName="LabelSetImage" label="Create smoothed polygon model" icon="" smoothed = "true" class="QmitkCreatePolygonModelAction" />
     <contextMenuAction nodeDescriptorName="LabelSetImage" label="Autocrop" icon="" class="QmitkAutocropLabelSetImageAction" />
     <contextMenuAction nodeDescriptorName="LabelSetImage" label="Save LabelSet Preset" icon="" class="QmitkSaveMultiLabelPresetAction" />
     <contextMenuAction nodeDescriptorName="LabelSetImage" label="Load LabelSet Preset" icon="" class="QmitkLoadMultiLabelPresetAction" />
     <contextMenuAction nodeDescriptorName="Surface" label="Convert to Label" icon="" class="QmitkConvertSurfaceToLabelAction" />
   </extension>
 
   <extension point="org.blueberry.ui.keywords">
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Segmentation" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Otsu" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Paint" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Wipe" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Region Growing" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Fill" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Erase" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Live Wire" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Fast Marching" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Threshold" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Picking" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Annotation annote" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Labeling" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="Tools" />
     <keyword id="org.mitk.views.segmentation.ViewKeyword"  label="nnUNet" />
 
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Segmentation" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Difference" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Intersection" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Union" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Image Masking" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Surface Masking" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Dilatation" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Erosion" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Closing" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Opening" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Fill Holes" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Morphological Operations" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Boolean Operations" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Surface to Image" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Surface creation" />
     <keyword id="org.mitk.views.segmentationutilities.ViewKeyword"  label="Surface operations" />
 
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Segmentation" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Task" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Task List" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Work List" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="To-do List" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Workflow" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="Preset" />
     <keyword id="org.mitk.views.segmentationtasklist.ViewKeyword"  label="JSON" />
   </extension>
 </plugin>
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.h
index d863238290..bf6dacb06b 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.h
@@ -1,171 +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 QmitkLabelSetWidget_h
 #define QmitkLabelSetWidget_h
 
 #include <org_mitk_gui_qt_segmentation_Export.h>
 
 #include <mitkColorSequenceRainbow.h>
 #include <mitkLabel.h>
 #include <mitkNumericTypes.h>
 #include <ui_QmitkLabelSetWidgetControls.h>
 
 class QmitkDataStorageComboBox;
 class QCompleter;
 
 namespace mitk
 {
   class LabelSetImage;
   class LabelSet;
   class Label;
   class DataStorage;
   class ToolManager;
   class DataNode;
 }
 
 class MITK_QT_SEGMENTATION QmitkLabelSetWidget : public QWidget
 {
   Q_OBJECT
 
 public:
   explicit QmitkLabelSetWidget(QWidget *parent = nullptr);
   ~QmitkLabelSetWidget() override;
 
   void SetDataStorage(mitk::DataStorage *storage);
 
   void UpdateControls();
 
   virtual void setEnabled(bool enabled);
 
   QStringList &GetLabelStringList();
 
 signals:
 
   /// \brief Send a signal when it was requested to go to a label.
   void goToLabel(const mitk::Point3D &);
   void LabelSetWidgetReset();
 
 public slots:
 
   /**
   * @brief Updates the current labels in the label set widget table. For each label (widget item) the 'UpdateTableWidgetItem' is called.
   *
   *   Updating means setting the color box of the table, setting the column with and fill it with the label name.
   *   Furthermore the two push buttons for locking and showing/hiding the layer are checked/unchecked.
   *   This functions only changes the appearance of the table widget and no render window update is necessary.
   */
   void UpdateAllTableWidgetItems();
   void UpdateAllTableWidgetItems(mitk::Label::PixelType);
   /**
   * @brief Resets the current labels in the label set widget table. For each label a widget item is inserted into the table.
   *
   *   Resetting means removing all rows of the widget table and inserting new rows (labels) from the active label set (= layer) of the current working node.
   *   The currently active label is selected and 'Number of labels' is set.
   *   As this function is typically used after one label has been removed or the reference node has been changed (e.g.) the render windows have to be updated.
   */
   void ResetAllTableWidgetItems();
   void ResetAllTableWidgetItems(mitk::Label::PixelType);
 
   void SelectLabelByPixelValue(mitk::Label::PixelType pixelValue);
 
 private slots:
 
   // LabelSet dependent
   void OnOpacityChanged(int);
   void OnUnlockAllLabels(bool);
   void OnLockAllLabels(bool);
   void OnSetAllLabelsVisible(bool);
   void OnSetAllLabelsInvisible(bool);
   void OnSetOnlyActiveLabelVisible(bool);
   void OnRandomColor(bool);
   void OnRemoveLabel(bool);
   void OnRemoveLabels(bool);
   void OnRenameLabel(bool);
   void OnRenameLabelShortcutActivated();
   void OnLockedButtonClicked();
   void OnVisibleButtonClicked();
   void OnColorButtonClicked();
   void OnItemClicked(QTableWidgetItem *item);
   void OnItemDoubleClicked(QTableWidgetItem *item);
   void OnTableViewContextMenuRequested(const QPoint &);
   void InsertTableWidgetItem(mitk::Label *label);
   void UpdateTableWidgetItem(QTableWidgetItem *item);
   // reaction to "returnPressed" signal from ...
   void OnSearchLabel();
   // reaction to the button "Change Label"
   void OnActiveLabelChanged(int pixelValue);
 
-  // LabelSetImage Dependet
+  // LabelSetImage Dependent
   void OnCreateDetailedSurface(bool);
   void OnCreateSmoothedSurface(bool);
   // reaction to the signal "createMask" from QmitkLabelSetTableWidget
   void OnCreateMask(bool);
   void OnCreateMasks(bool);
   // reaction to the signal "createCroppedMask" from QmitkLabelSetTableWidget
   void OnCreateCroppedMask(bool);
   void OnCombineAndCreateMask(bool);
   void OnCombineAndCreateSurface(bool);
   void OnEraseLabel(bool);
   void OnEraseLabels(bool);
   void OnMergeLabels(bool);
 
   // reaction to signal "labelListModified" from QmitkLabelSetTableWidget
   void OnLabelListModified(const QStringList &list);
   // reaction to the signal "toggleOutline" from QmitkLabelSetTableWidget
   void OnToggleOutline(bool);
   void OnRowsInserted(const QModelIndex&, int, int);
   void OnRowsRemoved(const QModelIndex&, int, int);
 
 private:
   enum TableColumns
   {
     NAME_COL = 0,
     LOCKED_COL,
     COLOR_COL,
     VISIBLE_COL
   };
 
   void WaitCursorOn();
 
   void WaitCursorOff();
 
   void RestoreOverrideCursor();
 
   void OnThreadedCalculationDone();
 
   void InitializeTableWidget();
 
   int GetPixelValueOfSelectedItem();
 
   mitk::LabelSetImage *GetWorkingImage();
 
   mitk::DataNode *GetWorkingNode();
 
   Ui::QmitkLabelSetWidgetControls m_Controls;
 
   mitk::ColorSequenceRainbow m_ColorSequenceRainbow;
 
   mitk::DataStorage *m_DataStorage;
 
   QCompleter *m_Completer;
 
   mitk::ToolManager *m_ToolManager;
 
   QStringList m_OrganColors;
 
   QStringList m_LabelStringList;
 
   bool m_ProcessingManualSelection;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.cpp
new file mode 100644
index 0000000000..3229b83a62
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.cpp
@@ -0,0 +1,368 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+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 "QmitkSegmentAnythingPreferencePage.h"
+
+#include <mitkCoreServices.h>
+#include <mitkIPreferencesService.h>
+#include <mitkIPreferences.h>
+#include <mitkProcessExecutor.h>
+#include <itkCommand.h>
+#include <QmitkSegmentAnythingToolGUI.h>
+
+#include <QFileDialog>
+#include <QmitkStyleManager.h>
+#include <QDir>
+#include <QDirIterator>
+
+
+namespace
+{
+  mitk::IPreferences* GetPreferences()
+  {
+    auto* preferencesService = mitk::CoreServices::GetPreferencesService();
+    return preferencesService->GetSystemPreferences()->Node("org.mitk.views.segmentation");
+  }
+}
+
+QmitkSegmentAnythingPreferencePage::QmitkSegmentAnythingPreferencePage()
+  : m_Ui(new Ui::QmitkSegmentAnythingPreferencePage),
+    m_Control(nullptr){}
+
+QmitkSegmentAnythingPreferencePage::~QmitkSegmentAnythingPreferencePage(){}
+
+void QmitkSegmentAnythingPreferencePage::Init(berry::IWorkbench::Pointer){}
+
+void QmitkSegmentAnythingPreferencePage::CreateQtControl(QWidget* parent)
+{
+  m_Control = new QWidget(parent);
+  m_Ui->setupUi(m_Control);
+#ifndef _WIN32
+  m_Ui->sysPythonComboBox->addItem("/usr/bin");
+#endif
+  this->AutoParsePythonPaths();
+  m_Ui->timeoutEdit->setValidator(new QIntValidator(0, 1000, this));
+  m_Ui->sysPythonComboBox->addItem("Select...");
+  m_Ui->sysPythonComboBox->setCurrentIndex(0);
+  connect(m_Ui->installSAMButton, SIGNAL(clicked()), this, SLOT(OnInstallBtnClicked()));
+  connect(m_Ui->clearSAMButton, SIGNAL(clicked()), this, SLOT(OnClearInstall()));
+  connect(m_Ui->sysPythonComboBox,
+          QOverload<int>::of(&QComboBox::activated),
+          [=](int index) { OnSystemPythonChanged(m_Ui->sysPythonComboBox->itemText(index)); });
+  QIcon deleteIcon =
+    QmitkStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/edit-delete.svg"));
+  m_Ui->clearSAMButton->setIcon(deleteIcon);
+  const QString storageDir = m_Installer.GetVirtualEnvPath();
+  bool isInstalled = QmitkSegmentAnythingToolGUI::IsSAMInstalled(storageDir);
+  QString welcomeText;
+  if (isInstalled)
+  {
+    m_PythonPath = GetExactPythonPath(storageDir);
+    m_Installer.SetVirtualEnvPath(m_PythonPath);
+    welcomeText += " Segment Anything tool is already found installed.";
+    m_Ui->installSAMButton->setEnabled(false);
+  }
+  else
+  {
+    welcomeText += " Segment Anything tool not installed. Please click on \"Install SAM\" above. \
+      The installation will create a new virtual environment using the System Python selected above.";
+    m_Ui->installSAMButton->setEnabled(true);
+  }
+  this->WriteStatusMessage(welcomeText);
+  m_Ui->samModelTypeComboBox->addItems(VALID_MODELS);
+  m_Ui->gpuComboBox->addItem(CPU_ID);
+  this->SetGPUInfo();
+  this->Update();
+}
+
+QWidget* QmitkSegmentAnythingPreferencePage::GetQtControl() const
+{
+  return m_Control;
+}
+
+bool QmitkSegmentAnythingPreferencePage::PerformOk()
+{
+  auto* prefs = GetPreferences();
+  prefs->Put("sam parent path", m_Installer.STORAGE_DIR.toStdString());
+  prefs->Put("sam python path", m_PythonPath.toStdString());
+  prefs->Put("sam modeltype", m_Ui->samModelTypeComboBox->currentText().toStdString());
+  prefs->PutInt("sam gpuid", FetchSelectedGPUFromUI());
+  prefs->PutInt("sam timeout", std::stoi(m_Ui->timeoutEdit->text().toStdString()));
+  return true;
+}
+
+void QmitkSegmentAnythingPreferencePage::PerformCancel(){}
+
+void QmitkSegmentAnythingPreferencePage::Update()
+{
+  auto* prefs = GetPreferences();
+  m_Ui->samModelTypeComboBox->setCurrentText(QString::fromStdString(prefs->Get("sam modeltype", "vit_b")));
+  m_Ui->timeoutEdit->setText(QString::number(prefs->GetInt("sam timeout", 300)));
+  int gpuId = prefs->GetInt("sam gpuid", -1);
+  if (gpuId == -1)
+  {
+    m_Ui->gpuComboBox->setCurrentText(CPU_ID);
+  }
+  else if (m_GpuLoader.GetGPUCount() == 0)
+  {
+    m_Ui->gpuComboBox->setCurrentText(QString::number(gpuId));
+  }
+  else
+  {
+    std::vector<QmitkGPUSpec> specs = m_GpuLoader.GetAllGPUSpecs();
+    QmitkGPUSpec gpuSpec = specs[gpuId];
+    m_Ui->gpuComboBox->setCurrentText(QString::number(gpuSpec.id) + ": " + gpuSpec.name + " (" + gpuSpec.memory + ")");
+  }
+}
+
+QString QmitkSegmentAnythingPreferencePage::OnSystemPythonChanged(const QString &pyEnv)
+{
+  QString pyPath;
+  if (pyEnv == QString("Select..."))
+  {
+    QString path = QFileDialog::getExistingDirectory(m_Ui->sysPythonComboBox->parentWidget(), "Python Path", "dir");
+    if (!path.isEmpty())
+    {
+      this->OnSystemPythonChanged(path);                           // recall same function for new path validation
+      bool oldState = m_Ui->sysPythonComboBox->blockSignals(true); // block signal firing while inserting item
+      m_Ui->sysPythonComboBox->insertItem(0, path);
+      m_Ui->sysPythonComboBox->setCurrentIndex(0);
+      m_Ui->sysPythonComboBox->blockSignals(oldState); // unblock signal firing after inserting item. Remove this after Qt6 migration
+    }
+  }
+  else
+  {
+    QString uiPyPath = this->GetPythonPathFromUI(pyEnv);
+    pyPath = this->GetExactPythonPath(uiPyPath);
+  }
+  return pyPath;
+}
+
+QString QmitkSegmentAnythingPreferencePage::GetPythonPathFromUI(const QString &pyUI) const
+{
+  QString fullPath = pyUI;
+  if (-1 != fullPath.indexOf(")"))
+  {
+    fullPath = fullPath.mid(fullPath.indexOf(")") + 2);
+  }
+  return fullPath.simplified();
+}
+
+QString QmitkSegmentAnythingPreferencePage::GetExactPythonPath(const QString &pyEnv) const
+{
+  QString fullPath = pyEnv;
+  bool isPythonExists = false;
+#ifdef _WIN32
+  isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python.exe"));
+  if (!isPythonExists &&
+      !(fullPath.endsWith("Scripts", Qt::CaseInsensitive) || fullPath.endsWith("Scripts/", Qt::CaseInsensitive)))
+  {
+    fullPath += QDir::separator() + QString("Scripts");
+    isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python.exe"));
+  }
+#else
+  isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python3"));
+  if (!isPythonExists &&
+      !(fullPath.endsWith("bin", Qt::CaseInsensitive) || fullPath.endsWith("bin/", Qt::CaseInsensitive)))
+  {
+    fullPath += QDir::separator() + QString("bin");
+    isPythonExists = QFile::exists(fullPath + QDir::separator() + QString("python3"));
+  }
+#endif
+  if (!isPythonExists)
+  {
+    fullPath.clear();
+  }
+  return fullPath;
+}
+
+void QmitkSegmentAnythingPreferencePage::AutoParsePythonPaths()
+{
+  QString homeDir = QDir::homePath();
+  std::vector<QString> searchDirs;
+#ifdef _WIN32
+  searchDirs.push_back(QString("C:") + QDir::separator() + QString("ProgramData") + QDir::separator() +
+                       QString("anaconda3"));
+#else
+  // Add search locations for possible standard python paths here
+  searchDirs.push_back(homeDir + QDir::separator() + "anaconda3");
+  searchDirs.push_back(homeDir + QDir::separator() + "miniconda3");
+  searchDirs.push_back(homeDir + QDir::separator() + "opt" + QDir::separator() + "miniconda3");
+  searchDirs.push_back(homeDir + QDir::separator() + "opt" + QDir::separator() + "anaconda3");
+#endif
+  for (QString searchDir : searchDirs)
+  {
+    if (searchDir.endsWith("anaconda3", Qt::CaseInsensitive))
+    {
+      if (QDir(searchDir).exists())
+      {
+        m_Ui->sysPythonComboBox->addItem("(base): " + searchDir);
+        searchDir.append((QDir::separator() + QString("envs")));
+      }
+    }
+    for (QDirIterator subIt(searchDir, QDir::AllDirs, QDirIterator::NoIteratorFlags); subIt.hasNext();)
+    {
+      subIt.next();
+      QString envName = subIt.fileName();
+      if (!envName.startsWith('.')) // Filter out irrelevent hidden folders, if any.
+      {
+        m_Ui->sysPythonComboBox->addItem("(" + envName + "): " + subIt.filePath());
+      }
+    }
+  }
+}
+
+void QmitkSegmentAnythingPreferencePage::SetGPUInfo()
+{
+  std::vector<QmitkGPUSpec> specs = m_GpuLoader.GetAllGPUSpecs();
+  for (const QmitkGPUSpec &gpuSpec : specs)
+  {
+    m_Ui->gpuComboBox->addItem(QString::number(gpuSpec.id) + ": " + gpuSpec.name + " (" + gpuSpec.memory + ")");
+  }
+  if (specs.empty())
+  {
+    m_Ui->gpuComboBox->setCurrentIndex(m_Ui->gpuComboBox->findText("cpu"));
+  }
+  else
+  {
+    m_Ui->gpuComboBox->setCurrentIndex(m_Ui->gpuComboBox->count()-1);
+  }
+}
+
+int QmitkSegmentAnythingPreferencePage::FetchSelectedGPUFromUI() const
+{
+  QString gpuInfo = m_Ui->gpuComboBox->currentText();
+  if ("cpu" == gpuInfo)
+  {
+    return -1;
+  }
+  else if(m_GpuLoader.GetGPUCount() == 0)
+  {
+    return static_cast<int>(gpuInfo.toInt());
+  }
+  else
+  {
+    QString gpuId = gpuInfo.split(":", QString::SplitBehavior::SkipEmptyParts).first();
+    return static_cast<int>(gpuId.toInt());
+  }
+}
+
+void QmitkSegmentAnythingPreferencePage::OnInstallBtnClicked()
+{
+  QString systemPython = OnSystemPythonChanged(m_Ui->sysPythonComboBox->currentText());
+  if (!systemPython.isEmpty())
+  {
+    this->WriteStatusMessage("<b>STATUS: </b>Installing SAM...");
+    m_Ui->installSAMButton->setEnabled(false);
+    m_Installer.SetSystemPythonPath(systemPython);
+    bool isInstalled = false;
+    bool isFinished = m_Installer.SetupVirtualEnv(m_Installer.VENV_NAME);
+    if (isFinished)
+    {
+      isInstalled = QmitkSegmentAnythingToolGUI::IsSAMInstalled(m_Installer.GetVirtualEnvPath());
+    }
+    if (isInstalled)
+    {
+      m_PythonPath = this->GetExactPythonPath(m_Installer.GetVirtualEnvPath());
+      this->WriteStatusMessage("<b>STATUS: </b>Successfully installed SAM.");
+    }
+    else
+    {
+      this->WriteErrorMessage("<b>ERROR: </b>Couldn't install SAM.");
+      m_Ui->installSAMButton->setEnabled(true);
+    }
+  }
+}
+
+void QmitkSegmentAnythingPreferencePage::OnClearInstall()
+{
+  QDir folderPath(m_Installer.GetVirtualEnvPath());
+  bool isDeleted = folderPath.removeRecursively();
+  if (isDeleted)
+  {
+    this->WriteStatusMessage("Deleted SAM installation.");
+    m_Ui->installSAMButton->setEnabled(true);
+    m_PythonPath.clear();
+  }
+  else
+  {
+    MITK_ERROR << "The virtual environment couldn't be removed. Please check if you have the required access "
+                  "privileges or, some other process is accessing the folders.";
+  }
+}
+
+void QmitkSegmentAnythingPreferencePage::WriteStatusMessage(const QString &message)
+{
+  m_Ui->samInstallStatusLabel->setText(message);
+  m_Ui->samInstallStatusLabel->setStyleSheet("font-weight: bold; color: white");
+  qApp->processEvents();
+}
+
+void QmitkSegmentAnythingPreferencePage::WriteErrorMessage(const QString &message)
+{
+  m_Ui->samInstallStatusLabel->setText(message);
+  m_Ui->samInstallStatusLabel->setStyleSheet("font-weight: bold; color: red");
+  qApp->processEvents();
+}
+
+QString QmitkSAMInstaller::GetVirtualEnvPath()
+{
+  return STORAGE_DIR + VENV_NAME;
+}
+
+bool QmitkSAMInstaller::SetupVirtualEnv(const QString &venvName)
+{
+  if (GetSystemPythonPath().isEmpty())
+  {
+    return false;
+  }
+  QDir folderPath(GetBaseDir());
+  folderPath.mkdir(venvName);
+  if (!folderPath.cd(venvName))
+  {
+    return false; // Check if directory creation was successful.
+  }
+  mitk::ProcessExecutor::ArgumentListType args;
+  auto spExec = mitk::ProcessExecutor::New();
+  auto spCommand = itk::CStyleCommand::New();
+  spCommand->SetCallback(&PrintProcessEvent);
+  spExec->AddObserver(mitk::ExternalProcessOutputEvent(), spCommand);
+
+  args.push_back("-m");
+  args.push_back("venv");
+  args.push_back(venvName.toStdString());
+#ifdef _WIN32
+  QString pythonFile = GetSystemPythonPath() + QDir::separator() + "python.exe";
+  QString pythonExeFolder = "Scripts";
+#else
+  QString pythonFile = GetSystemPythonPath() + QDir::separator() + "python3";
+  QString pythonExeFolder = "bin";
+#endif
+  spExec->Execute(GetBaseDir().toStdString(), pythonFile.toStdString(), args); // Setup local virtual environment
+  if (folderPath.cd(pythonExeFolder))
+  {
+    this->SetPythonPath(folderPath.absolutePath());
+    this->SetPipPath(folderPath.absolutePath());
+    this->InstallPytorch();
+    for (auto &package : PACKAGES)
+    {
+      this->PipInstall(package.toStdString(), &PrintProcessEvent);
+    }
+    std::string pythonCode; // python syntax to check if torch is installed with CUDA.
+    pythonCode.append("import torch;");
+    pythonCode.append("print('Pytorch was installed with CUDA') if torch.cuda.is_available() else print('PyTorch was "
+                      "installed WITHOUT CUDA');");
+    this->ExecutePython(pythonCode, &PrintProcessEvent);
+    return true;
+  }
+  return false;
+}
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.h b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.h
new file mode 100644
index 0000000000..3a4118eaec
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.h
@@ -0,0 +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 QmitkSegmentAnythingPreferencePage_h
+#define QmitkSegmentAnythingPreferencePage_h
+
+#include <berryIQtPreferencePage.h>
+#include <QmitknnUNetGPU.h>
+#include <QString>
+#include <QmitkSetupVirtualEnvUtil.h>
+#include <QStandardPaths>
+#include <ui_QmitkSegmentAnythingPreferencePage.h>
+
+class QWidget;
+
+namespace Ui
+{
+  class QmitkSegmentAnythingPreferencePage;
+}
+
+class QmitkSAMInstaller : public QmitkSetupVirtualEnvUtil
+{
+public:
+  const QString VENV_NAME = ".sam";
+  const QString SAM_VERSION = "1.0"; // currently, unused
+  const std::vector<QString> PACKAGES = {QString("git+https://github.com/MIC-DKFZ/agent-sam.git@v0.1")};
+  const QString STORAGE_DIR;
+  inline QmitkSAMInstaller(
+    const QString baseDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QDir::separator() +
+                            qApp->organizationName() + QDir::separator())
+    : QmitkSetupVirtualEnvUtil(baseDir), STORAGE_DIR(baseDir){};
+  bool SetupVirtualEnv(const QString &) override;
+  QString GetVirtualEnvPath() override;
+};
+
+class QmitkSegmentAnythingPreferencePage : public QObject, public berry::IQtPreferencePage
+{
+  Q_OBJECT
+  Q_INTERFACES(berry::IPreferencePage)
+
+public:
+  QmitkSegmentAnythingPreferencePage();
+  ~QmitkSegmentAnythingPreferencePage() override;
+
+  void Init(berry::IWorkbench::Pointer workbench) override;
+  void CreateQtControl(QWidget* parent) override;
+  QWidget* GetQtControl() const override;
+  bool PerformOk() override;
+  void PerformCancel() override;
+  void Update() override;
+
+private slots:
+  void OnInstallBtnClicked();
+  void OnClearInstall();
+  QString OnSystemPythonChanged(const QString&);
+
+protected:
+  /**
+   * @brief Searches and parses paths of python virtual enviroments
+   * from predefined lookout locations
+   */
+  void AutoParsePythonPaths();
+
+  /**
+   * @brief Get the virtual env path from UI combobox removing any
+   * extra special characters.
+   *
+   * @return QString
+   */
+  QString GetPythonPathFromUI(const QString &) const;
+
+  /**
+   * @brief Get the Exact Python Path for any OS
+   * from the virtual environment path.
+   * @return QString
+   */
+  QString GetExactPythonPath(const QString &) const;
+
+  /**
+   * @brief Adds GPU information to the gpu combo box.
+   * In case, there aren't any GPUs avaialble, the combo box will be
+   * rendered editable.
+   */
+  void SetGPUInfo();
+
+  /**
+   * @brief Returns GPU id of the selected GPU from the Combo box.
+   * @return int
+   */
+  int FetchSelectedGPUFromUI() const;
+
+  void WriteStatusMessage(const QString &);
+  void WriteErrorMessage(const QString &);
+
+private:
+  Ui::QmitkSegmentAnythingPreferencePage* m_Ui;
+  QmitkSAMInstaller m_Installer;
+  QWidget* m_Control;
+  QmitkGPULoader m_GpuLoader;
+  QString m_PythonPath;
+  const QString CPU_ID = "cpu";
+  const QStringList VALID_MODELS = {"vit_b", "vit_l", "vit_h"};
+};
+
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.ui b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.ui
new file mode 100644
index 0000000000..b68da828a3
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentAnythingPreferencePage.ui
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QmitkSegmentAnythingPreferencePage</class>
+ <widget class="QWidget" name="QmitkSegmentAnythingPreferencePage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>656</width>
+    <height>779</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QFormLayout" name="formLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="invisibleLabel"/>
+   </item>
+   <item row="0" column="1">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0" colspan="2">
+      <widget class="QPushButton" name="installSAMButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Install Segment Anything</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="2" colspan="2">
+      <widget class="QPushButton" name="clearSAMButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Clear Install</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="pythonLabel">
+       <property name="text">
+        <string>System Python</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1" colspan="3">
+      <widget class="ctkComboBox" name="sysPythonComboBox" native="true"/>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="samModelTypeLabel">
+       <property name="text">
+        <string>Model Type</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1" colspan="3">
+      <widget class="ctkComboBox" name="samModelTypeComboBox" native="true"/>
+     </item>
+     <item row="3" column="1" colspan="3">
+      <widget class="QLabel" name="samModelTipLabel">
+       <property name="text">
+        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic; color:#808080;&quot;&gt;Tip: Select vit_b for VRAM &amp;lt; 4GB, vit_l for VRAM &amp;lt; 6GB or vit_h for VRAM &amp;gt; 6GB.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="textFormat">
+        <enum>Qt::RichText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1" colspan="3">
+      <widget class="ctkComboBox" name="gpuComboBox" native="true"/>
+     </item>
+     <item row="4" column="0">
+      <widget class="QLabel" name="gpuSpinLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Device Id:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="1" colspan="3">
+      <widget class="QLineEdit" name="timeoutEdit">
+       <property name="text">
+        <string>300</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="0">
+      <widget class="QLabel" name="timeoutLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Time Out (s):</string>
+       </property>
+      </widget>
+     </item>
+     <item row="6" column="0" colspan="4">
+      <widget class="QLabel" name="samInstallStatusLabel">
+       <property name="textFormat">
+        <enum>Qt::RichText</enum>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="1" column="0">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ctkComboBox</class>
+   <extends>QWidget</extends>
+   <header>ctkComboBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePageControls.ui b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePageControls.ui
index 578328a20f..419f143f68 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePageControls.ui
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePageControls.ui
@@ -1,233 +1,233 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkSegmentationPreferencePageControls</class>
  <widget class="QWidget" name="QmitkSegmentationPreferencePageControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>656</width>
     <height>779</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QFormLayout" name="formLayout">
    <item row="0" column="0">
     <widget class="QLabel" name="compactViewLabel">
      <property name="text">
       <string>Compact view</string>
      </property>
     </widget>
    </item>
    <item row="0" column="1">
     <widget class="QCheckBox" name="compactViewCheckBox">
      <property name="text">
       <string>Hide tool button texts and increase icon size</string>
      </property>
     </widget>
    </item>
    <item row="1" column="0">
     <widget class="QLabel" name="displayLabel">
      <property name="text">
       <string>2D display</string>
      </property>
     </widget>
    </item>
    <item row="1" column="1">
     <layout class="QVBoxLayout" name="displayOptionsLayout">
      <item>
       <widget class="QRadioButton" name="outlineRadioButton">
        <property name="text">
         <string>Draw as outline</string>
        </property>
        <property name="checked">
         <bool>true</bool>
        </property>
        <attribute name="buttonGroup">
         <string notr="true">displayButtonGroup</string>
        </attribute>
       </widget>
      </item>
      <item>
       <widget class="QRadioButton" name="overlayRadioButton">
        <property name="text">
         <string>Draw as transparent overlay</string>
        </property>
        <attribute name="buttonGroup">
         <string notr="true">displayButtonGroup</string>
        </attribute>
       </widget>
      </item>
     </layout>
    </item>
    <item row="2" column="0">
     <widget class="QLabel" name="selectionModeLabel">
      <property name="text">
       <string>Data node selection mode</string>
      </property>
     </widget>
    </item>
    <item row="2" column="1">
     <widget class="QCheckBox" name="selectionModeCheckBox">
      <property name="toolTip">
       <string>If checked the segmentation plugin ensures that only the selected segmentation and the reference image are visible at one time.</string>
      </property>
      <property name="text">
       <string>Show only selected nodes</string>
      </property>
     </widget>
    </item>
    <item row="3" column="0">
     <widget class="QLabel" name="labelSetPresetLabel">
      <property name="text">
       <string>Default label set preset</string>
      </property>
     </widget>
    </item>
    <item row="3" column="1">
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0">
       <widget class="QLineEdit" name="labelSetPresetLineEdit">
        <property name="clearButtonEnabled">
         <bool>true</bool>
        </property>
       </widget>
      </item>
      <item row="0" column="1">
       <widget class="QToolButton" name="labelSetPresetToolButton">
        <property name="text">
         <string>...</string>
        </property>
       </widget>
      </item>
      <item row="1" column="0" colspan="2">
       <widget class="QLabel" name="labelSetPresetCmdLineArgLabel">
        <property name="text">
-        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;The default label set preset is currently overriden by the &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New'; color:#ff0000;&quot;&gt;Segmentation.labelSetPreset&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt; command-line argument.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;The default label set preset is currently overridden by the &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New'; color:#ff0000;&quot;&gt;Segmentation.labelSetPreset&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt; command-line argument.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
        <property name="textFormat">
         <enum>Qt::RichText</enum>
        </property>
        <property name="wordWrap">
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item row="4" column="0">
     <widget class="QLabel" name="labelCreationLabel">
      <property name="text">
       <string>Label creation</string>
      </property>
     </widget>
    </item>
    <item row="4" column="1">
     <layout class="QVBoxLayout" name="verticalLayout">
      <item>
       <widget class="QRadioButton" name="defaultNameRadioButton">
        <property name="text">
         <string>Assign default name and color</string>
        </property>
        <property name="checked">
         <bool>true</bool>
        </property>
        <attribute name="buttonGroup">
         <string notr="true">labelCreationButtonGroup</string>
        </attribute>
       </widget>
      </item>
      <item>
       <widget class="QRadioButton" name="askForNameRadioButton">
        <property name="text">
         <string>Ask for name and color</string>
        </property>
        <attribute name="buttonGroup">
         <string notr="true">labelCreationButtonGroup</string>
        </attribute>
       </widget>
      </item>
     </layout>
    </item>
    <item row="5" column="0">
     <widget class="QLabel" name="labelSuggestions">
      <property name="text">
       <string>Label suggestions</string>
      </property>
     </widget>
    </item>
    <item row="5" column="1">
     <layout class="QGridLayout" name="gridLayout_2">
      <item row="0" column="0">
       <widget class="QLineEdit" name="suggestionsLineEdit">
        <property name="clearButtonEnabled">
         <bool>true</bool>
        </property>
       </widget>
      </item>
      <item row="0" column="1">
       <widget class="QToolButton" name="suggestionsToolButton">
        <property name="text">
         <string>...</string>
        </property>
       </widget>
      </item>
      <item row="1" column="0" colspan="2">
       <widget class="QLabel" name="suggestionsCmdLineArgLabel">
        <property name="text">
         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;Suggestions are currently enforced by the &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New'; color:#ff0000;&quot;&gt;Segmentation.labelSuggestions&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt; command-line argument.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
        <property name="textFormat">
         <enum>Qt::RichText</enum>
        </property>
        <property name="wordWrap">
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item row="6" column="1">
     <widget class="QCheckBox" name="replaceStandardSuggestionsCheckBox">
      <property name="text">
       <string>Replace standard organ suggestions</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="7" column="1">
     <widget class="QCheckBox" name="suggestOnceCheckBox">
      <property name="text">
       <string>Suggest once per segmentation</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="8" column="1">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <resources/>
  <connections/>
  <buttongroups>
   <buttongroup name="labelCreationButtonGroup"/>
   <buttongroup name="displayButtonGroup"/>
  </buttongroups>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
index d4db0bc770..3b518f8ba3 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
@@ -1,1083 +1,1083 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkSegmentationView.h"
 #include "mitkPluginActivator.h"
 
 // blueberry
 #include <berryIWorkbenchPage.h>
 
 // mitk
 #include <mitkApplicationCursor.h>
 #include <mitkBaseApplication.h>
 #include <mitkBaseRendererHelper.h>
 #include <mitkCameraController.h>
 #include <mitkLabelSetImage.h>
 #include <mitkLabelSetImageHelper.h>
 #include <mitkMultiLabelIOHelper.h>
 #include <mitkManualPlacementAnnotationRenderer.h>
 #include <mitkNodePredicateSubGeometry.h>
 #include <mitkSegmentationObjectFactory.h>
 #include <mitkSegTool2D.h>
 #include <mitkStatusBar.h>
 #include <mitkToolManagerProvider.h>
 #include <mitkVtkResliceInterpolationProperty.h>
 #include <mitkWorkbenchUtil.h>
 #include <mitkIPreferences.h>
 
 // Qmitk
 #include <QmitkRenderWindow.h>
 #include <QmitkStaticDynamicSegmentationDialog.h>
 #include <QmitkNewSegmentationDialog.h>
 #include <QmitkMultiLabelManager.h>
 
 // us
 #include <usModuleResource.h>
 #include <usModuleResourceStream.h>
 
 // Qt
 #include <QMessageBox>
 #include <QShortcut>
 #include <QDir>
 
 // vtk
 #include <vtkQImageToImageSource.h>
 
 #include <regex>
 
 namespace
 {
   QList<QmitkRenderWindow*> Get2DWindows(const QList<QmitkRenderWindow*> allWindows)
   {
     QList<QmitkRenderWindow*> all2DWindows;
     for (auto* window : allWindows)
     {
       if (window->GetRenderer()->GetMapperID() == mitk::BaseRenderer::Standard2D)
       {
         all2DWindows.append(window);
       }
     }
     return all2DWindows;
   }
 }
 
 const std::string QmitkSegmentationView::VIEW_ID = "org.mitk.views.segmentation";
 
 QmitkSegmentationView::QmitkSegmentationView()
   : m_Parent(nullptr)
   , m_Controls(nullptr)
   , m_RenderWindowPart(nullptr)
   , m_ToolManager(nullptr)
   , m_ReferenceNode(nullptr)
   , m_WorkingNode(nullptr)
   , m_DrawOutline(true)
   , m_SelectionMode(false)
   , m_MouseCursorSet(false)
   , m_DefaultLabelNaming(true)
   , m_SelectionChangeIsAlreadyBeingHandled(false)
 {
   auto isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
   auto isDwi = mitk::NodePredicateDataType::New("DiffusionImage");
   auto isDti = mitk::NodePredicateDataType::New("TensorImage");
   auto isOdf = mitk::NodePredicateDataType::New("OdfImage");
   auto isSegment = mitk::NodePredicateDataType::New("Segment");
 
   auto validImages = mitk::NodePredicateOr::New();
   validImages->AddPredicate(mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isSegment)));
   validImages->AddPredicate(isDwi);
   validImages->AddPredicate(isDti);
   validImages->AddPredicate(isOdf);
 
   m_SegmentationPredicate = mitk::NodePredicateAnd::New();
   m_SegmentationPredicate->AddPredicate(mitk::TNodePredicateDataType<mitk::LabelSetImage>::New());
   m_SegmentationPredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
   m_SegmentationPredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("hidden object")));
 
   m_ReferencePredicate = mitk::NodePredicateAnd::New();
   m_ReferencePredicate->AddPredicate(validImages);
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(m_SegmentationPredicate));
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("hidden object")));
 }
 
 QmitkSegmentationView::~QmitkSegmentationView()
 {
   if (nullptr != m_Controls)
   {
     // deactivate all tools
     m_ToolManager->ActivateTool(-1);
 
     // removing all observers from working data
     for (NodeTagMapType::iterator dataIter = m_WorkingDataObserverTags.begin(); dataIter != m_WorkingDataObserverTags.end(); ++dataIter)
     {
       (*dataIter).first->GetProperty("visible")->RemoveObserver((*dataIter).second);
     }
     m_WorkingDataObserverTags.clear();
 
     this->RemoveObserversFromWorkingImage();
 
     // removing all observers from reference data
     for (NodeTagMapType::iterator dataIter = m_ReferenceDataObserverTags.begin(); dataIter != m_ReferenceDataObserverTags.end(); ++dataIter)
     {
       (*dataIter).first->GetProperty("visible")->RemoveObserver((*dataIter).second);
     }
     m_ReferenceDataObserverTags.clear();
 
     mitk::RenderingManager::GetInstance()->RemoveObserver(m_RenderingManagerObserverTag);
 
     ctkPluginContext* context = mitk::PluginActivator::getContext();
     ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
     mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
     service->RemoveAllPlanePositions();
     context->ungetService(ppmRef);
 
     m_ToolManager->SetReferenceData(nullptr);
     m_ToolManager->SetWorkingData(nullptr);
   }
 
   m_ToolManager->ActiveToolChanged -=
     mitk::MessageDelegate<Self>(this, &Self::ActiveToolChanged);
 
   delete m_Controls;
 }
 
 /**********************************************************************/
 /* private Q_SLOTS                                                    */
 /**********************************************************************/
 void QmitkSegmentationView::OnReferenceSelectionChanged(QList<mitk::DataNode::Pointer>)
 {
   this->OnAnySelectionChanged();
 }
 
 void QmitkSegmentationView::OnSegmentationSelectionChanged(QList<mitk::DataNode::Pointer>)
 {
   this->OnAnySelectionChanged();
 }
 
 void QmitkSegmentationView::OnAnySelectionChanged()
 {
   // When only a segmentation has been selected and the method is then called by a reference image selection,
   // the already selected segmentation may not match the geometry predicate of the new reference image anymore.
   // This will trigger a recursive call of this method further below. While it would be resolved gracefully, we
   // can spare the extra call with an early-out. The original call of this method will handle the segmentation
   // selection change afterwards anyway.
 
   if (m_SelectionChangeIsAlreadyBeingHandled)
     return;
 
   auto selectedReferenceNode = m_Controls->referenceNodeSelector->GetSelectedNode();
   bool referenceNodeChanged = false;
 
   m_ToolManager->ActivateTool(-1);
 
   if (m_ReferenceNode != selectedReferenceNode)
   {
     referenceNodeChanged = true;
 
     // Remove visibility observer for the current reference node
     if (m_ReferenceDataObserverTags.find(m_ReferenceNode) != m_ReferenceDataObserverTags.end())
     {
       m_ReferenceNode->GetProperty("visible")->RemoveObserver(m_ReferenceDataObserverTags[m_ReferenceNode]);
       m_ReferenceDataObserverTags.erase(m_ReferenceNode);
     }
 
     // Set new reference node
     m_ReferenceNode = selectedReferenceNode;
     m_ToolManager->SetReferenceData(m_ReferenceNode);
 
     // Prepare for a potential recursive call when changing node predicates of the working node selector
     m_SelectionChangeIsAlreadyBeingHandled = true;
 
     if (m_ReferenceNode.IsNull())
     {
       // Without a reference image, allow all segmentations to be selected
       m_Controls->workingNodeSelector->SetNodePredicate(m_SegmentationPredicate);
       m_SelectionChangeIsAlreadyBeingHandled = false;
     }
     else
     {
       // With a reference image, only allow segmentations that fit the geometry of the reference image to be selected.
       m_Controls->workingNodeSelector->SetNodePredicate(mitk::NodePredicateAnd::New(
         mitk::NodePredicateSubGeometry::New(m_ReferenceNode->GetData()->GetGeometry()),
         m_SegmentationPredicate.GetPointer()));
 
       m_SelectionChangeIsAlreadyBeingHandled = false;
 
       this->ApplySelectionModeOnReferenceNode();
 
       // Add visibility observer for the new reference node
       auto command = itk::SimpleMemberCommand<Self>::New();
       command->SetCallbackFunction(this, &Self::ValidateSelectionInput);
 
       m_ReferenceDataObserverTags[m_ReferenceNode] =
         m_ReferenceNode->GetProperty("visible")->AddObserver(itk::ModifiedEvent(), command);
     }
   }
 
   auto selectedWorkingNode = m_Controls->workingNodeSelector->GetSelectedNode();
   bool workingNodeChanged = false;
 
   if (m_WorkingNode != selectedWorkingNode)
   {
     workingNodeChanged = true;
 
     this->RemoveObserversFromWorkingImage();
 
     // Remove visibility observer for the current working node
     if (m_WorkingDataObserverTags.find(m_WorkingNode) != m_WorkingDataObserverTags.end())
     {
       m_WorkingNode->GetProperty("visible")->RemoveObserver(m_WorkingDataObserverTags[m_WorkingNode]);
       m_WorkingDataObserverTags.erase(m_WorkingNode);
     }
 
     // Set new working node
     m_WorkingNode = selectedWorkingNode;
     m_ToolManager->SetWorkingData(m_WorkingNode);
 
     if (m_WorkingNode.IsNotNull())
     {
       this->ApplySelectionModeOnWorkingNode();
 
       // Add visibility observer for the new segmentation node
       auto command = itk::SimpleMemberCommand<Self>::New();
       command->SetCallbackFunction(this, &Self::ValidateSelectionInput);
 
       m_WorkingDataObserverTags[m_WorkingNode] =
         m_WorkingNode->GetProperty("visible")->AddObserver(itk::ModifiedEvent(), command);
 
       this->AddObserversToWorkingImage();
     }
   }
 
   // Reset camera if any selection changed but only if both reference node and working node are set
   if ((referenceNodeChanged || workingNodeChanged) && (m_ReferenceNode.IsNotNull() && m_WorkingNode.IsNotNull()))
   {
     if (nullptr != m_RenderWindowPart)
     {
       m_RenderWindowPart->InitializeViews(m_ReferenceNode->GetData()->GetTimeGeometry(), false);
     }
   }
 
   this->UpdateGUI();
 }
 
 void QmitkSegmentationView::OnLabelAdded(mitk::LabelSetImage::LabelValueType)
 {
   this->ValidateSelectionInput();
 }
 
 void QmitkSegmentationView::OnLabelRemoved(mitk::LabelSetImage::LabelValueType)
 {
   this->ValidateSelectionInput();
 }
 
 void QmitkSegmentationView::OnGroupRemoved(mitk::LabelSetImage::GroupIndexType)
 {
   this->ValidateSelectionInput();
 }
 
 mitk::LabelSetImage* QmitkSegmentationView::GetWorkingImage()
 {
   if (m_WorkingNode.IsNull())
     return nullptr;
 
   return dynamic_cast<mitk::LabelSetImage*>(m_WorkingNode->GetData());
 }
 
 void QmitkSegmentationView::AddObserversToWorkingImage()
 {
   auto* workingImage = this->GetWorkingImage();
 
   if (workingImage != nullptr)
   {
     workingImage->AddLabelAddedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::LabelValueType>(this, &Self::OnLabelAdded));
     workingImage->AddLabelRemovedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::LabelValueType>(this, &Self::OnLabelRemoved));
     workingImage->AddGroupRemovedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::GroupIndexType>(this, &Self::OnGroupRemoved));
   }
 }
 
 void QmitkSegmentationView::RemoveObserversFromWorkingImage()
 {
   auto* workingImage = this->GetWorkingImage();
 
   if (workingImage != nullptr)
   {
     workingImage->RemoveLabelAddedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::LabelValueType>(this, &Self::OnLabelAdded));
     workingImage->RemoveLabelRemovedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::LabelValueType>(this, &Self::OnLabelRemoved));
     workingImage->RemoveGroupRemovedListener(mitk::MessageDelegate1<Self, mitk::LabelSetImage::GroupIndexType>(this, &Self::OnGroupRemoved));
   }
 }
 
 void QmitkSegmentationView::OnVisibilityShortcutActivated()
 {
   if (m_WorkingNode.IsNull())
   {
     return;
   }
 
   bool isVisible = false;
   m_WorkingNode->GetBoolProperty("visible", isVisible);
   m_WorkingNode->SetVisibility(!isVisible);
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkSegmentationView::OnLabelToggleShortcutActivated()
 {
   if (m_WorkingNode.IsNull())
   {
     return;
   }
 
   auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_WorkingNode->GetData());
   if (nullptr == workingImage)
   {
     return;
   }
 
   this->WaitCursorOn();
   workingImage->GetActiveLabelSet()->SetNextActiveLabel();
   workingImage->Modified();
   this->WaitCursorOff();
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkSegmentationView::OnNewSegmentation()
 {
   m_ToolManager->ActivateTool(-1);
 
   if (m_ReferenceNode.IsNull())
   {
     MITK_ERROR << "'Create new segmentation' button should never be clickable unless a reference image is selected.";
     return;
   }
 
   mitk::Image::ConstPointer referenceImage = dynamic_cast<mitk::Image*>(m_ReferenceNode->GetData());
   if (referenceImage.IsNull())
   {
     QMessageBox::information(
       m_Parent, "New segmentation", "Please load and select an image before starting some action.");
     return;
   }
 
   if (referenceImage->GetDimension() <= 1)
   {
     QMessageBox::information(
       m_Parent, "New segmentation", "Segmentation is currently not supported for 2D images");
     return;
   }
 
   auto segTemplateImage = referenceImage;
   if (referenceImage->GetDimension() > 3)
   {
     QmitkStaticDynamicSegmentationDialog dialog(m_Parent);
     dialog.SetReferenceImage(referenceImage.GetPointer());
     dialog.exec();
     segTemplateImage = dialog.GetSegmentationTemplate();
   }
 
   mitk::DataNode::Pointer newSegmentationNode;
   try
   {
     this->WaitCursorOn();
     newSegmentationNode = mitk::LabelSetImageHelper::CreateNewSegmentationNode(m_ReferenceNode, segTemplateImage);
     this->WaitCursorOff();
   }
   catch (mitk::Exception& e)
   {
     this->WaitCursorOff();
     MITK_ERROR << "Exception caught: " << e.GetDescription();
     QMessageBox::warning(m_Parent, "New segmentation", "Could not create a new segmentation.");
     return;
   }
 
   auto newLabelSetImage = dynamic_cast<mitk::LabelSetImage*>(newSegmentationNode->GetData());
   if (nullptr == newLabelSetImage)
   {
     // something went wrong
     return;
   }
 
   const auto labelSetPreset = this->GetDefaultLabelSetPreset();
 
   if (labelSetPreset.empty() || !mitk::MultiLabelIOHelper::LoadLabelSetImagePreset(labelSetPreset, newLabelSetImage))
   {
     auto newLabel = mitk::LabelSetImageHelper::CreateNewLabel(newLabelSetImage);
 
     if (!m_DefaultLabelNaming)
       QmitkNewSegmentationDialog::DoRenameLabel(newLabel, nullptr, m_Parent);
 
     newLabelSetImage->GetActiveLabelSet()->AddLabel(newLabel);
   }
 
   if (!this->GetDataStorage()->Exists(newSegmentationNode))
   {
     this->GetDataStorage()->Add(newSegmentationNode, m_ReferenceNode);
   }
 
   if (m_ToolManager->GetWorkingData(0))
   {
     m_ToolManager->GetWorkingData(0)->SetSelected(false);
   }
 
   newSegmentationNode->SetSelected(true);
   m_Controls->workingNodeSelector->SetCurrentSelectedNode(newSegmentationNode);
 }
 
 std::string QmitkSegmentationView::GetDefaultLabelSetPreset() const
 {
   auto labelSetPreset = mitk::BaseApplication::instance().config().getString(mitk::BaseApplication::ARG_SEGMENTATION_LABELSET_PRESET.toStdString(), "");
 
   if (labelSetPreset.empty())
     labelSetPreset = m_LabelSetPresetPreference.toStdString();
 
   return labelSetPreset;
 }
 
 void QmitkSegmentationView::OnManualTool2DSelected(int id)
 {
   this->ResetMouseCursor();
   mitk::StatusBar::GetInstance()->DisplayText("");
 
   if (id >= 0)
   {
     std::string text = "Active Tool: \"";
     text += m_ToolManager->GetToolById(id)->GetName();
     text += "\"";
     mitk::StatusBar::GetInstance()->DisplayText(text.c_str());
 
     us::ModuleResource resource = m_ToolManager->GetToolById(id)->GetCursorIconResource();
     this->SetMouseCursor(resource, 0, 0);
   }
 }
 
 void QmitkSegmentationView::OnShowMarkerNodes(bool state)
 {
   mitk::SegTool2D::Pointer manualSegmentationTool;
 
   unsigned int numberOfExistingTools = m_ToolManager->GetTools().size();
 
   for (unsigned int i = 0; i < numberOfExistingTools; i++)
   {
     manualSegmentationTool = dynamic_cast<mitk::SegTool2D*>(m_ToolManager->GetToolById(i));
     if (nullptr == manualSegmentationTool)
     {
       continue;
     }
 
     manualSegmentationTool->SetShowMarkerNodes(state);
   }
 }
 
 void QmitkSegmentationView::OnCurrentLabelSelectionChanged(QmitkMultiLabelManager::LabelValueVectorType labels)
 {
   auto segmentation = this->GetCurrentSegmentation();
 
   const auto labelValue = labels.front();
   const auto groupID = segmentation->GetGroupIndexOfLabel(labelValue);
   if (groupID != segmentation->GetActiveLayer()) segmentation->SetActiveLayer(groupID);
   if (labelValue != segmentation->GetActiveLabelSet()->GetActiveLabel()->GetValue()) segmentation->GetActiveLabelSet()->SetActiveLabel(labelValue);
 
   segmentation->Modified();
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkSegmentationView::OnGoToLabel(mitk::LabelSetImage::LabelValueType /*label*/, const mitk::Point3D& pos)
 {
   if (m_RenderWindowPart)
   {
     m_RenderWindowPart->SetSelectedPosition(pos);
   }
 }
 
 void QmitkSegmentationView::OnLabelRenameRequested(mitk::Label* label, bool rename) const
 {
   auto segmentation = this->GetCurrentSegmentation();
 
   if (rename)
   {
     QmitkNewSegmentationDialog::DoRenameLabel(label, segmentation, this->m_Parent, QmitkNewSegmentationDialog::Mode::RenameLabel);
     return;
   }
 
   QmitkNewSegmentationDialog::DoRenameLabel(label, nullptr, this->m_Parent, QmitkNewSegmentationDialog::Mode::NewLabel);
 }
 
 mitk::LabelSetImage* QmitkSegmentationView::GetCurrentSegmentation() const
 {
   auto workingNode = m_Controls->workingNodeSelector->GetSelectedNode();
   if (workingNode.IsNull()) mitkThrow() << "Segmentation view is in an invalid state. Working node is null, but a label selection change has been triggered.";
 
   auto segmentation = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   if (nullptr == segmentation) mitkThrow() << "Segmentation view is in an invalid state. Working node contains no segmentation, but a label selection change has been triggered.";
 
   return segmentation;
 }
 
 /**********************************************************************/
 /* private                                                            */
 /**********************************************************************/
 void QmitkSegmentationView::CreateQtPartControl(QWidget* parent)
 {
    m_Parent = parent;
 
    m_Controls = new Ui::QmitkSegmentationViewControls;
    m_Controls->setupUi(parent);
 
    // *------------------------
    // * SHORTCUTS
    // *------------------------
    QShortcut* visibilityShortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key::Key_H), parent);
    connect(visibilityShortcut, &QShortcut::activated, this, &Self::OnVisibilityShortcutActivated);
    QShortcut* labelToggleShortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key::Key_L, Qt::CTRL | Qt::Key::Key_I), parent);
    connect(labelToggleShortcut, &QShortcut::activated, this, &Self::OnLabelToggleShortcutActivated);
 
    // *------------------------
    // * DATA SELECTION WIDGETS
    // *------------------------
    m_Controls->referenceNodeSelector->SetDataStorage(GetDataStorage());
    m_Controls->referenceNodeSelector->SetNodePredicate(m_ReferencePredicate);
    m_Controls->referenceNodeSelector->SetInvalidInfo("Select an image");
    m_Controls->referenceNodeSelector->SetPopUpTitel("Select an image");
    m_Controls->referenceNodeSelector->SetPopUpHint("Select an image that should be used to define the geometry and bounds of the segmentation.");
 
    m_Controls->workingNodeSelector->SetDataStorage(GetDataStorage());
    m_Controls->workingNodeSelector->SetNodePredicate(m_SegmentationPredicate);
    m_Controls->workingNodeSelector->SetInvalidInfo("Select a segmentation");
    m_Controls->workingNodeSelector->SetPopUpTitel("Select a segmentation");
    m_Controls->workingNodeSelector->SetPopUpHint("Select a segmentation that should be modified. Only segmentation with the same geometry and within the bounds of the reference image are selected.");
 
    connect(m_Controls->referenceNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
            this, &Self::OnReferenceSelectionChanged);
    connect(m_Controls->workingNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
            this, &Self::OnSegmentationSelectionChanged);
 
    // *------------------------
    // * TOOLMANAGER
    // *------------------------
    m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager();
    m_ToolManager->SetDataStorage(*(this->GetDataStorage()));
    m_ToolManager->InitializeTools();
 
-   QString segTools2D = tr("Add Subtract Lasso Fill Erase Close Paint Wipe 'Region Growing' 'Live Wire' MonaiLabel2D");
+   QString segTools2D = tr("Add Subtract Lasso Fill Erase Close Paint Wipe 'Region Growing' 'Live Wire' 'Segment Anything' MonaiLabel2D");
    QString segTools3D = tr("Threshold 'UL Threshold' Otsu 'Region Growing 3D' Picking GrowCut TotalSegmentator MonaiLabel3D");
 
 #ifdef __linux__
    segTools3D.append(" nnUNet"); // plugin not enabled for MacOS / Windows
 #endif
    std::regex extSegTool2DRegEx("SegTool2D$");
    std::regex extSegTool3DRegEx("SegTool3D$");
 
    auto tools = m_ToolManager->GetTools();
    for (const auto &tool : tools)
    {
      if (std::regex_search(tool->GetNameOfClass(), extSegTool2DRegEx))
      {
        segTools2D.append(QString(" '%1'").arg(tool->GetName()));
      }
      else if (std::regex_search(tool->GetNameOfClass(), extSegTool3DRegEx))
      {
        segTools3D.append(QString(" '%1'").arg(tool->GetName()));
      }
    }
 
    // setup 2D tools
    m_Controls->toolSelectionBox2D->SetToolManager(*m_ToolManager);
    m_Controls->toolSelectionBox2D->SetGenerateAccelerators(true);
    m_Controls->toolSelectionBox2D->SetToolGUIArea(m_Controls->toolGUIArea2D);
    m_Controls->toolSelectionBox2D->SetDisplayedToolGroups(segTools2D.toStdString());
    connect(m_Controls->toolSelectionBox2D, &QmitkToolSelectionBox::ToolSelected,
            this, &Self::OnManualTool2DSelected);
 
    // setup 3D Tools
    m_Controls->toolSelectionBox3D->SetToolManager(*m_ToolManager);
    m_Controls->toolSelectionBox3D->SetGenerateAccelerators(true);
    m_Controls->toolSelectionBox3D->SetToolGUIArea(m_Controls->toolGUIArea3D);
    m_Controls->toolSelectionBox3D->SetDisplayedToolGroups(segTools3D.toStdString());
 
    m_Controls->slicesInterpolator->SetDataStorage(this->GetDataStorage());
 
    // create general signal / slot connections
    connect(m_Controls->newSegmentationButton, &QToolButton::clicked, this, &Self::OnNewSegmentation);
 
    connect(m_Controls->slicesInterpolator, &QmitkSlicesInterpolator::SignalShowMarkerNodes, this, &Self::OnShowMarkerNodes);
 
    connect(m_Controls->multiLabelWidget, &QmitkMultiLabelManager::CurrentSelectionChanged, this, &Self::OnCurrentLabelSelectionChanged);
    connect(m_Controls->multiLabelWidget, &QmitkMultiLabelManager::GoToLabel, this, &Self::OnGoToLabel);
    connect(m_Controls->multiLabelWidget, &QmitkMultiLabelManager::LabelRenameRequested, this, &Self::OnLabelRenameRequested);
 
    auto command = itk::SimpleMemberCommand<Self>::New();
    command->SetCallbackFunction(this, &Self::ValidateSelectionInput);
    m_RenderingManagerObserverTag =
      mitk::RenderingManager::GetInstance()->AddObserver(mitk::RenderingManagerViewsInitializedEvent(), command);
 
    m_RenderWindowPart = this->GetRenderWindowPart();
    if (nullptr != m_RenderWindowPart)
    {
      this->RenderWindowPartActivated(m_RenderWindowPart);
    }
 
    // Make sure the GUI notices if appropriate data is already present on creation.
    // Should be done last, if everything else is configured because it triggers the autoselection of data.
    m_Controls->referenceNodeSelector->SetAutoSelectNewNodes(true);
    m_Controls->workingNodeSelector->SetAutoSelectNewNodes(true);
 
    this->UpdateGUI();
 }
 
 void QmitkSegmentationView::ActiveToolChanged()
 {
   if (nullptr == m_RenderWindowPart)
   {
     return;
   }
 
   mitk::TimeGeometry* interactionReferenceGeometry = nullptr;
   auto activeTool = m_ToolManager->GetActiveTool();
   if (nullptr != activeTool && m_ReferenceNode.IsNotNull())
   {
     mitk::Image::ConstPointer referenceImage = dynamic_cast<mitk::Image *>(m_ReferenceNode->GetData());
     if (referenceImage.IsNotNull())
     {
       // tool activated, reference image available: set reference geometry
       interactionReferenceGeometry = m_ReferenceNode->GetData()->GetTimeGeometry();
     }
   }
 
   // set the interaction reference geometry for the render window part (might be nullptr)
   m_RenderWindowPart->SetInteractionReferenceGeometry(interactionReferenceGeometry);
 }
 
 void QmitkSegmentationView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   if (m_RenderWindowPart != renderWindowPart)
   {
     m_RenderWindowPart = renderWindowPart;
   }
 
   if (nullptr != m_Parent)
   {
     m_Parent->setEnabled(true);
   }
 
   if (nullptr == m_Controls)
   {
     return;
   }
 
   if (nullptr != m_RenderWindowPart)
   {
     auto all2DWindows = Get2DWindows(m_RenderWindowPart->GetQmitkRenderWindows().values());
     m_Controls->slicesInterpolator->Initialize(m_ToolManager, all2DWindows);
 
     if (!m_RenderWindowPart->HasCoupledRenderWindows())
     {
       // react if the active tool changed, only if a render window part with decoupled render windows is used
       m_ToolManager->ActiveToolChanged +=
         mitk::MessageDelegate<Self>(this, &Self::ActiveToolChanged);
     }
   }
 }
 
 void QmitkSegmentationView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
 {
   m_RenderWindowPart = nullptr;
   if (nullptr != m_Parent)
   {
     m_Parent->setEnabled(false);
   }
 
   // remove message-connection to make sure no message is processed if no render window part is available
   m_ToolManager->ActiveToolChanged -=
     mitk::MessageDelegate<Self>(this, &Self::ActiveToolChanged);
 
   m_Controls->slicesInterpolator->Uninitialize();
 }
 
 void QmitkSegmentationView::RenderWindowPartInputChanged(mitk::IRenderWindowPart* /*renderWindowPart*/)
 {
   if (nullptr == m_RenderWindowPart)
   {
     return;
   }
 
   m_Controls->slicesInterpolator->Uninitialize();
   auto all2DWindows = Get2DWindows(m_RenderWindowPart->GetQmitkRenderWindows().values());
   m_Controls->slicesInterpolator->Initialize(m_ToolManager, all2DWindows);
 }
 
 void QmitkSegmentationView::OnPreferencesChanged(const mitk::IPreferences* prefs)
 {
   auto labelSuggestions = mitk::BaseApplication::instance().config().getString(mitk::BaseApplication::ARG_SEGMENTATION_LABEL_SUGGESTIONS.toStdString(), "");
 
   m_DefaultLabelNaming = labelSuggestions.empty()
     ? prefs->GetBool("default label naming", true)
     : false; // No default label naming when label suggestions are enforced via command-line argument
 
   if (nullptr != m_Controls)
   {
     m_Controls->multiLabelWidget->SetDefaultLabelNaming(m_DefaultLabelNaming);
 
     bool compactView = prefs->GetBool("compact view", false);
     int numberOfColumns = compactView ? 6 : 4;
 
     m_Controls->toolSelectionBox2D->SetLayoutColumns(numberOfColumns);
     m_Controls->toolSelectionBox2D->SetShowNames(!compactView);
 
     m_Controls->toolSelectionBox3D->SetLayoutColumns(numberOfColumns);
     m_Controls->toolSelectionBox3D->SetShowNames(!compactView);
   }
 
   m_DrawOutline = prefs->GetBool("draw outline", true);
   m_SelectionMode = prefs->GetBool("selection mode", false);
 
   m_LabelSetPresetPreference = QString::fromStdString(prefs->Get("label set preset", ""));
 
   this->ApplyDisplayOptions();
   this->ApplySelectionMode();
 }
 
 void QmitkSegmentationView::NodeAdded(const mitk::DataNode* node)
 {
   if (m_SegmentationPredicate->CheckNode(node))
     this->ApplyDisplayOptions(const_cast<mitk::DataNode*>(node));
 
   this->ApplySelectionMode();
 }
 
 void QmitkSegmentationView::NodeRemoved(const mitk::DataNode* node)
 {
   if (!m_SegmentationPredicate->CheckNode(node))
   {
     return;
   }
 
   // remove all possible contour markers of the segmentation
   mitk::DataStorage::SetOfObjects::ConstPointer allContourMarkers = this->GetDataStorage()->GetDerivations(
     node, mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true)));
 
   ctkPluginContext* context = mitk::PluginActivator::getContext();
   ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
   mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
 
   for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End(); ++it)
   {
     std::string nodeName = node->GetName();
     unsigned int t = nodeName.find_last_of(" ");
     unsigned int id = atof(nodeName.substr(t + 1).c_str()) - 1;
 
     service->RemovePlanePosition(id);
 
     this->GetDataStorage()->Remove(it->Value());
   }
 
   context->ungetService(ppmRef);
   service = nullptr;
 
   mitk::Image* image = dynamic_cast<mitk::Image*>(node->GetData());
   mitk::SurfaceInterpolationController::GetInstance()->RemoveInterpolationSession(image);
 }
 
 void QmitkSegmentationView::ApplyDisplayOptions()
 {
   if (nullptr == m_Parent)
   {
     return;
   }
 
   if (nullptr == m_Controls)
   {
     return; // might happen on initialization (preferences loaded)
   }
 
   mitk::DataStorage::SetOfObjects::ConstPointer allImages = this->GetDataStorage()->GetSubset(m_SegmentationPredicate);
   for (mitk::DataStorage::SetOfObjects::const_iterator iter = allImages->begin(); iter != allImages->end(); ++iter)
   {
     this->ApplyDisplayOptions(*iter);
   }
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkSegmentationView::ApplyDisplayOptions(mitk::DataNode* node)
 {
   if (nullptr == node)
   {
     return;
   }
 
   auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(node->GetData());
   if (nullptr == labelSetImage)
   {
     return;
   }
 
   // the outline property can be set in the segmentation preference page
   node->SetProperty("labelset.contour.active", mitk::BoolProperty::New(m_DrawOutline));
 
   // force render window update to show outline
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkSegmentationView::ApplySelectionMode()
 {
   if (!m_SelectionMode)
     return;
 
   this->ApplySelectionModeOnReferenceNode();
   this->ApplySelectionModeOnWorkingNode();
 }
 
 void QmitkSegmentationView::ApplySelectionModeOnReferenceNode()
 {
   this->ApplySelectionMode(m_ReferenceNode, m_ReferencePredicate);
 }
 
 void QmitkSegmentationView::ApplySelectionModeOnWorkingNode()
 {
   this->ApplySelectionMode(m_WorkingNode, m_SegmentationPredicate);
 }
 
 void QmitkSegmentationView::ApplySelectionMode(mitk::DataNode* node, mitk::NodePredicateBase* predicate)
 {
   if (!m_SelectionMode || node == nullptr || predicate == nullptr)
     return;
 
   auto nodes = this->GetDataStorage()->GetSubset(predicate);
 
   for (auto iter = nodes->begin(); iter != nodes->end(); ++iter)
     (*iter)->SetVisibility(*iter == node);
 }
 
 void QmitkSegmentationView::OnContourMarkerSelected(const mitk::DataNode* node)
 {
   QmitkRenderWindow* selectedRenderWindow = nullptr;
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
   auto* axialRenderWindow = renderWindowPart->GetQmitkRenderWindow("axial");
   auto* sagittalRenderWindow = renderWindowPart->GetQmitkRenderWindow("sagittal");
   auto* coronalRenderWindow = renderWindowPart->GetQmitkRenderWindow("coronal");
   auto* threeDRenderWindow = renderWindowPart->GetQmitkRenderWindow("3d");
   bool PlanarFigureInitializedWindow = false;
 
   // find initialized renderwindow
   if (node->GetBoolProperty("PlanarFigureInitializedWindow",
     PlanarFigureInitializedWindow, axialRenderWindow->GetRenderer()))
   {
     selectedRenderWindow = axialRenderWindow;
   }
   if (!selectedRenderWindow && node->GetBoolProperty(
     "PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
     sagittalRenderWindow->GetRenderer()))
   {
     selectedRenderWindow = sagittalRenderWindow;
   }
   if (!selectedRenderWindow && node->GetBoolProperty(
     "PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
     coronalRenderWindow->GetRenderer()))
   {
     selectedRenderWindow = coronalRenderWindow;
   }
   if (!selectedRenderWindow && node->GetBoolProperty(
     "PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
     threeDRenderWindow->GetRenderer()))
   {
     selectedRenderWindow = threeDRenderWindow;
   }
 
   // make node visible
   if (nullptr != selectedRenderWindow)
   {
     std::string nodeName = node->GetName();
     unsigned int t = nodeName.find_last_of(" ");
     unsigned int id = atof(nodeName.substr(t + 1).c_str()) - 1;
 
     ctkPluginContext* context = mitk::PluginActivator::getContext();
     ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
     mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
     selectedRenderWindow->GetSliceNavigationController()->ExecuteOperation(service->GetPlanePosition(id));
     context->ungetService(ppmRef);
 
     selectedRenderWindow->GetRenderer()->GetCameraController()->Fit();
     mitk::RenderingManager::GetInstance()->RequestUpdateAll();
   }
 }
 
 void QmitkSegmentationView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*part*/, const QList<mitk::DataNode::Pointer>& nodes)
 {
   if (0 == nodes.size())
   {
     return;
   }
 
   std::string markerName = "Position";
   unsigned int numberOfNodes = nodes.size();
   std::string nodeName = nodes.at(0)->GetName();
   if ((numberOfNodes == 1) && (nodeName.find(markerName) == 0))
   {
     this->OnContourMarkerSelected(nodes.at(0));
     return;
   }
 }
 
 void QmitkSegmentationView::ResetMouseCursor()
 {
   if (m_MouseCursorSet)
   {
     mitk::ApplicationCursor::GetInstance()->PopCursor();
     m_MouseCursorSet = false;
   }
 }
 
 void QmitkSegmentationView::SetMouseCursor(const us::ModuleResource& resource, int hotspotX, int hotspotY)
 {
   // Remove previously set mouse cursor
   if (m_MouseCursorSet)
   {
     this->ResetMouseCursor();
   }
 
   if (resource)
   {
     us::ModuleResourceStream cursor(resource, std::ios::binary);
     mitk::ApplicationCursor::GetInstance()->PushCursor(cursor, hotspotX, hotspotY);
     m_MouseCursorSet = true;
   }
 }
 
 void QmitkSegmentationView::UpdateGUI()
 {
   mitk::DataNode* referenceNode = m_ToolManager->GetReferenceData(0);
   bool hasReferenceNode = referenceNode != nullptr;
 
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   bool hasWorkingNode = workingNode != nullptr;
 
   m_Controls->newSegmentationButton->setEnabled(false);
 
   if (hasReferenceNode)
   {
     m_Controls->newSegmentationButton->setEnabled(true);
   }
 
   if (hasWorkingNode && hasReferenceNode)
   {
     int layer = -1;
     referenceNode->GetIntProperty("layer", layer);
     workingNode->SetIntProperty("layer", layer + 1);
   }
 
   this->ValidateSelectionInput();
 }
 
 void QmitkSegmentationView::ValidateSelectionInput()
 {
   auto referenceNode = m_Controls->referenceNodeSelector->GetSelectedNode();
   auto workingNode = m_Controls->workingNodeSelector->GetSelectedNode();
 
   bool hasReferenceNode = referenceNode.IsNotNull();
   bool hasWorkingNode = workingNode.IsNotNull();
   bool hasBothNodes = hasReferenceNode && hasWorkingNode;
 
   QString warning;
   bool toolSelectionBoxesEnabled = hasReferenceNode && hasWorkingNode;
   unsigned int numberOfLabels = 0;
 
   m_Controls->multiLabelWidget->setEnabled(hasWorkingNode);
 
   m_Controls->toolSelectionBox2D->setEnabled(hasBothNodes);
   m_Controls->toolSelectionBox3D->setEnabled(hasBothNodes);
 
   m_Controls->slicesInterpolator->setEnabled(false);
   m_Controls->interpolatorWarningLabel->hide();
 
   if (hasReferenceNode)
   {
     if (nullptr != m_RenderWindowPart && m_RenderWindowPart->HasCoupledRenderWindows() && !referenceNode->IsVisible(nullptr))
     {
       warning += tr("The selected reference image is currently not visible!");
       toolSelectionBoxesEnabled = false;
     }
   }
 
   if (hasWorkingNode)
   {
     if (nullptr != m_RenderWindowPart && m_RenderWindowPart->HasCoupledRenderWindows() && !workingNode->IsVisible(nullptr))
     {
       warning += (!warning.isEmpty() ? "<br>" : "") + tr("The selected segmentation is currently not visible!");
       toolSelectionBoxesEnabled = false;
     }
 
     m_ToolManager->SetReferenceData(referenceNode);
     m_ToolManager->SetWorkingData(workingNode);
     m_Controls->multiLabelWidget->setEnabled(true);
     m_Controls->toolSelectionBox2D->setEnabled(true);
     m_Controls->toolSelectionBox3D->setEnabled(true);
 
     auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
     numberOfLabels = labelSetImage->GetTotalNumberOfLabels();
 
     if (numberOfLabels > 0)
       m_Controls->slicesInterpolator->setEnabled(true);
 
     m_Controls->multiLabelWidget->SetMultiLabelSegmentation(dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData()));
   }
   else
   {
     m_Controls->multiLabelWidget->SetMultiLabelSegmentation(nullptr);
   }
 
   toolSelectionBoxesEnabled &= numberOfLabels > 0;
 
   // Here we need to check whether the geometry of the selected segmentation image (working image geometry)
   // is aligned with the geometry of the 3D render window.
   // It is not allowed to use a geometry different from the working image geometry for segmenting.
   // We only need to this if the tool selection box would be enabled without this check.
   // Additionally this check only has to be performed for render window parts with coupled render windows.
   // For different render window parts the user is given the option to reinitialize each render window individually
   // (see QmitkRenderWindow::ShowOverlayMessage).
   if (toolSelectionBoxesEnabled && nullptr != m_RenderWindowPart && m_RenderWindowPart->HasCoupledRenderWindows())
   {
     const mitk::BaseGeometry* workingNodeGeometry = workingNode->GetData()->GetGeometry();
     const mitk::BaseGeometry* renderWindowGeometry =
       m_RenderWindowPart->GetQmitkRenderWindow("3d")->GetSliceNavigationController()->GetCurrentGeometry3D();
     if (nullptr != workingNodeGeometry && nullptr != renderWindowGeometry)
     {
       if (!mitk::Equal(*workingNodeGeometry->GetBoundingBox(), *renderWindowGeometry->GetBoundingBox(), mitk::eps, true))
       {
         warning += (!warning.isEmpty() ? "<br>" : "") + tr("Please reinitialize the selected segmentation image!");
         toolSelectionBoxesEnabled = false;
       }
     }
   }
 
   m_Controls->toolSelectionBox2D->setEnabled(toolSelectionBoxesEnabled);
   m_Controls->toolSelectionBox3D->setEnabled(toolSelectionBoxesEnabled);
 
   this->UpdateWarningLabel(warning);
 
   m_ToolManager->SetReferenceData(referenceNode);
   m_ToolManager->SetWorkingData(workingNode);
 }
 
 void QmitkSegmentationView::UpdateWarningLabel(QString text)
 {
   if (text.isEmpty())
   {
     m_Controls->selectionWarningLabel->hide();
   }
   else
   {
     m_Controls->selectionWarningLabel->setText("<font color=\"red\">" + text + "</font>");
     m_Controls->selectionWarningLabel->show();
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
index 0d71e0274c..a4f3ea2571 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
@@ -1,175 +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 QmitkSegmentationView_h
 #define QmitkSegmentationView_h
 
 #include "ui_QmitkSegmentationViewControls.h"
 
 #include <QmitkAbstractView.h>
 #include <mitkIRenderWindowPartListener.h>
 
 /**
 * @brief The segmentation view provides a set of tool to use different segmentation algorithms.
 *        It provides two selection widgets to load an image node and a segmentation node
 *        on which to perform the segmentation. Creating new segmentation nodes is also possible.
 *        The available segmentation tools are grouped into "2D"- and "3D"-tools.
 *
 *        Most segmentation tools / algorithms need some kind of user interaction, where the
 *        user is asked to draw something in the image display or set some seed points / start values.
-*        The tools also often provide additional propeties so that a user can modify the
+*        The tools also often provide additional properties so that a user can modify the
 *        algorithm's behavior.
 *
 *        This class additionally provides options to work with different layers (create new layers,
 *        switch between layers).
 *        Moreover, a multilabel widget displays all the existing labels of a multilabel segmentation
 *        for the currently active layer.
-*        The multilabel widget allows to control the labels by creatin new one, removing existing ones,
+*        The multilabel widget allows to control the labels by creating new ones, removing existing ones,
 *        showing / hiding single labels, merging labels, (re-)naming them etc.
 *
 *        Additionally the view provides an option to create "2D"- and "3D"-interpolations between
 *        neighboring segmentation masks on unsegmented slices.
 *        Interpolation for multilabel segmentations is currently not implemented.
 */
 class QmitkSegmentationView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
 {
   Q_OBJECT
 
 public:
 
   static const std::string VIEW_ID;
 
   QmitkSegmentationView();
   ~QmitkSegmentationView() override;
 
 private Q_SLOTS:
 
   // reaction to the selection of a new reference image in the selection widget
   void OnReferenceSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
 
   // reaction to the selection of a new segmentation image in the selection widget
   void OnSegmentationSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
 
   // reaction to the shortcut ("CTRL+H") for toggling the visibility of the working node
   void OnVisibilityShortcutActivated();
 
   // reaction to the shortcut ("CTRL+L") for iterating over all labels
   void OnLabelToggleShortcutActivated();
 
   // reaction to the button "New segmentation"
   void OnNewSegmentation();
 
   void OnManualTool2DSelected(int id);
 
   void OnShowMarkerNodes(bool);
 
   void OnCurrentLabelSelectionChanged(QmitkMultiLabelManager::LabelValueVectorType labels);
 
   void OnGoToLabel(mitk::LabelSetImage::LabelValueType label, const mitk::Point3D&);
   void OnLabelRenameRequested(mitk::Label* label, bool rename) const;
 
   void OnLabelAdded(mitk::LabelSetImage::LabelValueType labelValue);
   void OnLabelRemoved(mitk::LabelSetImage::LabelValueType labelValue);
   void OnGroupRemoved(mitk::LabelSetImage::GroupIndexType groupIndex);
 
 private:
 
   using Self = QmitkSegmentationView;
 
   mitk::LabelSetImage* GetWorkingImage();
   void AddObserversToWorkingImage();
   void RemoveObserversFromWorkingImage();
 
   void CreateQtPartControl(QWidget* parent) override;
 
   void SetFocus() override {}
   /**
   * @brief Enable or disable the SegmentationInteractor.
   *
   * The active tool is retrieved from the tool manager.
   * If the active tool is valid, the SegmentationInteractor is enabled
   * to listen to 'SegmentationInteractionEvent's.
   */
   void ActiveToolChanged();
 
   void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
   void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
   void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override;
 
   void OnPreferencesChanged(const mitk::IPreferences* prefs) override;
 
   void NodeAdded(const mitk::DataNode* node) override;
 
   void NodeRemoved(const mitk::DataNode* node) override;
 
   void OnAnySelectionChanged();
 
   // make sure all images / segmentations look according to the user preference settings
   void ApplyDisplayOptions();
 
   // decorates a DataNode according to the user preference settings
   void ApplyDisplayOptions(mitk::DataNode* node);
 
   void ApplySelectionMode();
   void ApplySelectionModeOnReferenceNode();
   void ApplySelectionModeOnWorkingNode();
   void ApplySelectionMode(mitk::DataNode* node, mitk::NodePredicateBase* predicate);
 
   // If a contourmarker is selected, the plane in the related widget will be reoriented according to the marker`s geometry
   void OnContourMarkerSelected(const mitk::DataNode* node);
 
   void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes) override;
 
   void ResetMouseCursor();
 
   void SetMouseCursor(const us::ModuleResource&, int hotspotX, int hotspotY);
 
   void UpdateGUI();
 
   void ValidateSelectionInput();
 
   void UpdateWarningLabel(QString text);
 
   std::string GetDefaultLabelSetPreset() const;
 
   mitk::LabelSetImage* GetCurrentSegmentation() const;
 
   QWidget* m_Parent;
 
   Ui::QmitkSegmentationViewControls* m_Controls;
 
   mitk::IRenderWindowPart* m_RenderWindowPart;
 
   mitk::ToolManager* m_ToolManager;
 
   mitk::DataNode::Pointer m_ReferenceNode;
   mitk::DataNode::Pointer m_WorkingNode;
 
   typedef std::map<mitk::DataNode*, unsigned long> NodeTagMapType;
   NodeTagMapType m_WorkingDataObserverTags;
   NodeTagMapType m_ReferenceDataObserverTags;
   unsigned int m_RenderingManagerObserverTag;
 
   mitk::NodePredicateAnd::Pointer m_ReferencePredicate;
   mitk::NodePredicateAnd::Pointer m_SegmentationPredicate;
 
   bool m_DrawOutline;
   bool m_SelectionMode;
   bool m_MouseCursorSet;
 
   QString m_LabelSetPresetPreference;
   bool m_DefaultLabelNaming;
 
   bool m_SelectionChangeIsAlreadyBeingHandled;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.cpp
index 70ab9cfbb3..8bbb2fd9f7 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.cpp
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.cpp
@@ -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.
 
 ============================================================================*/
 #include "mitkPluginActivator.h"
 
 #include "QmitkSegmentationView.h"
 #include "QmitkSegmentationPreferencePage.h"
+#include "QmitkSegmentAnythingPreferencePage.h"
 #include "QmitkSegmentationUtilitiesView.h"
 #include "QmitkSegmentationTaskListView.h"
 
 #include "QmitkAutocropAction.h"
 #include "QmitkAutocropLabelSetImageAction.h"
 #include "QmitkCreatePolygonModelAction.h"
 #include "QmitkLoadMultiLabelPresetAction.h"
 #include "QmitkSaveMultiLabelPresetAction.h"
 #include "QmitkConvertSurfaceToLabelAction.h"
 #include "QmitkConvertMaskToLabelAction.h"
 #include "QmitkConvertToMultiLabelSegmentationAction.h"
 #include "QmitkCreateMultiLabelSegmentationAction.h"
 
 #include <usModuleInitialization.h>
 
 US_INITIALIZE_MODULE
 
 using namespace mitk;
 
 ctkPluginContext* PluginActivator::m_context = nullptr;
 PluginActivator* PluginActivator::m_Instance = nullptr;
 
 PluginActivator::PluginActivator()
 {
   m_Instance = this;
 }
 
 PluginActivator::~PluginActivator()
 {
   m_Instance = nullptr;
 }
 
 void PluginActivator::start(ctkPluginContext *context)
 {
   BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentationView, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentationPreferencePage, context)
+  BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentAnythingPreferencePage, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentationUtilitiesView, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentationTaskListView, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkAutocropAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkAutocropLabelSetImageAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkCreatePolygonModelAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkLoadMultiLabelPresetAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkSaveMultiLabelPresetAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkConvertSurfaceToLabelAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkConvertMaskToLabelAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkConvertToMultiLabelSegmentationAction, context)
   BERRY_REGISTER_EXTENSION_CLASS(QmitkCreateMultiLabelSegmentationAction, context)
 
   this->m_context = context;
 }
 
 void PluginActivator::stop(ctkPluginContext *)
 {
   this->m_context = nullptr;
 }
 
 PluginActivator* PluginActivator::getDefault()
 {
   return m_Instance;
 }
 
 ctkPluginContext*PluginActivator::getContext()
 {
   return m_context;
 }
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h
index 4e41188322..9fbf842373 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.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 QmitkDataNodeAddToSemanticRelationsAction_h
 #define QmitkDataNodeAddToSemanticRelationsAction_h
 
 #include <org_mitk_gui_qt_semanticrelations_Export.h>
 
 // mitk gui qt application plugin
 #include <QmitkAbstractDataNodeAction.h>
 
 // qt
 #include <QAction>
 
 namespace AddToSemanticRelationsAction
 {
   /**
   * @brief The function checks whether the given node is an image or a segmentation and calls the corresponding add function.
   *        The corresponding add functions will add the data node to the semantic relations storage.
   *        If an image is added, the 'AddImage' function will check if another image at the fitting control-point - information type cell
   *        already exists. If so, the user is prompted to overwrite the existing image or abort the process.
   *        If the user wants to overwrite the existing image, the image and it's corresponding segmentation nodes will be removed from the semantic relations storage.
   *        If a segmentation is added, the parent image node will also be to the semantic relations storage. If the segmentation does not contain the required DICOM information,
-  *        the DICOM information of the parent data will be transfered to the segmentation data.
+  *        the DICOM information of the parent data will be transferred to the segmentation data.
   *
   * @pre    The given dataStorage has to be valid (!nullptr).
   * @pre    The given dataNode has to be valid (!nullptr).
   *         The function simply returns if the preconditions are not met.
   *
   * @throw  SemanticRelationException re-thrown.
   *
   * @param dataStorage                    The data storage to use for to remove the existing image and to check for the parent image node of a segmentation.
   * @param dataNode                       The data node to add.
   */
   MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(mitk::DataStorage* dataStorage, const mitk::DataNode* image);
 
   void AddImage(mitk::DataStorage* dataStorage, const mitk::DataNode* image);
   void AddSegmentation(mitk::DataStorage* dataStorage, const mitk::DataNode* segmentation);
 }
 
 class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeAddToSemanticRelationsAction : public QAction, public QmitkAbstractDataNodeAction
 {
   Q_OBJECT
 
 public:
 
   QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
   QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
 
 private Q_SLOTS:
 
   void OnActionTriggered(bool);
 
 protected:
 
   void InitializeAction() override;
 
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h
index 8df9d19e23..639d04c265 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.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 QmitkSemanticRelationsView_h
 #define QmitkSemanticRelationsView_h
 
 // semantic relations plugin
 #include "ui_QmitkSemanticRelationsControls.h"
 #include "QmitkLesionInfoWidget.h"
 #include "QmitkSemanticRelationsContextMenu.h"
 
 // semantic relations module
 #include <mitkSemanticTypes.h>
 
 // semantic relations UI module
 #include <QmitkPatientTableInspector.h>
 
 // mitk gui common plugin
 #include <mitkIRenderWindowPartListener.h>
 
 // berry
 #include <berryISelectionListener.h>
 
 // mitk qt gui common plugin
 #include <QmitkAbstractView.h>
 
 class QmitkDnDDataNodeWidget;
 class QMenu;
 
 /*
 * @brief The QmitkSemanticRelationsView is an MITK view to combine and show the widgets of the 'SemanticRelationsUI'-module and this semantic relations plugin.
 *
 *         It allows the MITK user to see and modify the content of the SemanticRelations-session.
 *         A combo box is used to select and show the current patient.
 */
 class QmitkSemanticRelationsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
 {
   Q_OBJECT
 
 public:
 
   static const std::string VIEW_ID;
 
   void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
   void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
   void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override;
 
 protected:
 
   void SetFocus() override;
   void CreateQtPartControl(QWidget* parent) override;
 
 private Q_SLOTS:
 
   void OnLesionSelectionChanged(const mitk::SemanticTypes::Lesion&);
   void OnDataNodeSelectionChanged(const QList<mitk::DataNode::Pointer>&);
   void OnDataNodeDoubleClicked(const mitk::DataNode*);
   void OnCaseIDSelectionChanged(const QString&);
 
   void OnNodesAdded(std::vector<mitk::DataNode*>);
   void OnNodeRemoved(const mitk::DataNode*);
 
 private:
 
   void SetUpConnections();
   /**
   * @brief Provide a QItemSelectionModel, which supports the data role 'QmitkDataNodeRole' (\see QmitkRenderWindowDataModel).
   *
   * The provided QItemSelectionModel is used in the QmitkAbstractView-base class as the selection model of
   * the selection provider (\see QmitkAbstractView::SetSelectionProvider()).
   * The default selection provider is a QmitkDataNodeSelectionProvider. Each time a selection in the provided
-  * QItemSeletionModel is changed, a selection changed event is fired. All plugins (views), that subclass the
+  * QItemSelectionModel is changed, a selection changed event is fired. All plugins (views), that subclass the
   * QmitkAbstractView will be informed about the selection changed via the OnSelectionChanged-function.
   */
   QItemSelectionModel* GetDataNodeSelectionModel() const override;
 
   void NodeRemoved(const mitk::DataNode* dataNode) override;
 
   void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID);
   void RemoveFromComboBox(const mitk::SemanticTypes::CaseID& caseID);
 
   void OpenInEditor(const mitk::DataNode* dataNode);
 
   void SetControlledRenderer();
 
   Ui::QmitkSemanticRelationsControls m_Controls;
 
   mitk::IRenderWindowPart* m_RenderWindowPart;
 
   QmitkLesionInfoWidget* m_LesionInfoWidget;
   QmitkPatientTableInspector* m_PatientTableInspector;
   QmitkDnDDataNodeWidget* m_DnDDataNodeWidget;
 
   QmitkSemanticRelationsContextMenu* m_ContextMenu;
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/plugin.xml b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/plugin.xml
index 596b89bd5c..20ad7f0e3b 100644
--- a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/plugin.xml
@@ -1,29 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
   <extension point="org.blueberry.ui.editors">
     <editor
       id="org.mitk.editors.stdmultiwidget"
       name="Standard Display"
       icon="resources/StdMultiWidgetEditor.svg"
       extensions="mitk"
 	  default="true"
       class="QmitkStdMultiWidgetEditor">
     </editor>
   </extension>
 
   <extension point="org.blueberry.ui.preferencePages">
     <page id="org.mitk.StdMultiWidgetEditorPreferencePage" name="Standard Multi Widget"
       class="QmitkStdMultiWidgetEditorPreferencePage" category="org.mitk.EditorsPreferencePage">
       <keywordreference id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords"/>
     </page>
   </extension>
 
   <extension point="org.blueberry.ui.keywords">
-    <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="zooming panning contraint"/>
+    <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="zooming panning constraint"/>
     <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="show level window widget"/>
     <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="pacs like mouse interaction select left mouse button action"/>
     <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="rendering mode fxaa anti-aliasing"/>
     <keyword id="org.mitk.StdMultiWidgetEditorPreferencePageKeywords" label="crosshair gap size background decoration color corner annotation"/>
   </extension>
 </plugin>
diff --git a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.ui b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.ui
index 646add5dc0..82950ccf70 100644
--- a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.ui
+++ b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.ui
@@ -1,195 +1,195 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkStdMultiWidgetEditorPreferencePage</class>
  <widget class="QWidget" name="QmitkStdMultiWidgetEditorPreferencePage">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>518</width>
     <height>330</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>External Programs</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="11" column="0">
     <widget class="QLabel" name="label_8">
      <property name="toolTip">
       <string>The small text on the button left of each renderwindow.</string>
      </property>
      <property name="text">
       <string>Corner annotation</string>
      </property>
     </widget>
    </item>
    <item row="2" column="0" colspan="3">
     <widget class="QCheckBox" name="m_PACSLikeMouseMode">
      <property name="layoutDirection">
       <enum>Qt::LeftToRight</enum>
      </property>
      <property name="text">
       <string>Use PACS like mouse interaction (select left mouse button action)</string>
      </property>
      <property name="tristate">
       <bool>false</bool>
      </property>
     </widget>
    </item>
    <item row="0" column="0" colspan="3">
     <widget class="QCheckBox" name="m_EnableFlexibleZooming">
      <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If activated, zooming and panning is limited to a certain space arround each image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If activated, zooming and panning is limited to a certain space around each image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="layoutDirection">
       <enum>Qt::LeftToRight</enum>
      </property>
      <property name="text">
       <string>Use constraint zooming and panning</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="8" column="0">
     <widget class="QLabel" name="label_2">
      <property name="toolTip">
       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If two colors are set, a gradient background is generated.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="text">
       <string>Background color</string>
      </property>
     </widget>
    </item>
    <item row="6" column="0">
     <widget class="QLabel" name="label_9">
      <property name="toolTip">
       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The gap in the middle of the crosshair in pixels.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="text">
       <string>Crosshair gap size</string>
      </property>
     </widget>
    </item>
    <item row="8" column="2">
     <widget class="QPushButton" name="m_ColorButton2">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
    <item row="3" column="0" colspan="3">
     <widget class="Line" name="line">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
    <item row="10" column="1">
     <widget class="QPushButton" name="m_RenderWindowDecorationColor">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
    <item row="6" column="1">
     <widget class="QSpinBox" name="m_CrosshairGapSize">
      <property name="value">
       <number>32</number>
      </property>
     </widget>
    </item>
    <item row="10" column="0">
     <widget class="QLabel" name="label_7">
      <property name="toolTip">
       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The color is used for the following decorations (of each renderwindow):&lt;/p&gt;&lt;p&gt;Rectangle border&lt;/p&gt;&lt;p&gt;Corner annotation&lt;/p&gt;&lt;p&gt;Crosshair&lt;/p&gt;&lt;p&gt;Plane geometry helper objects (3D Planes)&lt;/p&gt;&lt;p&gt;Image navigator borders&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="text">
       <string>Decoration color</string>
      </property>
     </widget>
    </item>
    <item row="12" column="0">
     <widget class="QPushButton" name="m_ResetButton">
      <property name="text">
       <string>Reset preferences</string>
      </property>
     </widget>
    </item>
    <item row="1" column="0" colspan="3">
     <widget class="QCheckBox" name="m_ShowLevelWindowWidget">
      <property name="layoutDirection">
       <enum>Qt::LeftToRight</enum>
      </property>
      <property name="text">
       <string>Show level/window widget</string>
      </property>
      <property name="checked">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item row="7" column="0">
     <widget class="QLabel" name="label_6">
      <property name="toolTip">
       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose the renderwindow from the multi widget.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
      </property>
      <property name="text">
       <string>Render windows</string>
      </property>
     </widget>
    </item>
    <item row="8" column="1">
     <widget class="QPushButton" name="m_ColorButton1">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
    <item row="11" column="1" colspan="2">
     <widget class="QLineEdit" name="m_RenderWindowDecorationText"/>
    </item>
    <item row="13" column="0">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
    <item row="7" column="1">
     <widget class="QComboBox" name="m_RenderWindowChooser">
      <item>
       <property name="text">
        <string>stdmulti.widget0</string>
       </property>
      </item>
      <item>
       <property name="text">
        <string>stdmulti.widget1</string>
       </property>
      </item>
      <item>
       <property name="text">
        <string>stdmulti.widget2</string>
       </property>
      </item>
      <item>
       <property name="text">
        <string>stdmulti.widget3</string>
       </property>
      </item>
     </widget>
    </item>
   </layout>
  </widget>
  <resources/>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.cpp b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.cpp
index 4f4f60a21f..1675dfdcc5 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.cpp
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.cpp
@@ -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.
 
 ============================================================================*/
 
 // Qmitk
 #include "QmitkToFScreenshotMaker.h"
 #include <QmitkServiceListWidget.h>
 
 // Mitk
 #include <mitkToFCameraDevice.h>
 #include <mitkIOUtil.h>
 
 // Qt
 #include <QString>
 #include <QStringList>
 #include <QMessageBox>
 
 const std::string QmitkToFScreenshotMaker::VIEW_ID = "org.mitk.views.tofscreenshotmaker";
 
 QmitkToFScreenshotMaker::QmitkToFScreenshotMaker()
   : QmitkAbstractView(),
     m_SavingCounter(0)
 {
 }
 
 QmitkToFScreenshotMaker::~QmitkToFScreenshotMaker()
 {
 }
 
 void QmitkToFScreenshotMaker::SetFocus()
 {
 }
 
 void QmitkToFScreenshotMaker::CreateQtPartControl( QWidget *parent )
 {
   // create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi( parent );
   connect( (QObject*)(m_Controls.m_MakeScreenshot), SIGNAL(clicked()), this, SLOT(OnMakeScreenshotClicked()) );
 
   connect( m_Controls.m_ConnectedDeviceServiceListWidget, SIGNAL(ServiceSelectionChanged(us::ServiceReferenceU)), this, SLOT(OnSelectCamera()));
 
   std::string filter = "";
   m_Controls.m_ConnectedDeviceServiceListWidget->Initialize<mitk::ToFImageSource>("ToFImageSourceName", filter);
 
   std::string defaultPath = "/tmp/";
 #ifdef _WIN32
   defaultPath = "C:/tmp/";
 #endif
   m_Controls.m_PathToSaveFiles->setText(defaultPath.c_str());
 }
 
 void QmitkToFScreenshotMaker::OnSelectCamera()
 {
   //Update gui according to device properties
   mitk::ToFImageGrabber* source = static_cast<mitk::ToFImageGrabber*>(m_Controls.m_ConnectedDeviceServiceListWidget->GetSelectedService<mitk::ToFImageSource>());
   mitk::ToFCameraDevice* device = source->GetCameraDevice();
   m_Controls.m_MakeScreenshot->setEnabled(device->IsCameraActive());
 
   //todo: where do i get correct file extensions?
   std::vector<std::string> fileExtensions;
   fileExtensions.push_back(".png");
   fileExtensions.push_back(".nrrd");
   fileExtensions.push_back(".jpg");
   QStringList extensions;
   for( unsigned int i = 0; i < fileExtensions.size(); ++i)
   {
     extensions.append(QString(fileExtensions.at(i).c_str()));
   }
   this->UpdateGUIElements(device, "no depth property available", m_Controls.m_SaveDepth, m_Controls.m_DepthFormat, extensions, ".nrrd");
   //usually you want to save depth data, but there is no "HasDepthImage" property, because every depth
-  //camera should provide a depth iamge
+  //camera should provide a depth image
   m_Controls.m_SaveDepth->setChecked(true);
   m_Controls.m_SaveDepth->setEnabled(true);
   m_Controls.m_DepthFormat->setEnabled(true);
 
   this->UpdateGUIElements(device, "HasAmplitudeImage", m_Controls.m_SaveAmplitude ,
                           m_Controls.m_AmplitudeFormat, extensions, ".nrrd");
   this->UpdateGUIElements(device, "HasIntensityImage", m_Controls.m_SaveIntensity,
                           m_Controls.m_IntensityFormat, extensions, ".nrrd");
   this->UpdateGUIElements(device, "HasRGBImage", m_Controls.m_SaveColor,
                           m_Controls.m_ColorFormat, extensions, ".png"); //png is nice default for calibration
   this->UpdateGUIElements(device, "HasRawImage", m_Controls.m_SaveRaw,
                           m_Controls.m_RawFormat, extensions, ".nrrd");
 }
 
 void QmitkToFScreenshotMaker::UpdateGUIElements(mitk::ToFCameraDevice* device, const char* ToFImageType,
                                                 QCheckBox* saveCheckBox, QComboBox* saveTypeComboBox,
                                                 QStringList fileExentions, const char* preferredFormat)
 {
   bool isTypeProvidedByDevice = false;
   device->GetBoolProperty(ToFImageType, isTypeProvidedByDevice);
   saveCheckBox->setChecked(isTypeProvidedByDevice);
   saveCheckBox->setEnabled(isTypeProvidedByDevice);
 
   saveTypeComboBox->clear();
   saveTypeComboBox->setEnabled(isTypeProvidedByDevice);
   saveTypeComboBox->addItems(fileExentions);
   int index = saveTypeComboBox->findText(preferredFormat);
   if ( index != -1 ) { // -1 for not found
      saveTypeComboBox->setCurrentIndex(index);
   }
 }
 
 void QmitkToFScreenshotMaker::OnMakeScreenshotClicked()
 {
   mitk::ToFImageGrabber* source = static_cast<mitk::ToFImageGrabber*>(m_Controls.m_ConnectedDeviceServiceListWidget->GetSelectedService<mitk::ToFImageSource>());
   source->Update();
 
   //### Save Images
   this->SaveImage(source->GetOutput(0), m_Controls.m_SaveDepth->isChecked(),
                   m_Controls.m_PathToSaveFiles->text().toStdString(), std::string("Depth_"),
                   m_Controls.m_DepthFormat->currentText().toStdString());
   this->SaveImage(source->GetOutput(1), m_Controls.m_SaveAmplitude->isChecked(),
                   m_Controls.m_PathToSaveFiles->text().toStdString(), std::string("Amplitude_"),
                   m_Controls.m_AmplitudeFormat->currentText().toStdString());
   this->SaveImage(source->GetOutput(2), m_Controls.m_SaveIntensity->isChecked(),
                   m_Controls.m_PathToSaveFiles->text().toStdString(), std::string("Intensity_"),
                   m_Controls.m_IntensityFormat->currentText().toStdString());
   this->SaveImage(source->GetOutput(3), m_Controls.m_SaveColor->isChecked(),
                   m_Controls.m_PathToSaveFiles->text().toStdString(), std::string("Color_"),
                   m_Controls.m_ColorFormat->currentText().toStdString());
   //todo, where is the raw data?
 
   //todo what about the surface or pre-processed data?
   m_SavingCounter++;
 }
 
 void QmitkToFScreenshotMaker::SaveImage(mitk::Image::Pointer image, bool saveImage, std::string path, std::string name, std::string extension)
 {
   if(saveImage)
   {
     std::stringstream outdepthimage;
     outdepthimage << path << name<< m_SavingCounter << extension;
     mitk::IOUtil::Save( image, outdepthimage.str() );
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.cpp b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.cpp
index 6395f6f164..f5148f105a 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.cpp
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.cpp
@@ -1,536 +1,536 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 <mitkIRenderWindowPart.h>
 #include <mitkILinkedRenderWindowPart.h>
 
 // Qmitk
 #include "QmitkToFUtilView.h"
 
 // Qt
 #include <QMessageBox>
 #include <QString>
 #include <qmessagebox.h>
 #include <qfiledialog.h>
 #include <qcombobox.h>
 
 // MITK
 #include <mitkBaseRenderer.h>
 #include <mitkToFDistanceImageToPointSetFilter.h>
 #include <mitkTransferFunction.h>
 #include <mitkTransferFunctionProperty.h>
 #include <mitkToFDeviceFactoryManager.h>
 #include <mitkToFCameraDevice.h>
 #include <mitkCameraIntrinsicsProperty.h>
 #include <mitkSmartPointerProperty.h>
 #include <mitkRenderingModeProperty.h>
 #include <mitkVtkScalarModeProperty.h>
 
 // VTK
 #include <vtkCamera.h>
 #include <vtkPointData.h>
 #include <vtkPolyData.h>
 
 // ITK
 #include <itkCommand.h>
 #include <itksys/SystemTools.hxx>
 
 const std::string QmitkToFUtilView::VIEW_ID = "org.mitk.views.tofutil";
 
 //Constructor
 QmitkToFUtilView::QmitkToFUtilView()
   : QmitkAbstractView()
   , m_Controls(nullptr)
   , m_Framerateoutput(false)
   , m_MitkDistanceImage(nullptr), m_MitkAmplitudeImage(nullptr), m_MitkIntensityImage(nullptr), m_Surface(nullptr)
   , m_DistanceImageNode(nullptr), m_AmplitudeImageNode(nullptr), m_IntensityImageNode(nullptr), m_RGBImageNode(nullptr), m_SurfaceNode(nullptr)
   , m_ToFImageRecorder(nullptr), m_ToFImageGrabber(nullptr), m_ToFDistanceImageToSurfaceFilter(nullptr), m_ToFCompositeFilter(nullptr)
   , m_2DDisplayCount(0)
   , m_RealTimeClock(nullptr)
   , m_StepsForFramerate(100)
   , m_2DTimeBefore(0.0)
   , m_2DTimeAfter(0.0)
   , m_CameraIntrinsics(nullptr)
 {
   this->m_Frametimer = new QTimer(this);
 
   this->m_ToFDistanceImageToSurfaceFilter = mitk::ToFDistanceImageToSurfaceFilter::New();
   this->m_ToFCompositeFilter = mitk::ToFCompositeFilter::New();
   this->m_ToFImageRecorder = mitk::ToFImageRecorder::New();
 }
 
 //Destructor, specifically calling OnToFCameraStopped() and OnToFCammeraDiconnected()
 QmitkToFUtilView::~QmitkToFUtilView()
 {
   OnToFCameraStopped();
   OnToFCameraDisconnected();
 }
 
-//Createing the PartControl Signal-Slot principal
+//Creating the PartControl Signal-Slot principal
 void QmitkToFUtilView::CreateQtPartControl( QWidget *parent )
 {
   // build up qt view, unless already done
   if ( !m_Controls )
   {
     // create GUI widgets from the Qt Designer's .ui file
     m_Controls = new Ui::QmitkToFUtilViewControls;
     m_Controls->setupUi( parent );
 
     //Looking for Input and Defining reaction
     connect(m_Frametimer, SIGNAL(timeout()), this, SLOT(OnUpdateCamera()));
 
     connect( (QObject*)(m_Controls->m_ToFConnectionWidget), SIGNAL(KinectAcquisitionModeChanged()), this, SLOT(OnKinectAcquisitionModeChanged()) ); // Todo in Widget2
     connect( (QObject*)(m_Controls->m_ToFConnectionWidget), SIGNAL(ToFCameraConnected()), this, SLOT(OnToFCameraConnected()) );
     connect( (QObject*)(m_Controls->m_ToFConnectionWidget), SIGNAL(ToFCameraDisconnected()), this, SLOT(OnToFCameraDisconnected()) );
     connect( (QObject*)(m_Controls->m_ToFRecorderWidget), SIGNAL(ToFCameraStarted()), this, SLOT(OnToFCameraStarted()) );
     connect( (QObject*)(m_Controls->m_ToFRecorderWidget), SIGNAL(ToFCameraStopped()), this, SLOT(OnToFCameraStopped()) );
     connect( (QObject*)(m_Controls->m_ToFRecorderWidget), SIGNAL(RecordingStarted()), this, SLOT(OnToFCameraStopped()) );
     connect( (QObject*)(m_Controls->m_ToFRecorderWidget), SIGNAL(RecordingStopped()), this, SLOT(OnToFCameraStarted()) );
 }
 }
 
-//SetFocus-Method -> actually seting Focus to the Recorder
+//SetFocus-Method -> actually setting Focus to the Recorder
 void QmitkToFUtilView::SetFocus()
 {
   m_Controls->m_ToFRecorderWidget->setFocus();
 }
 
 //Activated-Method->Generating RenderWindow
 void QmitkToFUtilView::Activated()
 {
   //get the current RenderWindowPart or open a new one if there is none
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
   if (nullptr != renderWindowPart)
   {
     auto* linkedRenderWindowPart = dynamic_cast<mitk::ILinkedRenderWindowPart*>(renderWindowPart);
     if (linkedRenderWindowPart == nullptr)
     {
-      MITK_ERROR << "No linked render window part avaiable!!!";
+      MITK_ERROR << "No linked render window part available!!!";
     }
     else
     {
       linkedRenderWindowPart->EnableSlicingPlanes(false);
     }
     renderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Axial);
     renderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SliceLockedOn();
     renderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Axial);
     renderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController()->SliceLockedOn();
     renderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Axial);
     renderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController()->SliceLockedOn();
 
     mitk::RenderingManager::GetInstance()->InitializeViews();
 
     this->UseToFVisibilitySettings(true);
 
     if (this->m_ToFCompositeFilter)
     {
       m_Controls->m_ToFCompositeFilterWidget->SetToFCompositeFilter(this->m_ToFCompositeFilter);
     }
     if (this->GetDataStorage())
     {
       m_Controls->m_ToFCompositeFilterWidget->SetDataStorage(this->GetDataStorage());
     }
 
     if (this->m_ToFImageGrabber.IsNull())
     {
       m_Controls->m_ToFRecorderWidget->setEnabled(false);
       m_Controls->m_ToFVisualisationSettingsWidget->setEnabled(false);
       m_Controls->m_ToFCompositeFilterWidget->setEnabled(false);
       m_Controls->m_ToFMeasurementWidget->setEnabled(false);
       m_Controls->m_ToFSurfaceGenerationWidget->setEnabled(false);
     }
   }
 }
 
 //ZomnnieView-Method -> Resetting GUI to default. Why not just QmitkToFUtilView()?!
 void QmitkToFUtilView::ActivatedZombieView(berry::IWorkbenchPartReference::Pointer /*zombieView*/)
 {
   ResetGUIToDefault();
 }
 
 void QmitkToFUtilView::Deactivated()
 {
 }
 
 void QmitkToFUtilView::Visible()
 {
 }
 
 //Reset of the ToFUtilView
 void QmitkToFUtilView::Hidden()
 {
   ResetGUIToDefault();
 }
 
 void QmitkToFUtilView::OnToFCameraConnected()
 {
   MITK_DEBUG <<"OnToFCameraConnected";
   this->m_2DDisplayCount = 0;
 
   this->m_ToFImageGrabber = m_Controls->m_ToFConnectionWidget->GetToFImageGrabber();
 
   // initialize surface generation
   this->m_ToFDistanceImageToSurfaceFilter = mitk::ToFDistanceImageToSurfaceFilter::New();
 
   // initialize ToFImageRecorder and ToFRecorderWidget
   this->m_ToFImageRecorder = mitk::ToFImageRecorder::New();
   this->m_ToFImageRecorder->SetCameraDevice(this->m_ToFImageGrabber->GetCameraDevice());
   m_Controls->m_ToFRecorderWidget->SetParameter(this->m_ToFImageGrabber, this->m_ToFImageRecorder);
   m_Controls->m_ToFRecorderWidget->setEnabled(true);
   m_Controls->m_ToFRecorderWidget->ResetGUIToInitial();
   m_Controls->m_ToFVisualisationSettingsWidget->setEnabled(false);
 
   // initialize ToFCompositeFilterWidget
   this->m_ToFCompositeFilter = mitk::ToFCompositeFilter::New();
   if (this->m_ToFCompositeFilter)
   {
     m_Controls->m_ToFCompositeFilterWidget->SetToFCompositeFilter(this->m_ToFCompositeFilter);
   }
   if (this->GetDataStorage())
   {
     m_Controls->m_ToFCompositeFilterWidget->SetDataStorage(this->GetDataStorage());
   }
 
   if ( this->GetRenderWindowPart() )
     // initialize measurement widget
     m_Controls->m_ToFMeasurementWidget->InitializeWidget(this->GetRenderWindowPart()->GetQmitkRenderWindows(),this->GetDataStorage(), this->m_ToFDistanceImageToSurfaceFilter->GetCameraIntrinsics());
   else
     MITK_WARN << "No render window part available!!! MeasurementWidget will not work.";
 
   this->m_RealTimeClock = mitk::RealTimeClock::New();
   this->m_2DTimeBefore = this->m_RealTimeClock->GetCurrentStamp();
 
   this->RequestRenderWindowUpdate();
 }
 
 void QmitkToFUtilView::ResetGUIToDefault()
 {
   auto* renderWindowPart = this->GetRenderWindowPart();
   if(nullptr != renderWindowPart)
   {
     auto* linkedRenderWindowPart = dynamic_cast<mitk::ILinkedRenderWindowPart*>(renderWindowPart);
     if(linkedRenderWindowPart == nullptr)
     {
-      MITK_ERROR << "No linked render window part avaiable!!!";
+      MITK_ERROR << "No linked render window part available!!!";
     }
     else
     {
       linkedRenderWindowPart->EnableSlicingPlanes(true);
     }
     renderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Axial);
     renderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SliceLockedOff();
     renderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Sagittal);
     renderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController()->SliceLockedOff();
     renderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Coronal);
     renderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController()->SliceLockedOff();
 
     this->UseToFVisibilitySettings(false);
 
     //global reinit
     mitk::RenderingManager::GetInstance()->InitializeViews();
     this->RequestRenderWindowUpdate();
   }
 }
 
 void QmitkToFUtilView::OnToFCameraDisconnected()
 {
   this->GetDataStorage()->Remove(m_DistanceImageNode);
   if(m_RGBImageNode)
     this->GetDataStorage()->Remove(m_RGBImageNode);
   if(m_AmplitudeImageNode)
     this->GetDataStorage()->Remove(m_AmplitudeImageNode);
   if(m_IntensityImageNode)
     this->GetDataStorage()->Remove(m_IntensityImageNode);
   if(m_SurfaceNode)
     this->GetDataStorage()->Remove(m_SurfaceNode);
 
   m_Controls->m_ToFRecorderWidget->OnStop();
   m_Controls->m_ToFRecorderWidget->setEnabled(false);
   m_Controls->m_ToFVisualisationSettingsWidget->setEnabled(false);
   m_Controls->m_ToFMeasurementWidget->setEnabled(false);
   m_Controls->m_ToFSurfaceGenerationWidget->setEnabled(false);
   //clean up measurement widget
   m_Controls->m_ToFMeasurementWidget->CleanUpWidget();
 }
 
 void QmitkToFUtilView::OnKinectAcquisitionModeChanged()
 {
   if (m_ToFCompositeFilter.IsNotNull()&&m_ToFImageGrabber.IsNotNull())
   {
     if (m_SelectedCamera.contains("Kinect"))
     {
       if (m_ToFImageGrabber->GetBoolProperty("RGB"))
       {
         this->m_RGBImageNode = ReplaceNodeData("RGB image",this->m_ToFImageGrabber->GetOutput(3));
         this->m_ToFDistanceImageToSurfaceFilter->SetInput(3,this->m_ToFImageGrabber->GetOutput(3));
       }
       else if (m_ToFImageGrabber->GetBoolProperty("IR"))
       {
         this->m_MitkAmplitudeImage = m_ToFCompositeFilter->GetOutput(1);
         this->m_AmplitudeImageNode = ReplaceNodeData("Amplitude image",m_MitkAmplitudeImage);
       }
     }
     this->UseToFVisibilitySettings(true);
   }
 }
 
 void QmitkToFUtilView::OnToFCameraStarted()
 {
   if (m_ToFImageGrabber.IsNotNull())
   {
     // initialize camera intrinsics
     if (this->m_ToFImageGrabber->GetProperty("CameraIntrinsics"))
     {
       m_CameraIntrinsics = dynamic_cast<mitk::CameraIntrinsicsProperty*>(this->m_ToFImageGrabber->GetProperty("CameraIntrinsics"))->GetValue();
       MITK_INFO << m_CameraIntrinsics->ToString();
     }
     else
     {
       m_CameraIntrinsics = nullptr;
       MITK_ERROR << "No camera intrinsics were found!";
     }
 
     // set camera intrinsics
     if ( m_CameraIntrinsics.IsNotNull() )
     {
       this->m_ToFDistanceImageToSurfaceFilter->SetCameraIntrinsics(m_CameraIntrinsics);
     }
 
     // initial update of image grabber
     this->m_ToFImageGrabber->Update();
 
     bool hasRGBImage = false;
     m_ToFImageGrabber->GetCameraDevice()->GetBoolProperty("HasRGBImage",hasRGBImage);
 
     bool hasIntensityImage = false;
     m_ToFImageGrabber->GetCameraDevice()->GetBoolProperty("HasIntensityImage",hasIntensityImage);
 
     bool hasAmplitudeImage = false;
     m_ToFImageGrabber->GetCameraDevice()->GetBoolProperty("HasAmplitudeImage",hasAmplitudeImage);
 
     this->m_ToFCompositeFilter->SetInput(0,this->m_ToFImageGrabber->GetOutput(0));
     if(hasAmplitudeImage)
       this->m_ToFCompositeFilter->SetInput(1,this->m_ToFImageGrabber->GetOutput(1));
     if(hasIntensityImage)
       this->m_ToFCompositeFilter->SetInput(2,this->m_ToFImageGrabber->GetOutput(2));
 
     // initial update of composite filter
     this->m_ToFCompositeFilter->Update();
     this->m_MitkDistanceImage = m_ToFCompositeFilter->GetOutput();
     this->m_DistanceImageNode = ReplaceNodeData("Distance image",m_MitkDistanceImage);
 
     std::string rgbFileName;
     m_ToFImageGrabber->GetCameraDevice()->GetStringProperty("RGBImageFileName",rgbFileName);
 
     if(hasRGBImage || (rgbFileName!=""))
     {
       if(m_ToFImageGrabber->GetBoolProperty("IR"))
       {
         this->m_MitkAmplitudeImage = m_ToFCompositeFilter->GetOutput(1);
       }
       else
       {
         this->m_RGBImageNode = ReplaceNodeData("RGB image",this->m_ToFImageGrabber->GetOutput(3));
       }
     }
     else
     {
       this->m_RGBImageNode = nullptr;
     }
 
     if(hasAmplitudeImage)
     {
       this->m_MitkAmplitudeImage = m_ToFCompositeFilter->GetOutput(1);
       this->m_AmplitudeImageNode = ReplaceNodeData("Amplitude image",m_MitkAmplitudeImage);
     }
 
     if(hasIntensityImage)
     {
       this->m_MitkIntensityImage = m_ToFCompositeFilter->GetOutput(2);
       this->m_IntensityImageNode = ReplaceNodeData("Intensity image",m_MitkIntensityImage);
     }
 
     this->m_ToFDistanceImageToSurfaceFilter->SetInput(0,m_MitkDistanceImage);
     this->m_ToFDistanceImageToSurfaceFilter->SetInput(1,m_MitkAmplitudeImage);
     this->m_ToFDistanceImageToSurfaceFilter->SetInput(2,m_MitkIntensityImage);
 
     this->UseToFVisibilitySettings(true);
 
     this->m_SurfaceNode = ReplaceNodeData("Surface", nullptr);
     m_Controls->m_ToFCompositeFilterWidget->UpdateFilterParameter();
     // initialize visualization widget
     m_Controls->m_ToFVisualisationSettingsWidget->Initialize(this->m_DistanceImageNode,
                                                              this->m_AmplitudeImageNode,
                                                              this->m_IntensityImageNode,
                                                              this->m_SurfaceNode);
     m_Controls->m_ToFSurfaceGenerationWidget->Initialize(m_ToFDistanceImageToSurfaceFilter,
                                                          m_ToFImageGrabber,
                                                          m_CameraIntrinsics,
                                                          m_SurfaceNode,
                                                          GetRenderWindowPart(mitk::WorkbenchUtil::OPEN)->GetQmitkRenderWindow("3d")->GetRenderer()->GetVtkRenderer()->GetActiveCamera());
     // set distance image to measurement widget
     m_Controls->m_ToFMeasurementWidget->SetDistanceImage(m_MitkDistanceImage);
 
     this->m_Frametimer->start(50);
 
     m_Controls->m_ToFVisualisationSettingsWidget->setEnabled(true);
     m_Controls->m_ToFCompositeFilterWidget->setEnabled(true);
     m_Controls->m_ToFMeasurementWidget->setEnabled(true);
     m_Controls->m_ToFSurfaceGenerationWidget->setEnabled(true);
   }
 }
 
 void QmitkToFUtilView::OnToFCameraStopped()
 {
   m_Controls->m_ToFVisualisationSettingsWidget->setEnabled(false);
   m_Controls->m_ToFCompositeFilterWidget->setEnabled(false);
 
   this->m_Frametimer->stop();
 }
 
 void QmitkToFUtilView::OnUpdateCamera()
 {
   if(!m_Controls->m_ToFSurfaceGenerationWidget->UpdateSurface())
   {
     // update pipeline
     this->m_MitkDistanceImage->Update();
   }
 
   this->RequestRenderWindowUpdate();
 
   if (m_Framerateoutput)
   {
     this->m_2DDisplayCount++;
     if ((this->m_2DDisplayCount % this->m_StepsForFramerate) == 0)
     {
       this->m_2DTimeAfter = this->m_RealTimeClock->GetCurrentStamp() - this->m_2DTimeBefore;
       MITK_INFO << " 2D-Display-framerate (fps): " << this->m_StepsForFramerate / (this->m_2DTimeAfter / 1000);
       this->m_2DTimeBefore = this->m_RealTimeClock->GetCurrentStamp();
     }
   }
 
 }
 
 void QmitkToFUtilView::OnChangeCoronalWindowOutput(int index)
 {
   this->OnToFCameraStopped();
   if(index == 0)
   {
     if(this->m_IntensityImageNode.IsNotNull())
       this->m_IntensityImageNode->SetVisibility(false);
     if(this->m_RGBImageNode.IsNotNull())
       this->m_RGBImageNode->SetVisibility(true);
   }
   else if(index == 1)
   {
     if(this->m_IntensityImageNode.IsNotNull())
       this->m_IntensityImageNode->SetVisibility(true);
     if(this->m_RGBImageNode.IsNotNull())
       this->m_RGBImageNode->SetVisibility(false);
   }
   this->RequestRenderWindowUpdate();
   this->OnToFCameraStarted();
 }
 
 mitk::DataNode::Pointer QmitkToFUtilView::ReplaceNodeData( std::string nodeName, mitk::BaseData* data )
 {
   mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode(nodeName);
   if (node.IsNull())
   {
     node = mitk::DataNode::New();
     node->SetName(nodeName);
     node->SetBoolProperty("binary",false);
     node->SetData(data);
     this->GetDataStorage()->Add(node);
   }
   else
   {
     node->SetData(data);
   }
   return node;
 }
 
 void QmitkToFUtilView::UseToFVisibilitySettings(bool useToF)
 {
   //We need this property for every node.
   auto renderingModePropertyForTransferFunction = mitk::RenderingModeProperty::New(mitk::RenderingModeProperty::COLORTRANSFERFUNCTION_COLOR);
 
   auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
 
   auto* axialRenderer = mitk::BaseRenderer::GetInstance(renderWindowPart->GetQmitkRenderWindow("axial")->renderWindow());
   auto* sagittalRenderer = mitk::BaseRenderer::GetInstance(renderWindowPart->GetQmitkRenderWindow("sagittal")->renderWindow());
   auto* coronalRenderer = mitk::BaseRenderer::GetInstance(renderWindowPart->GetQmitkRenderWindow("coronal")->renderWindow());
   auto* threeDimRenderer = mitk::BaseRenderer::GetInstance(renderWindowPart->GetQmitkRenderWindow("3d")->renderWindow());
 
   // set node properties
   if (m_DistanceImageNode.IsNotNull())
   {
     this->m_DistanceImageNode->SetProperty( "visible" , mitk::BoolProperty::New( true ));
     this->m_DistanceImageNode->SetVisibility( !useToF, sagittalRenderer );
     this->m_DistanceImageNode->SetVisibility( !useToF, coronalRenderer );
     this->m_DistanceImageNode->SetVisibility( !useToF, threeDimRenderer );
     this->m_DistanceImageNode->SetProperty("Image Rendering.Mode", renderingModePropertyForTransferFunction);
   }
   if (m_AmplitudeImageNode.IsNotNull())
   {
     this->m_AmplitudeImageNode->SetVisibility( !useToF, axialRenderer );
     this->m_AmplitudeImageNode->SetVisibility( !useToF, coronalRenderer );
     this->m_AmplitudeImageNode->SetVisibility( !useToF, threeDimRenderer );
     this->m_AmplitudeImageNode->SetProperty("Image Rendering.Mode", renderingModePropertyForTransferFunction);
   }
   if (m_IntensityImageNode.IsNotNull())
   {
       this->m_IntensityImageNode->SetProperty( "visible" , mitk::BoolProperty::New( true ));
       this->m_IntensityImageNode->SetVisibility( !useToF, axialRenderer );
       this->m_IntensityImageNode->SetVisibility( !useToF, sagittalRenderer );
       this->m_IntensityImageNode->SetVisibility( !useToF, threeDimRenderer );
       this->m_IntensityImageNode->SetProperty("Image Rendering.Mode", renderingModePropertyForTransferFunction);
   }
   if ((m_RGBImageNode.IsNotNull()))
   {
       this->m_RGBImageNode->SetProperty( "visible" , mitk::BoolProperty::New( true ));
       this->m_RGBImageNode->SetVisibility( !useToF, axialRenderer );
       this->m_RGBImageNode->SetVisibility( !useToF, sagittalRenderer );
       this->m_RGBImageNode->SetVisibility( !useToF, threeDimRenderer );
   }
   // initialize images
   if (m_MitkDistanceImage.IsNotNull())
   {
     mitk::RenderingManager::GetInstance()->InitializeViews(
       this->m_MitkDistanceImage->GetTimeGeometry(), mitk::RenderingManager::REQUEST_UPDATE_2DWINDOWS);
   }
   if(this->m_SurfaceNode.IsNotNull())
   {
     QHash<QString, QmitkRenderWindow*> renderWindowHashMap = renderWindowPart->GetQmitkRenderWindows();
     QHashIterator<QString, QmitkRenderWindow*> i(renderWindowHashMap);
     while (i.hasNext()){
       i.next();
       this->m_SurfaceNode->SetVisibility( false, mitk::BaseRenderer::GetInstance(i.value()->renderWindow()) );
     }
     this->m_SurfaceNode->SetVisibility( true, mitk::BaseRenderer::GetInstance(renderWindowPart->GetQmitkRenderWindow("3d")->renderWindow() ) );
   }
   //disable/enable gradient background
   renderWindowPart->EnableDecorations(!useToF, QStringList(QString("background")));
 
   if((this->m_RGBImageNode.IsNotNull()))
   {
     bool RGBImageHasDifferentResolution = false;
     m_ToFImageGrabber->GetCameraDevice()->GetBoolProperty("RGBImageHasDifferentResolution",RGBImageHasDifferentResolution);
     if(RGBImageHasDifferentResolution)
     {
       //update the display geometry by using the RBG image node. Only for renderwindow coronal
       mitk::RenderingManager::GetInstance()->InitializeView(renderWindowPart->GetQmitkRenderWindow("coronal")->renderWindow(),
         this->m_RGBImageNode->GetData()->GetGeometry());
     }
   }
 }
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.cpp b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.cpp
index c8271b953b..9e3665c522 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.cpp
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "QmitkTubeGraphDeleteLabelGroupDialog.h"
 
 #include <QAbstractItemView>
 #include <QPushButton>
 #include <QLayout>
 #include <QLabel>
 #include <QListWidget>
 
 
 
 QmitkTubeGraphDeleteLabelGroupDialog::QmitkTubeGraphDeleteLabelGroupDialog(QWidget* parent)
 :QDialog(parent)
 {
 
   QDialog::setFixedSize(400, 400);
 
   auto   layout = new QVBoxLayout(this);
   layout->setMargin(5);
   layout->setSpacing(5);
 
   descriptionLabel = new QLabel("Which Label Group should be removed?", this);
   layout->addWidget(descriptionLabel);
 
   labelGroupListWidget = new QListWidget(this);
   labelGroupListWidget->setSelectionMode(QAbstractItemView::MultiSelection);
   layout->addWidget(labelGroupListWidget);
 
   auto   buttonLayout = new QHBoxLayout();
 
   deleteButton = new QPushButton("Delete", this);
   buttonLayout->addWidget(deleteButton);
   connect( deleteButton, SIGNAL(clicked()), this, SLOT(OnDeleteLabelGroupClicked()) );
 
-  cancleButton = new QPushButton("Cancle", this);
+  cancleButton = new QPushButton("Cancel", this);
   buttonLayout->addWidget(cancleButton);
   connect( cancleButton, SIGNAL(clicked()), this, SLOT(reject()) );
 
   layout->addLayout(buttonLayout);
 
   deleteButton->setFocus();
 
 }
 
 QmitkTubeGraphDeleteLabelGroupDialog::~QmitkTubeGraphDeleteLabelGroupDialog()
 {
     delete descriptionLabel;
     delete labelGroupListWidget;
     delete deleteButton;
     delete cancleButton;
 }
 
 void QmitkTubeGraphDeleteLabelGroupDialog::OnDeleteLabelGroupClicked()
 {
   //get selected items and save it in vector
   m_LabelGroupList.clear();
   for (int i =0; i < labelGroupListWidget->count(); i++)
   {
     QListWidgetItem* newItem= labelGroupListWidget->item(i);
     if(newItem->isSelected()) //For all checked items
     {
       m_LabelGroupList.push_back(newItem->text());
     }
   }
 
   this->accept();
 }
 
 QStringList QmitkTubeGraphDeleteLabelGroupDialog::GetSelectedLabelGroups()
 {
   return m_LabelGroupList;
 }
 
 void QmitkTubeGraphDeleteLabelGroupDialog::SetLabelGroups(const QStringList &labelGroups)
 {
   for (const auto &labelGroup : labelGroups)
     labelGroupListWidget->addItem(labelGroup);
 }
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.cpp b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.cpp
index 8f27f53700..42242f42f1 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.cpp
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "QmitkTubeGraphNewAnnotationDialog.h"
 
 #include <qpushbutton.h>
 #include <qlayout.h>
 #include <qlineedit.h>
 #include <qlabel.h>
 #include <qlistwidget.h>
 
 
 QmitkTubeGraphNewAnnotationDialog::QmitkTubeGraphNewAnnotationDialog(QWidget* parent)
 :QDialog(parent)
 {
   QDialog::setFixedSize(200, 200);
 
   layout = new QVBoxLayout(this);
   layout->setMargin(5);
   layout->setSpacing(5);
 
   annotationNameLabel = new QLabel("Enter the name of the annotation!", this);
   layout->addWidget(annotationNameLabel);
 
   annotationNameLineEdit = new QLineEdit(this);
   layout->addWidget(annotationNameLineEdit);
 
   annotationDescriptionLabel = new QLabel("Enter a description!", this);
   layout->addWidget(annotationDescriptionLabel);
 
   annotationDescriptionLineEdit = new QLineEdit(this);
   layout->addWidget(annotationDescriptionLineEdit);
 
   buttonLayout = new QHBoxLayout();
 
   okButton = new QPushButton("Ok", this);
   buttonLayout->addWidget(okButton, 0, Qt::AlignRight);
   connect( okButton, SIGNAL(clicked()), this, SLOT(OnAddingAnnotation()) );
 
-  cancleButton = new QPushButton("Cancle", this);
+  cancleButton = new QPushButton("Cancel", this);
   buttonLayout->addWidget(cancleButton,  0, Qt::AlignRight);
   connect( cancleButton, SIGNAL(clicked()), this, SLOT(reject()) );
 
   layout->addLayout(buttonLayout);
 
   annotationNameLineEdit->setFocus();
 }
 
 void QmitkTubeGraphNewAnnotationDialog::OnAddingAnnotation()
 {
   if (annotationNameLineEdit->text().isEmpty())
   {
     annotationNameLineEdit->setStyleSheet("border: 1px solid red");
     return;
   }
 
   m_NewAnnotationName = annotationNameLineEdit->text();
   m_NewAnnotationDescription = annotationDescriptionLineEdit->text();
 
   this->accept();
 }
 
 QmitkTubeGraphNewAnnotationDialog::~QmitkTubeGraphNewAnnotationDialog()
 {
   delete layout;
 
   delete okButton;
   delete cancleButton;
    // delete buttonLayout;
 
   delete annotationNameLabel;
   delete annotationNameLineEdit;
 
   delete annotationDescriptionLabel;
   delete annotationDescriptionLineEdit;
 }
 
 QString QmitkTubeGraphNewAnnotationDialog::GetAnnotationName()
 {
   return m_NewAnnotationName;
 }
 
 QString QmitkTubeGraphNewAnnotationDialog::GetAnnotationDescription()
 {
   return m_NewAnnotationDescription;
 }
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.cpp b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.cpp
index 16a9ccc49b..d3559fc168 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.cpp
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.cpp
@@ -1,270 +1,270 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkTubeGraphNewLabelGroupDialog.h"
 
 #include <qpushbutton.h>
 #include <qlayout.h>
 #include <qlineedit.h>
 #include <qlabel.h>
 #include <qlistwidget.h>
 #include <qtreewidget.h>
 #include <qheaderview.h>
 
 #include "mitkTubeGraphDefaultLabelGroups.h"
 
 
 QmitkTubeGraphNewLabelGroupDialog::QmitkTubeGraphNewLabelGroupDialog(QWidget* parent)
 :QDialog(parent)
 ,m_NewLabelGroup()
 {
   QDialog::setFixedSize(200, 200);
 
   layout = new QVBoxLayout(this);
   layout->setMargin(5);
   layout->setSpacing(5);
 
   newLabelGroupButton = new QPushButton("Create new label group", this);
   layout->addWidget(newLabelGroupButton,  0, Qt::AlignHCenter);
   connect( newLabelGroupButton, SIGNAL(clicked()), this, SLOT(OnCreateNewLabelGroup()) );
 
   standardLabelGroupButton = new QPushButton("Add standard label group", this);
   layout->addWidget(standardLabelGroupButton, 0, Qt::AlignHCenter);
   connect( standardLabelGroupButton, SIGNAL(clicked()), this, SLOT(OnAddStandardLabelGroup()) );
 
   spacer = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Minimum );
   layout->addSpacerItem(spacer);
 
   buttonLayout = new QHBoxLayout();
 
   okButton = new QPushButton("Ok", this);
   buttonLayout->addWidget(okButton, 0, Qt::AlignRight);
   okButton->setVisible(false);
 
-  cancleButton = new QPushButton("Cancle", this);
+  cancleButton = new QPushButton("Cancel", this);
   buttonLayout->addWidget(cancleButton,  0, Qt::AlignRight);
   connect( cancleButton, SIGNAL(clicked()), this, SLOT(reject()) );
 
   layout->addLayout(buttonLayout);
 
   newLabelGroupButton->setFocus();
 
 }
 
 QmitkTubeGraphNewLabelGroupDialog::~QmitkTubeGraphNewLabelGroupDialog()
 {
   //delete layout;
   ////delete buttonLayout;
   //delete spacer;
   //delete okButton;
   //delete cancleButton;
 
   //delete labelGroupDescriptionLabel;
  /* delete labelGroupLineEdit;
 
   delete labelDescriptionLabel;
   delete labelLineEdit;
   delete addLabelButton;
   delete labelListWidget; */
   //delete labelGroupTreeWidget;
 }
 
 void QmitkTubeGraphNewLabelGroupDialog::OnCreateNewLabelGroup()
 {
   QDialog::setFixedSize(400, 200);
 
   layout->removeWidget(newLabelGroupButton);
   delete newLabelGroupButton;
 
   layout->removeWidget(standardLabelGroupButton);
   delete standardLabelGroupButton;
 
   layout->removeWidget(okButton);
   layout->removeWidget(cancleButton);
 
   layout->removeItem(spacer);
   layout->removeItem(buttonLayout);
 
   labelGroupDescriptionLabel = new QLabel("Enter the label group name!", this);
   layout->addWidget(labelGroupDescriptionLabel);
 
   labelGroupLineEdit = new QLineEdit(this);
   layout->addWidget(labelGroupLineEdit);
 
   labelDescriptionLabel = new QLabel("Enter a label name!", this);
   layout->addWidget(labelDescriptionLabel);
 
 
   auto   labelLayout = new QHBoxLayout();
 
   labelLineEdit = new QLineEdit(this);
   labelLayout->addWidget(labelLineEdit);
 
   addLabelButton = new QPushButton("+", this);
   labelLayout->addWidget(addLabelButton);
   connect( addLabelButton, SIGNAL(clicked()), this, SLOT(OnAddingLabel()) );
 
   layout->addLayout(labelLayout);
 
   labelListWidget = new QListWidget(this);
   labelListWidget->setDragDropMode(QAbstractItemView::InternalMove);
   labelListWidget->addItem("Undefined");
   layout->addWidget(labelListWidget);
 
   layout->addLayout(buttonLayout);
   connect( okButton, SIGNAL(clicked()), this, SLOT(OnAddingNewLabelGroup()) );
 
   okButton->setVisible(true);
 }
 
 void QmitkTubeGraphNewLabelGroupDialog::OnAddStandardLabelGroup()
 {
   QDialog::setFixedSize(400, 200);
 
   layout->removeWidget(newLabelGroupButton);
   delete newLabelGroupButton;
 
   layout->removeWidget(standardLabelGroupButton);
   delete standardLabelGroupButton;
 
   layout->removeWidget(okButton);
   layout->removeWidget(cancleButton);
 
   layout->removeItem(spacer);
   layout->removeItem(buttonLayout);
 
   labelGroupDescriptionLabel = new QLabel("Choose one of the standard label group!", this);
   layout->addWidget(labelGroupDescriptionLabel);
 
   labelGroupTreeWidget = new QTreeWidget(this);
   labelGroupTreeWidget->header()->close();
 
 
   auto   defaultLabelGroups = new mitk::TubeGraphDefaultLabelGroups();
 
   m_LabelGroupsLiver = defaultLabelGroups->GetLabelGroupForLiver();
   m_LabelGroupsLung = defaultLabelGroups->GetLabelGroupForLung();
 
   auto   liverItem = new QTreeWidgetItem(labelGroupTreeWidget);
   liverItem->setText(0, tr("Liver"));
   QTreeWidgetItem* liverChildItem;
   for (unsigned int k = 0; k < m_LabelGroupsLiver.size(); k++)
   {
     liverChildItem = new QTreeWidgetItem(liverItem);
     liverChildItem->setText(0, QString::fromStdString(m_LabelGroupsLiver.at(k)->labelGroupName));
   }
   liverItem->setExpanded(true);
 
   auto   lungItem = new QTreeWidgetItem(labelGroupTreeWidget);
   lungItem->setText(0, tr("Lung"));
   QTreeWidgetItem* lungChildItem;
   for (unsigned int k = 0; k < m_LabelGroupsLung.size(); k++)
   {
     lungChildItem = new QTreeWidgetItem(lungItem);
     lungChildItem->setText(0, QString::fromStdString(m_LabelGroupsLung.at(k)->labelGroupName));
   }
   lungItem->setExpanded(true);
 
 
   labelGroupTreeWidget->insertTopLevelItem(1,lungItem);
 
   delete defaultLabelGroups;
 
   layout->addWidget(labelGroupTreeWidget);
 
   layout->addLayout(buttonLayout);
   connect( okButton, SIGNAL(clicked()), this, SLOT(OnAddingStandardLabelGroup()) );
 
   okButton->setVisible(true);
 
 }
 
 void QmitkTubeGraphNewLabelGroupDialog::OnAddingLabel()
 {
   if (labelLineEdit->text().isEmpty())
   {
     labelLineEdit->setStyleSheet("border: 1px solid red");
     return;
   }
 
   labelListWidget->addItem(labelLineEdit->text());
   labelLineEdit->clear();
 }
 
 void QmitkTubeGraphNewLabelGroupDialog::OnAddingNewLabelGroup()
 {
   if (labelGroupLineEdit->text().isEmpty())
   {
     labelGroupLineEdit->setStyleSheet("border: 1px solid red");
     return;
   }
   m_NewLabelGroup   = new LabelGroupType();
   m_NewLabelGroup->labelGroupName = (labelGroupLineEdit->text()).toStdString();
 
   for (int i =0; i < labelListWidget->count(); i++)
   {
     auto   label = new LabelType();
     label->labelName = (labelListWidget->item(i)->text()).toStdString();
     mitk::Color color;
 
     if(label->labelName.compare("Undefined") == 0)
     {
       color[0] = 170; color[1] = 170; color[2] = 169;
     }
     else
     {
       color[0] = rand() % 255; color[1] = rand() % 255; color[2] = rand() % 255;
     }
     label->labelColor = color;
     label->isVisible = true;
     m_NewLabelGroup->labels.push_back(label);
   }
 
   this->accept();
 }
 
 void QmitkTubeGraphNewLabelGroupDialog::OnAddingStandardLabelGroup()
 {
   if (labelGroupTreeWidget->selectedItems().isEmpty())
   {
     labelGroupDescriptionLabel->setStyleSheet("border: 1px solid red");
     return;
   }
 
   if(labelGroupTreeWidget->selectedItems().at(0)->parent()->text(0) == "Lung")
   {
     for (unsigned int k = 0; k < m_LabelGroupsLung.size(); k++)
     {
       if(m_LabelGroupsLung.at(k)->labelGroupName == (labelGroupTreeWidget->selectedItems().at(0)->text(0)).toStdString())
         m_NewLabelGroup = m_LabelGroupsLung.at(k);
     }
   }
   else
   {
     for (unsigned int k = 0; k < m_LabelGroupsLiver.size(); k++)
     {
       if(m_LabelGroupsLiver.at(k)->labelGroupName == (labelGroupTreeWidget->selectedItems().at(0)->text(0)).toStdString())
         m_NewLabelGroup = m_LabelGroupsLiver.at(k);
     }
   }
   if (m_NewLabelGroup == nullptr)
     return;
 
 
   this->accept();
 
 }
 
 QmitkTubeGraphNewLabelGroupDialog::LabelGroupType* QmitkTubeGraphNewLabelGroupDialog::GetLabelGroup()
 {
   return m_NewLabelGroup;
 }
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphViewControls.ui b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphViewControls.ui
index 96ba85fee2..c1b48b36a4 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphViewControls.ui
@@ -1,559 +1,559 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkTubeGraphViewControls</class>
  <widget class="QWidget" name="QmitkTubeGraphViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>385</width>
     <height>739</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string/>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_5">
    <item>
     <widget class="QGroupBox" name="activeNodeGroupBox">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="title">
       <string>Active Tube Graph</string>
      </property>
      <property name="flat">
       <bool>false</bool>
      </property>
      <property name="checkable">
       <bool>false</bool>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <property name="sizeConstraint">
        <enum>QLayout::SetDefaultConstraint</enum>
       </property>
       <item>
        <widget class="QmitkDataStorageComboBox" name="activeGraphComboBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QGroupBox" name="activationGroupBox">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="title">
       <string>Activation Mode</string>
      </property>
      <layout class="QHBoxLayout" name="horizontalLayout_3">
       <item>
        <layout class="QVBoxLayout" name="verticalLayout_4">
         <item>
          <widget class="QGroupBox" name="activationModeGroupBox">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="font">
            <font>
             <weight>50</weight>
             <bold>false</bold>
            </font>
           </property>
           <property name="title">
            <string/>
           </property>
           <property name="checkable">
            <bool>false</bool>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout">
            <item>
             <widget class="QRadioButton" name="noneModeRadioButton">
              <property name="text">
               <string>None</string>
              </property>
              <property name="checked">
               <bool>true</bool>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="singleModeRadioButton">
              <property name="text">
               <string>Single</string>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="multipleModeRadioButton">
              <property name="text">
               <string>Multiple</string>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="peripheryModeRadioButton">
              <property name="text">
               <string>Periphery</string>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="rootModeRadioButton">
              <property name="text">
               <string>Path to Root</string>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="pointModeRadioButton">
              <property name="text">
               <string>Point to Point</string>
              </property>
              <attribute name="buttonGroup">
               <string>buttonGroup</string>
              </attribute>
             </widget>
            </item>
           </layout>
          </widget>
         </item>
         <item>
          <layout class="QHBoxLayout" name="horizontalLayout">
           <item>
            <widget class="QPushButton" name="setRootButton">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="toolTip">
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Enable to select a new root with &lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;left mouse click&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; in the image.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
             </property>
             <property name="text">
              <string/>
             </property>
             <property name="icon">
              <iconset>
               <normaloff>:/QmitkExt/icon_seedpoint.png</normaloff>:/QmitkExt/icon_seedpoint.png</iconset>
             </property>
             <property name="checkable">
              <bool>true</bool>
             </property>
             <property name="flat">
              <bool>false</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QPushButton" name="deselectAllButton">
             <property name="font">
              <font>
               <weight>50</weight>
               <bold>false</bold>
              </font>
             </property>
             <property name="text">
              <string>Deselect All</string>
             </property>
            </widget>
           </item>
          </layout>
         </item>
        </layout>
       </item>
       <item>
        <widget class="QGroupBox" name="shortInformationGroupBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="font">
          <font>
           <weight>50</weight>
           <italic>true</italic>
           <bold>false</bold>
          </font>
         </property>
         <property name="title">
          <string>Short Information about Selection</string>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_9">
          <item>
           <widget class="QLabel" name="shortInformationLabel">
            <property name="font">
             <font>
              <italic>false</italic>
             </font>
            </property>
            <property name="text">
             <string/>
            </property>
            <property name="alignment">
             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <widget class="QTabWidget" name="tubeGraphTabWidget">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="font">
       <font>
        <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
      <property name="contextMenuPolicy">
       <enum>Qt::DefaultContextMenu</enum>
      </property>
      <property name="autoFillBackground">
       <bool>true</bool>
      </property>
      <property name="locale">
       <locale language="English" country="UnitedStates"/>
      </property>
      <property name="tabShape">
       <enum>QTabWidget::Rounded</enum>
      </property>
      <property name="currentIndex">
       <number>3</number>
      </property>
      <widget class="QWidget" name="attributationTab">
       <attribute name="title">
        <string>Attributation</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
         <widget class="QToolBox" name="toolBox">
          <widget class="QWidget" name="page">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>343</width>
             <height>282</height>
            </rect>
           </property>
           <attribute name="label">
            <string/>
           </attribute>
          </widget>
          <widget class="QWidget" name="page_2">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>98</width>
             <height>28</height>
            </rect>
           </property>
           <attribute name="label">
            <string/>
           </attribute>
          </widget>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
           <widget class="QPushButton" name="addLabelGroupButton">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="text">
             <string>+</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="removeLabelGroupButton">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="text">
             <string>-</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="annotationTab">
       <attribute name="title">
        <string>Annotation</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_6">
        <item>
         <widget class="QTableWidget" name="annotationsTableWidget">
          <property name="enabled">
           <bool>true</bool>
          </property>
          <property name="font">
           <font>
            <family>MS Shell Dlg 2</family>
            <kerning>true</kerning>
           </font>
          </property>
          <property name="frameShape">
           <enum>QFrame::WinPanel</enum>
          </property>
          <property name="dragEnabled">
           <bool>false</bool>
          </property>
          <property name="selectionBehavior">
           <enum>QAbstractItemView::SelectRows</enum>
          </property>
          <property name="showGrid">
           <bool>true</bool>
          </property>
          <column>
           <property name="text">
            <string>Name</string>
           </property>
          </column>
          <column>
           <property name="text">
            <string>Description</string>
           </property>
          </column>
          <column>
           <property name="text">
            <string>Tube</string>
           </property>
          </column>
         </widget>
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_4">
          <item>
           <widget class="QPushButton" name="addAnnotationButton">
            <property name="text">
             <string>+</string>
            </property>
           </widget>
          </item>
          <item>
           <widget class="QPushButton" name="deleteAnnotationButton">
            <property name="text">
             <string>--</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="editTab">
       <attribute name="title">
        <string>Edit</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_7">
        <item>
         <widget class="QLabel" name="editDescriptionLabel">
          <property name="text">
           <string>Please select the region you want to interact with!</string>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_2">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeType">
           <enum>QSizePolicy::Fixed</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
        <item>
         <widget class="QPushButton" name="editSelectionNewButton">
          <property name="text">
           <string>Connect</string>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_5">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeType">
           <enum>QSizePolicy::Fixed</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>40</height>
           </size>
          </property>
         </spacer>
        </item>
        <item>
         <widget class="QPushButton" name="editSelectionSeperateButton">
          <property name="text">
-          <string>Seperate</string>
+          <string>Separate</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="editSelectionDeleteButton">
          <property name="text">
           <string>Delete</string>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>40</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="informationTab">
       <attribute name="title">
        <string>Information</string>
       </attribute>
       <layout class="QVBoxLayout" name="verticalLayout_8">
        <item>
         <widget class="QLabel" name="informationLabel">
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="verticalSpacer_4">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>20</width>
            <height>345</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeType">
       <enum>QSizePolicy::Preferred</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>20</height>
       </size>
      </property>
     </spacer>
    </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>QmitkDataStorageComboBox</class>
    <extends>QComboBox</extends>
    <header location="global">QmitkDataStorageComboBox.h</header>
   </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
  <slots>
   <slot>OnActivationModeChanged()</slot>
  </slots>
  <buttongroups>
   <buttongroup name="buttonGroup"/>
  </buttongroups>
 </ui>
diff --git a/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
index bf7ee4f2fc..cfc051fc7a 100644
--- a/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
+++ b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
@@ -1,181 +1,181 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef QmitkUltrasoundSupport_h
 #define QmitkUltrasoundSupport_h
 
 #include <mitkLookupTable.h>
 #include <mitkLookupTableProperty.h>
 
 #include <berryISelectionListener.h>
 
 #include <QmitkAbstractView.h>
 
 #include "ui_QmitkUltrasoundSupportControls.h"
 #include "QmitkUSAbstractCustomWidget.h"
 #include "QmitkUSControlsBModeWidget.h"
 #include "QmitkUSControlsDopplerWidget.h"
 #include "QmitkUSControlsProbesWidget.h"
 #include <mitkBaseRenderer.h>
 #include "QmitkRenderWindow.h"
 #include <mitkStandaloneDataStorage.h>
 #include <QmitkLevelWindowWidget.h>
 #include <QmitkSliceWidget.h>
 
 #include <QTime>
 
 #include <ctkServiceEvent.h>
 
 /*!
 \brief UltrasoundSupport
 This plugin provides functionality to manage Ultrasound devices, create video devices and to view device images.
 
 \ingroup ${plugin_target}_internal
 */
 class QmitkUltrasoundSupport : 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:
 
   void SetFocus() override;
 
   static const std::string VIEW_ID;
 
   void CreateQtPartControl(QWidget *parent) override;
 
   QmitkUltrasoundSupport();
   ~QmitkUltrasoundSupport() override;
 
   public slots:
   /*
   * \brief This is called when the newDeviceWidget is closed
   */
   void OnNewDeviceWidgetDone();
 
   protected slots:
 
   void OnClickedAddNewDevice();
 
   void OnChangedFramerateLimit();
 
   void OnClickedEditDevice();
 
   /*
    *\brief Called, when the selection in the list of the active devices changes.
    */
   void OnChangedActiveDevice();
 
   void OnClickedFreezeButton();
 
   void OnDeviceServiceEvent(const ctkServiceEvent event);
 
   /*
-  * \brief This is the main imaging loop that updates the image and is called regularily during the imaging process
+  * \brief This is the main imaging loop that updates the image and is called regularly during the imaging process
   */
   void UpdateImage();
 
   void RenderImage2d();
 
   void RenderImage3d();
 
   void StartTimers();
 
   void StopTimers();
 
 protected:
 
   void CreateControlWidgets();
   void RemoveControlWidgets();
 
   Ui::UltrasoundSupportControls* m_Controls;
 
   QmitkUSAbstractCustomWidget*  m_ControlCustomWidget;
   QmitkUSControlsBModeWidget*   m_ControlBModeWidget;
   QmitkUSControlsDopplerWidget* m_ControlDopplerWidget;
   QmitkUSControlsProbesWidget*  m_ControlProbesWidget;
 
   bool m_ImageAlreadySetToNode;
 
   unsigned int m_CurrentImageWidth;
   unsigned int m_CurrentImageHeight;
 
   /** Keeps track of the amount of output Nodes*/
   unsigned int m_AmountOfOutputs;
 
-  /** The device that is currently used to aquire images */
+  /** The device that is currently used to acquire images */
   mitk::USDevice::Pointer m_Device;
 
   void SetTimerIntervals(int intervalPipeline, int interval2D, int interval3D);
   /** This timer triggers periodic updates to the pipeline */
   QTimer* m_UpdateTimer;
   QTimer* m_RenderingTimer2d;
   QTimer* m_RenderingTimer3d;
 
   /** These clocks are used to compute the framerate in the methods DisplayImage(),RenderImage2d() and RenderImage3d(). */
   QTime  m_Clock;
   QTime  m_Clock2d;
   QTime  m_Clock3d;
 
-  /** A counter to comute the framerate. */
+  /** A counter to compute the framerate. */
   int m_FrameCounterPipeline;
   int m_FrameCounter2d;
   int m_FrameCounter3d;
   int m_FPSPipeline, m_FPS2d, m_FPS3d;
 
   /** Stores the properties of some QWidgets (and the tool storage file name) to QSettings.*/
   void StoreUISettings();
 
   /** Loads the properties of some QWidgets (and the tool storage file name) from QSettings.*/
   void LoadUISettings();
 
   /** The nodes that we feed images into.*/
   std::vector<mitk::DataNode::Pointer> m_Node;
   /** Adds a new node to the m_Nodes vector*/
   void InitNewNode();
   /** Destroys the last node in the m_Nodes vector */
   void DestroyLastNode();
   /** Checks the amount of slices in the image from the USDevice and creates as many Nodes as there are slices */
   void UpdateAmountOfOutputs();
 
   /** This function just checks how many nodes there are currently and sets the laser image to a jet transparent colormap. */
   void UpdateLevelWindows();
   bool m_ForceRequestUpdateAll;
 
   void SetColormap(mitk::DataNode::Pointer node, mitk::LookupTable::LookupTableType type);
 
-  /** The seperated slices from m_Image */
+  /** The separated slices from m_Image */
   std::vector<mitk::Image::Pointer>   m_curOutput;
 
   /** The old geometry of m_Image. It is needed to check if the geometry changed (e.g. because
    *  the zoom factor was modified) and the image needs to be reinitialized. */
   mitk::SlicedGeometry3D::Pointer m_OldGeometry;
 
   QList<ctkServiceReference>    m_CustomWidgetServiceReference;
 
   double m_CurrentDynamicRange;
 
   /* Spacing calibration variables and methods */
   mitk::Point3D m_Xpoint1,m_Xpoint2,m_Ypoint1,m_Ypoint2;
   double m_XSpacing, m_YSpacing;
   double ComputeSpacing(mitk::Point3D p1, mitk::Point3D p2, double distance);
   protected slots:
   void SetXPoint1();
   void SetXPoint2();
   void SetYPoint1();
   void SetYPoint2();
   void WriteSpacingToDevice();
 };
 
 #endif
diff --git a/Plugins/org.mitk.gui.qt.volumevisualization/documentation/UserManual/QmitkVolumeVisualization.dox b/Plugins/org.mitk.gui.qt.volumevisualization/documentation/UserManual/QmitkVolumeVisualization.dox
index 4414f06d79..5c4024fe23 100644
--- a/Plugins/org.mitk.gui.qt.volumevisualization/documentation/UserManual/QmitkVolumeVisualization.dox
+++ b/Plugins/org.mitk.gui.qt.volumevisualization/documentation/UserManual/QmitkVolumeVisualization.dox
@@ -1,130 +1,130 @@
 /**
 \page org_mitk_views_volumevisualization The Volume Visualization Plugin
 
 \imageMacro{volume_visualization-dox.svg,"Icon of the Volume Visualization Plugin",2.00}
 
 \tableofcontents
 
 \section QVV_Overview Overview
 
 The <b> Volume Visualization Plugin </b> is a basic tool for volume rendering of three dimensional medical images. 
 MITK provides generic transfer function presets for medical CT and MRT data.
 These functions that map the gray-value to color and opacity can be interactively edited.
 Additionally, there are controls to quickly generate commonly used transfer function shapes like the threshold and bell curve to help identify a range of grey-values.
 
 \imageMacro{QmitkVolumeVisualization_Overview.png,"",16.00}
 
 \section QVV_EnableVRPage Volume Rendering
 
 \subsection QVV_LoadingImage Select an image and enable volume rendering
 
 Select an image on top of the view and click on the checkbox left of 'Volume rendering'.
 
 \note 
 Volume Visualization imposes following restrictions on images:
 <ul>
 <li> It has to be a 3D scalar image, that means e.g. a CT or MRT image.
 <li> 3D+t images are supported for rendering, but the histograms are not computed.
 <li> Also be aware that volume visualization requires a huge amount of memory. Very large images may not work unless you use the 64bit version.
 </ul>
 
 
 \subsection QVV_LODGPU Dropdown menu for the blend modes
 
-Two dropdown menu is located right next to the 'Volume rendering' checkbox. It allows you to select a blend mode (Composite, Maximim intensity, Minimum intensity, Average intensity, and Additive intensity).
+Two dropdown menu is located right next to the 'Volume rendering' checkbox. It allows you to select a blend mode (Composite, Maximum intensity, Minimum intensity, Average intensity, and Additive intensity).
 
 Blend modes define how the volume voxels, intersected by the rendering rays, are pooled. The 'Composite' mode specifies standard volume rendering,
 for which each voxel contributes equally with opacity and color. Other 'blend' modes visualize the voxel of the maximum or minimum intensity or average or add the intensities along the rendering ray.
 
 \section QVV_PresetPage Applying premade presets
 
 \subsection QVV_Preset Internal presets
 
 There are some internal presets given that can be used with normal CT data (given in Houndsfield units).
 A large set of medical data has been tested with those presets, but they may not suit some special cases.
 
 Click on the 'Preset' tab for using internal or custom presets.
 
 \imageMacro{QmitkVolumeVisualization_InternalPresets.png,"",8.30}
 
 <ul>
 <li> 'CT Generic' is the default transfer function that is first applied.
 <li> 'CT Black&White' does not use any colors for the volume visualization as it may be distracting on some data.
 <li> 'CT Cardiac' is well-suited for CT images containing the heart.
 <li> 'CT Bone' emphasizes bones and shows other areas more transparent.
 <li> 'CT Bone (Gradient)' is like 'CT Bone' but shows only the surface from other organs by using the gradient.
 <li> 'MR Generic' is the default transfer function that can be used on MRT data (which is not normalized like CT data).
 <li> 'CT Thorax small' is useful if only a proportion of the thorax is selected to emphasize details.
 <li> 'CT Thorax large' is useful if a large proportion or the entire thorax is selected to emphasize details.
 </ul>
 
 \subsection QVV_CustomPreset Saving and loading custom presets
 
 After creating or editing a transfer function (see \ref QVV_Editing or \ref QVV_ThresholdBell),
 the custom transfer function can be stored and later retrieved on the filesystem.
 Click 'Save' (respectively 'Load') button below the preset selection to save (load) the threshold-, color- and gradient function combined in a single .xml file.
 
 \section QVV_ThresholdBell Interactively create transfer functions
 
 Besides the possibility to directly edit the transfer functions (\ref QVV_Editing), the plugin provides two commonly known shapes to quickly generate transfer functions with a few clicks. Both generators have two parameters that can be modified by first clicking on the cross and then moving the mouse up/down and left/right. 
 
 The first parameter 'center' (controlled by horizontal movement of the mouse) specifies the gray value where the center of the shape will be located.
 
 The second parameter 'width' (controlled by vertical movement of the mouse) specifies the width (or steepness) of the shape.
 
 \subsection Threshold
 
 Click on the 'Threshold' tab to activate the threshold function generator.
 
 \imageMacro{QmitkVolumeVisualization_Threshold.png,"",8.21}
 
 A threshold shape begins with zero and raises to one across the 'center' parameter. Lower widths result in steeper threshold functions.
 
 \subsection Bell
 
 Click on the 'Bell' tab to activate the bell-shaped threshold function generator.
 
 \imageMacro{QmitkVolumeVisualization_Bell.png,"",8.23}
 
 A threshold shape begins with zero and raises to one at the 'center' parameter and then lowers again to zero. The 'width' parameter corresponds to the width of the bell.
 
 \section QVV_Editing Customize transfer functions in detail
 
 \subsection QVV_Navigate Choosing gray value interval to edit
 
 \imageMacro{QmitkVolumeVisualization_Slider.png,"",8.23}
 
 To navigate across the gray value range or to zoom in some ranges use the 'range'-slider.
 
 All three function editors have in common following:
 
 <ul>
 <li> By left-clicking a new point is added.
 <li> By right-clicking a point is deleted.
-<li> By left-clicking and holding, an exisiting point can be dragged.
+<li> By left-clicking and holding, an existing point can be dragged.
 <li> By pressing arrow keys, the currently selected point is moved.
 <li> By pressing the 'DELETE' key, the currently selected point is deleted.
 <li> Between points the transferfunctions are linear interpolated.
 </ul>
 
 There are three transfer functions to customize:
 
 \subsection QVV_GO Grayvalue -> Opacity
 
 \imageMacro{QmitkVolumeVisualization_Opacity.png,"Gray values will be mapped to opacity.",8.04}
 
 An opacity of 0 means total transparent, an opacity of 1 means total opaque. The opacity editor allows changing the opacity for all gray values independently. You can alter the position of control points using your mouse. You can add control points by left-clicking on the graph. To remove a control point again you can right-click on the respective point. 
 
 
 \subsection QVV_GC Grayvalue -> Color
 
 \imageMacro{QmitkVolumeVisualization_Color.png,"Gray values will be mapped to color.",8.81}
 
 The color transfer function editor also allows you to change its color by double-clicking a point. You can add color control points by left-clicking on the color bar. To remove a control point again right-click on the respective point. 
 
 \subsection QVV_GGO Grayvalue and Gradient -> Opacity
 
 \imageMacro{QmitkVolumeVisualization_Gradient.png,"",8.85}
 
 The gradient editor allows you to change the gradient influence for all gray values independently. You can move the existing control points using your mouse. Additionally, you can add control points by left-clicking on the graph. To remove a control point again, right-click on the respective point.
 */
diff --git a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
index cba95f5cf5..53662af647 100755
--- a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
+++ b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
@@ -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.
 
 ============================================================================*/
 
 #include "QmitkVolumeVisualizationView.h"
 
 #include <vtkSmartVolumeMapper.h>
 
 #include <mitkImage.h>
 
 #include <mitkTimeNavigationController.h>
 
 #include <mitkTransferFunction.h>
 #include <mitkTransferFunctionInitializer.h>
 #include <mitkTransferFunctionProperty.h>
 
 #include <mitkNodePredicateDataType.h>
 #include <mitkNodePredicateDimension.h>
 #include <mitkNodePredicateAnd.h>
 #include <mitkNodePredicateNot.h>
 #include <mitkNodePredicateOr.h>
 #include <mitkNodePredicateProperty.h>
 
 #include <mitkProperties.h>
 
 const std::string QmitkVolumeVisualizationView::VIEW_ID = "org.mitk.views.volumevisualization";
 
 enum
 {
   DEFAULT_RENDERMODE = 0,
   RAYCAST_RENDERMODE = 1,
   GPU_RENDERMODE = 2
 };
 
 QmitkVolumeVisualizationView::QmitkVolumeVisualizationView()
   : QmitkAbstractView()
   , m_Controls(nullptr)
 {
 }
 
 void QmitkVolumeVisualizationView::SetFocus()
 {
 }
 
 void QmitkVolumeVisualizationView::CreateQtPartControl(QWidget* parent)
 {
   m_Controls = new Ui::QmitkVolumeVisualizationViewControls;
   m_Controls->setupUi(parent);
 
   m_Controls->volumeSelectionWidget->SetDataStorage(GetDataStorage());
   m_Controls->volumeSelectionWidget->SetNodePredicate(mitk::NodePredicateAnd::New(
     mitk::TNodePredicateDataType<mitk::Image>::New(),
     mitk::NodePredicateOr::New(mitk::NodePredicateDimension::New(3), mitk::NodePredicateDimension::New(4)),
     mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))));
   m_Controls->volumeSelectionWidget->SetSelectionIsOptional(true);
   m_Controls->volumeSelectionWidget->SetEmptyInfo(QString("Please select a 3D / 4D image volume"));
   m_Controls->volumeSelectionWidget->SetPopUpTitel(QString("Select image volume"));
 
   // Fill the transfer function presets in the generator widget
   std::vector<std::string> names;
   mitk::TransferFunctionInitializer::GetPresetNames(names);
   for (const auto& name : names)
   {
     m_Controls->transferFunctionGeneratorWidget->AddPreset(QString::fromStdString(name));
   }
 
   // see vtkVolumeMapper::BlendModes
   m_Controls->blendMode->addItem("Composite", vtkVolumeMapper::COMPOSITE_BLEND);
   m_Controls->blendMode->addItem("Maximum intensity", vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
   m_Controls->blendMode->addItem("Minimum intensity", vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
   m_Controls->blendMode->addItem("Average intensity", vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
   m_Controls->blendMode->addItem("Additive", vtkVolumeMapper::ADDITIVE_BLEND);
 
   connect(m_Controls->volumeSelectionWidget, &QmitkSingleNodeSelectionWidget::CurrentSelectionChanged,
     this, &QmitkVolumeVisualizationView::OnCurrentSelectionChanged);
   connect(m_Controls->enableRenderingCB, SIGNAL(toggled(bool)), this, SLOT(OnEnableRendering(bool)));
   connect(m_Controls->blendMode, SIGNAL(activated(int)), this, SLOT(OnBlendMode(int)));
 
   connect(m_Controls->transferFunctionGeneratorWidget, SIGNAL(SignalUpdateCanvas()),
           m_Controls->transferFunctionWidget, SLOT(OnUpdateCanvas()));
   connect(m_Controls->transferFunctionGeneratorWidget, SIGNAL(SignalTransferFunctionModeChanged(int)),
           SLOT(OnMitkInternalPreset(int)));
 
   m_Controls->enableRenderingCB->setEnabled(false);
   m_Controls->blendMode->setEnabled(false);
   m_Controls->transferFunctionWidget->setEnabled(false);
   m_Controls->transferFunctionGeneratorWidget->setEnabled(false);
 
   m_Controls->volumeSelectionWidget->SetAutoSelectNewNodes(true);
 
   this->m_TimePointChangeListener.RenderWindowPartActivated(this->GetRenderWindowPart());
   connect(&m_TimePointChangeListener,
           &QmitkSliceNavigationListener::SelectedTimePointChanged,
           this,
           &QmitkVolumeVisualizationView::OnSelectedTimePointChanged);
 }
 
 void QmitkVolumeVisualizationView::RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart)
 {
   this->m_TimePointChangeListener.RenderWindowPartActivated(renderWindowPart);
 }
 
 void QmitkVolumeVisualizationView::RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart)
 {
   this->m_TimePointChangeListener.RenderWindowPartDeactivated(renderWindowPart);
 }
 
 void QmitkVolumeVisualizationView::OnMitkInternalPreset(int mode)
 {
   auto node = m_SelectedNode.Lock();
 
   if (node.IsNull())
   {
     return;
   }
 
   mitk::TransferFunctionProperty::Pointer transferFuncProp;
   if (node->GetProperty(transferFuncProp, "TransferFunction"))
   {
     // first item is only information
     if (--mode == -1)
       return;
 
-    // -- Creat new TransferFunction
+    // -- Create new TransferFunction
     mitk::TransferFunctionInitializer::Pointer tfInit = mitk::TransferFunctionInitializer::New(transferFuncProp->GetValue());
     tfInit->SetTransferFunctionMode(mode);
     RequestRenderWindowUpdate();
     m_Controls->transferFunctionWidget->OnUpdateCanvas();
   }
 }
 
 void QmitkVolumeVisualizationView::OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes)
 {
   m_SelectedNode = nullptr;
 
   if (nodes.empty() || nodes.front().IsNull())
   {
     UpdateInterface();
     return;
   }
 
   auto selectedNode = nodes.front();
   auto image = dynamic_cast<mitk::Image*>(selectedNode->GetData());
   if (nullptr != image)
   {
     m_SelectedNode = selectedNode;
   }
 
   UpdateInterface();
 }
 
 void QmitkVolumeVisualizationView::OnEnableRendering(bool state)
 {
   auto selectedNode = m_SelectedNode.Lock();
 
   if (selectedNode.IsNull())
   {
     return;
   }
 
   selectedNode->SetProperty("volumerendering", mitk::BoolProperty::New(state));
   UpdateInterface();
   RequestRenderWindowUpdate();
 }
 
 void QmitkVolumeVisualizationView::OnBlendMode(int index)
 {
   auto selectedNode = m_SelectedNode.Lock();
 
   if (selectedNode.IsNull())
     return;
 
   int mode = m_Controls->blendMode->itemData(index).toInt();
   selectedNode->SetProperty("volumerendering.blendmode", mitk::IntProperty::New(mode));
 
   this->RequestRenderWindowUpdate();
 }
 
 void QmitkVolumeVisualizationView::OnSelectedTimePointChanged(const mitk::TimePointType & /*newTimePoint*/)
 {
   this->UpdateInterface();
 }
 
 void QmitkVolumeVisualizationView::UpdateInterface()
 {
   if (m_SelectedNode.IsExpired())
   {
     // turnoff all
     m_Controls->enableRenderingCB->setChecked(false);
     m_Controls->enableRenderingCB->setEnabled(false);
 
     m_Controls->blendMode->setCurrentIndex(0);
     m_Controls->blendMode->setEnabled(false);
 
     m_Controls->transferFunctionWidget->SetDataNode(nullptr);
     m_Controls->transferFunctionWidget->setEnabled(false);
 
     m_Controls->transferFunctionGeneratorWidget->SetDataNode(nullptr);
     m_Controls->transferFunctionGeneratorWidget->setEnabled(false);
     return;
   }
 
   bool enabled = false;
   auto selectedNode = m_SelectedNode.Lock();
 
   selectedNode->GetBoolProperty("volumerendering", enabled);
   m_Controls->enableRenderingCB->setEnabled(true);
   m_Controls->enableRenderingCB->setChecked(enabled);
 
   if (!enabled)
   {
     // turnoff all except volumerendering checkbox
     m_Controls->blendMode->setCurrentIndex(0);
     m_Controls->blendMode->setEnabled(false);
 
     m_Controls->transferFunctionWidget->SetDataNode(nullptr);
     m_Controls->transferFunctionWidget->setEnabled(false);
 
     m_Controls->transferFunctionGeneratorWidget->SetDataNode(nullptr);
     m_Controls->transferFunctionGeneratorWidget->setEnabled(false);
     return;
   }
 
   // otherwise we can activate em all
   m_Controls->blendMode->setEnabled(true);
 
   // Determine Combo Box mode
   int blendMode;
   if (selectedNode->GetIntProperty("volumerendering.blendmode", blendMode))
     m_Controls->blendMode->setCurrentIndex(blendMode);
 
   const auto timeStep = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimeStep();
   m_Controls->transferFunctionWidget->SetDataNode(selectedNode, timeStep);
   m_Controls->transferFunctionWidget->setEnabled(true);
   m_Controls->transferFunctionGeneratorWidget->SetDataNode(selectedNode, timeStep);
   m_Controls->transferFunctionGeneratorWidget->setEnabled(true);
 }
diff --git a/Plugins/org.mitk.gui.qt.xnat/documentation/UserManual/QmitkXnatPluginManual.dox b/Plugins/org.mitk.gui.qt.xnat/documentation/UserManual/QmitkXnatPluginManual.dox
index d25bb1c70d..d7d2d1025e 100644
--- a/Plugins/org.mitk.gui.qt.xnat/documentation/UserManual/QmitkXnatPluginManual.dox
+++ b/Plugins/org.mitk.gui.qt.xnat/documentation/UserManual/QmitkXnatPluginManual.dox
@@ -1,113 +1,113 @@
 /**
 \page org_mitk_gui_qt_xnat The XNAT Plugin
 
 \imageMacro{xnat-docu-icon.png,"Icon of XNAT Plugin",1.00}
 
 \tableofcontents
 
 \section org_mitk_gui_qt_xnatOverview Overview
 This plug-in is allows the communication with a XNAT server from within MITK.
 
 The benefits of this plug-in are:
 <ul>
 <li>Browsing through the XNAT data hierarchy
 <li>Downloading data and visualize/process it in the MITK Workbench
 <li>Uploading data from within the MITK Workbench
 </ul>
 
 \imageMacro{QmitkXnat_IMGTreeBrowser.png,"The XNAT tree-browser plugin", 6.00}
 
 \section org_mitk_gui_qt_xnatConnection Connect to XNAT
 For communicating with XNAT you have to connect to your XNAT instance.
 
 \subsection org_mitk_gui_qt_xnatPreferences XNAT preferences
 In order to establish the connection to XNAT you have to specify the XNAT server address, username and password in the XNAT preference page.
 It is also possible to specify a network proxy if you are behind one (this could lead to connection errors).
 Via the download path you can tell MITK where to save the data that is uploaded or downloaded.
 A screenshot of the preference page can be seen below.
 
 \imageMacro{QmitkXnat_IMGPreferences.png,"The XNAT preference page", 10.00}
 
 \subsection org_mitk_gui_qt_xnatSessionHandling Session time-out handling
 Once you are connected to XNAT, MITK takes care about the session handling. A existing XNAT session times out after a certain period of inactivity, usually after 15 minutes.
 One minute before session time-out MITK asks you to renew the session:
 
 \imageMacro{QmitkXnat_IMGSessionAboutToTimeOut.png,"Notification that the session will time-out in a minute", 6.00}
 
 If you do not renew the session MITK notifies you if the session has expired:
 
 \imageMacro{QmitkXnat_IMGSessionExpired.png,"Notification that the session has expired", 6.00}
 
 \section org_mitk_gui_qt_xnatBrowsing Browse data
-Once you are connected to XNAT, MITK displays the XNAT data hierachy as a tree within the XNAT tree browser.
-You can browse through the data by expanding the tree items ( which ist also possible via double click).
+Once you are connected to XNAT, MITK displays the XNAT data hierarchy as a tree within the XNAT tree browser.
+You can browse through the data by expanding the tree items (which is also possible via double click).
 If you hover the mouse cursor over an item you will see a tool tip with detailed information.
 The following table gives an overview about the icons of the treeview and the related XNAT objects
 
 <table>
 <caption id="multi_row">XNAT Icon Overview</caption>
 <tr><th>Icon                     <th>XNAT object
 <tr><td>\image html xnat-server.png <td>XNAT Server
 <tr><td>\image html xnat-project.png <td>XNAT Project
 <tr><td>\image html xnat-subject.png <td>XNAT Subject
 <tr><td>\image html xnat-experiment.png <td>XNAT Experiment
 <tr><td>\image html xnat-folder-icon.png <td>XNAT Scan top-level folder
 <tr><td>\image html xnat-scan.png <td>XNAT Scan
 <tr><td>\image html xnat-folder-icon.png <td>XNAT Resource top-level folder
 <tr><td>\image html xnat-resource.png <td>XNAT Resource folder
 <tr><td>\image html xnat-file.png <td>XNAT File
 </table>
 
 If you have selected a XNAT project, subject or experiment, MITK displays detailed information in a separate info area below the tree browser
 
 \section org_mitk_gui_qt_xnatDownload Download data
 MITK allows you to download your data from XNAT. You can either simply download the data to your file system or your can download it and open it immediately in the workbench.
 \subsection org_mitk_gui_qt_xnatDownload_file_system Download data to file system
-If you just want to download data, simply right-click on a XNAT file or scan on the tree brower and select "Download". The data will be stored in the specified download location.
+If you just want to download data, simply right-click on a XNAT file or scan on the tree browser and select "Download". The data will be stored in the specified download location.
 \subsection org_mitk_gui_qt_xnatDownload_in_MITK Download data and open it in MITK
 You can download and open data in three ways:
 <ul>
 <li>One is via right-click on a file or scan and selecting "Download and open".
 <li>You can also double-click on a file or scan. MITK will then ask you if you want to download and open the data.
 <li>The other one is via selecting a file or scan with left-click and then click on the download button above the tree view
 </ul>
 
-\imageMacro{QmitkXnat_IMGDownloadButton.png,"The XNAT dowload button", 16.00}
+\imageMacro{QmitkXnat_IMGDownloadButton.png,"The XNAT download button", 16.00}
 
 \section org_mitk_gui_qt_xnatUpload Upload data
 You can also upload data to XNAT from within the workbench. Please note that it is currently only possible to upload files as resources. Uploading DICOMs is not yet available.
 
 \subsection org_mitk_gui_qt_xnatUpload1 Upload from file system
 If you just want to upload a local file, right-click on a resource and select "Upload". A file dialog will open, which allows you to select a file for upload.
 
 \subsection org_mitk_gui_qt_xnatUpload2 Upload via data manager
 If you want to upload data from within the MITK Workbench you can simply right-click on the data node in the data manager and select "Upload to XNAT".
 An "XNAT Upload dialog" will appear:
 
 \imageMacro{QmitkXnat_IMGUploadDialog.png,"The XNAT upload dialog", 16.00}
 
 You can then either select a existing resource folder if MITK is able to find ones or you can select the upload destination in a tree view.
 
 \subsection org_mitk_gui_qt_xnatUpload3 Upload via drag and drop
 Another way to upload the data is to drag the data node on the XNAT resource where you want to upload it to.
 
 \subsection org_mitk_gui_qt_xnatUpload4 Upload via XNAT Plugin
 Finally, if you select a data node and you select a XNAT resource, the upload button of the XNAT plugin will be enabled. If you click on that, the data will be uploaded.
 
 \imageMacro{QmitkXnat_IMGUploadButton.png,"The XNAT upload button", 16.00}
 
 \section org_mitk_gui_qt_xnatAddResourceFolder Create a resource folder
 You can also create new resources (i.e. folders to group your files in XNAT). Therefor you can either right-click on a project, subject, experiment or scan and enter the name
 of the folder in the appearing dialog. Or you simply select one of these items and click on the "Add folder button" above the tree browser.
 
 \imageMacro{QmitkXnat_IMGAddFolderButton.png,"The XNAT add folder button", 16.00}
 
 \subsection org_mitk_gui_qt_xnatCreateSubject Create a subject
 You can create subjects by right-clicking on a project and selecting "Create new subject".
 A dialog will appear where you have to enter the subject information.
 
 \subsection org_mitk_gui_qt_xnatCreateExperiment Create a experiment
 You can create experiments by right-clicking on a subject and selecting "Create new experiment".
 A dialog will appear where you have to enter the experiment information.
 
 */
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.cpp b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.cpp
index 30d9b3f565..5eaf8a507d 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.cpp
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.cpp
@@ -1,296 +1,296 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkXnatConnectionPreferencePage.h"
 #include "QmitkXnatTreeBrowserView.h"
 
 #include "org_mitk_gui_qt_xnatinterface_Activator.h"
 
 #include <QFileDialog>
 #include <QLabel>
 #include <QPushButton>
 #include <QLineEdit>
 #include <QGridLayout>
 #include <QMessageBox>
 #include <QApplication>
 #include <QMap>
 
 #include "ctkXnatSession.h"
 #include "ctkXnatLoginProfile.h"
 #include "ctkXnatException.h"
 
 #include <mitkIOUtil.h>
 #include <mitkCoreServices.h>
 #include <mitkIPreferencesService.h>
 #include <mitkIPreferences.h>
 
 using namespace berry;
 
 namespace
 {
   mitk::IPreferences* GetPreferences()
   {
     auto* preferencesService = mitk::CoreServices::GetPreferencesService();
     return preferencesService->GetSystemPreferences()->Node(QmitkXnatTreeBrowserView::VIEW_ID.toStdString());
   }
 }
 
 QmitkXnatConnectionPreferencePage::QmitkXnatConnectionPreferencePage()
   : m_Control(nullptr)
 {
 }
 
 void QmitkXnatConnectionPreferencePage::Init(berry::IWorkbench::Pointer)
 {
 }
 
 void QmitkXnatConnectionPreferencePage::CreateQtControl(QWidget* parent)
 {
   m_Controls.setupUi(parent);
   m_Control = new QWidget(parent);
   m_Control->setLayout(m_Controls.gridLayout);
 
   ctkXnatSession* session;
 
   try
   {
     session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
           mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
   }
   catch (std::invalid_argument&)
   {
     session = nullptr;
   }
 
   if (session != nullptr && session->isOpen())
   {
     m_Controls.xnatTestConnectionLabel->setStyleSheet("color: green");
     m_Controls.xnatTestConnectionLabel->setText("Already connected.");
     m_Controls.xnatTestConnectionButton->setEnabled(false);
   }
   const QIntValidator *portV = new QIntValidator(0, 65535, parent);
   m_Controls.inXnatPort->setValidator(portV);
 
   const QRegExp hostRx("^(https?)://[^ /](\\S)+$");
   const QRegExpValidator *hostV = new QRegExpValidator(hostRx, parent);
   m_Controls.inXnatHostAddress->setValidator(hostV);
 
   connect(m_Controls.xnatTestConnectionButton, SIGNAL(clicked()), this, SLOT(TestConnection()));
 
   connect(m_Controls.inXnatHostAddress, SIGNAL(editingFinished()), this, SLOT(UrlChanged()));
   connect(m_Controls.inXnatDownloadPath, SIGNAL(editingFinished()), this, SLOT(DownloadPathChanged()));
 
   connect(m_Controls.cbUseNetworkProxy, SIGNAL(toggled(bool)), this, SLOT(onUseNetworkProxy(bool)));
 
   connect(m_Controls.btnDownloadPath, SIGNAL(clicked()), this, SLOT(OnDownloadPathButtonClicked()));
 
   m_Controls.groupBoxProxySettings->setVisible(m_Controls.cbUseNetworkProxy->isChecked());
 
   this->Update();
 }
 
 QWidget* QmitkXnatConnectionPreferencePage::GetQtControl() const
 {
   return m_Control;
 }
 
 bool QmitkXnatConnectionPreferencePage::PerformOk()
 {
   auto* prefs = GetPreferences();
 
   if (prefs != nullptr)
   {
     prefs->Put(m_Controls.xnatHostAddressLabel->text().toStdString(), m_Controls.inXnatHostAddress->text().toStdString());
     prefs->Put(m_Controls.xnatPortLabel->text().toStdString(), m_Controls.inXnatPort->text().toStdString());
     prefs->Put(m_Controls.xnatUsernameLabel->text().toStdString(), m_Controls.inXnatUsername->text().toStdString());
     prefs->Put(m_Controls.xnatPasswortLabel->text().toStdString(), m_Controls.inXnatPassword->text().toStdString());
     prefs->Put(m_Controls.xnatDownloadPathLabel->text().toStdString(), m_Controls.inXnatDownloadPath->text().toStdString());
 
     // Network proxy settings
     prefs->PutBool(m_Controls.cbUseNetworkProxy->text().toStdString(), m_Controls.cbUseNetworkProxy->isChecked());
     prefs->Put(m_Controls.proxyAddressLabel->text().toStdString(), m_Controls.inProxyAddress->text().toStdString());
     prefs->Put(m_Controls.proxyPortLabel->text().toStdString(), m_Controls.inProxyPort->text().toStdString());
     prefs->Put(m_Controls.proxyUsernameLabel->text().toStdString(), m_Controls.inProxyUsername->text().toStdString());
     prefs->Put(m_Controls.proxyPasswordLabel->text().toStdString(), m_Controls.inProxyPassword->text().toStdString());
 
     // Silent Mode
     prefs->PutBool(m_Controls.cbUseSilentMode->text().toStdString(), m_Controls.cbUseSilentMode->isChecked());
 
     //Write
     prefs->Flush();
 
     return true;
   }
   return false;
 }
 
 void QmitkXnatConnectionPreferencePage::PerformCancel()
 {
 }
 
 bool QmitkXnatConnectionPreferencePage::UserInformationEmpty()
 {
   // To check empty QLineEdits in the following
   QString errString;
 
   if (m_Controls.inXnatHostAddress->text().isEmpty())
   {
     errString += "Server Address is empty.\n";
   }
 
   if (m_Controls.inXnatUsername->text().isEmpty())
   {
     errString += "Username is empty.\n";
   }
 
   if (m_Controls.inXnatPassword->text().isEmpty())
   {
     errString += "Password is empty.\n";
   }
 
   // if something is empty
   if (!errString.isEmpty())
   {
     m_Controls.xnatTestConnectionLabel->setStyleSheet("color: red");
     m_Controls.xnatTestConnectionLabel->setText("Connecting failed.\n" + errString);
     return true;
   }
   else
   {
     return false;
   }
 }
 
 void QmitkXnatConnectionPreferencePage::Update()
 {
   auto* prefs = GetPreferences();
 
   if (prefs != nullptr)
   {
     m_Controls.inXnatHostAddress->setText(QString::fromStdString(prefs->Get(m_Controls.xnatHostAddressLabel->text().toStdString(), m_Controls.inXnatHostAddress->text().toStdString())));
     m_Controls.inXnatPort->setText(QString::fromStdString(prefs->Get(m_Controls.xnatPortLabel->text().toStdString(), m_Controls.inXnatPort->text().toStdString())));
     m_Controls.inXnatUsername->setText(QString::fromStdString(prefs->Get(m_Controls.xnatUsernameLabel->text().toStdString(), m_Controls.inXnatUsername->text().toStdString())));
     m_Controls.inXnatPassword->setText(QString::fromStdString(prefs->Get(m_Controls.xnatPasswortLabel->text().toStdString(), m_Controls.inXnatPassword->text().toStdString())));
     m_Controls.inXnatDownloadPath->setText(QString::fromStdString(prefs->Get(m_Controls.xnatDownloadPathLabel->text().toStdString(), m_Controls.inXnatDownloadPath->text().toStdString())));
 
     // Network proxy settings
     m_Controls.cbUseNetworkProxy->setChecked(prefs->GetBool(m_Controls.cbUseNetworkProxy->text().toStdString(), false));
     m_Controls.inProxyAddress->setText(QString::fromStdString(prefs->Get(m_Controls.proxyAddressLabel->text().toStdString(), m_Controls.inProxyAddress->text().toStdString())));
     m_Controls.inProxyPort->setText(QString::fromStdString(prefs->Get(m_Controls.proxyPortLabel->text().toStdString(), m_Controls.inProxyPort->text().toStdString())));
     m_Controls.inProxyUsername->setText(QString::fromStdString(prefs->Get(m_Controls.proxyUsernameLabel->text().toStdString(), m_Controls.inProxyUsername->text().toStdString())));
     m_Controls.inProxyPassword->setText(QString::fromStdString(prefs->Get(m_Controls.proxyPasswordLabel->text().toStdString(), m_Controls.inProxyPassword->text().toStdString())));
 
     // Silent Mode
     m_Controls.cbUseSilentMode->setChecked(prefs->GetBool(m_Controls.cbUseSilentMode->text().toStdString(), false));
   }
 }
 
 void QmitkXnatConnectionPreferencePage::UrlChanged()
 {
   m_Controls.inXnatHostAddress->setStyleSheet("");
   QString str = m_Controls.inXnatHostAddress->text();
 
   while (str.endsWith("/"))
   {
     str = str.left(str.length() - 1);
   }
 
   m_Controls.inXnatHostAddress->setText(str);
 
   QUrl url(m_Controls.inXnatHostAddress->text());
   if (!url.isValid())
   {
     m_Controls.inXnatHostAddress->setStyleSheet("background-color: red");
   }
 }
 
 void QmitkXnatConnectionPreferencePage::DownloadPathChanged()
 {
   m_Controls.inXnatDownloadPath->setStyleSheet("");
   QString downloadPath = m_Controls.inXnatDownloadPath->text();
   if (!downloadPath.isEmpty())
   {
     if (downloadPath.lastIndexOf("/") != downloadPath.size() - 1)
     {
       downloadPath.append("/");
       m_Controls.inXnatDownloadPath->setText(downloadPath);
     }
     QFileInfo path(m_Controls.inXnatDownloadPath->text());
     if (!path.isDir())
     {
       m_Controls.inXnatDownloadPath->setStyleSheet("background-color: red");
     }
   }
 }
 
 void QmitkXnatConnectionPreferencePage::onUseNetworkProxy(bool status)
 {
   m_Controls.groupBoxProxySettings->setVisible(status);
 }
 
 void QmitkXnatConnectionPreferencePage::OnDownloadPathButtonClicked()
 {
   QString dir = QFileDialog::getExistingDirectory();
   if (!dir.endsWith("/") || !dir.endsWith("\\"))
     dir.append("/");
   m_Controls.inXnatDownloadPath->setText(dir);
 }
 
 void QmitkXnatConnectionPreferencePage::TestConnection()
 {
   if(UserInformationEmpty())
   {
     return;
   }
 
   try
   {
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
   }
   catch (const std::invalid_argument &)
   {
     if (!UserInformationEmpty())
     {
       PerformOk();
 
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CreateXnatSession();
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
         mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
     }
   }
 
   try
   {
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->OpenXnatSession();
 
     m_Controls.xnatTestConnectionLabel->setStyleSheet("color: green");
     m_Controls.xnatTestConnectionLabel->setText("Connecting successful.");
 
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
   }
   catch (const ctkXnatAuthenticationException& auth)
   {
     m_Controls.xnatTestConnectionLabel->setStyleSheet("color: red");
     m_Controls.xnatTestConnectionLabel->setText("Connecting failed:\nAuthentication error.");
     MITK_INFO << auth.message().toStdString();
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
   }
   catch (const ctkException& e)
   {
     m_Controls.xnatTestConnectionLabel->setStyleSheet("color: red");
-    m_Controls.xnatTestConnectionLabel->setText("Connecting failed:\nInvalid Server Adress\nPossibly due to missing OpenSSL for HTTPS connections");
+    m_Controls.xnatTestConnectionLabel->setText("Connecting failed:\nInvalid Server Address\nPossibly due to missing OpenSSL for HTTPS connections");
     MITK_INFO << e.message().toStdString();
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
   }
 
 }
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.cpp b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.cpp
index b30b0f326a..0df20f10f2 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.cpp
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.cpp
@@ -1,1338 +1,1338 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 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 "QmitkXnatTreeBrowserView.h"
 
 #include <mitkCoreServices.h>
 #include <mitkIPreferencesService.h>
 #include <mitkIPreferences.h>
 
 // Qmitk
 #include "org_mitk_gui_qt_xnatinterface_Activator.h"
 
 // CTK XNAT Core
 #include <ctkXnatAssessor.h>
 #include <ctkXnatAssessorFolder.h>
 #include <ctkXnatDataModel.h>
 #include <ctkXnatException.h>
 #include <ctkXnatExperiment.h>
 #include "ctkXnatFile.h"
 #include <ctkXnatProject.h>
 #include <ctkXnatReconstruction.h>
 #include <ctkXnatReconstructionFolder.h>
 #include <ctkXnatResource.h>
 #include <ctkXnatResourceFolder.h>
 #include <ctkXnatScan.h>
 #include <ctkXnatScanFolder.h>
 #include <ctkXnatSubject.h>
 
 // MITK XNAT
 #include <mitkDataStorage.h>
 #include <QmitkIOUtil.h>
 #include <QmitkXnatProjectWidget.h>
 #include <QmitkXnatSubjectWidget.h>
 #include <QmitkXnatExperimentWidget.h>
 #include <QmitkXnatCreateObjectDialog.h>
 #include <QmitkXnatUploadFromDataStorageDialog.h>
 
 // Qt
 #include <QAction>
 #include <QClipboard>
 #include <QDateTime>
 #include <QDialog>
 #include <QDir>
 #include <QDirIterator>
 #include <QFileDialog>
 #include <QInputDialog>
 #include <QMenu>
 #include <QMessageBox>
 #include <QTimer>
 #include <QFileInfoList>
 
 #include <QmitkPreferencesDialog.h>
 
 // Poco
 #include <Poco/Zip/Decompress.h>
 
 const QString QmitkXnatTreeBrowserView::VIEW_ID = "org.mitk.views.xnat.treebrowser";
 
 static bool isDirWriteable(QDir myDir)
 {
   const QFileInfoList tmpInfo = myDir.entryInfoList();
   foreach (QFileInfo f, tmpInfo)
   {
     if(f.fileName() == ".")
       return f.isWritable();
   }
   return true;
 }
 
 static bool doesDirExist(QDir myDir)
 {
   if (!myDir.exists())
   {
     if(!myDir.mkpath("."))
     {
       MITK_INFO << "Path Creation Failed.";
       return false;
     }
   }
   return true;
 }
 
 QmitkXnatTreeBrowserView::QmitkXnatTreeBrowserView() :
   m_DataStorageServiceTracker(mitk::org_mitk_gui_qt_xnatinterface_Activator::GetContext()),
   m_TreeModel(new QmitkXnatTreeModel()),
   m_Tracker(nullptr),
   m_DownloadPath(QString::fromStdString(mitk::CoreServices::GetPreferencesService()->GetSystemPreferences()->Node(VIEW_ID.toStdString())->Get("Download Path", ""))),
   m_SilentMode(false)
 {
   m_DataStorageServiceTracker.open();
 
   // Set DownloadPath
   if (m_DownloadPath.isEmpty())
   {
     QString xnatFolder = "XNAT_DOWNLOADS";
     QDir dir(mitk::org_mitk_gui_qt_xnatinterface_Activator::GetContext()->getDataFile("").absoluteFilePath());
     dir.mkdir(xnatFolder);
     dir.setPath(dir.path() + "/" + xnatFolder);
     m_DownloadPath = dir.path() + "/";
   }
 }
 
 QmitkXnatTreeBrowserView::~QmitkXnatTreeBrowserView()
 {
   m_DataStorageServiceTracker.close();
   delete m_TreeModel;
   delete m_Tracker;
 }
 
 void QmitkXnatTreeBrowserView::SetFocus()
 {
 }
 
 void QmitkXnatTreeBrowserView::FilePathNotAvailableWarning(QString file)
 {
   MITK_INFO << "Download of " << file.toStdString() << " failed! Download Path not available!";
   QMessageBox::critical(m_Controls.treeView, "Download failed!", "Download of " + file + " failed!\nDownload Path "
                         + m_DownloadPath + " not available. \n\nChange Download Path in Settings!");
   QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
   _PreferencesDialog.SetSelectedPage("org.mitk.gui.qt.application.XnatConnectionPreferencePage");
   _PreferencesDialog.exec();
   m_Controls.groupBox->hide();
 }
 
 void QmitkXnatTreeBrowserView::ToggleConnection()
 {
   ctkXnatSession* session = nullptr;
 
   try
   {
     session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
           mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
   }
   catch (std::invalid_argument&)
   {
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CreateXnatSession();
 
     session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
           mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
   }
 
   if (session != nullptr && session->isOpen())
   {
     mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
     m_Controls.btnXnatConnect->setToolTip("Connect");
     m_Controls.btnXnatConnect->setIcon(QIcon(":/xnat-plugin/xnat-connect.png"));
     CleanUp();
   }
   else if (session != nullptr && !session->isOpen())
   {
     try
     {
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->OpenXnatSession();
       m_Controls.btnXnatConnect->setToolTip("Disconnect");
       m_Controls.btnXnatConnect->setIcon(QIcon(":/xnat-plugin/xnat-disconnect.png"));
       m_Controls.searchField->setEnabled(true);
       m_Controls.searchModeBox->setEnabled(true);
     }
     catch (const ctkXnatAuthenticationException& auth)
     {
       MITK_INFO << auth.message().toStdString();
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
       QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
       _PreferencesDialog.SetSelectedPage("org.mitk.gui.qt.application.XnatConnectionPreferencePage");
       _PreferencesDialog.exec();
     }
     catch (const ctkException& e)
     {
       MITK_INFO << e.message().toStdString();
       mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatSessionManager()->CloseXnatSession();
       QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
       _PreferencesDialog.SetSelectedPage("org.mitk.gui.qt.application.XnatConnectionPreferencePage");
       _PreferencesDialog.exec();
     }
     catch (...)
     {
       QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
       _PreferencesDialog.SetSelectedPage("org.mitk.gui.qt.application.XnatConnectionPreferencePage");
       _PreferencesDialog.exec();
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::CreateQtPartControl(QWidget *parent)
 {
   // Create GUI widgets from the Qt Designer's .ui file
   m_Controls.setupUi(parent);
   m_Controls.treeView->setModel(m_TreeModel);
   m_Controls.treeView->header()->hide();
   m_Controls.treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
   m_Controls.treeView->setAcceptDrops(true);
   m_Controls.treeView->setDropIndicatorShown(true);
 
   m_Controls.treeView->setSelectionMode(QAbstractItemView::SingleSelection);
   m_Controls.treeView->setContextMenuPolicy(Qt::CustomContextMenu);
 
   m_Controls.groupBox->hide();
   m_Controls.wgtExperimentInfo->hide();
   m_Controls.wgtSubjectInfo->hide();
   m_Controls.wgtProjectInfo->hide();
 
   m_Tracker = new mitk::XnatSessionTracker(mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext());
 
   m_ContextMenu = new QMenu(m_Controls.treeView);
 
   connect(m_Controls.treeView, SIGNAL(clicked(const QModelIndex&)), SLOT(ItemSelected(const QModelIndex&)));
   connect(m_Controls.treeView, SIGNAL(customContextMenuRequested(const QPoint&)),
           this, SLOT(OnContextMenuRequested(const QPoint&)));
   connect(m_Tracker, SIGNAL(AboutToBeClosed(ctkXnatSession*)), this, SLOT(CleanTreeModel(ctkXnatSession*)));
   connect(m_Tracker, SIGNAL(Opened(ctkXnatSession*)), this, SLOT(UpdateSession(ctkXnatSession*)));
 
   m_Tracker->Open();
 
   connect(m_Controls.treeView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnActivatedNode(const QModelIndex&)));
   connect(m_Controls.treeView, SIGNAL(clicked(const QModelIndex&)), this, SLOT(OnXnatNodeSelected(const QModelIndex&)));
   connect(m_TreeModel, SIGNAL(ResourceDropped(const QList<mitk::DataNode*>&, ctkXnatObject*, const QModelIndex&)), this, SLOT(OnUploadResource(const QList<mitk::DataNode*>&, ctkXnatObject*, const QModelIndex&)));
 
   connect(m_Controls.btnXnatConnect, SIGNAL(clicked()), SLOT(ToggleConnection()));
   connect(m_Controls.btnXnatUpload, SIGNAL(clicked()), this, SLOT(OnUploadFromDataStorage()));
   connect(m_Controls.btnXnatDownload, SIGNAL(clicked()), this, SLOT(OnDownloadSelectedXnatFile()));
   connect(m_Controls.btnCreateXnatFolder, SIGNAL(clicked()), this, SLOT(OnCreateResourceFolder()));
   connect(m_Controls.searchField, SIGNAL(textChanged(const QString&)), this, SLOT(Search(const QString&)));
 }
 
 void QmitkXnatTreeBrowserView::OnCreateResourceFolder()
 {
   QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
 
   if(!index.isValid()) return;
 
   ctkXnatObject* parent = index.data(Qt::UserRole).value<ctkXnatObject*>();
 
   this->InternalAddResourceFolder(parent);
 
   OnContextMenuRefreshItem();
 }
 
 
 void QmitkXnatTreeBrowserView::Search(const QString &toSearch)
 {
   if(m_AlreadyInSearch)
     return;
 
   m_AlreadyInSearch = true;
 
   m_Controls.treeView->collapseAll();
   m_Controls.treeView->expandToDepth(m_Controls.searchModeBox->currentIndex());
 
   m_Controls.treeView->clearSelection();
 
   foreach (const QModelIndex &hidden, m_hiddenItems)
   {
     m_Controls.treeView->setRowHidden(hidden.row(),hidden.parent(),false);
   }
   m_hiddenItems.clear();
 
   if(toSearch.isEmpty())
   {
     m_Controls.treeView->collapseAll();
     m_Controls.treeView->expandToDepth(0);
     m_AlreadyInSearch = false;
     return;
   }
 
   QModelIndexList items = m_Controls.treeView->model()->match(
         m_Controls.treeView->model()->index(0,0),
         Qt::DisplayRole,
         QVariant::fromValue(toSearch),
         -1,
         Qt::MatchContains|Qt::MatchRecursive);
 
   if(!items.isEmpty())
   {
     foreach (const QModelIndex &match, items)
     {
       int depth = 0;
       QModelIndex tparent = match;
       while ( tparent.parent().isValid() )
       {
         tparent = tparent.parent();
         depth++;
       }
 
       switch (depth)
       {
       case 1: //Project Level
         if(m_Controls.searchModeBox->currentIndex() == ProjectLevel)
         {
           m_hiddenItems.append(match);
           m_Controls.treeView->setRowHidden(match.row(),match.parent(),true);
         }
         break;
       case 2: //Patient level
         if(m_Controls.searchModeBox->currentIndex() == SubjectLevel)
         {
           m_hiddenItems.append(match);
           m_Controls.treeView->setRowHidden(match.row(),match.parent(),true);
         }
         break;
       default:
         break;
       }
     }
 
   }
   m_AlreadyInSearch = false;
 }
 
 void QmitkXnatTreeBrowserView::OnDownloadSelectedXnatFile()
 {
   QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
 
   if(!index.isValid()) return;
 
   ctkXnatObject* selectedXnatObject = index.data(Qt::UserRole).value<ctkXnatObject*>();
   bool enableDownload = dynamic_cast<ctkXnatFile*>(selectedXnatObject) != nullptr;
   enableDownload |= dynamic_cast<ctkXnatScan*>(selectedXnatObject) != nullptr;
 
   if (enableDownload)
   {
     this->InternalFileDownload(index, true);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnUploadFromDataStorage()
 {
   QmitkXnatUploadFromDataStorageDialog dialog;
   dialog.SetDataStorage(this->GetDataStorage());
   int result = dialog.exec();
   if (result == QDialog::Accepted)
   {
     QList<mitk::DataNode*> nodes;
     nodes << dialog.GetSelectedNode().GetPointer();
     QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
 
     if (!index.isValid()) return;
     ctkXnatObject* parent = m_TreeModel->xnatObject(index);
     this->OnUploadResource(nodes, parent, index);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnXnatNodeSelected(const QModelIndex& index)
 {
   if (!index.isValid()) return;
 
   ctkXnatObject* selectedXnatObject = index.data(Qt::UserRole).value<ctkXnatObject*>();
 
   // enable download button
   bool enableDownload = dynamic_cast<ctkXnatFile*>(selectedXnatObject) != nullptr;
   enableDownload |= dynamic_cast<ctkXnatScan*>(selectedXnatObject) != nullptr;
   m_Controls.btnXnatDownload->setEnabled(enableDownload);
 
   // enable folder creation
   bool enableCreateFolder = dynamic_cast<ctkXnatProject*>(selectedXnatObject) != nullptr;
   enableCreateFolder |= dynamic_cast<ctkXnatSubject*>(selectedXnatObject) != nullptr;
   enableCreateFolder |= dynamic_cast<ctkXnatExperiment*>(selectedXnatObject) != nullptr;
   enableCreateFolder |= dynamic_cast<ctkXnatResourceFolder*>(selectedXnatObject) != nullptr;
   m_Controls.btnCreateXnatFolder->setEnabled(enableCreateFolder);
 
   // enable upload
   bool enableUpload = dynamic_cast<ctkXnatResource*>(selectedXnatObject) != nullptr;
   m_Controls.btnXnatUpload->setEnabled(enableUpload);
 }
 
 void QmitkXnatTreeBrowserView::OnActivatedNode(const QModelIndex& index)
 {
   if (!index.isValid()) return;
 
   ctkXnatObject* selectedXnatObject = index.data(Qt::UserRole).value<ctkXnatObject*>();
   bool enableDownload = dynamic_cast<ctkXnatFile*>(selectedXnatObject) != nullptr;
   enableDownload |= dynamic_cast<ctkXnatScan*>(selectedXnatObject) != nullptr;
 
   if (enableDownload)
   {
     if(!m_SilentMode)
     {
       QMessageBox msgBox;
       QString fname = selectedXnatObject->name() != "" ? selectedXnatObject->name() :
                                                          index.data(Qt::DisplayRole).toString();
       QString msg ("Do you want to download "+ fname +"?");
       msgBox.setWindowTitle("MITK XNAT download");
       msgBox.setText(msg);
       msgBox.setIcon(QMessageBox::Question);
       msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
       int result = msgBox.exec();
       if (result == QMessageBox::Ok)
       {
         InternalFileDownload(index, true);
       }
     }
     else
     {
       InternalFileDownload(index, true);
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::UpdateSession(ctkXnatSession* session)
 {
   if (session != nullptr && session->isOpen())
   {
     // Fill model and show in the GUI
     m_TreeModel->addDataModel(session->dataModel());
     m_Controls.treeView->reset();
 
     connect(session, SIGNAL(progress(QUuid,double)), this, SLOT(OnProgress(QUuid,double)));
     connect(session, SIGNAL(timedOut()), this, SLOT(SessionTimedOutMsg()));
     connect(session, SIGNAL(aboutToTimeOut()), this, SLOT(SessionTimesOutSoonMsg()));
   }
 }
 
 void QmitkXnatTreeBrowserView::CleanTreeModel(ctkXnatSession* session)
 {
   if (session != nullptr)
   {
     m_TreeModel->removeDataModel(session->dataModel());
     m_Controls.treeView->reset();
   }
 }
 
 void QmitkXnatTreeBrowserView::OnProgress(QUuid /*queryID*/, double progress)
 {
   if (progress > 0)
   {
     unsigned int currentProgress = progress*100;
     if (m_Controls.groupBox->isHidden())
     {
       m_Controls.groupBox->show();
       m_Controls.progressBar->setValue(0);
     }
     m_Controls.progressBar->setValue(currentProgress);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnPreferencesChanged(const mitk::IPreferences* prefs)
 {
   QString downloadPath = QString::fromStdString(prefs->Get("Download Path", ""));
   QDir downloadDir (downloadPath);
   if (downloadPath.length() != 0 && downloadDir.exists())
     m_DownloadPath = downloadPath;
 
   m_SilentMode = prefs->GetBool("Silent Mode", false);
 }
 
 void QmitkXnatTreeBrowserView::InternalFileDownload(const QModelIndex& index, bool loadData)
 {
   if (!index.isValid())
     return;
 
   QDir rootDownloadDir(m_DownloadPath);
   if(isDirWriteable(rootDownloadDir) == false)
   {
-    MITK_INFO << "Download directory access permission unsufficient! " << m_DownloadPath;
-    QMessageBox::critical(nullptr,"Download directory access permission unsufficient!",
+    MITK_INFO << "Download directory access permission insufficient! " << m_DownloadPath;
+    QMessageBox::critical(nullptr,"Download directory access permission insufficient!",
                           "You have no permission to write to selected download directory " + m_DownloadPath +"!\n\nChange Download Path in Settings!");
     QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
     _PreferencesDialog.SetSelectedPage("org.mitk.gui.qt.application.XnatConnectionPreferencePage");
     _PreferencesDialog.exec();
     return;
   }
 
   ctkXnatObject* xnatObject = m_TreeModel->xnatObject(index);
   if (xnatObject != nullptr)
   {
     m_Controls.progressBar->setMinimum(0);
     m_Controls.progressBar->setMaximum(100);
     // The path to the downloaded file
     QString filePath;
     QDir downloadPath (m_DownloadPath);
     auto serverURL = QString::fromStdString(mitk::CoreServices::GetPreferencesService()->GetSystemPreferences()->Node(VIEW_ID.toStdString())->Get("Server Address", ""));
     bool isDICOM (false);
     bool filePathExists (true);
 
     // If a scan was selected, downloading the contained DICOM folder as ZIP
     ctkXnatScan* scan = dynamic_cast<ctkXnatScan*>(xnatObject);
 
     if (scan != nullptr)
     {
       isDICOM = true;
 
       if (!scan->isFetched())
         scan->fetch();
 
       QList<ctkXnatObject*> children = scan->children();
 
       foreach (ctkXnatObject* obj, children)
       {
         if (obj->name() == "DICOM")
         {
           QString uriId = obj->resourceUri();
           uriId.replace("/data/archive/projects/", "");
           QString folderName = m_DownloadPath + uriId + "/";
           downloadPath = folderName;
           filePathExists = doesDirExist(downloadPath);
 
           if(filePathExists)
           {
             try
             {
               this->InternalDICOMDownload(obj, downloadPath);
             }
             catch(const ctkRuntimeException& exc)
             {
               QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
               return;
             }
             serverURL = obj->resourceUri();
           }
           else
           {
             FilePathNotAvailableWarning("DICOM folder");
             return;
           }
         }
       }
     }
     else
     {
       ctkXnatFile* file = dynamic_cast<ctkXnatFile*>(xnatObject);
 
       if (file == nullptr)
       {
         MITK_ERROR << "Selected XNAT object not downloadable!";
         return;
       }
 
       QString uriId = file->parent()->resourceUri();
       uriId.replace("/data/archive/projects/", "");
 
       QString folderName = m_DownloadPath + uriId + "/";
       downloadPath = folderName;
 
       filePathExists = doesDirExist(downloadPath);
       filePath = folderName + file->name();
 
       // Checking if the file exists already
       if (downloadPath.exists(file->name()))
       {
         MITK_INFO << "File '" << file->name().toStdString() << "' already exists!";
         serverURL = file->parent()->resourceUri();
       }
       else
       {
         if (file->property("collection") == QString("DICOM"))
         {
           isDICOM = true;
           ctkXnatObject* parent = file->parent();
 
           QString uriId = parent->resourceUri();
           uriId.replace("/data/archive/projects/", "");
           QString folderName = m_DownloadPath + uriId + "/";
           downloadPath = folderName;
           filePathExists = doesDirExist(downloadPath);
 
           if(filePathExists)
           {
             try
             {
               this->InternalDICOMDownload(parent, downloadPath);
             }
             catch(const ctkRuntimeException& exc)
             {
               QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
               return;
             }
           }
           else
           {
             FilePathNotAvailableWarning(parent->name());
             return;
           }
 
           serverURL = parent->resourceUri();
         }
         //Normal file download, no DICOM download
         else
         {
           if(filePathExists)
           {
             this->SetStatusInformation("Downloading file " + file->name());
             file->download(filePath);
           }
           else
           {
             MITK_INFO << "File Download Failed.";
           }
           serverURL = file->parent()->resourceUri();
 
           // Checking if the file exists now
           if (downloadPath.exists(file->name()))
           {
             MITK_INFO << "Download of " << file->name().toStdString() << " completed!";
             if(!m_SilentMode)
             {
               QMessageBox msgBox;
               msgBox.setText("Download of " + file->name() + " completed!");
               msgBox.setIcon(QMessageBox::Information);
               msgBox.exec();
             }
             m_Controls.groupBox->hide();
           }
           else
           {
             if(filePathExists)
             {
               MITK_INFO << "Download of " << file->name().toStdString() << " failed!";
               QMessageBox::critical(m_Controls.treeView, "Download failed!", "Download of " + file->name() + " failed!");
               m_Controls.groupBox->hide();
               return;
             }
             else
             {
               FilePathNotAvailableWarning(file->name());
               return;
             }
           }
         }
       }
     }
     if (loadData)
     {
       QFileInfoList fileList;
       if (isDICOM)
       {
         fileList = downloadPath.entryInfoList(QDir::Files);
       }
       else
       {
         QFileInfo fileInfo(filePath);
         fileList << fileInfo;
       }
 
       mitk::StringProperty::Pointer xnatURL = mitk::StringProperty::New(serverURL.toStdString());
       try
       {
         this->InternalOpenFiles(fileList, xnatURL);
       }
       catch(const ctkRuntimeException& exc)
       {
         QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
         return;
       }
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::InternalDICOMDownload(ctkXnatObject *obj, QDir &DICOMDirPath)
 {
 
   QString filePath = m_DownloadPath + obj->property("label") + ".zip";
 
   this->SetStatusInformation("Downloading DICOM series " + obj->parent()->name());
   // In case of DICOM zip download we do not know the total file size
-  // Because of that the dowload progres cannot be calculated
+  // Because of that the download progress cannot be calculated
   // Because of that we use the busy indicator of the progress bar by setting min and max to 0
   m_Controls.progressBar->setMinimum(0);
   m_Controls.progressBar->setMaximum(0);
   m_Controls.progressBar->show();
   obj->download(filePath);
 
   std::ifstream in(filePath.toStdString().c_str(), std::ios::binary);
   poco_assert(in);
 
   // decompress to XNAT_DOWNLOAD dir
   Poco::Zip::Decompress dec(in, Poco::Path(DICOMDirPath.path().toStdString()), true);
   dec.decompressAllFiles();
 
   in.close();
   QFile::remove(filePath);
 
   // Checking if the file exists now
   if (DICOMDirPath.exists())
   {
     if(!m_SilentMode)
     {
       MITK_INFO << "Download of DICOM series completed!";
       QMessageBox msgBox;
       msgBox.setText("Download of DICOM series completed!");
       msgBox.setIcon(QMessageBox::Information);
       msgBox.exec();
       m_Controls.groupBox->hide();
     }
   }
   else
   {
     MITK_INFO << "Download of DICOM series failed!";
     QMessageBox msgBox;
     msgBox.setText("Download of DICOM series failed!");
     msgBox.setIcon(QMessageBox::Critical);
     msgBox.exec();
     m_Controls.groupBox->hide();
   }
 }
 
 void QmitkXnatTreeBrowserView::InternalOpenFiles(const QFileInfoList & fileList, mitk::StringProperty::Pointer xnatURL)
 {
 
   if (fileList.isEmpty())
   {
     MITK_WARN << "No files available for loading!";
     return;
   }
 
   mitk::IDataStorageService* dsService = m_DataStorageServiceTracker.getService();
   mitk::DataStorage::Pointer dataStorage = dsService->GetDataStorage()->GetDataStorage();
   QStringList list;
   list << fileList.at(0).absoluteFilePath();
   try
   {
     mitk::DataStorage::SetOfObjects::Pointer nodes = QmitkIOUtil::Load(list, *dataStorage);
     if (nodes->size() == 1)
     {
       mitk::DataNode* node = nodes->at(0);
       node->SetProperty("xnat.url", xnatURL);
     }
   }
   catch (const mitk::Exception& e)
   {
     MITK_INFO << e;
     return;
   }
   mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(
         dsService->GetDataStorage()->GetDataStorage());
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuDownloadFile()
 {
   QModelIndex index = m_Controls.treeView->currentIndex();
   InternalFileDownload(index, false);
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuDownloadAndOpenFile()
 {
   QModelIndex index = m_Controls.treeView->currentIndex();
 
   InternalFileDownload(index, true);
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuCreateResourceFolder()
 {
   const QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
   ctkXnatObject* parentObject = m_TreeModel->xnatObject(index);
 
   if (parentObject != nullptr)
   {
     this->InternalAddResourceFolder(parentObject);
   }
 }
 
 ctkXnatResource* QmitkXnatTreeBrowserView::InternalAddResourceFolder(ctkXnatObject *parent)
 {
   bool ok;
   QString folderName = QInputDialog::getText(m_Controls.treeView, tr("Create XNAT resource folder"),
                                              tr("Folder name:"), QLineEdit::Normal, tr("data"), &ok);
   if (ok)
   {
     if (folderName.isEmpty())
       folderName = "NO LABEL";
 
     // if called on the resource-folder level we need to provide he corresponding
     // parent instead of the folder
     ctkXnatResourceFolder* resourceFolder = dynamic_cast<ctkXnatResourceFolder*>(parent);
     if (resourceFolder != nullptr)
     {
       parent = parent->parent();
     }
 
     try
     {
       return parent->addResourceFolder(folderName);
     }
     catch(const ctkRuntimeException& exc)
     {
       QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
       return nullptr;
     }
   }
   else
   {
     return nullptr;
   }
 }
 
 void QmitkXnatTreeBrowserView::InternalFileUpload(ctkXnatFile* file)
 {
   m_Controls.groupBox->setTitle("Uploading file...");
   m_Controls.groupBox->show();
 
   try
   {
     file->save();
     MITK_INFO << "Upload of " << file->name().toStdString() << " completed!";
     if(!m_SilentMode)
     {
       QMessageBox msgBox;
       msgBox.setText("Upload of " + file->name() + " completed!");
       msgBox.setIcon(QMessageBox::Information);
       msgBox.show();
       msgBox.exec();
     }
   }
   catch (ctkXnatException &e)
   {
     QMessageBox msgbox;
     msgbox.setText(e.what());
     msgbox.setIcon(QMessageBox::Critical);
     msgbox.exec();
     m_Controls.progressBar->setValue(0);
   }
   m_Controls.groupBox->hide();
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuUploadFile()
 {
   QString filename = QFileDialog::getOpenFileName(m_Controls.treeView, tr("Open File"), QDir::homePath());
   const QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
   ctkXnatResource* resource = dynamic_cast<ctkXnatResource*>(m_TreeModel->xnatObject(index));
   if (resource != nullptr && filename.length() != 0)
   {
     ctkXnatFile* file = new ctkXnatFile(resource);
     file->setLocalFilePath(filename);
     QFileInfo fileInfo (filename);
     file->setName(fileInfo.fileName());
     try
     {
       this->InternalFileUpload(file);
     }
     catch(const ctkRuntimeException& exc)
     {
       QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
       return;
     }
     m_TreeModel->addChildNode(index, file);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuCopyXNATUrlToClipboard()
 {
   const QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
   ctkXnatObject* currentXnatObject = m_TreeModel->xnatObject(index);
   if (currentXnatObject != nullptr)
   {
     auto serverURL = QString::fromStdString(mitk::CoreServices::GetPreferencesService()->GetSystemPreferences()->Node(VIEW_ID.toStdString())->Get("Server Address", ""));
     serverURL.append(currentXnatObject->resourceUri());
     QClipboard *clipboard = QApplication::clipboard();
     clipboard->setText(serverURL);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuRefreshItem()
 {
   const QModelIndex index = m_Controls.treeView->selectionModel()->currentIndex();
   if (index.isValid())
   {
     this->m_TreeModel->refresh(index);
   }
 }
 
 void QmitkXnatTreeBrowserView::OnUploadResource(const QList<mitk::DataNode*>& droppedNodes, ctkXnatObject* parentObject, const QModelIndex& parentIndex)
 {
   if (parentObject == nullptr)
     return;
 
   //1. If not dropped on a resource, create a new folder
   //temporarily remove the annoying message box that upload was successful..
   ctkXnatResource* resource = dynamic_cast<ctkXnatResource*>(parentObject);
   // store original resource folder object for later use
   ctkXnatResourceFolder* originalResourceFolder = dynamic_cast<ctkXnatResourceFolder*>(parentObject);
   if (resource == nullptr)
   {
     resource = this->InternalAddResourceFolder(parentObject);
   }
 
   if (resource == nullptr)
   {
     MITK_WARN << "Resource folder could not be created!";
     return;
   }
 
   //2. Save files locally
   //3. Upload file
   mitk::DataNode* node = nullptr;
   foreach (node, droppedNodes)
   {
     mitk::BaseData* data = node->GetData();
     if (!data)
       return;
 
     //We have to replace special characters due to XNAT inability to get along with them (" " is replaced by "%20", what leads to nasty behaviour!)
     QString fileName(QString::fromStdString(ReplaceSpecialChars(node->GetName())));
 
     ctkXnatFile* xnatFile = new ctkXnatFile(resource);
 
     if (dynamic_cast<mitk::Image*>(data))
     {
       fileName.append(".nrrd");
     }
     else if (dynamic_cast<mitk::Surface*>(data))
     {
       fileName.append(".vtk");
     }
     else if (dynamic_cast<mitk::PointSet*>(data))
     {
       fileName.append(".mps");
     }
     else
     {
       MITK_WARN << "Could not upload file! File-type not supported";
       QMessageBox msgbox;
       msgbox.setText("Could not upload file! File-type not supported");
       msgbox.setIcon(QMessageBox::Critical);
       msgbox.exec();
       return;
     }
 
     xnatFile->setName(fileName);
 
     QString xnatFolder = "XNAT_UPLOADS";
     QDir dir(mitk::org_mitk_gui_qt_xnatinterface_Activator::GetContext()->getDataFile("").absoluteFilePath());
     dir.mkdir(xnatFolder);
 
     fileName = dir.path().append("/" + fileName);
     mitk::IOUtil::Save (data, fileName.toStdString());
 
     // TODO Check if file exists
     // AbstractFileReader::SetDefaultDataNodeProperties
     // und in die andere SetDefaultDataNodeProperties
     // PropertyName klein: mtime.initial + Kommentar
     mitk::StringProperty::Pointer orignalFilePath = mitk::StringProperty::New();
     node->GetProperty(orignalFilePath, "path");
 
     xnatFile->setLocalFilePath(fileName);
 
     try
     {
       this->InternalFileUpload(xnatFile);
     }
     catch(const ctkRuntimeException& exc)
     {
       QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
       return;
     }
     QFile::remove(fileName);
 
     if (originalResourceFolder == nullptr)
     {
       m_TreeModel->refresh(parentIndex);
     }
     else
     {
       m_TreeModel->refresh(parentIndex.parent());
     }
 
     // The filename for uploading
     //    QFileInfo fileInfo;
     //      if (surface)
     //      {
     //        // Save surface
     //        fileName.append(".stl");
     //        xnatFile->setName(fileName);
     //        dir.setPath(dir.path().append("/" + fileName));
 
     //    QString origFile = QString::fromStdString(orignalFilePath->GetValueAsString());
     //    origFile.append("/" + fileName);
     //        origFile.append(".stl");
 
     //        fileInfo.setFile(origFile);
     //        if (!fileInfo.exists())
     //          mitk::IOUtil::Save(surface, dir.path().toStdString());
     //      }
     //    this->uploadFileToXnat(xnatFile, dir.path());
   }
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuRequested(const QPoint & pos)
 {
   if(m_TreeModel==nullptr)
   {
     return;
   }
 
   QModelIndex index = m_Controls.treeView->indexAt(pos);
 
   if(index.isValid() == false)
   {
     return;
   }
 
   m_ContextMenu->clear();
 
   QAction* actRefreshItem = new QAction("Refresh", m_ContextMenu);
   m_ContextMenu->addAction(actRefreshItem);
   connect(actRefreshItem, SIGNAL(triggered()), this, SLOT(OnContextMenuRefreshItem()));
 
   QAction* actGetXNATURL = new QAction("Copy XNAT URL to clipboard", m_ContextMenu);
   m_ContextMenu->addAction(actGetXNATURL);
   connect(actGetXNATURL, SIGNAL(triggered()), this, SLOT(OnContextMenuCopyXNATUrlToClipboard()));
   m_ContextMenu->addSeparator();
 
   ctkXnatObject* xnatObject = m_TreeModel->xnatObject(index);
 
   bool downloadable = false;
   downloadable |= dynamic_cast<ctkXnatFile*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatScan*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatScanFolder*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatAssessor*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatAssessorFolder*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatResource*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatReconstruction*>(xnatObject)!=nullptr;
   downloadable |= dynamic_cast<ctkXnatReconstructionFolder*>(xnatObject)!=nullptr;
 
   bool canHaveResourceFolder = false;
   canHaveResourceFolder |= dynamic_cast<ctkXnatProject*>(xnatObject) != nullptr;
   canHaveResourceFolder |=  dynamic_cast<ctkXnatSubject*>(xnatObject) != nullptr;
   canHaveResourceFolder |=  dynamic_cast<ctkXnatExperiment*>(xnatObject) != nullptr;
   canHaveResourceFolder |= dynamic_cast<ctkXnatResourceFolder*>(xnatObject) != nullptr;
 
   bool uploadFilePossible = false;
   uploadFilePossible |= dynamic_cast<ctkXnatResource*>(xnatObject) != nullptr;
   uploadFilePossible |=  dynamic_cast<ctkXnatScan*>(xnatObject) != nullptr;
   uploadFilePossible |=  dynamic_cast<ctkXnatAssessor*>(xnatObject) != nullptr;
 
   if (downloadable)
   {
     QAction* actDownload = new QAction("Download", m_ContextMenu);
     connect(actDownload, SIGNAL(triggered()), this, SLOT(OnContextMenuDownloadFile()));
     m_ContextMenu->addAction(actDownload);
     ctkXnatFile* file = dynamic_cast<ctkXnatFile*>(xnatObject);
     if (file)
     {
       QAction* actView = new QAction("Download and Open", m_ContextMenu);
       connect(actView, SIGNAL(triggered()), this, SLOT(OnContextMenuDownloadAndOpenFile()));
       m_ContextMenu->addAction(actView);
     }
   }
 
   if (canHaveResourceFolder)
   {
     QAction* actCreateResource = new QAction("Add resource folder", m_ContextMenu);
     connect(actCreateResource, SIGNAL(triggered()), this, SLOT(OnContextMenuCreateResourceFolder()));
     m_ContextMenu->addAction(actCreateResource);
   }
 
   if (uploadFilePossible)
   {
     QAction* actUploadFile = new QAction("Upload File", m_ContextMenu);
     connect(actUploadFile, SIGNAL(triggered()), this, SLOT(OnContextMenuUploadFile()));
     m_ContextMenu->addAction(actUploadFile);
   }
 
   ctkXnatProject* project = dynamic_cast<ctkXnatProject*>(xnatObject);
   if (project != nullptr)
   {
     QAction* actCreateSubject = new QAction("Create new subject", m_ContextMenu);
     m_ContextMenu->addAction(actCreateSubject);
     connect(actCreateSubject, SIGNAL(triggered()), this, SLOT(OnContextMenuCreateNewSubject()));
   }
   ctkXnatSubject* subject = dynamic_cast<ctkXnatSubject*>(xnatObject);
   if (subject != nullptr)
   {
     QAction* actCreateExperiment = new QAction("Create new experiment", m_ContextMenu);
     m_ContextMenu->addAction(actCreateExperiment);
     connect(actCreateExperiment, SIGNAL(triggered()), this, SLOT(OnContextMenuCreateNewExperiment()));
   }
 
 
   m_ContextMenu->popup(QCursor::pos());
 
 }
 
 void QmitkXnatTreeBrowserView::CleanUp()
 {
   m_Controls.wgtExperimentInfo->hide();
   m_Controls.wgtSubjectInfo->hide();
   m_Controls.wgtProjectInfo->hide();
   m_Controls.btnCreateXnatFolder->setEnabled(false);
   m_Controls.btnXnatDownload->setEnabled(false);
   m_Controls.btnXnatUpload->setEnabled(false);
   m_Controls.searchField->setEnabled(false);
   m_Controls.searchField->setText("");
   m_Controls.searchModeBox->setEnabled(false);
 }
 
 std::string QmitkXnatTreeBrowserView::ReplaceSpecialChars(const std::string& input) const
 {
   QString convertedString = QString(QUrl::toPercentEncoding(QString::fromStdString(input)));
   return  convertedString.toStdString();
 }
 
 void QmitkXnatTreeBrowserView::ItemSelected(const QModelIndex& index)
 {
   //TODO: CTK seems to ignore spaces while creating the http request. This will lead to corrupted http request that will fail.
   QVariant variant = m_TreeModel->data(index, Qt::UserRole);
   if (variant.isValid())
   {
     ctkXnatSession *session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
           mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
 
     ctkXnatObject* object = variant.value<ctkXnatObject*>();
     ctkXnatProject* project = dynamic_cast<ctkXnatProject*>(object);
     ctkXnatSubject* subject = dynamic_cast<ctkXnatSubject*>(object);
     ctkXnatExperiment* experiment = dynamic_cast<ctkXnatExperiment*>(object);
 
     if (project != nullptr)
     {
       m_Controls.wgtExperimentInfo->hide();
       m_Controls.wgtSubjectInfo->hide();
 
       m_Controls.wgtProjectInfo->SetProject(project);
       m_Controls.wgtProjectInfo->show();
     }
     else if (subject != nullptr)
     {
       QMap<QString, QString> paramMap;
       paramMap.insert("columns", "dob,gender,handedness,weight,height");
       QUuid requestID = session->httpGet(QString("%1/subjects").arg(subject->parent()->resourceUri()), paramMap);
       QList<QVariantMap> results = session->httpSync(requestID);
 
       foreach(const QVariantMap& propertyMap, results)
       {
         QMapIterator<QString, QVariant> it(propertyMap);
         bool isConcretSubject = false;
 
         if (it.hasNext())
         {
           it.next();
 
           QVariant var = it.value();
 
           // After CTK Change (subjectID = name) to (subjectID = ID)
           // CHANGE TO: if (var == subject->property("ID"))
           if (var == subject->property("URI").right(11))
           {
             isConcretSubject = true;
           }
           else
           {
             isConcretSubject = false;
           }
           it.toFront();
         }
 
         while (it.hasNext() && isConcretSubject)
         {
           it.next();
 
           QString  str = it.key().toLatin1().data();
           QVariant var = it.value();
 
           subject->setProperty(str, var);
         }
       }
       m_Controls.wgtExperimentInfo->hide();
       m_Controls.wgtProjectInfo->hide();
 
       m_Controls.wgtSubjectInfo->SetSubject(subject);
       m_Controls.wgtSubjectInfo->show();
     }
     else if (experiment != nullptr)
     {
       QMap<QString, QString> paramMap;
       paramMap.insert("columns", "date,time,scanner,modality");
       QUuid requestID = session->httpGet(QString("%1/experiments").arg(experiment->parent()->resourceUri()), paramMap);
       QList<QVariantMap> results = session->httpSync(requestID);
 
       foreach(const QVariantMap& propertyMap, results)
       {
         QMapIterator<QString, QVariant> it(propertyMap);
         bool isConcretExperiment = false;
 
         if (it.hasNext())
         {
           it.next();
 
           QVariant var = it.value();
 
           if (var == experiment->property("URI"))
           {
             isConcretExperiment = true;
           }
           else
           {
             isConcretExperiment = false;
           }
           it.toFront();
         }
 
         while (it.hasNext() && isConcretExperiment)
         {
           it.next();
 
           QString  str = it.key().toLatin1().data();
           QVariant var = it.value();
 
           experiment->setProperty(str, var);
         }
       }
 
       m_Controls.wgtSubjectInfo->hide();
       m_Controls.wgtProjectInfo->hide();
 
       m_Controls.wgtExperimentInfo->SetExperiment(experiment);
       m_Controls.wgtExperimentInfo->show();
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuCreateNewSubject()
 {
   QModelIndex index = m_Controls.treeView->currentIndex();
   QVariant variant = m_TreeModel->data(index, Qt::UserRole);
   if (variant.isValid())
   {
     QmitkXnatCreateObjectDialog* dialog = new QmitkXnatCreateObjectDialog(QmitkXnatCreateObjectDialog::SpecificType::SUBJECT);
     if (dialog->exec() == QDialog::Accepted)
     {
       ctkXnatProject* project = dynamic_cast<ctkXnatProject*>(variant.value<ctkXnatObject*>());
       ctkXnatSubject* subject = dynamic_cast<ctkXnatSubject*>(dialog->GetXnatObject());
       subject->setParent(project);
       try
       {
         subject->save();
       }
       catch(const ctkRuntimeException& exc)
       {
         //TODO: Implement isValid-flag to check if ctkRuntimeExceptio is valid http-exception.
         QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
         project->remove(subject);
         delete subject;
         return;
       }
 
       // Get xnat session from micro service
       ctkXnatSession* session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
             mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
 
       // Update View
       m_TreeModel->removeDataModel(session->dataModel());
 
       UpdateSession(session);
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::OnContextMenuCreateNewExperiment()
 {
   QModelIndex index = m_Controls.treeView->currentIndex();
   QVariant variant = m_TreeModel->data(index, Qt::UserRole);
   if (variant.isValid())
   {
     QmitkXnatCreateObjectDialog* dialog = new QmitkXnatCreateObjectDialog(QmitkXnatCreateObjectDialog::SpecificType::EXPERIMENT);
     if (dialog->exec() == QDialog::Accepted)
     {
       ctkXnatSubject* subject = dynamic_cast<ctkXnatSubject*>(variant.value<ctkXnatObject*>());
       ctkXnatExperiment* experiment = dynamic_cast<ctkXnatExperiment*>(dialog->GetXnatObject());
       experiment->setParent(subject);
       experiment->setProperty("xsiType", experiment->imageModality());
 
       try
       {
         experiment->save();
       }
       catch(const ctkRuntimeException& exc)
       {
         QmitkHttpStatusCodeHandler::HandleErrorMessage(exc.what());
         subject->remove(experiment);
         delete experiment;
         return;
       }
 
       // Get xnat session from micro service
       ctkXnatSession* session = mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetService(
             mitk::org_mitk_gui_qt_xnatinterface_Activator::GetXnatModuleContext()->GetServiceReference<ctkXnatSession>());
 
       // Update View
       m_TreeModel->removeDataModel(session->dataModel());
       UpdateSession(session);
     }
   }
 }
 
 void QmitkXnatTreeBrowserView::SetStatusInformation(const QString& text)
 {
   m_Controls.groupBox->setTitle(text);
   m_Controls.progressBar->setValue(0);
   m_Controls.groupBox->show();
 }
 
 void QmitkXnatTreeBrowserView::SessionTimedOutMsg()
 {
   ctkXnatSession* session = qobject_cast<ctkXnatSession*>(QObject::sender());
 
   if (session == nullptr)
     return;
 
   ctkXnatDataModel* dataModel = session->dataModel();
   m_TreeModel->removeDataModel(dataModel);
   m_Controls.treeView->reset();
   session->close();
   QMessageBox::warning(m_Controls.treeView, "Session Timeout", "The session timed out.");
 
   m_Controls.btnXnatConnect->setToolTip("Connect");
   m_Controls.btnXnatConnect->setIcon(QIcon(":/xnat-plugin/xnat-connect.png"));
 
   CleanUp();
 }
 
 void QmitkXnatTreeBrowserView::SessionTimesOutSoonMsg()
 {
   ctkXnatSession* session = qobject_cast<ctkXnatSession*>(QObject::sender());
 
   if (session == nullptr)
     return;
 
   QMessageBox msgBox;
   msgBox.setIcon(QMessageBox::Warning);
   msgBox.setWindowTitle("Session Timeout Soon");
   msgBox.setText("The session will time out in 1 minute.\nDo you want to renew the session?");
   msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
   msgBox.setDefaultButton(QMessageBox::No);
   msgBox.show();
   QTimer* timer = new QTimer(this);
   timer->start(60000);
   this->connect(timer, SIGNAL(timeout()), &msgBox, SLOT(reject()));
   if (msgBox.exec() == QMessageBox::Yes){
     session->renew();
   }
   timer->stop();
 }
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserViewControls.ui b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserViewControls.ui
index f2f67f3aea..86c8ea8747 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserViewControls.ui
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserViewControls.ui
@@ -1,245 +1,245 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>QmitkXnatTreeBrowserViewControls</class>
  <widget class="QWidget" name="QmitkXnatTreeBrowserViewControls">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>455</width>
     <height>332</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">
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
       <widget class="QPushButton" name="btnXnatUpload">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="toolTip">
         <string>Upload to XNAT</string>
        </property>
        <property name="styleSheet">
         <string notr="true"/>
        </property>
        <property name="text">
         <string/>
        </property>
        <property name="icon">
         <iconset resource="../../resources/xnat.qrc">
          <normaloff>:/xnat-plugin/xnat-upload.png</normaloff>:/xnat-plugin/xnat-upload.png</iconset>
        </property>
        <property name="iconSize">
         <size>
          <width>32</width>
          <height>32</height>
         </size>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="btnXnatDownload">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="toolTip">
         <string>Download File</string>
        </property>
        <property name="text">
         <string/>
        </property>
        <property name="icon">
         <iconset resource="../../resources/xnat.qrc">
          <normaloff>:/xnat-plugin/xnat-download.png</normaloff>:/xnat-plugin/xnat-download.png</iconset>
        </property>
        <property name="iconSize">
         <size>
          <width>32</width>
          <height>32</height>
         </size>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="btnCreateXnatFolder">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="toolTip">
         <string>Create Folder</string>
        </property>
        <property name="text">
         <string/>
        </property>
        <property name="icon">
         <iconset resource="../../resources/xnat.qrc">
          <normaloff>:/xnat-plugin/xnat-folder.png</normaloff>:/xnat-plugin/xnat-folder.png</iconset>
        </property>
        <property name="iconSize">
         <size>
          <width>32</width>
          <height>32</height>
         </size>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="btnXnatConnect">
        <property name="enabled">
         <bool>true</bool>
        </property>
        <property name="toolTip">
         <string>Connect</string>
        </property>
        <property name="text">
         <string/>
        </property>
        <property name="icon">
         <iconset resource="../../resources/xnat.qrc">
          <normaloff>:/xnat-plugin/xnat-connect.png</normaloff>:/xnat-plugin/xnat-connect.png</iconset>
        </property>
        <property name="iconSize">
         <size>
          <width>32</width>
          <height>32</height>
         </size>
        </property>
        <property name="checkable">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <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>
     </layout>
    </item>
    <item>
     <layout class="QHBoxLayout" name="searchLayout">
      <item>
       <widget class="QLineEdit" name="searchField">
        <property name="enabled">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QComboBox" name="searchModeBox">
        <property name="enabled">
         <bool>false</bool>
        </property>
        <property name="currentIndex">
         <number>1</number>
        </property>
        <item>
         <property name="text">
          <string>Projects</string>
         </property>
        </item>
        <item>
         <property name="text">
          <string>Patients</string>
         </property>
        </item>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
       <widget class="QTreeView" name="treeView">
        <property name="uniformRowHeights">
         <bool>false</bool>
        </property>
        <property name="sortingEnabled">
         <bool>false</bool>
        </property>
        <property name="animated">
         <bool>false</bool>
        </property>
        <property name="expandsOnDoubleClick">
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Dowloading file ...</string>
+      <string>Downloading file ...</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QProgressBar" name="progressBar">
         <property name="value">
          <number>0</number>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
    <item>
     <layout class="QVBoxLayout" name="infoVerticalLayout">
      <item>
       <widget class="QmitkXnatProjectWidget" name="wgtProjectInfo" native="true"/>
      </item>
      <item>
       <widget class="QmitkXnatExperimentWidget" name="wgtExperimentInfo" native="true"/>
      </item>
      <item>
       <widget class="QmitkXnatSubjectWidget" name="wgtSubjectInfo" native="true"/>
      </item>
     </layout>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
   <customwidget>
    <class>QmitkXnatProjectWidget</class>
    <extends>QWidget</extends>
    <header>QmitkXnatProjectWidget.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkXnatSubjectWidget</class>
    <extends>QWidget</extends>
    <header>QmitkXnatSubjectWidget.h</header>
    <container>1</container>
   </customwidget>
   <customwidget>
    <class>QmitkXnatExperimentWidget</class>
    <extends>QWidget</extends>
    <header>QmitkXnatExperimentWidget.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources>
   <include location="../../resources/xnat.qrc"/>
  </resources>
  <connections/>
 </ui>
diff --git a/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h b/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h
index f2774a3133..d2c6c05575 100644
--- a/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h
+++ b/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.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 mitkPlanarFigureActivator_h
 #define mitkPlanarFigureActivator_h
 
 #include <ctkPluginActivator.h>
 
 
 namespace mitk
 {
 
 /**
  * \ingroup org_mitk_planarfigure_internal
  *
  * \brief The plug-in activator for the planar figure module
  *
- * When the plug-in is started by the framework, it initialzes planar figure specific things.
+ * When the plug-in is started by the framework, it initializes planar figure specific things.
  */
 class PlanarFigureActivator :
   public QObject, public ctkPluginActivator
 {
 
   Q_OBJECT
   Q_PLUGIN_METADATA(IID "org_mitk_planarfigure")
   Q_INTERFACES(ctkPluginActivator)
 
 public:
 
   /**
    * Registers sandbox core object factories.
    */
   void start(ctkPluginContext* context) override;
   void stop(ctkPluginContext* context) override;
 
 };
 
 }
 #endif
diff --git a/SuperBuild.cmake b/SuperBuild.cmake
index 1ab1ad5f59..c02d3fc7b3 100644
--- a/SuperBuild.cmake
+++ b/SuperBuild.cmake
@@ -1,502 +1,502 @@
 #-----------------------------------------------------------------------------
 # Convenient macro allowing to download a file
 #-----------------------------------------------------------------------------
 
 if(NOT MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL)
   set(MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL https://www.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})
+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()
 
 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)
 include(mitkFunctionInstallExternalCMakeProject)
 include(mitkFunctionCleanExternalProject)
 
 option(MITK_AUTOCLEAN_EXTERNAL_PROJECTS "Experimental: Clean external project builds if updated" ON)
 
 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()
 
 # 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_POLICY_DEFAULT_CMP0091:STRING=OLD
   -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_CXX${MITK_CXX_STANDARD}_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})
   set(p_hash "")
 
   set(p_file "${CMAKE_SOURCE_DIR}/CMakeExternals/${p}.cmake")
   if(EXISTS ${p_file})
     file(MD5 ${p_file} p_hash)
   else()
     foreach(MITK_EXTENSION_DIR ${MITK_ABSOLUTE_EXTENSION_DIRS})
       set(MITK_CMAKE_EXTERNALS_EXTENSION_DIR "${MITK_EXTENSION_DIR}/CMakeExternals")
       set(p_file "${MITK_CMAKE_EXTERNALS_EXTENSION_DIR}/${p}.cmake")
       if(EXISTS "${p_file}")
         file(MD5 "${p_file}" p_hash)
         break()
       endif()
     endforeach()
   endif()
 
   if(p_hash)
     set(p_hash_file "${ep_prefix}/tmp/${p}-hash.txt")
     if(MITK_AUTOCLEAN_EXTERNAL_PROJECTS)
       if(EXISTS "${p_hash_file}")
         file(READ "${p_hash_file}" p_prev_hash)
         if(NOT p_hash STREQUAL p_prev_hash)
           mitkCleanExternalProject(${p})
         endif()
       endif()
     endif()
     file(WRITE "${p_hash_file}" ${p_hash})
   endif()
 
   include("${p_file}" OPTIONAL)
 
   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
   )
 
 #-----------------------------------------------------------------------------
 # 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()
 
 if(MITK_USE_OpenCV)
   list(APPEND mitk_optional_cache_args "-DCMAKE_CONFIGURATION_TYPES:STRING=Debug$<SEMICOLON>Release")
 endif()
 
 # 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()
 
 if(MITK_DOXYGEN_BUILD_ALWAYS)
   list(APPEND mitk_optional_cache_args
     -DMITK_DOXYGEN_BUILD_ALWAYS:BOOL=${MITK_DOXYGEN_BUILD_ALWAYS}
   )
 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}
     -DMITK_XVFB_TESTING_COMMAND:STRING=${MITK_XVFB_TESTING_COMMAND}
     -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}
     -DMITK_CUSTOM_REVISION_DESC:STRING=${MITK_CUSTOM_REVISION_DESC}
     # --------------- 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_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
 )