diff --git a/Applications/Tutorial/Step6RegionGrowing1.cpp b/Applications/Tutorial/Step6RegionGrowing1.cpp index 8aeed6b07d..04104e5ac6 100644 --- a/Applications/Tutorial/Step6RegionGrowing1.cpp +++ b/Applications/Tutorial/Step6RegionGrowing1.cpp @@ -1,28 +1,33 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "Step6RegionGrowing.txx" +#include + +#define InstantiateAccessFunction_RegionGrowing(pixelType, dim) \ +template void RegionGrowing(itk::Image*, Step6*); + /// Instantiate the access function for 2D and all datatypes. /// Instantiation for 3D is done in Step6RegionGrowing2. /// Some compilers have memory problems without the explicit /// instantiation, some even need the separation in 2D/3D. -InstantiateAccessFunctionForFixedDimension_1(RegionGrowing, 2, Step6*) +InstantiateAccessFunctionForFixedDimension(RegionGrowing, 2) /** \example Step6RegionGrowing1.cpp */ diff --git a/Applications/Tutorial/Step6RegionGrowing2.cpp b/Applications/Tutorial/Step6RegionGrowing2.cpp index b6f2ef0c69..5a2333b575 100644 --- a/Applications/Tutorial/Step6RegionGrowing2.cpp +++ b/Applications/Tutorial/Step6RegionGrowing2.cpp @@ -1,28 +1,33 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "Step6RegionGrowing.txx" +#include + +#define InstantiateAccessFunction_RegionGrowing(pixelType, dim) \ +template void RegionGrowing(itk::Image*, Step6*); + /// Instantiate the access function for 3D and all datatypes. /// Instantiation for 2D is done in Step6RegionGrowing1. /// Some compilers have memory problems without the explicit /// instantiation, some even need the separation in 2D/3D. -InstantiateAccessFunctionForFixedDimension_1(RegionGrowing, 3, Step6*) +InstantiateAccessFunctionForFixedDimension(RegionGrowing, 3) /** \example Step6RegionGrowing2.cpp */ diff --git a/Applications/Tutorial/mitkWithITKAndVTK.cpp b/Applications/Tutorial/mitkWithITKAndVTK.cpp index a60ecefcd2..90767280d6 100644 --- a/Applications/Tutorial/mitkWithITKAndVTK.cpp +++ b/Applications/Tutorial/mitkWithITKAndVTK.cpp @@ -1,66 +1,67 @@ #include #include #include #include #include +#include #include #include #include /// /// Small application for demonstrating the interaction between MITK, /// ITK and VTK (not necessarily useful). /// int main( int /*argc*/, char ** argv ) { // MITK: Read a .pic.gz file, e.g. Core/Code/Testing/Data/Pic3D.pic.gz from // disk mitk::PicFileReader::Pointer reader = mitk::PicFileReader::New(); const char * filename = argv[1]; try { reader->SetFileName(filename); reader->Update(); } catch(...) { fprintf( stderr, "Could not open file %s \n\n", filename ); return EXIT_FAILURE; } mitk::Image::Pointer mitkImage = reader->GetOutput(); // ITK: Image smoothing // Create ITK image, cast from MITK image typedef itk::Image< short , 3 > ImageType; ImageType::Pointer itkImage = ImageType::New(); mitk::CastToItkImage( mitkImage, itkImage ); typedef itk::DiscreteGaussianImageFilter FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput( itkImage ); filter->SetVariance( 2 ); filter->SetMaximumKernelWidth( 5 ); filter->Update(); // run filter // reimport filtered image data mitk::CastToMitkImage( filter->GetOutput(), mitkImage ); // VTK: Show result in renderwindow vtkImageViewer *viewer=vtkImageViewer::New(); vtkRenderWindowInteractor* renderWindowInteractor =vtkRenderWindowInteractor ::New(); viewer->SetupInteractor(renderWindowInteractor); viewer->SetInput(mitkImage->GetVtkImageData()); viewer->Render(); viewer->SetColorWindow(255); viewer->SetColorLevel(128); renderWindowInteractor->Start(); renderWindowInteractor->Delete(); viewer->Delete(); return EXIT_SUCCESS; } diff --git a/CMake/mitkMacroMultiplexPicType.cmake b/CMake/mitkMacroMultiplexPicType.cmake index ba19ae9de6..9d192fbc78 100644 --- a/CMake/mitkMacroMultiplexPicType.cmake +++ b/CMake/mitkMacroMultiplexPicType.cmake @@ -1,20 +1,20 @@ # # MITK_MULTIPLEX_PICTYPE: generate separated source files for different # data types to reduce memory consumption of compiler during template # instantiation # # Param "file" should be named like mitkMyAlgo-TYPE.cpp # in the file, every occurence of @TYPE@ is replaced by the # datatype. For each datatype, a new file mitkMyAlgo-datatype.cpp # is generated and added to CPP_FILES_GENERATED. # MACRO(MITK_MULTIPLEX_PICTYPE file) - SET(TYPES "double;float;int;unsigned int;short;unsigned short;char;unsigned char") + STRING(REPLACE "," ";" TYPES "${MITK_ACCESSBYITK_PIXEL_TYPES}") FOREACH(TYPE ${TYPES}) # create filename for destination STRING(REPLACE " " "_" quoted_type "${TYPE}") STRING(REPLACE TYPE ${quoted_type} quoted_file ${file}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR}/${quoted_file} @ONLY) SET(CPP_FILES_GENERATED ${CPP_FILES_GENERATED} ${CMAKE_CURRENT_BINARY_DIR}/${quoted_file}) ENDFOREACH(TYPE) ENDMACRO(MITK_MULTIPLEX_PICTYPE) diff --git a/CMake/mitkSetupVariables.cmake b/CMake/mitkSetupVariables.cmake index adc3f0bf39..9981436fad 100644 --- a/CMake/mitkSetupVariables.cmake +++ b/CMake/mitkSetupVariables.cmake @@ -1,104 +1,142 @@ if(MITK_BUILD_ALL_PLUGINS) set(MITK_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL") endif() set(LIBPOSTFIX "") # MITK_VERSION set(MITK_VERSION_MAJOR "0") set(MITK_VERSION_MINOR "15") set(MITK_VERSION_PATCH "1") set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}") if(NOT UNIX AND NOT MINGW) set(MITK_WIN32_FORCE_STATIC "STATIC" CACHE INTERNAL "Use this variable to always build static libraries on non-unix platforms") endif() # build the MITK_INCLUDE_DIRS variable set(MITK_INCLUDE_DIRS ${PROJECT_BINARY_DIR}) set(CORE_DIRECTORIES DataManagement Algorithms IO Rendering Interactions Controllers) foreach(d ${CORE_DIRECTORIES}) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/Core/Code/${d}) endforeach() #list(APPEND MITK_INCLUDE_DIRS #${ITK_INCLUDE_DIRS} #${VTK_INCLUDE_DIRS} # ) foreach(d Utilities Utilities/ipPic Utilities/IIL4MITK Utilities/pic2vtk Utilities/tinyxml Utilities/mbilog) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) endforeach() if(WIN32) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipPic/win32) endif() # additional include dirs variables set(ANN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ann/include) set(IPSEGMENTATION_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipSegmentation) # variables containing librariy names set(MITK_CORE_LIBRARIES mitkCore) set(VTK_FOR_MITK_LIBRARIES vtkGraphics vtkCommon vtkFiltering vtkftgl vtkGraphics vtkHybrid vtkImaging vtkIO vtkParallel vtkRendering vtkVolumeRendering vtkWidgets ${VTK_JPEG_LIBRARIES} ${VTK_PNG_LIBRARIES} ${VTK_ZLIB_LIBRARIES} ${VTK_EXPAT_LIBRARIES} ${VTK_FREETYPE_LIBRARIES} ) # TODO: maybe solve this with lib depends mechanism of CMake set(UTIL_FOR_MITK_LIBRARIES mitkIpPic mitkIpFunc mbilog) set(LIBRARIES_FOR_MITK_CORE ${UTIL_FOR_MITK_LIBRARIES} ${VTK_FOR_MITK_LIBRARIES} ${ITK_LIBRARIES} ) set(MITK_LIBRARIES ${MITK_CORE_LIBRARIES} ${LIBRARIES_FOR_MITK_CORE} pic2vtk IIL4MITK ipSegmentation ann ) # variables containing link directories set(MITK_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) set(MITK_LINK_DIRECTORIES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${ITK_LIBRARY_DIRS} ${VTK_LIBRARY_DIRS}) # Qt support if(MITK_USE_QT) find_package(Qt4 REQUIRED) set(QMITK_INCLUDE_DIRS ${MITK_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk ${PROJECT_BINARY_DIR}/CoreUI/Qmitk ) foreach(d QmitkApplicationBase QmitkModels QmitkPropertyObservers) list(APPEND QMITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk/${d}) endforeach() list(APPEND QMITK_INCLUDE_DIRS ${QWT_INCLUDE_DIR}) set(QMITK_LIBRARIES Qmitk ${MITK_LIBRARIES} ${QT_LIBRARIES}) set(QMITK_LINK_DIRECTORIES ${MITK_LINK_DIRECTORIES} ${QT_LIBRARY_DIR}) endif() if(MITK_BUILD_ALL_PLUGINS) set(MITK_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL") endif() +# create a list of types for template instantiations of itk image access functions +function(_create_type_seq TYPES seq_var seqdim_var) + set(_seq ) + set(_seq_dim ) + string(REPLACE "," ";" _pixeltypes "${TYPES}") + foreach(_pixeltype ${_pixeltypes}) + set(_seq "${_seq}(${_pixeltype})") + set(_seq_dim "${_seq_dim}((${_pixeltype},dim))") + endforeach() + set(${seq_var} "${_seq}" PARENT_SCOPE) + set(${seqdim_var} "${_seq_dim}" PARENT_SCOPE) +endfunction() + +set(MITK_ACCESSBYITK_PIXEL_TYPES ) +set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ ) +set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ ) +foreach(_type INTEGRAL FLOATING COMPOSITE) + set(_typelist "${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES}") + if(_typelist) + if(MITK_ACCESSBYITK_PIXEL_TYPES) + set(MITK_ACCESSBYITK_PIXEL_TYPES "${MITK_ACCESSBYITK_PIXEL_TYPES},${_typelist}") + else() + set(MITK_ACCESSBYITK_PIXEL_TYPES "${_typelist}") + endif() + endif() + + _create_type_seq("${_typelist}" + MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ + MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ) + set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ "${MITK_ACCESSBYITK_PIXEL_TYPES_SEQ}${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ}") + set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ "${MITK_ACCESSBYITK_TYPES_DIMN_SEQ}${MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ}") +endforeach() + +set(MITK_ACCESSBYITK_DIMENSIONS_SEQ ) +string(REPLACE "," ";" _dimensions "${MITK_ACCESSBYITK_DIMENSIONS}") +foreach(_dimension ${_dimensions}) + set(MITK_ACCESSBYITK_DIMENSIONS_SEQ "${MITK_ACCESSBYITK_DIMENSIONS_SEQ}(${_dimension})") +endforeach() diff --git a/CMakeLists.txt b/CMakeLists.txt index 4848b9f747..17892f3fc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,606 +1,646 @@ cmake_minimum_required(VERSION 2.8.2) #----------------------------------------------------------------------------- # 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) endif() #----------------------------------------------------------------------------- # See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details #----------------------------------------------------------------------------- set(project_policies CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used. CMP0002 # NEW: Logical target names must be globally unique. CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths. CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace. CMP0005 # NEW: Preprocessor definition values are now escaped automatically. CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION. CMP0007 # NEW: List command no longer ignores empty elements. CMP0008 # NEW: Libraries linked by full-path must have a valid library file name. CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default. CMP0010 # NEW: Bad variable reference syntax is an error. CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP. CMP0012 # NEW: if() recognizes numbers and boolean constants. CMP0013 # NEW: Duplicate binary directories are not allowed. CMP0014 # NEW: Input directories must have CMakeLists.txt ) foreach(policy ${project_policies}) if(POLICY ${policy}) cmake_policy(SET ${policy} NEW) endif() endforeach() #----------------------------------------------------------------------------- # Update CMake module path #------------------------------------------------------------------------------ set(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} ) #----------------------------------------------------------------------------- # CMake Function(s) and Macro(s) #----------------------------------------------------------------------------- include(mitkMacroEmptyExternalProject) include(mitkFunctionGenerateProjectXml) #----------------------------------------------------------------------------- # Output directories. #----------------------------------------------------------------------------- foreach(type LIBRARY RUNTIME ARCHIVE) # Make sure the directory exists if(DEFINED 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_USE_SUPERBUILD) set(output_dir ${MITK_BINARY_DIR}/bin) if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY) set(MITK_CMAKE_${type}_OUTPUT_DIRECTORY ${MITK_BINARY_DIR}/MITK-build/bin) endif() else() if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY) SET(output_dir ${MITK_BINARY_DIR}/bin) else() SET(output_dir ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}) endif() endif() set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.") mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY) endforeach() #----------------------------------------------------------------------------- # Additional MITK Options (also shown during superbuild) #----------------------------------------------------------------------------- option(BUILD_SHARED_LIBS "Build MITK with shared libraries" ON) option(WITH_COVERAGE "Enable/Disable coverage" OFF) option(BUILD_TESTING "Test the project" ON) # some targets in Utilities also depend on Qt. Use this option # to decide if they should be build option(MITK_USE_QT "Use Trolltech's Qt library" ON) if(MITK_USE_QT) # find the package at the very beginning, so that QT4_FOUND is available find_package(Qt4 4.6.0 REQUIRED) endif() option(MITK_INSTALL_RPATH_RELATIVE "Use relative rpath entries for installation packages" OFF) option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF) option(MITK_BUILD_TUTORIAL "Build the MITK tutorial" ON) option(MITK_USE_Boost "Use the Boost C++ library" OFF) option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON) option(MITK_USE_CTK "Use CTK in MITK" ${MITK_USE_BLUEBERRY}) option(MITK_USE_DCMTK "EXEPERIMENTAL, superbuild only: Use DCMTK in MITK" OFF) option(MITK_USE_OpenCV "Use Intel's OpenCV library" OFF) mark_as_advanced(MITK_INSTALL_RPATH_RELATIVE MITK_BUILD_ALL_PLUGINS MITK_USE_CTK MITK_USE_DCMTK ) - + +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 + "" + 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(MITK_USE_BLUEBERRY AND NOT MITK_USE_CTK) MESSAGE(FATAL_ERROR "BlueBerry depends on CTK. Please set MITK_USE_CTK to ON.") endif() +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_DIMENSIONS) + set(MITK_ACCESSBYITK_DIMENSIONS + "2,3" + CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros") +endif() + #----------------------------------------------------------------------------- # Additional CXX/C Flags #----------------------------------------------------------------------------- set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") mark_as_advanced(ADDITIONAL_C_FLAGS) set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") mark_as_advanced(ADDITIONAL_CXX_FLAGS) #----------------------------------------------------------------------------- # Project.xml #----------------------------------------------------------------------------- # A list of topologically ordered targets set(CTEST_PROJECT_SUBPROJECTS) if(MITK_USE_BLUEBERRY) list(APPEND CTEST_PROJECT_SUBPROJECTS BlueBerry) endif() list(APPEND CTEST_PROJECT_SUBPROJECTS MITK-Core MITK-CoreUI MITK-IGT MITK-ToF MITK-DTI MITK-Registration MITK-Modules # all modules not contained in a specific subproject MITK-Plugins # all plugins not contained in a specific subproject ) # Configure CTestConfigSubProject.cmake that could be used by CTest scripts configure_file(${MITK_SOURCE_DIR}/CTestConfigSubProject.cmake.in ${MITK_BINARY_DIR}/CTestConfigSubProject.cmake) if(CTEST_PROJECT_ADDITIONAL_TARGETS) # those targets will be executed at the end of the ctest driver script # and they also get their own subproject label set(subproject_list "${CTEST_PROJECT_SUBPROJECTS};${CTEST_PROJECT_ADDITIONAL_TARGETS}") else() set(subproject_list "${CTEST_PROJECT_SUBPROJECTS}") endif() # Generate Project.xml file expected by the CTest driver script mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} ${PROJECT_NAME} "${subproject_list}" ${MITK_USE_SUPERBUILD}) #----------------------------------------------------------------------------- # Superbuild script #----------------------------------------------------------------------------- if(MITK_USE_SUPERBUILD) include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake") return() endif() #***************************************************************************** #**************************** END OF SUPERBUILD **************************** #***************************************************************************** #----------------------------------------------------------------------------- # CMake Function(s) and Macro(s) #----------------------------------------------------------------------------- include(mitkFunctionCheckCompilerFlags) include(mitkFunctionGetGccVersion) include(MacroParseArguments) include(mitkFunctionSuppressWarnings) # includes several functions include(mitkFunctionOrganizeSources) include(mitkFunctionGetVersion) include(mitkFunctionCreateWindowsBatchScript) include(mitkFunctionInstallProvisioningFiles) include(mitkMacroCreateModuleConf) include(mitkMacroCreateModule) include(mitkMacroCheckModule) include(mitkMacroCreateModuleTests) include(mitkFunctionAddCustomModuleTest) include(mitkMacroUseModule) include(mitkMacroMultiplexPicType) include(mitkMacroInstall) include(mitkMacroInstallHelperApp) include(mitkMacroInstallTargets) include(mitkMacroGenerateToolsLibrary) include(mitkMacroGetLinuxDistribution) #----------------------------------------------------------------------------- # Prerequesites #----------------------------------------------------------------------------- find_package(ITK REQUIRED) find_package(VTK REQUIRED) #----------------------------------------------------------------------------- # Set MITK specific options and variables (NOT available during superbuild) #----------------------------------------------------------------------------- # ASK THE USER TO SHOW THE CONSOLE WINDOW FOR CoreApp and ExtApp option(MITK_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting MITK GUI Applications" ON) mark_as_advanced(MITK_SHOW_CONSOLE_WINDOW) # TODO: check if necessary option(USE_ITKZLIB "Use the ITK zlib for pic compression." ON) mark_as_advanced(USE_ITKZLIB) #----------------------------------------------------------------------------- # Get MITK version info #----------------------------------------------------------------------------- mitkFunctionGetVersion(${MITK_SOURCE_DIR} MITK) #----------------------------------------------------------------------------- # Installation preparation # # These should be set before any MITK install macros are used #----------------------------------------------------------------------------- if(MITK_INSTALL_RPATH_RELATIVE) set(CMAKE_INSTALL_RPATH ".") else() set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/bin") endif() # on Mac OSX all BlueBerry plugins get copied into every # application bundle (.app directory) specified here if(APPLE) if(MITK_BUILD_org.mitk.gui.qt.extapplication) set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} ExtApp) endif() if(MITK_BUILD_org.mitk.gui.qt.application) set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} CoreApp) endif() endif(APPLE) #----------------------------------------------------------------------------- # Set symbol visibility Flags #----------------------------------------------------------------------------- # MinGW does not export all symbols automatically, so no need to set flags if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW) set(VISIBILITY_CXX_FLAGS ) #"-fvisibility=hidden -fvisibility-inlines-hidden") 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} ${ADDITIONAL_C_FLAGS}") set(MITK_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}") if(CMAKE_COMPILER_IS_GNUCXX) set(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2") mitkFunctionCheckCompilerFlags("-fdiagnostics-show-option" cflags) mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" cflags) mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION) # With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so # is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag. # Doing so should allow to build package made for distribution using older linux distro. if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0")) mitkFunctionCheckCompilerFlags("-fstack-protector-all" cflags) endif() if(MINGW) # suppress warnings about auto imported symbols set(MITK_CXX_FLAGS "-Wl,--enable-auto-import ${MITK_CXX_FLAGS}") # we need to define a Windows version set(MITK_CXX_FLAGS "-D_WIN32_WINNT=0x0500 ${MITK_CXX_FLAGS}") endif() set(MITK_C_FLAGS "${cflags} ${MITK_C_FLAGS}") #set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${MITK_CXX_FLAGS}") set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wstrict-null-sentinel ${MITK_CXX_FLAGS}") endif() #----------------------------------------------------------------------------- # MITK Modules #----------------------------------------------------------------------------- set(MITK_MODULES_CONF_DIR ${MITK_BINARY_DIR}/modulesConf CACHE INTERNAL "Modules Conf") set(MITK_MODULES_PACKAGE_DEPENDS_DIR ${MITK_SOURCE_DIR}/CMake/PackageDepends) set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR}) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if(BUILD_TESTING) enable_testing() include(CTest) mark_as_advanced(TCL_TCLSH DART_ROOT) option(MITK_ENABLE_GUI_TESTING OFF "Enable the MITK GUI tests") # Setup file for setting custom ctest vars configure_file( CMake/CTestCustom.cmake.in ${MITK_BINARY_DIR}/CTestCustom.cmake @ONLY ) # Configuration for the CMake-generated test driver set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include ") set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN " try {") set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " } catch( std::exception & excp ) { fprintf(stderr,\"%s\\n\",excp.what()); return EXIT_FAILURE; } catch( ... ) { printf(\"Exception caught in the test driver\\n\"); return EXIT_FAILURE; } ") set(MITK_TEST_OUTPUT_DIR "${MITK_BINARY_DIR}/test_output") if(NOT EXISTS ${MITK_TEST_OUTPUT_DIR}) file(MAKE_DIRECTORY ${MITK_TEST_OUTPUT_DIR}) endif() 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() #----------------------------------------------------------------------------- # Compile Utilities and set-up MITK variables #----------------------------------------------------------------------------- add_subdirectory(Utilities) include(mitkSetupVariables) if(MITK_USE_BLUEBERRY) include(mitkSetupBlueBerry) endif() #----------------------------------------------------------------------------- # Set C/CXX Flags for MITK code #----------------------------------------------------------------------------- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MITK_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MITK_C_FLAGS}") if(MITK_USE_QT) add_definitions(-DQWT_DLL) endif() #----------------------------------------------------------------------------- # Add custom targets representing CDash subprojects #----------------------------------------------------------------------------- foreach(subproject ${CTEST_PROJECT_SUBPROJECTS}) if(NOT TARGET ${subproject}) add_custom_target(${subproject}) endif() endforeach() #----------------------------------------------------------------------------- # Add subdirectories #----------------------------------------------------------------------------- link_directories(${MITK_LINK_DIRECTORIES}) add_subdirectory(Core) if(MITK_USE_QT AND QT4_FOUND) add_subdirectory(CoreUI/Qmitk) endif() add_subdirectory(Modules) if(MITK_USE_BLUEBERRY) set(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Bundles/PluginList.cmake") set(mitk_core_plugins_fullpath ) foreach(core_plugin ${MITK_CORE_PLUGINS}) list(APPEND mitk_core_plugins_fullpath CoreUI/Bundles/${core_plugin}) endforeach() if(BUILD_TESTING) include(berryTestingHelpers) include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/BundleTesting/PluginList.cmake") set(mitk_core_test_plugins_fullpath ) foreach(core_test_plugin ${MITK_CORE_TEST_PLUGINS}) # list(APPEND mitk_core_test_plugins_fullpath CoreUI/BundleTesting/${core_test_plugin}) endforeach() set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp") get_target_property(_is_macosx_bundle CoreApp MACOSX_BUNDLE) if(APPLE AND _is_macosx_bundle) set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp") endif() set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.application") endif() include("${CMAKE_CURRENT_SOURCE_DIR}/Modules/Bundles/PluginList.cmake") set(mitk_ext_plugins_fullpath ) foreach(ext_plugin ${MITK_EXT_PLUGINS}) list(APPEND mitk_ext_plugins_fullpath Modules/Bundles/${ext_plugin}) endforeach() ctkMacroSetupExternalPlugins(${mitk_core_plugins_fullpath} ${mitk_core_test_plugins_fullpath} ${mitk_ext_plugins_fullpath} BUILD_OPTION_PREFIX MITK_BUILD_ BUILD_ALL ${MITK_BUILD_ALL_PLUGINS} COMPACT_OPTIONS) ctkFunctionExtractPluginTargets("${mitk_core_plugins_fullpath}" ON MITK_CORE_ENABLED_PLUGINS) ctkFunctionExtractPluginTargets("${mitk_ext_plugins_fullpath}" ON MITK_EXT_ENABLED_PLUGINS) list(APPEND MITK_EXT_ENABLED_PLUGINS ${MITK_CORE_ENABLED_PLUGINS}) set(MITK_COREAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.provisioning") FunctionCreateProvisioningFile( FILE ${MITK_COREAPP_PROVISIONING_FILE} INCLUDE "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}" PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" PLUGINS ${mitk_core_plugins_fullpath} ) set(MITK_EXTAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtApp.provisioning") FunctionCreateProvisioningFile( FILE ${MITK_EXTAPP_PROVISIONING_FILE} INCLUDE "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}" PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" PLUGINS ${mitk_core_plugins_fullpath} ${mitk_ext_plugins_fullpath} ) set(MITK_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkPluginUseFile.cmake") ctkFunctionGeneratePluginUseFile(${MITK_PLUGIN_USE_FILE}) # Used in the export command further below GetMyTargetLibraries("${CTK_PLUGIN_LIBRARIES}" MITK_PLUGIN_TARGETS) # add legacy BlueBerry bundles add_subdirectory(Modules/Bundles) endif() # Construct a list of paths containing runtime directories # for MITK applications on Windows set(MITK_RUNTIME_PATH "${VTK_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${ITK_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/@VS_BUILD_TYPE@" ) if(QT4_FOUND) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${QT_LIBRARY_DIR}/../bin") endif() if(MITK_USE_BLUEBERRY) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CTK_RUNTIME_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins/@VS_BUILD_TYPE@") endif() if(GDCM_DIR) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${GDCM_DIR}/bin/@VS_BUILD_TYPE@") endif() if(OpenCV_DIR) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${OpenCV_DIR}/bin/@VS_BUILD_TYPE@") endif() # DCMTK is statically build #if(DCMTK_DIR) # set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${DCMTK_DIR}/bin/@VS_BUILD_TYPE@") #endif() # Add applications directory add_subdirectory(Applications) #----------------------------------------------------------------------------- # Python Wrapping #----------------------------------------------------------------------------- set(MITK_WRAPPING_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Wrapping) set(MITK_WRAPPING_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Wrapping) option(MITK_USE_PYTHON "Build cswig Python wrapper support (requires CableSwig)." OFF) if(MITK_USE_PYTHON) add_subdirectory(Wrapping) endif() #----------------------------------------------------------------------------- # Documentation #----------------------------------------------------------------------------- add_subdirectory(Documentation) #----------------------------------------------------------------------------- # Installation #----------------------------------------------------------------------------- # set MITK cpack variables include(mitkSetupCPack) if(MITK_BUILD_org.mitk.gui.qt.application) list(APPEND CPACK_CREATE_DESKTOP_LINKS "CoreApp") endif() if(MITK_BUILD_org.mitk.gui.qt.extapplication) list(APPEND CPACK_CREATE_DESKTOP_LINKS "ExtApp") endif() configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in ${MITK_BINARY_DIR}/MITKCPackOptions.cmake @ONLY) set(CPACK_PROJECT_CONFIG_FILE "${MITK_BINARY_DIR}/MITKCPackOptions.cmake") # include CPack model once all variables are set include(CPack) # Additional installation rules include(mitkInstallRules) #----------------------------------------------------------------------------- # Last configuration steps #----------------------------------------------------------------------------- set(MITK_EXPORTS_FILE "${MITK_BINARY_DIR}/MitkExports.cmake") file(REMOVE ${MITK_EXPORTS_FILE}) if(MITK_USE_BLUEBERRY) set(enabled_plugins ${BLUEBERRY_PLUGIN_TARGETS} ${MITK_PLUGIN_TARGETS} ${MITK_MODULES_ENABLED_PLUGINS} ) # This is for installation support of external projects depending on # MITK plugins. The export file should not be used for linking to MITK # libraries without using LINK_DIRECTORIES, since the exports are incomplete # yet(depending libraries are not exported). foreach(plugin ${enabled_plugins}) string(REPLACE "." "_" plugin_target ${plugin}) export(TARGETS ${plugin_target} APPEND FILE ${MITK_EXPORTS_FILE}) endforeach() endif() 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_file(mitkVersion.h.in ${MITK_BINARY_DIR}/mitkVersion.h) configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h) set(VECMATH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/vecmath) 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) # If we are under Windows, create two batch files which correctly # set up the environment for the application and for Visual Studio if(WIN32) include(mitkFunctionCreateWindowsBatchScript) set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln") foreach(VS_BUILD_TYPE debug release) mitkFunctionCreateWindowsBatchScript("${MITK_SOURCE_DIR}/CMake/StartVS.bat.in" ${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat ${VS_BUILD_TYPE}) endforeach() endif(WIN32) diff --git a/Core/Code/Algorithms/mitkHistogramGenerator.cpp b/Core/Code/Algorithms/mitkHistogramGenerator.cpp index e2642c028f..5fb63242ae 100644 --- a/Core/Code/Algorithms/mitkHistogramGenerator.cpp +++ b/Core/Code/Algorithms/mitkHistogramGenerator.cpp @@ -1,127 +1,127 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if(_MSC_VER==1200) #include #endif #include "mitkHistogramGenerator.h" #include "mitkImageTimeSelector.h" #include "mitkImageAccessByItk.h" // // The new ITK Statistics framework has // a class with the same functionality as // MITKScalarImageToHistogramGenerator.h, but // no longer has the classis the MITK class depends on. #if !defined(ITK_USE_REVIEW_STATISTICS) #include "itkMITKScalarImageToHistogramGenerator.h" #else #include "itkScalarImageToHistogramGenerator.h" #endif mitk::HistogramGenerator::HistogramGenerator() : m_Image(NULL), m_Size(256), m_Histogram(NULL) { } mitk::HistogramGenerator::~HistogramGenerator() { } template < typename TPixel, unsigned int VImageDimension > void InternalCompute(itk::Image< TPixel, VImageDimension >* itkImage, const mitk::HistogramGenerator* mitkHistoGenerator, mitk::HistogramGenerator::HistogramType::ConstPointer& histogram) { #if !defined(ITK_USE_REVIEW_STATISTICS) typedef itk::Statistics::MITKScalarImageToHistogramGenerator< itk::Image< TPixel, VImageDimension >, double > HistogramGeneratorType; #else typedef itk::Statistics::ScalarImageToHistogramGenerator< itk::Image< TPixel, VImageDimension > > HistogramGeneratorType; #endif typename HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput( itkImage ); histogramGenerator->SetNumberOfBins( mitkHistoGenerator->GetSize() ); // histogramGenerator->SetMarginalScale( 10.0 ); histogramGenerator->Compute(); histogram = histogramGenerator->GetOutput(); } void mitk::HistogramGenerator::ComputeHistogram() { if((m_Histogram.IsNull()) || (m_Histogram->GetMTime() < m_Image->GetMTime())) { const_cast(m_Image.GetPointer())->SetRequestedRegionToLargestPossibleRegion(); //@todo without this, Image::GetScalarMin does not work for dim==3 (including sliceselector!) const_cast(m_Image.GetPointer())->Update(); mitk::ImageTimeSelector::Pointer timeSelector=mitk::ImageTimeSelector::New(); timeSelector->SetInput(m_Image); timeSelector->SetTimeNr( 0 ); timeSelector->UpdateLargestPossibleRegion(); - AccessByItk_2( timeSelector->GetOutput() , InternalCompute, this, m_Histogram); + AccessByItk_n( timeSelector->GetOutput() , InternalCompute, (this, m_Histogram)); } // debug code /* MITK_INFO << "Histogram modfied 1" << m_Histogram->GetMTime() << std::endl; m_Histogram->Modified(); MITK_INFO << "Histogram modfied 2" << m_Histogram->GetMTime() << std::endl; MITK_INFO << "Image modfied" << m_Image->GetMTime() << std::endl; const unsigned int histogramSize = m_Histogram->Size(); MITK_INFO << "Histogram size " << histogramSize << std::endl; HistogramType::ConstIterator itr = GetHistogram()->Begin(); HistogramType::ConstIterator end = GetHistogram()->End(); int bin = 0; while( itr != end ) { MITK_INFO << "bin = " << GetHistogram()->GetBinMin(0,bin) << "--" << GetHistogram()->GetBinMax(0,bin) << " frequency = "; MITK_INFO << itr.GetFrequency() << std::endl; ++itr; ++bin; } */ } float mitk::HistogramGenerator::GetMaximumFrequency() const { return CalculateMaximumFrequency(this->m_Histogram); }; float mitk::HistogramGenerator::CalculateMaximumFrequency(const HistogramType* histogram) { HistogramType::ConstIterator itr = histogram->Begin(); HistogramType::ConstIterator end = histogram->End(); float maxFreq = 0; while( itr != end ) { maxFreq = vnl_math_max(maxFreq, // get rid of ambiguity with type signature // for vnl_math_max static_cast(itr.GetFrequency())); ++itr; } return maxFreq; }; diff --git a/Core/Code/Algorithms/mitkImageAccessByItk.h b/Core/Code/Algorithms/mitkImageAccessByItk.h index 5605e98751..1fdf7aebd9 100644 --- a/Core/Code/Algorithms/mitkImageAccessByItk.h +++ b/Core/Code/Algorithms/mitkImageAccessByItk.h @@ -1,708 +1,620 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED #define MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace mitk { + +/** + * \brief Exception class thrown in #AccessByItk macros. + * + * This exception can be thrown by the invocation of the #AccessByItk macros, + * if the MITK image is of non-expected dimension or pixel type. + * + * \ingroup Adaptor + */ +class AccessByItkException : public virtual std::runtime_error +{ +public: + + AccessByItkException(const std::string& msg) : std::runtime_error(msg) {} + ~AccessByItkException() throw() {} +}; + +} + #ifndef DOXYGEN_SKIP -#define _accessByItkWarning \ + +#define _accessByItkPixelTypeException(pixelType, pixelTypeSeq) \ { \ - itkGenericOutputMacro(<< "Pixel type " << pixelType.GetItkTypeAsString() \ - << " not supported by AccessByItk") \ + std::string msg("Pixel type "); \ + msg.append(pixelType.GetItkTypeAsString()); \ + msg.append(" is not in " MITK_PP_STRINGIZE(pixelTypeSeq)); \ + throw mitk::AccessByItkException(msg); \ } -#define _accessByItkWarningParam(pixelType, accessor) \ +#define _accessByItkDimensionException(dim, validDims) \ { \ - itkGenericOutputMacro(<< "Pixel type " << pixelType.GetItkTypeAsString() \ - << " not supported by " << accessor) \ + std::stringstream msg; \ + msg << "Dimension " << (dim) << " is not in " << validDims ; \ + throw mitk::AccessByItkException(msg.str()); \ } -#define _accessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension) \ - if ( pixelType == typeid(pixeltype) ) \ +#define _checkSpecificDimensionIter(r, mitkImage, dim) \ + if (mitkImage->GetDimension() == dim); else + +#define _checkSpecificDimension(mitkImage, dimSeq) \ + MITK_PP_SEQ_FOR_EACH(_checkSpecificDimensionIter, mitkImage, dimSeq) \ + _accessByItkDimensionException(mitkImage->GetDimension(), MITK_PP_STRINGIZE(dimSeq)) + +#define _msvc_expand_bug(macro, arg) MITK_PP_EXPAND(macro arg) + +//-------------------------------- 0-Arg Versions -------------------------------------- + +#define _accessByItk(itkImageTypeFunction, pixeltype, dimension) \ + if ( pixelType == typeid(pixeltype) && constImage->GetDimension() == dimension) \ { \ typedef itk::Image ImageType; \ typedef mitk::ImageToItk ImageToItkType; \ itk::SmartPointer imagetoitk = ImageToItkType::New(); \ - imagetoitk->SetInput(mitkImage); \ + imagetoitk->SetInput(constImage); \ imagetoitk->Update(); \ itkImageTypeFunction(imagetoitk->GetOutput()); \ - } \ - -#define _accessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension) \ - _accessByItk(mitkImage, itkImageTypeFunction, double, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, float, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, int, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, short, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, char, dimension) else \ - _accessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension) else \ - _accessByItkWarning + } else + +#define _accessByItkArgs(itkImageTypeFunction, type) \ + (itkImageTypeFunction, MITK_PP_TUPLE_REM(2)type) + +// product will be of the form (itkImageTypeFunction)(short)(2) for pixel type short and dimension 2 +#ifdef _MSC_VER +#define _accessByItkProductIter(r, product) \ + _msvc_expand_bug(_accessByItk, _msvc_expand_bug(_accessByItkArgs, (MITK_PP_SEQ_HEAD(product), MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product))))) +#else +#define _accessByItkProductIter(r, product) \ + MITK_PP_EXPAND(_accessByItk _accessByItkArgs(MITK_PP_SEQ_HEAD(product), MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product)))) +#endif + +#define _accessFixedTypeByItk(itkImageTypeFunction, pixelTypeSeq, dimSeq) \ + MITK_PP_SEQ_FOR_EACH_PRODUCT(_accessByItkProductIter, ((itkImageTypeFunction))(pixelTypeSeq)(dimSeq)) + +//-------------------------------- n-Arg Versions -------------------------------------- + +#define _accessByItk_n(itkImageTypeFunction, pixeltype, dimension, args) \ + if ( pixelType == typeid(pixeltype) && constImage->GetDimension() == dimension) \ + { \ + typedef itk::Image ImageType; \ + typedef mitk::ImageToItk ImageToItkType; \ + itk::SmartPointer imagetoitk = ImageToItkType::New(); \ + imagetoitk->SetInput(constImage); \ + imagetoitk->Update(); \ + itkImageTypeFunction(imagetoitk->GetOutput(), MITK_PP_TUPLE_REM(MITK_PP_SEQ_HEAD(args))MITK_PP_SEQ_TAIL(args)); \ + } else + +#define _accessByItkArgs_n(itkImageTypeFunction, type, args) \ + (itkImageTypeFunction, MITK_PP_TUPLE_REM(2) type, args) + +// product will be of the form ((itkImageTypeFunction)(3)(a,b,c))(short)(2) +// for the variable argument list a,b,c and for pixel type short and dimension 2 +#ifdef _MSC_VER +#define _accessByItkProductIter_n(r, product) \ + _msvc_expand_bug(_accessByItk_n, _msvc_expand_bug(_accessByItkArgs_n, (MITK_PP_SEQ_HEAD(MITK_PP_SEQ_HEAD(product)), MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product)), MITK_PP_SEQ_TAIL(MITK_PP_SEQ_HEAD(product))))) +#else +#define _accessByItkProductIter_n(r, product) \ + MITK_PP_EXPAND(_accessByItk_n _accessByItkArgs_n(MITK_PP_SEQ_HEAD(MITK_PP_SEQ_HEAD(product)), MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product)), MITK_PP_SEQ_TAIL(MITK_PP_SEQ_HEAD(product)))) +#endif + +#define _accessFixedTypeByItk_n(itkImageTypeFunction, pixelTypeSeq, dimSeq, va_tuple) \ + MITK_PP_SEQ_FOR_EACH_PRODUCT(_accessByItkProductIter_n, (((itkImageTypeFunction)(MITK_PP_ARG_COUNT va_tuple) va_tuple))(pixelTypeSeq)(dimSeq)) + + #endif //DOXYGEN_SKIP /** - * @brief Access an mitk-image by an itk-image + * \brief Access a MITK image by an ITK image * - * Define a templated function or method (@a itkImageTypeFunction) - * within which the mitk-image (@a mitkImage) is accessed: + * Define a templated function or method (\a itkImageTypeFunction) + * within which the mitk-image (\a mitkImage) is accessed: * \code * template < typename TPixel, unsigned int VImageDimension > - * void ExampleFunction( itk::Image* itkImage, TPixel* dummy = NULL ); - * \endcode - * Instantiate the function using - * \code - * InstantiateAccessFunction(ExampleFunction); + * void ExampleFunction( itk::Image* itkImage ); * \endcode - * Within the itk::Image passed to the function/method has the same + * + * The itk::Image passed to the function/method has the same * data-pointer as the mitk-image. So you have full read- and write- * access to the data vector of the mitk-image using the itk-image. * Call by: * \code - * inputMitkImage being of type mitk::Image* - * AccessByItk(inputMitkImage, ExampleFunction); + * mitk::Image* inputMitkImage = ... + * try + * { + * AccessByItk(inputMitkImage, ExampleFunction); + * } + * catch (const mitk::AccessByItkException& e) + * { + * // mitk::Image is of wrong pixel type or dimension, + * // insert error handling here + * } * \endcode - * @note If your inputMitkImage is an mitk::Image::Pointer, use + * + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \note If your inputMitkImage is an mitk::Image::Pointer, use * inputMitkImage.GetPointer() - * @note If you need to pass an additional parameter to your - * access-function (@a itkImageTypeFunction), use AccessByItk. - * @note If you know the dimension of your input mitk-image, + * \note If you need to pass additional parameters to your + * access-function (\a itkImageTypeFunction), use #AccessByItk_n. + * \note If you know the dimension of your input mitk-image, * it is better to use AccessFixedDimensionByItk (less code * is generated). * \sa AccessFixedDimensionByItk * \sa AccessFixedTypeByItk * \sa AccessFixedPixelTypeByItk - * \sa AccessByItk_1 - * \sa AccessByItk_2 - * @ingroup Adaptor + * \sa AccessByItk_n + * + * \ingroup Adaptor */ #define AccessByItk(mitkImage, itkImageTypeFunction) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert((mitkImage)->GetDimension()>=2 && (mitkImage)->GetDimension()<=3); \ - if((mitkImage)->GetDimension()==2) \ - { \ - _accessAllTypesByItk(mitkImage, itkImageTypeFunction, 2); \ - } \ - else \ - { \ - _accessAllTypesByItk(mitkImage, itkImageTypeFunction, 3) \ - } \ -} + AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + +/** + * \brief Access a mitk-image with known pixeltype (but unknown dimension) by an itk-image. + * + * For usage, see #AccessByItk. + * + * \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int) + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * If the image has a different pixel type, a mitk::AccessByItkException exception is + * thrown. If you do not know the pixel type for sure, use #AccessByItk. + * + * \sa AccessByItk + * \sa AccessFixedDimensionByItk + * \sa AccessFixedTypeByItk + * \sa AccessFixedPixelTypeByItk_n + * + * \ingroup Adaptor + */ +#define AccessFixedPixelTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq) \ + AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + +/** + * \brief Access a mitk-image with an integral pixel type by an itk-image + * + * See #AccessByItk for details. + * + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \sa AccessFixedPixelTypeByItk + * \sa AccessByItk + * \sa AccessIntegralPixelTypeByItk_n + */ +#define AccessIntegralPixelTypeByItk(mitkImage, itkImageTypeFunction) \ + AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + +/** + * \brief Access a mitk-image with a floating point pixel type by an ITK image + * + * See #AccessByItk for details. + * + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \sa AccessFixedPixelTypeByItk + * \sa AccessByItk + * \sa AccessFloatingPixelTypeByItk_n + */ +#define AccessFloatingPixelTypeByItk(mitkImage, itkImageTypeFunction) \ + AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ) -//##Documentation -//## @brief Access an mitk-image with known dimension by an itk-image -//## -//## For usage, see AccessByItk. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different dimension, an exception is thrown -//## (by assert). -//## If you do not know the dimension for sure, use AccessByItk. -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk -//## \sa AccessFixedPixelTypeByItk -//## @ingroup Adaptor +/** + * \brief Access a mitk-image with known dimension by an itk-image + * + * For usage, see #AccessByItk. + * + * \param dimension Dimension of the mitk-image. If the image has a different dimension, + * a mitk::AccessByItkException exception is thrown. + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \note If you do not know the dimension for sure, use #AccessByItk. + * + * \sa AccessByItk + * \sa AccessFixedDimensionByItk_n + * \sa AccessFixedTypeByItk + * \sa AccessFixedPixelTypeByItk + * + * \ingroup Adaptor + */ #define AccessFixedDimensionByItk(mitkImage, itkImageTypeFunction, dimension) \ + AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, (dimension)) + +/** + * \brief Access a mitk-image with known type (pixel type and dimension) by an itk-image. + * + * The provided mitk-image must be in the set of types created by taking the + * cartesian product of the pixel type sequence and the dimension sequence. + * For example, a call to + * \code + * AccessFixedTypeByItk(myMitkImage, MyAccessFunction, (short)(int), (2)(3)) + * \endcode + * asserts that the type of myMitkImage (pixeltype,dim) is in the set {(short,2),(short,3),(int,2),(int,3)}. + * For more information, see #AccessByItk. + * + * \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int). + * \param dimension A sequence of dimensions, like (2)(3). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * If the image has a different dimension or pixel type, + * a mitk::AccessByItkException exception is thrown. + * + * \note If you do not know the dimension for sure, use #AccessByItk. + * + * \sa AccessByItk + * \sa AccessFixedDimensionByItk + * \sa AccessFixedTypeByItk_n + * \sa AccessFixedPixelTypeByItk + * + * \ingroup Adaptor + */ +#define AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq) \ { \ const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ const mitk::Image* constImage = mitkImage; \ const_cast(constImage)->Update(); \ - assert((mitkImage)->GetDimension()==dimension); \ - _accessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension) \ -} - -//##Documentation -//## @brief Access an mitk-image with known type (pixel type and dimension) -//## by an itk-image -//## -//## For usage, see AccessByItk. -//## @param dimension dimension of the mitk-image. If the image -//## has a different dimension, an exception is thrown (by assert). -//## If you do not know the dimension for sure, use AccessByItk. -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk -//## \sa AccessFixedPixelTypeByItk -//## @ingroup Adaptor -#define AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert((mitkImage)->GetDimension()==dimension); \ - _accessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension) else \ - _accessByItkWarning \ + _checkSpecificDimension(mitkImage, dimSeq); \ + _accessFixedTypeByItk(itkImageTypeFunction, pixelTypeSeq, dimSeq) \ + _accessByItkPixelTypeException(mitkImage->GetPixelType(), pixelTypeSeq) \ } -//##Documentation -//## @brief Access an mitk-image with known pixeltype (but unknown dimension) -//## by an itk-image and pass two additional parameters to the access-function -//## -//## For usage, see AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## -//## If the image has a different pixel type, an exception is -//## thrown (by assert). -//## If you do not know the pixel type for sure, use AccessByItk. -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk -//## \sa AccessFixedPixelTypeByItk -//## @ingroup Adaptor -#define AccessFixedPixelTypeByItk(mitkImage, itkImageTypeFunction, pixeltype) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert((mitkImage)->GetDimension()>=2 && (mitkImage)->GetDimension()<=3); \ - if((mitkImage)->GetDimension()==2) \ - { \ - _accessByItk(mitkImage, itkImageTypeFunction, pixeltype, 2) else \ - _accessByItkWarning \ - } \ - else \ - { \ - _accessByItk(mitkImage, itkImageTypeFunction, pixeltype, 3) else \ - _accessByItkWarning \ - } \ -} - -//----------------------- version with 1 additional paramater ------------------ -#ifndef DOXYGEN_SKIP -#define _accessByItk_1(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1) \ - if ( pixelType == typeid(pixeltype) ) \ - { \ - typedef itk::Image ImageType; \ - typedef mitk::ImageToItk ImageToItkType; \ - itk::SmartPointer imagetoitk = ImageToItkType::New(); \ - imagetoitk->SetInput(mitkImage); \ - imagetoitk->Update(); \ - itkImageTypeFunction(imagetoitk->GetOutput(), param1); \ - } +//------------------------------ n-Arg Access Macros ----------------------------------- -#define _accessAllTypesByItk_1(mitkImage, itkImageTypeFunction, dimension, param1) \ - _accessByItk_1(mitkImage, itkImageTypeFunction, double, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, float, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, int, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, unsigned int, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, short, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, unsigned short, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, char, dimension, param1) else \ - _accessByItk_1(mitkImage, itkImageTypeFunction, unsigned char, dimension, param1) else \ - _accessByItkWarning \ - -#endif //DOXYGEN_SKIP - -//##Documentation -//## @brief Access an mitk-image by an itk-image and pass one -//## additional parameter to the access-function -//## -//## For usage, see AccessByItk. The only difference to AccessByItk -//## is that an additional parameter (@a param1) is passed. -//## @note If you know the dimension of your input mitk-image, -//## it is better to use AccessFixedDimensionByItk_1 (less code -//## is generated). -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_1 -//## \sa AccessFixedTypeByItk_1 -//## \sa AccessFixedPixelTypeByItk_1 -//## @ingroup Adaptor -#define AccessByItk_1(mitkImage, itkImageTypeFunction, param1) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessAllTypesByItk_1(mitkImage, itkImageTypeFunction, 2, param1); \ - } \ - else \ - { \ - _accessAllTypesByItk_1(mitkImage, itkImageTypeFunction, 3, param1) \ - } \ -} - -//##Documentation -//## @brief Access an mitk-image with known dimension by an itk-image -//## and pass one additional parameter to the access-function -//## -//## For usage, see AccessByItk_1 and AccessByItk. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different dimension, an exception is thrown -//## (by assert). -//## If you do not know the dimension for sure, use AccessByItk_1. -//## \sa AccessByItk_2 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_1 -//## \sa AccessFixedTypeByItk_1 -//## \sa AccessFixedPixelTypeByItk_1 -//## @ingroup Adaptor -#define AccessFixedDimensionByItk_1(mitkImage, itkImageTypeFunction, dimension, param1) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessAllTypesByItk_1(mitkImage, itkImageTypeFunction, dimension, param1) \ -} - -//##Documentation -//## @brief Access an mitk-image with known type (pixel type and dimension) -//## by an itk-image and pass one additional parameters to the access-function -//## -//## For usage, see AccessByItk_1 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different pixel type or dimension, an exception is -//## thrown (by assert). -//## If you do not know the pixel type and dimension for sure, use AccessByItk_1. -//## \sa AccessByItk_1 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_1 -//## \sa AccessFixedTypeByItk_1 -//## \sa AccessFixedPixelTypeByItk_1 -//## @ingroup Adaptor -#define AccessFixedTypeByItk_1(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessByItk_1(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1) else \ - _accessByItkWarning \ -} +/** + * \brief Access a MITK image by an ITK image with one or more parameters. + * + * Define a templated function or method (\a itkImageTypeFunction) with one ore more + * additional parameters, within which the mitk-image (\a mitkImage) is accessed: + * \code + * template < typename TPixel, unsigned int VImageDimension > + * void ExampleFunction( itk::Image* itkImage, SomeType param); + * \endcode + * + * The itk::Image passed to the function/method has the same + * data-pointer as the mitk-image. So you have full read- and write- + * access to the data vector of the mitk-image using the itk-image. + * Call by: + * \code + * SomeType param = ... + * mitk::Image* inputMitkImage = ... + * try + * { + * AccessByItk_n(inputMitkImage, ExampleFunction, (param)); + * } + * catch (const mitk::AccessByItkException& e) + * { + * // mitk::Image is of wrong pixel type or dimension, + * // insert error handling here + * } + * \endcode + * + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \note If your inputMitkImage is an mitk::Image::Pointer, use + * inputMitkImage.GetPointer() + * \note If you know the dimension of your input mitk-image, + * it is better to use AccessFixedDimensionByItk_n (less code + * is generated). + * \sa AccessFixedDimensionByItk_n + * \sa AccessFixedTypeByItk_n + * \sa AccessFixedPixelTypeByItk_n + * \sa AccessByItk + * + * \ingroup Adaptor + */ +#define AccessByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \ + AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple) -//##Documentation -//## @brief Access an mitk-image with known pixeltype (but unknown dimension) -//## by an itk-image and pass one additional parameters to the access-function -//## -//## For usage, see AccessByItk_1 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## -//## If the image has a different pixel type, an exception is -//## thrown (by assert). -//## If you do not know the pixel type for sure, use AccessByItk_2. -//## \sa AccessByItk_1 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk_1 -//## \sa AccessFixedPixelTypeByItk_1 -//## @ingroup Adaptor -#define AccessFixedPixelTypeByItk_1(mitkImage, itkImageTypeFunction, pixeltype, param1) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessByItk_1(mitkImage, itkImageTypeFunction, pixeltype, 2, param1) else \ - _accessByItkWarning \ - } \ - else \ - { \ - _accessByItk_1(mitkImage, itkImageTypeFunction, pixeltype, 3, param1) else \ - _accessByItkWarning \ - } \ -} +/** + * \brief Access a mitk-image with known pixeltype (but unknown dimension) by an itk-image + * with one or more parameters. + * + * For usage, see #AccessByItk_n. + * + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * If the image has a different pixel type, a mitk::AccessByItkException exception is + * thrown. If you do not know the pixel type for sure, use #AccessByItk_n. + * + * \sa AccessByItk_n + * \sa AccessFixedDimensionByItk_n + * \sa AccessFixedTypeByItk_n + * \sa AccessFixedPixelTypeByItk + * + * \ingroup Adaptor + */ +#define AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, va_tuple) \ + AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple) -//----------------------- version with 2 additional paramaters ----------------- -#ifndef DOXYGEN_SKIP -#define _accessByItk_2(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2) \ - if ( pixelType == typeid(pixeltype) ) \ - { \ - typedef itk::Image ImageType; \ - typedef mitk::ImageToItk ImageToItkType; \ - itk::SmartPointer imagetoitk = ImageToItkType::New(); \ - imagetoitk->SetInput(mitkImage); \ - imagetoitk->Update(); \ - itkImageTypeFunction(imagetoitk->GetOutput(), param1, param2); \ - } +/** + * \brief Access an mitk::Image with an integral pixel type by an ITK image with + * one or more parameters. + * + * See #AccessByItk_n for details. + * + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \sa AccessFixedPixelTypeByItk_n + * \sa AccessByItk_n + * \sa AccessIntegralPixelTypeByItk + */ +#define AccessIntegralPixelTypeByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \ + AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple) -#define _accessAllTypesByItk_2(mitkImage, itkImageTypeFunction, dimension, param1, param2) \ - _accessByItk_2(mitkImage, itkImageTypeFunction, double, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, float, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, int, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, unsigned int, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, short, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, unsigned short, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, char, dimension, param1, param2) else \ - _accessByItk_2(mitkImage, itkImageTypeFunction, unsigned char, dimension, param1, param2) else \ - _accessByItkWarning \ +/** + * \brief Access an mitk::Image with a floating point pixel type by an ITK image + * with one or more parameters. + * + * See #AccessByItk_n for details. + * + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \sa AccessFixedPixelTypeByItk_n + * \sa AccessByItk_n + * \sa AccessFloatingPixelTypeByItk + */ +#define AccessFloatingPixelTypeByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \ + AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple) -#endif //DOXYGEN_SKIP +/** + * \brief Access a mitk-image with known dimension by an itk-image with + * one or more parameters. + * + * For usage, see #AccessByItk_n. + * + * \param dimension Dimension of the mitk-image. If the image has a different dimension, + * a mitk::AccessByItkException exception is thrown. + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * \note If you do not know the dimension for sure, use #AccessByItk_n. + * + * \sa AccessByItk_n + * \sa AccessFixedDimensionByItk + * \sa AccessFixedTypeByItk_n + * \sa AccessFixedPixelTypeByItk_n + * + * \ingroup Adaptor + */ +#define AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, va_tuple) \ + AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, (dimension), va_tuple) -//##Documentation -//## @brief Access an mitk-image by an itk-image and pass two -//## additional parameters to the access-function -//## -//## For usage, see AccessByItk. The only difference to AccessByItk -//## is that two additional parameters (@a param1, @a param2) are passed. -//## @note If you know the dimension of your input mitk-image, -//## it is better to use AccessFixedDimensionByItk_2 (less code -//## is generated). -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_2 -//## \sa AccessFixedTypeByItk_2 -//## \sa AccessFixedPixelTypeByItk_2 -//## @ingroup Adaptor -#define AccessByItk_2(mitkImage, itkImageTypeFunction, param1, param2) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessAllTypesByItk_2(mitkImage, itkImageTypeFunction, 2, param1, param2); \ - } \ - else \ - { \ - _accessAllTypesByItk_2(mitkImage, itkImageTypeFunction, 3, param1, param2) \ - } \ +/** + * \brief Access a mitk-image with known type (pixel type and dimension) by an itk-image + * with one or more parameters. + * + * For usage, see AccessFixedTypeByItk. + * + * \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int). + * \param dimension A sequence of dimensions, like (2)(3). + * \param va_tuple A variable length tuple containing the arguments to be passed + * to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD). + * \param mitkImage The MITK input image. + * \param itkImageTypeFunction The templated access-function to be called. + * + * \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension. + * + * If the image has a different dimension or pixel type, + * a mitk::AccessByItkException exception is thrown. + * + * \note If you do not know the dimension for sure, use #AccessByItk_n. + * + * \sa AccessByItk_n + * \sa AccessFixedDimensionByItk_n + * \sa AccessFixedTypeByItk + * \sa AccessFixedPixelTypeByItk_n + * + * \ingroup Adaptor + */ +#define AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, va_tuple) \ +{ \ + const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ + const mitk::Image* constImage = mitkImage; \ + const_cast(constImage)->Update(); \ + _checkSpecificDimension(mitkImage, dimSeq); \ + _accessFixedTypeByItk_n(itkImageTypeFunction, pixelTypeSeq, dimSeq, va_tuple) \ + _accessByItkPixelTypeException(mitkImage->GetPixelType(), pixelTypeSeq) \ } -//##Documentation -//## @brief Access an mitk-image with known dimension by an itk-image -//## and pass two additional parameters to the access-function -//## -//## For usage, see AccessByItk_2 and AccessByItk. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different dimension, an exception is thrown -//## (by assert). -//## If you do not know the dimension for sure, use AccessByItk_2. -//## \sa AccessByItk_2 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_2 -//## \sa AccessFixedTypeByItk_2 -//## \sa AccessFixedPixelTypeByItk_2 -//## @ingroup Adaptor -#define AccessFixedDimensionByItk_2(mitkImage, itkImageTypeFunction, dimension, param1, param2) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessAllTypesByItk_2(mitkImage, itkImageTypeFunction, dimension, param1, param2) \ -} +//------------------------- For back-wards compatibility ------------------------------- -//##Documentation -//## @brief Access an mitk-image with known type (pixel type and dimension) -//## by an itk-image and pass two additional parameters to the access-function -//## -//## For usage, see AccessByItk_2 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different pixel type or dimension, an exception is -//## thrown (by assert). -//## If you do not know the pixel type and dimension for sure, use AccessByItk_2. -//## \sa AccessByItk_2 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk_2 -//## \sa AccessFixedPixelTypeByItk_2 -//## @ingroup Adaptor -#define AccessFixedTypeByItk_2(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessByItk_2(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2) else \ - _accessByItkWarning \ -} +#define AccessByItk_1(mitkImage, itkImageTypeFunction, arg1) AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1)) +#define AccessFixedPixelTypeByItk_1(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1) AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1)) +#define AccessFixedDimensionByItk_1(mitkImage, itkImageTypeFunction, dimension, arg1) AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1)) +#define AccessFixedTypeByItk_1(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1) AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1)) -//##Documentation -//## @brief Access an mitk-image with known pixel type (but unknown dimension) -//## by an itk-image and pass two additional parameters to the access-function -//## -//## For usage, see AccessByItk_2 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## -//## If the image has a different pixel type, an exception is -//## thrown (by assert). -//## If you do not know the pixel type for sure, use AccessByItk_2. -//## \sa AccessByItk_2 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk_2 -//## \sa AccessFixedPixelTypeByItk_2 -//## @ingroup Adaptor -#define AccessFixedPixelTypeByItk_2(mitkImage, itkImageTypeFunction, pixeltype, param1, param2) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessByItk_2(mitkImage, itkImageTypeFunction, pixeltype, 2, param1, param2) else \ - _accessByItkWarning \ - } \ - else \ - { \ - _accessByItk_2(mitkImage, itkImageTypeFunction, pixeltype, 3, param1, param2) else \ - _accessByItkWarning \ - } \ -} +#define AccessByItk_2(mitkImage, itkImageTypeFunction, arg1, arg2) AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1,arg2)) +#define AccessFixedPixelTypeByItk_2(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1, arg2) AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1,arg2)) +#define AccessFixedDimensionByItk_2(mitkImage, itkImageTypeFunction, dimension, arg1, arg2) AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1,arg2)) +#define AccessFixedTypeByItk_2(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1, arg2) AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1,arg2)) -#define _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, pixeltype2, dimension) \ - if ( pixelType2 == typeid(pixeltype2) ) \ - { \ - typedef itk::Image ImageType1; \ - typedef itk::Image ImageType2; \ - typedef mitk::ImageToItk ImageToItkType1; \ - typedef mitk::ImageToItk ImageToItkType2; \ - itk::SmartPointer imagetoitk1 = ImageToItkType1::New(); \ - imagetoitk1->SetInput(mitkImage1); \ - imagetoitk1->Update(); \ - itk::SmartPointer imagetoitk2 = ImageToItkType2::New(); \ - imagetoitk2->SetInput(mitkImage2); \ - imagetoitk2->Update(); \ - itkImageTypeFunction(imagetoitk1->GetOutput(), imagetoitk2->GetOutput()); \ - } - -#define _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, dimension) \ - if ( pixelType1 == typeid(pixeltype) ) \ - { \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, double, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, float, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, int, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, unsigned int, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, short, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, unsigned short, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, char, dimension) else \ - _accessTwoImagesByItk2(mitkImage1, mitkImage2, itkImageTypeFunction, pixeltype, unsigned char, dimension) else \ - _accessByItkWarningParam(pixelType2, "_accessTwoImagesByItk") \ - } +#define AccessByItk_3(mitkImage, itkImageTypeFunction, arg1, arg2, arg3) AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1,arg2,arg3)) +#define AccessFixedPixelTypeByItk_3(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1, arg2, arg3) AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1,arg2,arg3)) +#define AccessFixedDimensionByItk_3(mitkImage, itkImageTypeFunction, dimension, arg1, arg2, arg3) AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1,arg2,arg3)) +#define AccessFixedTypeByItk_3(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1, arg2, arg3) AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1,arg2,arg3)) -#define _accessTwoImagesAllTypesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, double, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, float, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, int, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, unsigned int, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, short, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, unsigned short, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, char, dimension) else \ - _accessTwoImagesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, unsigned char, dimension) else \ - _accessByItkWarningParam(pixelType1, "_accessTwoImagesByItk") +//----------------------------- Access two MITK Images --------------------------------- -//----------------------- version with 3 additional parameters ----------------- #ifndef DOXYGEN_SKIP -#define _accessByItk_3(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2, param3) \ - if ( pixelType == typeid(pixeltype) ) \ - { \ - typedef itk::Image ImageType; \ - typedef mitk::ImageToItk ImageToItkType; \ - itk::SmartPointer imagetoitk = ImageToItkType::New(); \ - imagetoitk->SetInput(mitkImage); \ - imagetoitk->Update(); \ - itkImageTypeFunction(imagetoitk->GetOutput(), param1, param2, param3); \ - } - -#define _accessAllTypesByItk_3(mitkImage, itkImageTypeFunction, dimension, param1, param2, param3) \ - _accessByItk_3(mitkImage, itkImageTypeFunction, double, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, float, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, int, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, unsigned int, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, short, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, unsigned short, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, char, dimension, param1, param2, param3) else \ - _accessByItk_3(mitkImage, itkImageTypeFunction, unsigned char, dimension, param1, param2, param3) else \ - _accessByItkWarning \ - -#endif //DOXYGEN_SKIP - -//##Documentation -//## @brief Access an mitk-image by an itk-image and pass three -//## additional parameters to the access-function -//## -//## For usage, see AccessByItk. The only difference to AccessByItk -//## is that two additional parameters (@a param1, @a param2) are passed. -//## @note If you know the dimension of your input mitk-image, -//## it is better to use AccessFixedDimensionByItk_3 (less code -//## is generated). -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_3 -//## \sa AccessFixedPixelTypeByItk_3 -//## @ingroup Adaptor -#define AccessByItk_3(mitkImage, itkImageTypeFunction, param1, param2, param3) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessAllTypesByItk_3(mitkImage, itkImageTypeFunction, 2, param1, param2, param3); \ - } \ - else \ - { \ - _accessAllTypesByItk_3(mitkImage, itkImageTypeFunction, 3, param1, param2, param3) \ - } \ -} - -//##Documentation -//## @brief Access an mitk-image with known dimension by an itk-image -//## and pass three additional parameters to the access-function -//## -//## For usage, see AccessByItk_3 and AccessByItk. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different dimension, an exception is thrown -//## (by assert). -//## If you do not know the dimension for sure, use AccessByItk_3. -//## \sa AccessByItk_3 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk_3 -//## \sa AccessFixedTypeByItk_3 -//## \sa AccessFixedPixelTypeByItk_3 -//## @ingroup Adaptor -#define AccessFixedDimensionByItk_3(mitkImage, itkImageTypeFunction, dimension, param1, param2, param3) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessAllTypesByItk_3(mitkImage, itkImageTypeFunction, dimension, param1, param2, param3) \ -} - -//##Documentation -//## @brief Access an mitk-image with known type (pixel type and dimension) -//## by an itk-image and pass three additional parameters to the access-function -//## -//## For usage, see AccessByItk_3 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## @param dimension dimension of the mitk-image. -//## -//## If the image has a different pixel type or dimension, an exception is -//## thrown (by assert). -//## If you do not know the pixel type and dimension for sure, use AccessByItk_3. -//## \sa AccessByItk_3 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedPixelTypeByItk_3 -//## @ingroup Adaptor -#define AccessFixedTypeByItk_3(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2, param3) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()==dimension); \ - _accessByItk_3(mitkImage, itkImageTypeFunction, pixeltype, dimension, param1, param2, param3) else \ - _accessByItkWarning \ -} - -//##Documentation -//## @brief Access an mitk-image with known pixel type (but unknown dimension) -//## by an itk-image and pass three additional parameters to the access-function -//## -//## For usage, see AccessByItk_3 and AccessByItk. -//## @param pixeltype pixel type of the mitk-image. -//## -//## If the image has a different pixel type, an exception is -//## thrown (by assert). -//## If you do not know the pixel type for sure, use AccessByItk_3. -//## \sa AccessByItk_3 -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk_3 -//## \sa AccessFixedPixelTypeByItk_3 -//## @ingroup Adaptor -#define AccessFixedPixelTypeByItk_3(mitkImage, itkImageTypeFunction, pixeltype, param1, param2, param3) \ -{ \ - const mitk::PixelType& pixelType = mitkImage->GetPixelType(); \ - const mitk::Image* constImage = mitkImage; \ - const_cast(constImage)->Update(); \ - assert(mitkImage->GetDimension()>=2 && mitkImage->GetDimension()<=3); \ - if(mitkImage->GetDimension()==2) \ - { \ - _accessByItk_3(mitkImage, itkImageTypeFunction, pixeltype, 2, param1, param2, param3) else \ - _accessByItkWarning \ - } \ - else \ - { \ - _accessByItk_3(mitkImage, itkImageTypeFunction, pixeltype, 3, param1, param2, param3) else \ - _accessByItkWarning \ - } \ -} - - -//##Documentation -//## @brief Access two mitk-images with known dimension by itk-images -//## -//## For usage, see AccessByItk. -//## @param dimension dimension of the mitk-image. -//## -//## If one of the images has a different dimension, an exception is thrown -//## (by assert). -//## If you do not know the dimension for sure, use AccessByItk. -//## \sa AccessByItk -//## \sa AccessFixedDimensionByItk -//## \sa AccessFixedTypeByItk -//## \sa AccessFixedPixelTypeByItk -//## @ingroup Adaptor -#define AccessTwoImagesFixedDimensionByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \ -{ \ - const mitk::PixelType& pixelType1 = mitkImage1->GetPixelType(); \ - const mitk::PixelType& pixelType2 = mitkImage2->GetPixelType(); \ - const mitk::Image* constImage1 = mitkImage1; \ - const mitk::Image* constImage2 = mitkImage2; \ - const_cast(constImage1)->Update(); \ - const_cast(constImage2)->Update(); \ - assert((mitkImage1)->GetDimension()==dimension); \ - assert((mitkImage2)->GetDimension()==dimension); \ - _accessTwoImagesAllTypesByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \ -} - -#ifdef mitkCore_EXPORTS -#define MITK_CORE_EXPORT_EXTERN +#define _accessTwoImagesByItk(itkImageTypeFunction, pixeltype1, dim1, pixeltype2, dim2) \ + if (pixelType1 == typeid(pixeltype1) && pixelType2 == typeid(pixeltype2) && \ + constImage1->GetDimension() == dim1 && constImage2->GetDimension() == dim2) \ + { \ + typedef itk::Image ImageType1; \ + typedef itk::Image ImageType2; \ + typedef mitk::ImageToItk ImageToItkType1; \ + typedef mitk::ImageToItk ImageToItkType2; \ + itk::SmartPointer imagetoitk1 = ImageToItkType1::New(); \ + imagetoitk1->SetInput(constImage1); \ + imagetoitk1->Update(); \ + itk::SmartPointer imagetoitk2 = ImageToItkType2::New(); \ + imagetoitk2->SetInput(constImage2); \ + imagetoitk2->Update(); \ + itkImageTypeFunction(imagetoitk1->GetOutput(), imagetoitk2->GetOutput()); \ + } else + +#define _accessTwoImagesByItkArgs2(itkImageTypeFunction, type1, type2) \ + (itkImageTypeFunction, MITK_PP_TUPLE_REM(2) type1, MITK_PP_TUPLE_REM(2) type2) + +#define _accessTwoImagesByItkArgs(product) \ + MITK_PP_EXPAND(_accessTwoImagesByItkArgs2 MITK_PP_EXPAND((MITK_PP_SEQ_HEAD(product), MITK_PP_TUPLE_REM(2) MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product))))) + +// product is of the form (itkImageTypeFunction)((short,2))((char,2)) +#ifdef _MSC_VER +#define _accessTwoImagesByItkIter(r, product) \ + MITK_PP_EXPAND(_accessTwoImagesByItk _msvc_expand_bug(_accessTwoImagesByItkArgs2, (MITK_PP_SEQ_HEAD(product), _msvc_expand_bug(MITK_PP_TUPLE_REM(2), MITK_PP_EXPAND(MITK_PP_SEQ_TO_TUPLE (MITK_PP_SEQ_TAIL(product))))))) #else -#define MITK_CORE_EXPORT_EXTERN extern +#define _accessTwoImagesByItkIter(r, product) \ + MITK_PP_EXPAND(_accessTwoImagesByItk _accessTwoImagesByItkArgs(product)) #endif -//----------------------- cast functions. Will be moved to mitkImageCast.h ----------------- -namespace mitk -{ -#ifndef DOXYGEN_SKIP - template < typename TPixel, unsigned int VImageDimension, class ItkOutputImageType > - void _CastToItkImage2Access( itk::Image* itkInputImage, itk::SmartPointer& itkOutputImage); -#endif //DOXYGEN_SKIP - //##Documentation - //## @brief Cast an mitk::Image to an itk::Image with a specific type. You don't have to initialize the itk::Image<..>::Pointer. - //## @ingroup Adaptor - template extern void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage); -} +#define _accessTwoImagesByItkForEach(itkImageTypeFunction, tseq1, tseq2) \ + MITK_PP_SEQ_FOR_EACH_PRODUCT(_accessTwoImagesByItkIter, ((itkImageTypeFunction))(tseq1)(tseq2)) -//----------------------- include to be removed ----------------------- -#include +#endif // DOXYGEN_SKIP + +/** + * \brief Access two mitk-images with known dimension by itk-images + * + * Define a templated function or method (\a itkImageTypeFunction) + * within which the mitk-images (\a mitkImage1 and \a mitkImage2) are accessed: + * \code + * template + * void ExampleFunctionTwoImages(itk::Image* itkImage1, itk::Image* itkImage2); + * \endcode + * + * The itk::Image passed to the function/method has the same + * data-pointer as the mitk-image. So you have full read- and write- + * access to the data vector of the mitk-image using the itk-image. + * Call by: + * \code + * mitk::Image* inputMitkImage1 = ... + * mitk::Image* inputMitkImage2 = ... + * try + * { + * AccessTwoImagesFixedDimensionByItk(inputMitkImage1, inputMitkImage2, ExampleFunctionTwoImages, 3); + * } + * catch (const mitk::AccessByItkException& e) + * { + * // mitk::Image arguments are of wrong pixel type or dimension, + * // insert error handling here + * } + * \endcode + * + * \note If your inputMitkImage1 or inputMitkImage2 is a mitk::Image::Pointer, use + * inputMitkImage1.GetPointer(). + * + * \param mitkImage1 The first MITK input image. + * \param mitkImage1 The second MITK input image. + * \param itkImageTypeFunction The name of the template access-function to be called. + * \param dimension Dimension of the two mitk-images. + * + * \throws mitk::AccessByItkException If mitkImage1 and mitkImage2 have different dimensions or + * one of the images is of unsupported pixel type or dimension. + * + * \sa #AccessByItk + * + * \ingroup Adaptor + */ +#define AccessTwoImagesFixedDimensionByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \ +{ \ + const mitk::PixelType& pixelType1 = mitkImage1->GetPixelType(); \ + const mitk::PixelType& pixelType2 = mitkImage2->GetPixelType(); \ + const mitk::Image* constImage1 = mitkImage1; \ + const mitk::Image* constImage2 = mitkImage2; \ + const_cast(constImage1)->Update(); \ + const_cast(constImage2)->Update(); \ + _checkSpecificDimension(mitkImage1, (dimension)); \ + _checkSpecificDimension(mitkImage2, (dimension)); \ + _accessTwoImagesByItkForEach(itkImageTypeFunction, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension), MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension)) \ + { \ + std::string msg("Pixel type "); \ + msg.append(pixelType1.GetItkTypeAsString()); \ + msg.append(" or pixel type "); \ + msg.append(pixelType2.GetItkTypeAsString()); \ + msg.append(" is not in " MITK_PP_STRINGIZE(MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension))); \ + throw mitk::AccessByItkException(msg); \ + } \ +} #endif // of MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED diff --git a/Core/Code/Algorithms/mitkImageCast.h b/Core/Code/Algorithms/mitkImageCast.h index 931b9a6194..72a47220c1 100644 --- a/Core/Code/Algorithms/mitkImageCast.h +++ b/Core/Code/Algorithms/mitkImageCast.h @@ -1,27 +1,41 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKIMAGECAST_H_HEADER_INCLUDED #define MITKIMAGECAST_H_HEADER_INCLUDED -#include "itkDiffusionTensor3D.h" -#include "itkVector.h" +#include +#include -#include +#include + +namespace mitk +{ + +#ifndef DOXYGEN_SKIP + template < typename TPixel, unsigned int VImageDimension, class ItkOutputImageType > + void _CastToItkImage2Access( itk::Image* itkInputImage, itk::SmartPointer& itkOutputImage); +#endif //DOXYGEN_SKIP + + //##Documentation + //## @brief Cast an mitk::Image to an itk::Image with a specific type. You don't have to initialize the itk::Image<..>::Pointer. + //## @ingroup Adaptor + template extern void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage); +} #endif // of MITKIMAGECAST_H_HEADER_INCLUDED diff --git a/Core/Code/Algorithms/mitkImageCastPart1.cpp b/Core/Code/Algorithms/mitkImageCastPart1.cpp index cee51bff5c..6fe18466b8 100644 --- a/Core/Code/Algorithms/mitkImageCastPart1.cpp +++ b/Core/Code/Algorithms/mitkImageCastPart1.cpp @@ -1,79 +1,54 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ - +#include #include +#include + #include #include namespace mitk { #ifndef DOXYGEN_SKIP template < typename TPixel, unsigned int VImageDimension, class ItkOutputImageType > void _CastToItkImage2Access( itk::Image* itkInputImage, itk::SmartPointer& itkOutputImage) { typedef itk::Image ItkInputImageType; if(typeid(ItkInputImageType) == typeid(ItkOutputImageType)) { itkOutputImage = reinterpret_cast(itkInputImage); return; } typedef itk::CastImageFilter< ItkInputImageType, ItkOutputImageType > CastImageFilterType; typename CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); castImageFilter->SetInput( itkInputImage ); castImageFilter->Update(); itkOutputImage = castImageFilter->GetOutput(); } #endif //DOXYGEN_SKIP -typedef itk::Image itkImageD2; -typedef itk::Image itkImageF2; -typedef itk::Image itkImageSI2; -typedef itk::Image itkImageUI2; -typedef itk::Image itkImageSS2; -typedef itk::Image itkImageUS2; -typedef itk::Image itkImageSC2; -typedef itk::Image itkImageUC2; -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer& ); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer& ); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 2, itk::SmartPointer&); +#define InstantiateAccessFunction__CastToItkImage2Access(type1, type2) \ + template MITK_CORE_EXPORT void _CastToItkImage2Access(itk::Image*, itk::SmartPointer >&); -typedef itk::Image itkImageD3; -typedef itk::Image itkImageF3; -typedef itk::Image itkImageSI3; -typedef itk::Image itkImageUI3; -typedef itk::Image itkImageSS3; -typedef itk::Image itkImageUS3; -typedef itk::Image itkImageSC3; -typedef itk::Image itkImageUC3; +#define InstantiateCastToItkImage2Access(r, data, dim) \ + MITK_PP_SEQ_FOR_EACH_PRODUCT(InstantiateAccessFunctionProductImpl, ((_CastToItkImage2Access))(MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dim))(MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dim))) -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); -InstantiateAccessFunctionForFixedDimension_1(_CastToItkImage2Access, 3, itk::SmartPointer&); +MITK_PP_SEQ_FOR_EACH(InstantiateCastToItkImage2Access, _, MITK_ACCESSBYITK_DIMENSIONS_SEQ) } diff --git a/Core/Code/Algorithms/mitkImageCastPart2.cpp b/Core/Code/Algorithms/mitkImageCastPart2.cpp index e36888f4aa..0eafbbe30d 100644 --- a/Core/Code/Algorithms/mitkImageCastPart2.cpp +++ b/Core/Code/Algorithms/mitkImageCastPart2.cpp @@ -1,73 +1,41 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include +#include +#include + #include #include namespace mitk { #ifndef DOXYGEN_SKIP template void CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { AccessFixedDimensionByItk_1(mitkImage, _CastToItkImage2Access, ::itk::GetImageDimension::ImageDimension, itkOutputImage); } #endif //DOXYGEN_SKIP -typedef itk::Image itkImageD2; -typedef itk::Image itkImageF2; -typedef itk::Image itkImageSI2; -typedef itk::Image itkImageUI2; -typedef itk::Image itkImageSS2; -typedef itk::Image itkImageUS2; -typedef itk::Image itkImageSC2; -typedef itk::Image itkImageUC2; - -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); - -typedef itk::Image itkImageD3; -typedef itk::Image itkImageF3; -typedef itk::Image itkImageSI3; -typedef itk::Image itkImageUI3; -typedef itk::Image itkImageSS3; -typedef itk::Image itkImageUS3; -typedef itk::Image itkImageSC3; -typedef itk::Image itkImageUC3; - -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); -template void MITK_CORE_EXPORT CastToItkImage(const mitk::Image *, itk::SmartPointer&); +#define InstantiateAccessFunction_CastToItkImage(pixelType, dim) \ +template MITK_CORE_EXPORT void CastToItkImage(const mitk::Image *, itk::SmartPointer >&); -#ifndef DOXYGEN_SKIP - -#endif //DOXYGEN_SKIP +InstantiateAccessFunction(CastToItkImage) } diff --git a/Core/Code/Algorithms/mitkImageCastPart3.cpp b/Core/Code/Algorithms/mitkImageCastPart3.cpp index 0e5988a8de..c3e79bf19c 100644 --- a/Core/Code/Algorithms/mitkImageCastPart3.cpp +++ b/Core/Code/Algorithms/mitkImageCastPart3.cpp @@ -1,119 +1,122 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2008-12-05 10:31:44 +0100 (Fr, 05 Dez 2008) $ Version: $Revision: 15893 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include #include +#include +#include + namespace mitk { #ifndef DOXYGEN_SKIP template < typename TPixel, unsigned int VImageDimension, class ItkOutputImageType > void _CastToItkImage2Access( itk::Image* itkInputImage, itk::SmartPointer& itkOutputImage) { typedef itk::Image ItkInputImageType; if(typeid(ItkInputImageType) == typeid(ItkOutputImageType)) { itkOutputImage = reinterpret_cast(itkInputImage); return; } typedef itk::CastImageFilter< ItkInputImageType, ItkOutputImageType > CastImageFilterType; typename CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); castImageFilter->SetInput( itkInputImage ); castImageFilter->Update(); itkOutputImage = castImageFilter->GetOutput(); } #endif //DOXYGEN_SKIP typedef itk::Image, 2> itkImageRGBUC2; typedef itk::Image, 2> itkImageDTIF2; typedef itk::Image, 2> itkImageDTID2; template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageRGBUC2*, itk::SmartPointer&); template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageDTIF2*, itk::SmartPointer&); template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageDTID2*, itk::SmartPointer&); typedef itk::Image, 3> itkImageRGBUC3; typedef itk::Image, 3> itkImageDTIF3; typedef itk::Image, 3> itkImageDTID3; template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageRGBUC3*, itk::SmartPointer&); template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageDTIF3*, itk::SmartPointer&); template void MITK_CORE_EXPORT _CastToItkImage2Access(itkImageDTID3*, itk::SmartPointer&); #define CAST_HUNDRED_VECS(HUN) \ CAST_TEN_VECS(HUN) \ CAST_TEN_VECS(HUN+10) \ CAST_TEN_VECS(HUN+20) \ CAST_TEN_VECS(HUN+30) \ CAST_TEN_VECS(HUN+40) \ CAST_TEN_VECS(HUN+50) \ CAST_TEN_VECS(HUN+60) \ CAST_TEN_VECS(HUN+70) \ CAST_TEN_VECS(HUN+80) \ CAST_TEN_VECS(HUN+90) \ #define CAST_TEN_VECS(TEN) \ CAST_N_VEC(TEN+ 1) \ CAST_N_VEC(TEN+ 2) \ CAST_N_VEC(TEN+ 3) \ CAST_N_VEC(TEN+ 4) \ CAST_N_VEC(TEN+ 5) \ CAST_N_VEC(TEN+ 6) \ CAST_N_VEC(TEN+ 7) \ CAST_N_VEC(TEN+ 8) \ CAST_N_VEC(TEN+ 9) \ CAST_N_VEC(TEN+10) \ #define CAST_N_VEC(N_DIRS) \ _CAST_N_VEC(N_DIRS,double) \ _CAST_N_VEC(N_DIRS,float) \ _CAST_N_VEC(N_DIRS,short) \ #define _CAST_N_VEC(N_DIRS,PIXTYPE) \ template void MITK_CORE_EXPORT _CastToItkImage2Access(itk::Image, 2> *, itk::SmartPointer, 2> >&); \ template void MITK_CORE_EXPORT _CastToItkImage2Access(itk::Image, 3> *, itk::SmartPointer, 3> >&); \ // the following lines allow for fixed-size vector images up to a certain size limit // (commented out for shorter compile times) //CAST_HUNDRED_VECS(0) //CAST_HUNDRED_VECS(100) //CAST_HUNDRED_VECS(200) //CAST_HUNDRED_VECS(300) // allow for fixed-size vectors of specific length // (inspired by itkPointshell.cpp, precompiled q-ball configs) //CAST_TEN_VECS(0) //CAST_N_VEC(11) //CAST_N_VEC(12) CAST_N_VEC(2) CAST_N_VEC(3) CAST_N_VEC(6) CAST_N_VEC(42) CAST_N_VEC(92) CAST_N_VEC(162) CAST_N_VEC(252) CAST_N_VEC(362) CAST_N_VEC(492) CAST_N_VEC(642) CAST_N_VEC(812) CAST_N_VEC(1002) } diff --git a/Core/Code/Algorithms/mitkImageCastPart4.cpp b/Core/Code/Algorithms/mitkImageCastPart4.cpp index 1c2a6b24c7..f8f7d22894 100644 --- a/Core/Code/Algorithms/mitkImageCastPart4.cpp +++ b/Core/Code/Algorithms/mitkImageCastPart4.cpp @@ -1,151 +1,155 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2008-12-05 10:31:44 +0100 (Fr, 05 Dez 2008) $ Version: $Revision: 15893 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include +#include + #include #include +#include + namespace mitk { #ifndef DOXYGEN_SKIP template void CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { AccessFixedDimensionByItk_1(mitkImage, _CastToItkImage2Access, ::itk::GetImageDimension::ImageDimension, itkOutputImage); } #endif //DOXYGEN_SKIP typedef itk::Image, 2> itkImageRGBUC2; typedef itk::Image, 2> itkImageDTIF2; typedef itk::Image, 2> itkImageDTID2; template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageRGBUC2 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::RGBPixel, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::RGBPixel), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageDTIF2 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::DiffusionTensor3D, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::DiffusionTensor3D), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageDTID2 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::DiffusionTensor3D, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::DiffusionTensor3D), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } typedef itk::Image, 3> itkImageRGBUC3; typedef itk::Image, 3> itkImageDTIF3; typedef itk::Image, 3> itkImageDTID3; template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageRGBUC3 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::RGBPixel, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::RGBPixel), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageDTIF3 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::DiffusionTensor3D, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::DiffusionTensor3D), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } template <> void MITK_CORE_EXPORT CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer& itkOutputImage) { typedef itkImageDTID3 ItkOutputImageType; - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, itk::DiffusionTensor3D, ::itk::GetImageDimension::ImageDimension, itkOutputImage); + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (itk::DiffusionTensor3D), (::itk::GetImageDimension::ImageDimension), itkOutputImage); } #define TYPE_VECS(HUN) \ TYPE_TEN_VECS(HUN) \ TYPE_TEN_VECS(HUN + 10) \ TYPE_TEN_VECS(HUN + 20) \ TYPE_TEN_VECS(HUN + 30) \ TYPE_TEN_VECS(HUN + 40) \ TYPE_TEN_VECS(HUN + 50) \ TYPE_TEN_VECS(HUN + 60) \ TYPE_TEN_VECS(HUN + 70) \ TYPE_TEN_VECS(HUN + 80) \ TYPE_TEN_VECS(HUN + 90) \ #define TYPE_TEN_VECS(HUN) \ TYPE_N_VEC(HUN + 1) \ TYPE_N_VEC(HUN + 2) \ TYPE_N_VEC(HUN + 3) \ TYPE_N_VEC(HUN + 4) \ TYPE_N_VEC(HUN + 5) \ TYPE_N_VEC(HUN + 6) \ TYPE_N_VEC(HUN + 7) \ TYPE_N_VEC(HUN + 8) \ TYPE_N_VEC(HUN + 9) \ TYPE_N_VEC(HUN + 10) \ #define TYPE_N_VEC(N_DIRS) \ _TYPE_N_VEC(N_DIRS,double) \ _TYPE_N_VEC(N_DIRS,float) \ _TYPE_N_VEC(N_DIRS,short) \ #define _TYPE_N_VEC(N_DIRS,PIXTYPE) \ template <> void MITK_CORE_EXPORT CastToItkImage, 2> >(const mitk::Image * mitkImage, itk::SmartPointer, 2> >& itkOutputImage) \ { \ typedef itk::Vector VECTORTYPE; \ typedef itk::Image ItkOutputImageType2; \ - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, VECTORTYPE, ::itk::GetImageDimension::ImageDimension, itkOutputImage); \ + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (VECTORTYPE), (::itk::GetImageDimension::ImageDimension), itkOutputImage); \ } \ template <> void MITK_CORE_EXPORT CastToItkImage, 3> >(const mitk::Image * mitkImage, itk::SmartPointer, 3> >& itkOutputImage) \ { \ typedef itk::Vector VECTORTYPE; \ typedef itk::Image ItkOutputImageType3; \ - AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, VECTORTYPE, ::itk::GetImageDimension::ImageDimension, itkOutputImage); \ + AccessFixedTypeByItk_1(mitkImage, _CastToItkImage2Access, (VECTORTYPE), (::itk::GetImageDimension::ImageDimension), itkOutputImage); \ } \ // the following lines allow for fixed-size vector images up to a certain size limit // (commented out for shorter compile times) //TYPE_VECS(000) //TYPE_VECS(100) //TYPE_VECS(200) //TYPE_VECS(300) //TYPE_VECS(400) //TYPE_VECS(500) //TYPE_VECS(600) //TYPE_VECS(700) // allow for fixed-size vectors of specific length // (inspired by itkPointshell.cpp, precompiled q-ball configs) //TYPE_TEN_VECS(0) //TYPE_N_VEC(11) //TYPE_N_VEC(12) TYPE_N_VEC(2) TYPE_N_VEC(3) TYPE_N_VEC(6) TYPE_N_VEC(42) TYPE_N_VEC(92) TYPE_N_VEC(162) TYPE_N_VEC(252) TYPE_N_VEC(362) TYPE_N_VEC(492) TYPE_N_VEC(642) TYPE_N_VEC(812) TYPE_N_VEC(1002) #ifndef DOXYGEN_SKIP #endif //DOXYGEN_SKIP } diff --git a/Core/Code/Algorithms/mitkImageCaster.cpp b/Core/Code/Algorithms/mitkImageCaster.cpp index 80d8ca657a..934c01e6e9 100644 --- a/Core/Code/Algorithms/mitkImageCaster.cpp +++ b/Core/Code/Algorithms/mitkImageCaster.cpp @@ -1,149 +1,59 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-06-18 20:12:43 +0200 (Fr, 18 Jun 2010) $ Version: $Revision: 23881 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkImageCaster.h" #include "mitkImageAccessByItk.h" + vtkRenderer* mitk::RendererAccess::m_3DRenderer = 0; void mitk::RendererAccess::Set3DRenderer(vtkRenderer* renwin4) { m_3DRenderer = renwin4; } vtkRenderer* mitk::RendererAccess::Get3DRenderer() { return m_3DRenderer; } -// shorts 2d -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} -// shorts 3d -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -// char 2d -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -// char 3d -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -// int -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -// float -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - -// int -void mitk::ImageCaster::CastToItkImage(const mitk::Image * mitkImage, itk::SmartPointer > & itkOutputImage){ - mitk::CastToItkImage >(mitkImage, itkOutputImage); -} - -void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkimage, itk::SmartPointer& mitkoutputimage){ - mitk::CastToMitkImage >(itkimage, mitkoutputimage); -} - void mitk::ImageCaster::CastBaseData(mitk::BaseData* const mitkBaseData, itk::SmartPointer& mitkoutputimage){ try { mitkoutputimage = dynamic_cast(mitkBaseData); } catch(...) { return; } } void mitk::Caster::Cast(mitk::BaseData* mitkBaseData, mitk::Surface* surface){ surface = dynamic_cast(mitkBaseData); } + +#define DefineMitkImageCasterMethods(r, data, type) \ + void mitk::ImageCaster::CastToItkImage(const mitk::Image* mitkImage, itk::SmartPointer >& itkOutputImage) { \ + mitk::CastToItkImage >(mitkImage, itkOutputImage); \ + } \ + void mitk::ImageCaster::CastToMitkImage(const itk::Image* itkImage, itk::SmartPointer& mitkOutputImage) { \ + mitk::CastToMitkImage >(itkImage, mitkOutputImage); \ + } + +MITK_PP_SEQ_FOR_EACH(DefineMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(2)) +MITK_PP_SEQ_FOR_EACH(DefineMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(3)) diff --git a/Core/Code/Algorithms/mitkImageCaster.h b/Core/Code/Algorithms/mitkImageCaster.h index 237f6586d1..dd0c5ed8c8 100644 --- a/Core/Code/Algorithms/mitkImageCaster.h +++ b/Core/Code/Algorithms/mitkImageCaster.h @@ -1,88 +1,67 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ Version: $Revision: 17179 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#ifndef MITKIMAGECASTER_H +#define MITKIMAGECASTER_H + #include #include #include #include #include +#include + +#define DeclareMitkImageCasterMethods(r, data, type) \ + static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); \ + static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); + namespace mitk { /// /// \brief This class is just a proxy for global functions which are needed by the /// python wrapping process since global functions cannnot be wrapped. Static method /// can be wrapped though. /// class MITK_CORE_EXPORT ImageCaster { public: - // short - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - // unsigned short - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - // char - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - // unsigned char - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); + MITK_PP_SEQ_FOR_EACH(DeclareMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(2)) + MITK_PP_SEQ_FOR_EACH(DeclareMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(3)) - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - static void CastToItkImage(const mitk::Image*, itk::SmartPointer >&); - static void CastToMitkImage(const itk::Image*, itk::SmartPointer&); - - static void CastBaseData(mitk::BaseData* const, itk::SmartPointer&); + static void CastBaseData(mitk::BaseData* const, itk::SmartPointer&); }; class MITK_CORE_EXPORT Caster { public: static void Cast(BaseData* dat, Surface* surface); }; class MITK_CORE_EXPORT RendererAccess { public: static void Set3DRenderer(vtkRenderer* renderer); static vtkRenderer* Get3DRenderer(); protected: static vtkRenderer* m_3DRenderer; }; } + +#endif // MITKIMAGECASTER_H diff --git a/Core/Code/Algorithms/mitkImageToItk.h b/Core/Code/Algorithms/mitkImageToItk.h index 0d15616f82..66a8e876c8 100644 --- a/Core/Code/Algorithms/mitkImageToItk.h +++ b/Core/Code/Algorithms/mitkImageToItk.h @@ -1,119 +1,119 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2 #define IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2 #if(_MSC_VER==1200) #include #endif #include #include #include "mitkImage.h" #include "mitkImageDataItem.h" namespace mitk { /** * Create itk::ImageSource for mitk::Image * \ingroup Adaptor * * \warning 2D MITK images will get a 2D identity matrix in ITK * \todo Get clear about how to handle directed ITK 2D images in ITK */ template -class ITK_EXPORT ImageToItk : public itk::ImageSource< TOutputImage > +class ImageToItk : public itk::ImageSource< TOutputImage > { protected: mitk::Image::Pointer m_MitkImage; mitk::ImageDataItem::Pointer m_ImageDataItem; public: typedef ImageToItk Self; typedef itk::ImageSource Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Superclass typedefs. */ typedef typename Superclass::OutputImageRegionType OutputImageRegionType; /** Some convenient typedefs. */ typedef mitk::Image InputImageType; typedef InputImageType::Pointer InputImagePointer; typedef InputImageType::ConstPointer InputImageConstPointer; typedef SlicedData::RegionType InputImageRegionType; typedef typename TOutputImage::SizeType SizeType; typedef typename TOutputImage::IndexType IndexType; typedef typename TOutputImage::RegionType RegionType; typedef typename TOutputImage::PixelType PixelType; const mitk::Image * GetInput(void); const mitk::Image * GetInput(unsigned int idx); virtual void SetInput(const mitk::Image *input); virtual void SetInput(unsigned int index, const mitk::Image * image); virtual void UpdateOutputInformation(); itkGetMacro( Channel, int ); itkSetMacro( Channel, int ); itkSetMacro( CopyMemFlag, bool ); itkGetMacro( CopyMemFlag, bool ); itkBooleanMacro( CopyMemFlag ); protected: ImageToItk(): m_CopyMemFlag(false), m_Channel(0) { } virtual ~ImageToItk() { } void PrintSelf(std::ostream& os, itk::Indent indent) const; virtual void GenerateData(); virtual void GenerateOutputInformation(); private: bool m_CopyMemFlag; int m_Channel; //ImageToItk(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #ifndef ITK_MANUAL_INSTANTIATION #include "mitkImageToItk.txx" #endif #endif // IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2 diff --git a/Core/Code/Algorithms/mitkInstantiateAccessFunctions.h b/Core/Code/Algorithms/mitkInstantiateAccessFunctions.h index 2229a5cbea..76e3efa355 100644 --- a/Core/Code/Algorithms/mitkInstantiateAccessFunctions.h +++ b/Core/Code/Algorithms/mitkInstantiateAccessFunctions.h @@ -1,211 +1,159 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED #define MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED #include #include +#include + +#include +#include +#include +#include +#include +#include + +#ifndef DOXYGEN_SKIP + +#define InstantiateAccessFunctionImpl(r, itkImgFunc, type) \ + MITK_PP_CAT(InstantiateAccessFunction_, itkImgFunc) type + +// product is of the form (itkImgFunc)(short)(2) +#ifdef _MSC_VER +#define InstantiateAccessFunctionProductImpl(r, product) \ + MITK_PP_CAT(InstantiateAccessFunction_, MITK_PP_SEQ_HEAD(product)) \ + MITK_PP_EXPAND(MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product))) +#else +#define InstantiateAccessFunctionProductImpl(r, product) \ + MITK_PP_EXPAND(MITK_PP_CAT(InstantiateAccessFunction_, MITK_PP_SEQ_HEAD(product)) \ + MITK_PP_SEQ_TO_TUPLE(MITK_PP_SEQ_TAIL(product))) +#endif + +#endif // DOXYGEN_SKIP -// File created using Visual Studio by replacing regular expression -// itkImgFunc\(itk\:\:Image\<(.*),(.*)\> -// with -// itkImgFunc<\1, \2>(itk::Image<\1,\2> -// from mitkAltInstantiateAccessFunction.h //--------------------------------- instantiation functions ------------------------------ -//##Documentation -//## @brief Instantiate access function without additional parammeters -//## for all datatypes and dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. The CMake macro -//## MITK_MULTIPLEX_PICTYPE can help you with that. See \c mitk/CMake/mitkMacroMultiplexPicType.cmake -//## for documentation. -//## -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunction_1 -//## \sa InstantiateAccessFunction_2 -//## @ingroup Adaptor -#define InstantiateAccessFunction(itkImgFunc) \ - InstantiateAccessFunctionForFixedDimension(itkImgFunc, 2) \ - InstantiateAccessFunctionForFixedDimension(itkImgFunc, 3) - -//##Documentation -//## @brief Instantiate access function with one additional parammeter -//## for all datatypes and dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunction -//## \sa InstantiateAccessFunction_2 -//## @ingroup Adaptor -#define InstantiateAccessFunction_1(itkImgFunc, param1Type) \ - InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, 2, param1Type) \ - InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, 3, param1Type) - -//##Documentation -//## @brief Instantiate access function with two additional parammeters -//## for all datatypes and dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \sa InstantiateAccessFunction -//## \sa InstantiateAccessFunction_1 -//## @ingroup Adaptor -#define InstantiateAccessFunction_2(itkImgFunc, param1Type, param2Type) \ - InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, 2, param1Type, param2Type) \ - InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, 3, param1Type, param2Type) - -//##Documentation -//## @brief Instantiate access function without additional parammeters -//## for all datatypes, but fixed dimension -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedDimension_1 -//## \sa InstantiateAccessFunctionForFixedDimension_2 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedDimension(itkImgFunc, dimension) \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); - -//##Documentation -//## @brief Instantiate access function with one additional parammeter -//## for all datatypes, but fixed dimension -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedDimension -//## \sa InstantiateAccessFunctionForFixedDimension_2 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, dimension, param1Type) \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); - -//##Documentation -//## @brief Instantiate access function with two additional parammeters -//## for all datatypes, but fixed dimension -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedDimension -//## \sa InstantiateAccessFunctionForFixedDimension_1 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, dimension, param1Type, param2Type) \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); - -//##Documentation -//## @brief Instantiate access function without additional parammeters -//## for a fixed datatype, but all dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedPixelType_1 -//## \sa InstantiateAccessFunctionForFixedPixelType_2 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedPixelType(itkImgFunc, pixelType) \ -template void itkImgFunc(itk::Image*); \ -template void itkImgFunc(itk::Image*); - -//##Documentation -//## @brief Instantiate access function with one additional parammeter -//## for a fixed datatype, but all dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedPixelType -//## \sa InstantiateAccessFunctionForFixedPixelType_2 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedPixelType_1(itkImgFunc, pixelType, param1Type) \ -template void itkImgFunc(itk::Image*, param1Type); \ -template void itkImgFunc(itk::Image*, param1Type); - -//##Documentation -//## @brief Instantiate access function with two additional parammeters -//## for a fixed datatype, but all dimensions -//## -//## Use this macro once after the definition of your access function. -//## Some compilers have memory problems without the explicit instantiation. -//## You may need to move the access function to a separate file. -//## \note If you experience compiler errors, try to -//## include mitkAltInstantiateAccessFunctions.h and -//## add "Alt" (for alternate) before the call -//## (e.g. AltInstantiateAccessFunction(...)). -//## \sa InstantiateAccessFunctionForFixedPixelType -//## \sa InstantiateAccessFunctionForFixedPixelType_1 -//## @ingroup Adaptor -#define InstantiateAccessFunctionForFixedPixelType_2(itkImgFunc, pixelType, param1Type, param2Type)\ -template void itkImgFunc(itk::Image*, param1Type, param2Type); \ -template void itkImgFunc(itk::Image*, param1Type, param2Type); + +/** + * \brief Instantiate access function for the given pixel types and dimensions. + * + * Iteratively calls a macro named InstantiateAccessFunction_itkImgFunc + * which you must define and which usually explicitly instantiates your access function. + * + * A call to InstantiateAccessFunctionForFixedPixelType(T, (a)(b), (d)(e)) results in calls + * + * InstantiateAccessFunction_T(a, d)
+ * InstantiateAccessFunction_T(a, e)
+ * InstantiateAccessFunction_T(b, d)
+ * InstantiateAccessFunction_T(b, e) + * + * That is, InstantiateAccessFunction_T is called for the cartesian product of the sequences pixelTypeSeq + * and dimSeq. + * + * Example: + * \code + * template + * void MyImageAccessFunction(itk::Image* itkImage) + * { ... } + * + * #define InstantiateAccessFunction_MyImageAccessFunction(pixelType, dim) \ + * template void MyImageAccessFunction(itk::Image*); + * + * InstantiateAccessFunctionForFixedPixelType(MyImageAccessFunction, (int), (3)) + * \endcode + * + * Use this macro once after the definition of your access function. + * Some compilers have memory problems without the explicit instantiation. + * You may need to move the access function to a separate file. The CMake macro + * MITK_MULTIPLEX_PICTYPE can help you with that. See \c mitk/CMake/mitkMacroMultiplexPicType.cmake + * for documentation. + * + * \param itkImgFunc The custom part of the name of the macro to be called. + * \param pixelTypeSeq a sequence of types, like (int)(short)(char). + * \param dimSeq a sequence of dimensions, like (2)(3). + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunctionForFixedType(itkImgFunc, pixelTypeSeq, dimSeq) \ + MITK_PP_SEQ_FOR_EACH_PRODUCT(InstantiateAccessFunctionProductImpl, ((itkImgFunc))(pixelTypeSeq)(dimSeq)) + +/** + * \brief Instantiate access function for all datatypes and dimensions. + * + * \sa InstantiateAccessFunctionForFixedType + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunction(itkImgFunc) \ + InstantiateAccessFunctionForFixedDimension(itkImgFunc, 2) \ + InstantiateAccessFunctionForFixedDimension(itkImgFunc, 3) + +/** + * \brief Instantiate access function for all datatypes and a specific dimension. + * + * \sa InstantiateAccessFunctionForFixedType + * + * \param itkImgFunc The custom part of the name of the macro to be called. + * \param dimSeq a sequence of dimensions, like (2)(3). + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunctionForFixedDimension(itkImgFunc, dim) \ + InstantiateAccessFunctionForFixedType(itkImgFunc, MITK_ACCESSBYITK_TYPES_SEQ, (dim)) + +/** + * \brief Instantiate access function for all given pixel types and all dimensions. + * + * \sa InstantiateAccessFunctionForFixedType + * + * \param itkImgFunc The custom part of the name of the macro to be called. + * \param pixelTypeSeq a sequence of types, like (int)(short)(char). + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunctionForFixedPixelType(itkImgFunc, pixelTypeSeq) \ + InstantiateAccessFunctionForFixedType(itkImgFunc, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + +/** + * \brief Instantiate access function for integral datatypes and all dimensions. + * + * \sa InstantiateAccessFunctionForFixedType + * + * \param itkImgFunc The custom part of the name of the macro to be called. + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunctionForIntegralPixelTypes(itkImgFunc) \ + InstantiateAccessFunctionForFixedType(itkImgFunc, MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + +/** + * \brief Instantiate access function for floating point datatypes and all dimensions. + * + * \sa InstantiateAccessFunctionForFixedType + * + * \param itkImgFunc The custom part of the name of the macro to be called. + * + * \ingroup Adaptor + */ +#define InstantiateAccessFunctionForFloatingPixelTypes(itkImgFunc) \ + InstantiateAccessFunctionForFixedType(itkImgFunc, MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ) + #endif // of MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED diff --git a/Core/Code/Algorithms/mitkImageCast.h b/Core/Code/Algorithms/mitkPPArgCount.h similarity index 57% copy from Core/Code/Algorithms/mitkImageCast.h copy to Core/Code/Algorithms/mitkPPArgCount.h index 931b9a6194..059338d7cc 100644 --- a/Core/Code/Algorithms/mitkImageCast.h +++ b/Core/Code/Algorithms/mitkPPArgCount.h @@ -1,27 +1,38 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef MITKIMAGECAST_H_HEADER_INCLUDED -#define MITKIMAGECAST_H_HEADER_INCLUDED +#ifndef MITKPPARGCOUNT_H +#define MITKPPARGCOUNT_H -#include "itkDiffusionTensor3D.h" -#include "itkVector.h" +#define MITK_PP_ARG_COUNT(...) \ + MITK_PP_ARG_COUNT_((__VA_ARGS__, MITK_PP_RSEQ_N())) -#include +#define MITK_PP_ARG_COUNT_(tuple) \ + MITK_PP_ARG_N tuple -#endif // of MITKIMAGECAST_H_HEADER_INCLUDED +#define MITK_PP_ARG_N( \ + _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \ + _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ + _21,_22,_23,_24,_25,N,...) N + +#define MITK_PP_RSEQ_N() \ + 25,24,23,22,21,20, \ + 19,18,17,16,15,14,13,12,11,10, \ + 9,8,7,6,5,4,3,2,1,0 + +#endif // MITKPPARGCOUNT_H diff --git a/Core/Code/Algorithms/mitkPPArithmeticDec.h b/Core/Code/Algorithms/mitkPPArithmeticDec.h new file mode 100644 index 0000000000..7a8cb469c9 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPArithmeticDec.h @@ -0,0 +1,288 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_ARITHMETIC_DEC_HPP +# define MITK_PREPROCESSOR_ARITHMETIC_DEC_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_DEC */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_DEC(x) MITK_PP_DEC_I(x) +# else +# define MITK_PP_DEC(x) MITK_PP_DEC_OO((x)) +# define MITK_PP_DEC_OO(par) MITK_PP_DEC_I ## par +# endif +# +# define MITK_PP_DEC_I(x) MITK_PP_DEC_ ## x +# +# define MITK_PP_DEC_0 0 +# define MITK_PP_DEC_1 0 +# define MITK_PP_DEC_2 1 +# define MITK_PP_DEC_3 2 +# define MITK_PP_DEC_4 3 +# define MITK_PP_DEC_5 4 +# define MITK_PP_DEC_6 5 +# define MITK_PP_DEC_7 6 +# define MITK_PP_DEC_8 7 +# define MITK_PP_DEC_9 8 +# define MITK_PP_DEC_10 9 +# define MITK_PP_DEC_11 10 +# define MITK_PP_DEC_12 11 +# define MITK_PP_DEC_13 12 +# define MITK_PP_DEC_14 13 +# define MITK_PP_DEC_15 14 +# define MITK_PP_DEC_16 15 +# define MITK_PP_DEC_17 16 +# define MITK_PP_DEC_18 17 +# define MITK_PP_DEC_19 18 +# define MITK_PP_DEC_20 19 +# define MITK_PP_DEC_21 20 +# define MITK_PP_DEC_22 21 +# define MITK_PP_DEC_23 22 +# define MITK_PP_DEC_24 23 +# define MITK_PP_DEC_25 24 +# define MITK_PP_DEC_26 25 +# define MITK_PP_DEC_27 26 +# define MITK_PP_DEC_28 27 +# define MITK_PP_DEC_29 28 +# define MITK_PP_DEC_30 29 +# define MITK_PP_DEC_31 30 +# define MITK_PP_DEC_32 31 +# define MITK_PP_DEC_33 32 +# define MITK_PP_DEC_34 33 +# define MITK_PP_DEC_35 34 +# define MITK_PP_DEC_36 35 +# define MITK_PP_DEC_37 36 +# define MITK_PP_DEC_38 37 +# define MITK_PP_DEC_39 38 +# define MITK_PP_DEC_40 39 +# define MITK_PP_DEC_41 40 +# define MITK_PP_DEC_42 41 +# define MITK_PP_DEC_43 42 +# define MITK_PP_DEC_44 43 +# define MITK_PP_DEC_45 44 +# define MITK_PP_DEC_46 45 +# define MITK_PP_DEC_47 46 +# define MITK_PP_DEC_48 47 +# define MITK_PP_DEC_49 48 +# define MITK_PP_DEC_50 49 +# define MITK_PP_DEC_51 50 +# define MITK_PP_DEC_52 51 +# define MITK_PP_DEC_53 52 +# define MITK_PP_DEC_54 53 +# define MITK_PP_DEC_55 54 +# define MITK_PP_DEC_56 55 +# define MITK_PP_DEC_57 56 +# define MITK_PP_DEC_58 57 +# define MITK_PP_DEC_59 58 +# define MITK_PP_DEC_60 59 +# define MITK_PP_DEC_61 60 +# define MITK_PP_DEC_62 61 +# define MITK_PP_DEC_63 62 +# define MITK_PP_DEC_64 63 +# define MITK_PP_DEC_65 64 +# define MITK_PP_DEC_66 65 +# define MITK_PP_DEC_67 66 +# define MITK_PP_DEC_68 67 +# define MITK_PP_DEC_69 68 +# define MITK_PP_DEC_70 69 +# define MITK_PP_DEC_71 70 +# define MITK_PP_DEC_72 71 +# define MITK_PP_DEC_73 72 +# define MITK_PP_DEC_74 73 +# define MITK_PP_DEC_75 74 +# define MITK_PP_DEC_76 75 +# define MITK_PP_DEC_77 76 +# define MITK_PP_DEC_78 77 +# define MITK_PP_DEC_79 78 +# define MITK_PP_DEC_80 79 +# define MITK_PP_DEC_81 80 +# define MITK_PP_DEC_82 81 +# define MITK_PP_DEC_83 82 +# define MITK_PP_DEC_84 83 +# define MITK_PP_DEC_85 84 +# define MITK_PP_DEC_86 85 +# define MITK_PP_DEC_87 86 +# define MITK_PP_DEC_88 87 +# define MITK_PP_DEC_89 88 +# define MITK_PP_DEC_90 89 +# define MITK_PP_DEC_91 90 +# define MITK_PP_DEC_92 91 +# define MITK_PP_DEC_93 92 +# define MITK_PP_DEC_94 93 +# define MITK_PP_DEC_95 94 +# define MITK_PP_DEC_96 95 +# define MITK_PP_DEC_97 96 +# define MITK_PP_DEC_98 97 +# define MITK_PP_DEC_99 98 +# define MITK_PP_DEC_100 99 +# define MITK_PP_DEC_101 100 +# define MITK_PP_DEC_102 101 +# define MITK_PP_DEC_103 102 +# define MITK_PP_DEC_104 103 +# define MITK_PP_DEC_105 104 +# define MITK_PP_DEC_106 105 +# define MITK_PP_DEC_107 106 +# define MITK_PP_DEC_108 107 +# define MITK_PP_DEC_109 108 +# define MITK_PP_DEC_110 109 +# define MITK_PP_DEC_111 110 +# define MITK_PP_DEC_112 111 +# define MITK_PP_DEC_113 112 +# define MITK_PP_DEC_114 113 +# define MITK_PP_DEC_115 114 +# define MITK_PP_DEC_116 115 +# define MITK_PP_DEC_117 116 +# define MITK_PP_DEC_118 117 +# define MITK_PP_DEC_119 118 +# define MITK_PP_DEC_120 119 +# define MITK_PP_DEC_121 120 +# define MITK_PP_DEC_122 121 +# define MITK_PP_DEC_123 122 +# define MITK_PP_DEC_124 123 +# define MITK_PP_DEC_125 124 +# define MITK_PP_DEC_126 125 +# define MITK_PP_DEC_127 126 +# define MITK_PP_DEC_128 127 +# define MITK_PP_DEC_129 128 +# define MITK_PP_DEC_130 129 +# define MITK_PP_DEC_131 130 +# define MITK_PP_DEC_132 131 +# define MITK_PP_DEC_133 132 +# define MITK_PP_DEC_134 133 +# define MITK_PP_DEC_135 134 +# define MITK_PP_DEC_136 135 +# define MITK_PP_DEC_137 136 +# define MITK_PP_DEC_138 137 +# define MITK_PP_DEC_139 138 +# define MITK_PP_DEC_140 139 +# define MITK_PP_DEC_141 140 +# define MITK_PP_DEC_142 141 +# define MITK_PP_DEC_143 142 +# define MITK_PP_DEC_144 143 +# define MITK_PP_DEC_145 144 +# define MITK_PP_DEC_146 145 +# define MITK_PP_DEC_147 146 +# define MITK_PP_DEC_148 147 +# define MITK_PP_DEC_149 148 +# define MITK_PP_DEC_150 149 +# define MITK_PP_DEC_151 150 +# define MITK_PP_DEC_152 151 +# define MITK_PP_DEC_153 152 +# define MITK_PP_DEC_154 153 +# define MITK_PP_DEC_155 154 +# define MITK_PP_DEC_156 155 +# define MITK_PP_DEC_157 156 +# define MITK_PP_DEC_158 157 +# define MITK_PP_DEC_159 158 +# define MITK_PP_DEC_160 159 +# define MITK_PP_DEC_161 160 +# define MITK_PP_DEC_162 161 +# define MITK_PP_DEC_163 162 +# define MITK_PP_DEC_164 163 +# define MITK_PP_DEC_165 164 +# define MITK_PP_DEC_166 165 +# define MITK_PP_DEC_167 166 +# define MITK_PP_DEC_168 167 +# define MITK_PP_DEC_169 168 +# define MITK_PP_DEC_170 169 +# define MITK_PP_DEC_171 170 +# define MITK_PP_DEC_172 171 +# define MITK_PP_DEC_173 172 +# define MITK_PP_DEC_174 173 +# define MITK_PP_DEC_175 174 +# define MITK_PP_DEC_176 175 +# define MITK_PP_DEC_177 176 +# define MITK_PP_DEC_178 177 +# define MITK_PP_DEC_179 178 +# define MITK_PP_DEC_180 179 +# define MITK_PP_DEC_181 180 +# define MITK_PP_DEC_182 181 +# define MITK_PP_DEC_183 182 +# define MITK_PP_DEC_184 183 +# define MITK_PP_DEC_185 184 +# define MITK_PP_DEC_186 185 +# define MITK_PP_DEC_187 186 +# define MITK_PP_DEC_188 187 +# define MITK_PP_DEC_189 188 +# define MITK_PP_DEC_190 189 +# define MITK_PP_DEC_191 190 +# define MITK_PP_DEC_192 191 +# define MITK_PP_DEC_193 192 +# define MITK_PP_DEC_194 193 +# define MITK_PP_DEC_195 194 +# define MITK_PP_DEC_196 195 +# define MITK_PP_DEC_197 196 +# define MITK_PP_DEC_198 197 +# define MITK_PP_DEC_199 198 +# define MITK_PP_DEC_200 199 +# define MITK_PP_DEC_201 200 +# define MITK_PP_DEC_202 201 +# define MITK_PP_DEC_203 202 +# define MITK_PP_DEC_204 203 +# define MITK_PP_DEC_205 204 +# define MITK_PP_DEC_206 205 +# define MITK_PP_DEC_207 206 +# define MITK_PP_DEC_208 207 +# define MITK_PP_DEC_209 208 +# define MITK_PP_DEC_210 209 +# define MITK_PP_DEC_211 210 +# define MITK_PP_DEC_212 211 +# define MITK_PP_DEC_213 212 +# define MITK_PP_DEC_214 213 +# define MITK_PP_DEC_215 214 +# define MITK_PP_DEC_216 215 +# define MITK_PP_DEC_217 216 +# define MITK_PP_DEC_218 217 +# define MITK_PP_DEC_219 218 +# define MITK_PP_DEC_220 219 +# define MITK_PP_DEC_221 220 +# define MITK_PP_DEC_222 221 +# define MITK_PP_DEC_223 222 +# define MITK_PP_DEC_224 223 +# define MITK_PP_DEC_225 224 +# define MITK_PP_DEC_226 225 +# define MITK_PP_DEC_227 226 +# define MITK_PP_DEC_228 227 +# define MITK_PP_DEC_229 228 +# define MITK_PP_DEC_230 229 +# define MITK_PP_DEC_231 230 +# define MITK_PP_DEC_232 231 +# define MITK_PP_DEC_233 232 +# define MITK_PP_DEC_234 233 +# define MITK_PP_DEC_235 234 +# define MITK_PP_DEC_236 235 +# define MITK_PP_DEC_237 236 +# define MITK_PP_DEC_238 237 +# define MITK_PP_DEC_239 238 +# define MITK_PP_DEC_240 239 +# define MITK_PP_DEC_241 240 +# define MITK_PP_DEC_242 241 +# define MITK_PP_DEC_243 242 +# define MITK_PP_DEC_244 243 +# define MITK_PP_DEC_245 244 +# define MITK_PP_DEC_246 245 +# define MITK_PP_DEC_247 246 +# define MITK_PP_DEC_248 247 +# define MITK_PP_DEC_249 248 +# define MITK_PP_DEC_250 249 +# define MITK_PP_DEC_251 250 +# define MITK_PP_DEC_252 251 +# define MITK_PP_DEC_253 252 +# define MITK_PP_DEC_254 253 +# define MITK_PP_DEC_255 254 +# define MITK_PP_DEC_256 255 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPCat.h b/Core/Code/Algorithms/mitkPPCat.h new file mode 100644 index 0000000000..36973a7b54 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPCat.h @@ -0,0 +1,35 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_CAT_HPP +# define MITK_PREPROCESSOR_CAT_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_CAT */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_CAT(a, b) MITK_PP_CAT_I(a, b) +# else +# define MITK_PP_CAT(a, b) MITK_PP_CAT_OO((a, b)) +# define MITK_PP_CAT_OO(par) MITK_PP_CAT_I ## par +# endif +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_CAT_I(a, b) a ## b +# else +# define MITK_PP_CAT_I(a, b) MITK_PP_CAT_II(a ## b) +# define MITK_PP_CAT_II(res) res +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPPConfig.h b/Core/Code/Algorithms/mitkPPConfig.h new file mode 100644 index 0000000000..39168738a8 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPConfig.h @@ -0,0 +1,70 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_CONFIG_CONFIG_HPP +# define MITK_PREPROCESSOR_CONFIG_CONFIG_HPP +# +# /* MITK_PP_CONFIG_FLAGS */ +# +# define MITK_PP_CONFIG_STRICT() 0x0001 +# define MITK_PP_CONFIG_IDEAL() 0x0002 +# +# define MITK_PP_CONFIG_MSVC() 0x0004 +# define MITK_PP_CONFIG_MWCC() 0x0008 +# define MITK_PP_CONFIG_BCC() 0x0010 +# define MITK_PP_CONFIG_EDG() 0x0020 +# define MITK_PP_CONFIG_DMC() 0x0040 +# +# ifndef MITK_PP_CONFIG_FLAGS +# if defined(__GCCXML__) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_STRICT()) +# elif defined(__WAVE__) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_STRICT()) +# elif defined(__MWERKS__) && __MWERKS__ >= 0x3200 +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_STRICT()) +# elif defined(__EDG__) || defined(__EDG_VERSION__) +# if defined(_MSC_VER) && __EDG_VERSION__ >= 308 +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_MSVC()) +# else +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_EDG() | MITK_PP_CONFIG_STRICT()) +# endif +# elif defined(__MWERKS__) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_MWCC()) +# elif defined(__DMC__) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_DMC()) +# elif defined(__BORLANDC__) && __BORLANDC__ >= 0x581 +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_STRICT()) +# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_BCC()) +# elif defined(_MSC_VER) +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_MSVC()) +# else +# define MITK_PP_CONFIG_FLAGS() (MITK_PP_CONFIG_STRICT()) +# endif +# endif +# +# /* MITK_PP_CONFIG_EXTENDED_LINE_INFO */ +# +# ifndef MITK_PP_CONFIG_EXTENDED_LINE_INFO +# define MITK_PP_CONFIG_EXTENDED_LINE_INFO 0 +# endif +# +# /* MITK_PP_CONFIG_ERRORS */ +# +# ifndef MITK_PP_CONFIG_ERRORS +# ifdef NDEBUG +# define MITK_PP_CONFIG_ERRORS 0 +# else +# define MITK_PP_CONFIG_ERRORS 1 +# endif +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPPControlExprIIf.h b/Core/Code/Algorithms/mitkPPControlExprIIf.h new file mode 100644 index 0000000000..d7262de6a8 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPControlExprIIf.h @@ -0,0 +1,31 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_CONTROL_EXPR_IIF_HPP +# define MITK_PREPROCESSOR_CONTROL_EXPR_IIF_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_EXPR_IIF */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_EXPR_IIF(bit, expr) MITK_PP_EXPR_IIF_I(bit, expr) +# else +# define MITK_PP_EXPR_IIF(bit, expr) MITK_PP_EXPR_IIF_OO((bit, expr)) +# define MITK_PP_EXPR_IIF_OO(par) MITK_PP_EXPR_IIF_I ## par +# endif +# +# define MITK_PP_EXPR_IIF_I(bit, expr) MITK_PP_EXPR_IIF_ ## bit(expr) +# +# define MITK_PP_EXPR_IIF_0(expr) +# define MITK_PP_EXPR_IIF_1(expr) expr +# +# endif diff --git a/Core/Code/Algorithms/mitkPPControlIIf.h b/Core/Code/Algorithms/mitkPPControlIIf.h new file mode 100644 index 0000000000..565b7fd9f6 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPControlIIf.h @@ -0,0 +1,34 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_CONTROL_IIF_HPP +# define MITK_PREPROCESSOR_CONTROL_IIF_HPP +# +# include "mitkPPConfig.h" +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_IIF(bit, t, f) MITK_PP_IIF_I(bit, t, f) +# else +# define MITK_PP_IIF(bit, t, f) MITK_PP_IIF_OO((bit, t, f)) +# define MITK_PP_IIF_OO(par) MITK_PP_IIF_I ## par +# endif +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_IIF_I(bit, t, f) MITK_PP_IIF_ ## bit(t, f) +# else +# define MITK_PP_IIF_I(bit, t, f) MITK_PP_IIF_II(MITK_PP_IIF_ ## bit(t, f)) +# define MITK_PP_IIF_II(id) id +# endif +# +# define MITK_PP_IIF_0(t, f) f +# define MITK_PP_IIF_1(t, f) t +# +# endif diff --git a/Core/Code/Algorithms/mitkPPControlIf.h b/Core/Code/Algorithms/mitkPPControlIf.h new file mode 100644 index 0000000000..9c64d12743 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPControlIf.h @@ -0,0 +1,30 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_CONTROL_IF_HPP +# define MITK_PREPROCESSOR_CONTROL_IF_HPP +# +# include "mitkPPConfig.h" +# include "mitkPPControlIIf.h" +# include "mitkPPLogicalBool.h" +# +# /* MITK_PP_IF */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_IF(cond, t, f) MITK_PP_IIF(MITK_PP_BOOL(cond), t, f) +# else +# define MITK_PP_IF(cond, t, f) MITK_PP_IF_I(cond, t, f) +# define MITK_PP_IF_I(cond, t, f) MITK_PP_IIF(MITK_PP_BOOL(cond), t, f) +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPPDebugError.h b/Core/Code/Algorithms/mitkPPDebugError.h new file mode 100644 index 0000000000..800c390658 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPDebugError.h @@ -0,0 +1,33 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_DEBUG_ERROR_HPP +# define MITK_PREPROCESSOR_DEBUG_ERROR_HPP +# +# include "mitkPPCat.h" +# include "mitkPPConfig.h" +# +# /* MITK_PP_ERROR */ +# +# if MITK_PP_CONFIG_ERRORS +# define MITK_PP_ERROR(code) MITK_PP_CAT(MITK_PP_ERROR_, code) +# endif +# +# define MITK_PP_ERROR_0x0000 MITK_PP_ERROR(0x0000, MITK_PP_INDEX_OUT_OF_BOUNDS) +# define MITK_PP_ERROR_0x0001 MITK_PP_ERROR(0x0001, MITK_PP_WHILE_OVERFLOW) +# define MITK_PP_ERROR_0x0002 MITK_PP_ERROR(0x0002, MITK_PP_FOR_OVERFLOW) +# define MITK_PP_ERROR_0x0003 MITK_PP_ERROR(0x0003, MITK_PP_REPEAT_OVERFLOW) +# define MITK_PP_ERROR_0x0004 MITK_PP_ERROR(0x0004, MITK_PP_LIST_FOLD_OVERFLOW) +# define MITK_PP_ERROR_0x0005 MITK_PP_ERROR(0x0005, MITK_PP_SEQ_FOLD_OVERFLOW) +# define MITK_PP_ERROR_0x0006 MITK_PP_ERROR(0x0006, MITK_PP_ARITHMETIC_OVERFLOW) +# define MITK_PP_ERROR_0x0007 MITK_PP_ERROR(0x0007, MITK_PP_DIVISION_BY_ZERO) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPDetailAutoRec.h b/Core/Code/Algorithms/mitkPPDetailAutoRec.h new file mode 100644 index 0000000000..42289fbe44 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPDetailAutoRec.h @@ -0,0 +1,293 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# include "mitkPPConfig.h" +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_DMC() +# include "mitkPPDetailDMCAutoRec.h" +# else +# +# ifndef MITK_PREPROCESSOR_DETAIL_AUTO_REC_HPP +# define MITK_PREPROCESSOR_DETAIL_AUTO_REC_HPP +# +# include "mitkPPControlIIf.h" +# +# /* MITK_PP_AUTO_REC */ +# +# define MITK_PP_AUTO_REC(pred, n) MITK_PP_NODE_ENTRY_ ## n(pred) +# +# define MITK_PP_NODE_ENTRY_256(p) MITK_PP_NODE_128(p)(p)(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_128(p) MITK_PP_NODE_64(p)(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_64(p) MITK_PP_NODE_32(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_32(p) MITK_PP_NODE_16(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_16(p) MITK_PP_NODE_8(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_8(p) MITK_PP_NODE_4(p)(p)(p) +# define MITK_PP_NODE_ENTRY_4(p) MITK_PP_NODE_2(p)(p) +# define MITK_PP_NODE_ENTRY_2(p) MITK_PP_NODE_1(p) +# +# define MITK_PP_NODE_128(p) MITK_PP_IIF(p(128), MITK_PP_NODE_64, MITK_PP_NODE_192) +# define MITK_PP_NODE_64(p) MITK_PP_IIF(p(64), MITK_PP_NODE_32, MITK_PP_NODE_96) +# define MITK_PP_NODE_32(p) MITK_PP_IIF(p(32), MITK_PP_NODE_16, MITK_PP_NODE_48) +# define MITK_PP_NODE_16(p) MITK_PP_IIF(p(16), MITK_PP_NODE_8, MITK_PP_NODE_24) +# define MITK_PP_NODE_8(p) MITK_PP_IIF(p(8), MITK_PP_NODE_4, MITK_PP_NODE_12) +# define MITK_PP_NODE_4(p) MITK_PP_IIF(p(4), MITK_PP_NODE_2, MITK_PP_NODE_6) +# define MITK_PP_NODE_2(p) MITK_PP_IIF(p(2), MITK_PP_NODE_1, MITK_PP_NODE_3) +# define MITK_PP_NODE_1(p) MITK_PP_IIF(p(1), 1, 2) +# define MITK_PP_NODE_3(p) MITK_PP_IIF(p(3), 3, 4) +# define MITK_PP_NODE_6(p) MITK_PP_IIF(p(6), MITK_PP_NODE_5, MITK_PP_NODE_7) +# define MITK_PP_NODE_5(p) MITK_PP_IIF(p(5), 5, 6) +# define MITK_PP_NODE_7(p) MITK_PP_IIF(p(7), 7, 8) +# define MITK_PP_NODE_12(p) MITK_PP_IIF(p(12), MITK_PP_NODE_10, MITK_PP_NODE_14) +# define MITK_PP_NODE_10(p) MITK_PP_IIF(p(10), MITK_PP_NODE_9, MITK_PP_NODE_11) +# define MITK_PP_NODE_9(p) MITK_PP_IIF(p(9), 9, 10) +# define MITK_PP_NODE_11(p) MITK_PP_IIF(p(11), 11, 12) +# define MITK_PP_NODE_14(p) MITK_PP_IIF(p(14), MITK_PP_NODE_13, MITK_PP_NODE_15) +# define MITK_PP_NODE_13(p) MITK_PP_IIF(p(13), 13, 14) +# define MITK_PP_NODE_15(p) MITK_PP_IIF(p(15), 15, 16) +# define MITK_PP_NODE_24(p) MITK_PP_IIF(p(24), MITK_PP_NODE_20, MITK_PP_NODE_28) +# define MITK_PP_NODE_20(p) MITK_PP_IIF(p(20), MITK_PP_NODE_18, MITK_PP_NODE_22) +# define MITK_PP_NODE_18(p) MITK_PP_IIF(p(18), MITK_PP_NODE_17, MITK_PP_NODE_19) +# define MITK_PP_NODE_17(p) MITK_PP_IIF(p(17), 17, 18) +# define MITK_PP_NODE_19(p) MITK_PP_IIF(p(19), 19, 20) +# define MITK_PP_NODE_22(p) MITK_PP_IIF(p(22), MITK_PP_NODE_21, MITK_PP_NODE_23) +# define MITK_PP_NODE_21(p) MITK_PP_IIF(p(21), 21, 22) +# define MITK_PP_NODE_23(p) MITK_PP_IIF(p(23), 23, 24) +# define MITK_PP_NODE_28(p) MITK_PP_IIF(p(28), MITK_PP_NODE_26, MITK_PP_NODE_30) +# define MITK_PP_NODE_26(p) MITK_PP_IIF(p(26), MITK_PP_NODE_25, MITK_PP_NODE_27) +# define MITK_PP_NODE_25(p) MITK_PP_IIF(p(25), 25, 26) +# define MITK_PP_NODE_27(p) MITK_PP_IIF(p(27), 27, 28) +# define MITK_PP_NODE_30(p) MITK_PP_IIF(p(30), MITK_PP_NODE_29, MITK_PP_NODE_31) +# define MITK_PP_NODE_29(p) MITK_PP_IIF(p(29), 29, 30) +# define MITK_PP_NODE_31(p) MITK_PP_IIF(p(31), 31, 32) +# define MITK_PP_NODE_48(p) MITK_PP_IIF(p(48), MITK_PP_NODE_40, MITK_PP_NODE_56) +# define MITK_PP_NODE_40(p) MITK_PP_IIF(p(40), MITK_PP_NODE_36, MITK_PP_NODE_44) +# define MITK_PP_NODE_36(p) MITK_PP_IIF(p(36), MITK_PP_NODE_34, MITK_PP_NODE_38) +# define MITK_PP_NODE_34(p) MITK_PP_IIF(p(34), MITK_PP_NODE_33, MITK_PP_NODE_35) +# define MITK_PP_NODE_33(p) MITK_PP_IIF(p(33), 33, 34) +# define MITK_PP_NODE_35(p) MITK_PP_IIF(p(35), 35, 36) +# define MITK_PP_NODE_38(p) MITK_PP_IIF(p(38), MITK_PP_NODE_37, MITK_PP_NODE_39) +# define MITK_PP_NODE_37(p) MITK_PP_IIF(p(37), 37, 38) +# define MITK_PP_NODE_39(p) MITK_PP_IIF(p(39), 39, 40) +# define MITK_PP_NODE_44(p) MITK_PP_IIF(p(44), MITK_PP_NODE_42, MITK_PP_NODE_46) +# define MITK_PP_NODE_42(p) MITK_PP_IIF(p(42), MITK_PP_NODE_41, MITK_PP_NODE_43) +# define MITK_PP_NODE_41(p) MITK_PP_IIF(p(41), 41, 42) +# define MITK_PP_NODE_43(p) MITK_PP_IIF(p(43), 43, 44) +# define MITK_PP_NODE_46(p) MITK_PP_IIF(p(46), MITK_PP_NODE_45, MITK_PP_NODE_47) +# define MITK_PP_NODE_45(p) MITK_PP_IIF(p(45), 45, 46) +# define MITK_PP_NODE_47(p) MITK_PP_IIF(p(47), 47, 48) +# define MITK_PP_NODE_56(p) MITK_PP_IIF(p(56), MITK_PP_NODE_52, MITK_PP_NODE_60) +# define MITK_PP_NODE_52(p) MITK_PP_IIF(p(52), MITK_PP_NODE_50, MITK_PP_NODE_54) +# define MITK_PP_NODE_50(p) MITK_PP_IIF(p(50), MITK_PP_NODE_49, MITK_PP_NODE_51) +# define MITK_PP_NODE_49(p) MITK_PP_IIF(p(49), 49, 50) +# define MITK_PP_NODE_51(p) MITK_PP_IIF(p(51), 51, 52) +# define MITK_PP_NODE_54(p) MITK_PP_IIF(p(54), MITK_PP_NODE_53, MITK_PP_NODE_55) +# define MITK_PP_NODE_53(p) MITK_PP_IIF(p(53), 53, 54) +# define MITK_PP_NODE_55(p) MITK_PP_IIF(p(55), 55, 56) +# define MITK_PP_NODE_60(p) MITK_PP_IIF(p(60), MITK_PP_NODE_58, MITK_PP_NODE_62) +# define MITK_PP_NODE_58(p) MITK_PP_IIF(p(58), MITK_PP_NODE_57, MITK_PP_NODE_59) +# define MITK_PP_NODE_57(p) MITK_PP_IIF(p(57), 57, 58) +# define MITK_PP_NODE_59(p) MITK_PP_IIF(p(59), 59, 60) +# define MITK_PP_NODE_62(p) MITK_PP_IIF(p(62), MITK_PP_NODE_61, MITK_PP_NODE_63) +# define MITK_PP_NODE_61(p) MITK_PP_IIF(p(61), 61, 62) +# define MITK_PP_NODE_63(p) MITK_PP_IIF(p(63), 63, 64) +# define MITK_PP_NODE_96(p) MITK_PP_IIF(p(96), MITK_PP_NODE_80, MITK_PP_NODE_112) +# define MITK_PP_NODE_80(p) MITK_PP_IIF(p(80), MITK_PP_NODE_72, MITK_PP_NODE_88) +# define MITK_PP_NODE_72(p) MITK_PP_IIF(p(72), MITK_PP_NODE_68, MITK_PP_NODE_76) +# define MITK_PP_NODE_68(p) MITK_PP_IIF(p(68), MITK_PP_NODE_66, MITK_PP_NODE_70) +# define MITK_PP_NODE_66(p) MITK_PP_IIF(p(66), MITK_PP_NODE_65, MITK_PP_NODE_67) +# define MITK_PP_NODE_65(p) MITK_PP_IIF(p(65), 65, 66) +# define MITK_PP_NODE_67(p) MITK_PP_IIF(p(67), 67, 68) +# define MITK_PP_NODE_70(p) MITK_PP_IIF(p(70), MITK_PP_NODE_69, MITK_PP_NODE_71) +# define MITK_PP_NODE_69(p) MITK_PP_IIF(p(69), 69, 70) +# define MITK_PP_NODE_71(p) MITK_PP_IIF(p(71), 71, 72) +# define MITK_PP_NODE_76(p) MITK_PP_IIF(p(76), MITK_PP_NODE_74, MITK_PP_NODE_78) +# define MITK_PP_NODE_74(p) MITK_PP_IIF(p(74), MITK_PP_NODE_73, MITK_PP_NODE_75) +# define MITK_PP_NODE_73(p) MITK_PP_IIF(p(73), 73, 74) +# define MITK_PP_NODE_75(p) MITK_PP_IIF(p(75), 75, 76) +# define MITK_PP_NODE_78(p) MITK_PP_IIF(p(78), MITK_PP_NODE_77, MITK_PP_NODE_79) +# define MITK_PP_NODE_77(p) MITK_PP_IIF(p(77), 77, 78) +# define MITK_PP_NODE_79(p) MITK_PP_IIF(p(79), 79, 80) +# define MITK_PP_NODE_88(p) MITK_PP_IIF(p(88), MITK_PP_NODE_84, MITK_PP_NODE_92) +# define MITK_PP_NODE_84(p) MITK_PP_IIF(p(84), MITK_PP_NODE_82, MITK_PP_NODE_86) +# define MITK_PP_NODE_82(p) MITK_PP_IIF(p(82), MITK_PP_NODE_81, MITK_PP_NODE_83) +# define MITK_PP_NODE_81(p) MITK_PP_IIF(p(81), 81, 82) +# define MITK_PP_NODE_83(p) MITK_PP_IIF(p(83), 83, 84) +# define MITK_PP_NODE_86(p) MITK_PP_IIF(p(86), MITK_PP_NODE_85, MITK_PP_NODE_87) +# define MITK_PP_NODE_85(p) MITK_PP_IIF(p(85), 85, 86) +# define MITK_PP_NODE_87(p) MITK_PP_IIF(p(87), 87, 88) +# define MITK_PP_NODE_92(p) MITK_PP_IIF(p(92), MITK_PP_NODE_90, MITK_PP_NODE_94) +# define MITK_PP_NODE_90(p) MITK_PP_IIF(p(90), MITK_PP_NODE_89, MITK_PP_NODE_91) +# define MITK_PP_NODE_89(p) MITK_PP_IIF(p(89), 89, 90) +# define MITK_PP_NODE_91(p) MITK_PP_IIF(p(91), 91, 92) +# define MITK_PP_NODE_94(p) MITK_PP_IIF(p(94), MITK_PP_NODE_93, MITK_PP_NODE_95) +# define MITK_PP_NODE_93(p) MITK_PP_IIF(p(93), 93, 94) +# define MITK_PP_NODE_95(p) MITK_PP_IIF(p(95), 95, 96) +# define MITK_PP_NODE_112(p) MITK_PP_IIF(p(112), MITK_PP_NODE_104, MITK_PP_NODE_120) +# define MITK_PP_NODE_104(p) MITK_PP_IIF(p(104), MITK_PP_NODE_100, MITK_PP_NODE_108) +# define MITK_PP_NODE_100(p) MITK_PP_IIF(p(100), MITK_PP_NODE_98, MITK_PP_NODE_102) +# define MITK_PP_NODE_98(p) MITK_PP_IIF(p(98), MITK_PP_NODE_97, MITK_PP_NODE_99) +# define MITK_PP_NODE_97(p) MITK_PP_IIF(p(97), 97, 98) +# define MITK_PP_NODE_99(p) MITK_PP_IIF(p(99), 99, 100) +# define MITK_PP_NODE_102(p) MITK_PP_IIF(p(102), MITK_PP_NODE_101, MITK_PP_NODE_103) +# define MITK_PP_NODE_101(p) MITK_PP_IIF(p(101), 101, 102) +# define MITK_PP_NODE_103(p) MITK_PP_IIF(p(103), 103, 104) +# define MITK_PP_NODE_108(p) MITK_PP_IIF(p(108), MITK_PP_NODE_106, MITK_PP_NODE_110) +# define MITK_PP_NODE_106(p) MITK_PP_IIF(p(106), MITK_PP_NODE_105, MITK_PP_NODE_107) +# define MITK_PP_NODE_105(p) MITK_PP_IIF(p(105), 105, 106) +# define MITK_PP_NODE_107(p) MITK_PP_IIF(p(107), 107, 108) +# define MITK_PP_NODE_110(p) MITK_PP_IIF(p(110), MITK_PP_NODE_109, MITK_PP_NODE_111) +# define MITK_PP_NODE_109(p) MITK_PP_IIF(p(109), 109, 110) +# define MITK_PP_NODE_111(p) MITK_PP_IIF(p(111), 111, 112) +# define MITK_PP_NODE_120(p) MITK_PP_IIF(p(120), MITK_PP_NODE_116, MITK_PP_NODE_124) +# define MITK_PP_NODE_116(p) MITK_PP_IIF(p(116), MITK_PP_NODE_114, MITK_PP_NODE_118) +# define MITK_PP_NODE_114(p) MITK_PP_IIF(p(114), MITK_PP_NODE_113, MITK_PP_NODE_115) +# define MITK_PP_NODE_113(p) MITK_PP_IIF(p(113), 113, 114) +# define MITK_PP_NODE_115(p) MITK_PP_IIF(p(115), 115, 116) +# define MITK_PP_NODE_118(p) MITK_PP_IIF(p(118), MITK_PP_NODE_117, MITK_PP_NODE_119) +# define MITK_PP_NODE_117(p) MITK_PP_IIF(p(117), 117, 118) +# define MITK_PP_NODE_119(p) MITK_PP_IIF(p(119), 119, 120) +# define MITK_PP_NODE_124(p) MITK_PP_IIF(p(124), MITK_PP_NODE_122, MITK_PP_NODE_126) +# define MITK_PP_NODE_122(p) MITK_PP_IIF(p(122), MITK_PP_NODE_121, MITK_PP_NODE_123) +# define MITK_PP_NODE_121(p) MITK_PP_IIF(p(121), 121, 122) +# define MITK_PP_NODE_123(p) MITK_PP_IIF(p(123), 123, 124) +# define MITK_PP_NODE_126(p) MITK_PP_IIF(p(126), MITK_PP_NODE_125, MITK_PP_NODE_127) +# define MITK_PP_NODE_125(p) MITK_PP_IIF(p(125), 125, 126) +# define MITK_PP_NODE_127(p) MITK_PP_IIF(p(127), 127, 128) +# define MITK_PP_NODE_192(p) MITK_PP_IIF(p(192), MITK_PP_NODE_160, MITK_PP_NODE_224) +# define MITK_PP_NODE_160(p) MITK_PP_IIF(p(160), MITK_PP_NODE_144, MITK_PP_NODE_176) +# define MITK_PP_NODE_144(p) MITK_PP_IIF(p(144), MITK_PP_NODE_136, MITK_PP_NODE_152) +# define MITK_PP_NODE_136(p) MITK_PP_IIF(p(136), MITK_PP_NODE_132, MITK_PP_NODE_140) +# define MITK_PP_NODE_132(p) MITK_PP_IIF(p(132), MITK_PP_NODE_130, MITK_PP_NODE_134) +# define MITK_PP_NODE_130(p) MITK_PP_IIF(p(130), MITK_PP_NODE_129, MITK_PP_NODE_131) +# define MITK_PP_NODE_129(p) MITK_PP_IIF(p(129), 129, 130) +# define MITK_PP_NODE_131(p) MITK_PP_IIF(p(131), 131, 132) +# define MITK_PP_NODE_134(p) MITK_PP_IIF(p(134), MITK_PP_NODE_133, MITK_PP_NODE_135) +# define MITK_PP_NODE_133(p) MITK_PP_IIF(p(133), 133, 134) +# define MITK_PP_NODE_135(p) MITK_PP_IIF(p(135), 135, 136) +# define MITK_PP_NODE_140(p) MITK_PP_IIF(p(140), MITK_PP_NODE_138, MITK_PP_NODE_142) +# define MITK_PP_NODE_138(p) MITK_PP_IIF(p(138), MITK_PP_NODE_137, MITK_PP_NODE_139) +# define MITK_PP_NODE_137(p) MITK_PP_IIF(p(137), 137, 138) +# define MITK_PP_NODE_139(p) MITK_PP_IIF(p(139), 139, 140) +# define MITK_PP_NODE_142(p) MITK_PP_IIF(p(142), MITK_PP_NODE_141, MITK_PP_NODE_143) +# define MITK_PP_NODE_141(p) MITK_PP_IIF(p(141), 141, 142) +# define MITK_PP_NODE_143(p) MITK_PP_IIF(p(143), 143, 144) +# define MITK_PP_NODE_152(p) MITK_PP_IIF(p(152), MITK_PP_NODE_148, MITK_PP_NODE_156) +# define MITK_PP_NODE_148(p) MITK_PP_IIF(p(148), MITK_PP_NODE_146, MITK_PP_NODE_150) +# define MITK_PP_NODE_146(p) MITK_PP_IIF(p(146), MITK_PP_NODE_145, MITK_PP_NODE_147) +# define MITK_PP_NODE_145(p) MITK_PP_IIF(p(145), 145, 146) +# define MITK_PP_NODE_147(p) MITK_PP_IIF(p(147), 147, 148) +# define MITK_PP_NODE_150(p) MITK_PP_IIF(p(150), MITK_PP_NODE_149, MITK_PP_NODE_151) +# define MITK_PP_NODE_149(p) MITK_PP_IIF(p(149), 149, 150) +# define MITK_PP_NODE_151(p) MITK_PP_IIF(p(151), 151, 152) +# define MITK_PP_NODE_156(p) MITK_PP_IIF(p(156), MITK_PP_NODE_154, MITK_PP_NODE_158) +# define MITK_PP_NODE_154(p) MITK_PP_IIF(p(154), MITK_PP_NODE_153, MITK_PP_NODE_155) +# define MITK_PP_NODE_153(p) MITK_PP_IIF(p(153), 153, 154) +# define MITK_PP_NODE_155(p) MITK_PP_IIF(p(155), 155, 156) +# define MITK_PP_NODE_158(p) MITK_PP_IIF(p(158), MITK_PP_NODE_157, MITK_PP_NODE_159) +# define MITK_PP_NODE_157(p) MITK_PP_IIF(p(157), 157, 158) +# define MITK_PP_NODE_159(p) MITK_PP_IIF(p(159), 159, 160) +# define MITK_PP_NODE_176(p) MITK_PP_IIF(p(176), MITK_PP_NODE_168, MITK_PP_NODE_184) +# define MITK_PP_NODE_168(p) MITK_PP_IIF(p(168), MITK_PP_NODE_164, MITK_PP_NODE_172) +# define MITK_PP_NODE_164(p) MITK_PP_IIF(p(164), MITK_PP_NODE_162, MITK_PP_NODE_166) +# define MITK_PP_NODE_162(p) MITK_PP_IIF(p(162), MITK_PP_NODE_161, MITK_PP_NODE_163) +# define MITK_PP_NODE_161(p) MITK_PP_IIF(p(161), 161, 162) +# define MITK_PP_NODE_163(p) MITK_PP_IIF(p(163), 163, 164) +# define MITK_PP_NODE_166(p) MITK_PP_IIF(p(166), MITK_PP_NODE_165, MITK_PP_NODE_167) +# define MITK_PP_NODE_165(p) MITK_PP_IIF(p(165), 165, 166) +# define MITK_PP_NODE_167(p) MITK_PP_IIF(p(167), 167, 168) +# define MITK_PP_NODE_172(p) MITK_PP_IIF(p(172), MITK_PP_NODE_170, MITK_PP_NODE_174) +# define MITK_PP_NODE_170(p) MITK_PP_IIF(p(170), MITK_PP_NODE_169, MITK_PP_NODE_171) +# define MITK_PP_NODE_169(p) MITK_PP_IIF(p(169), 169, 170) +# define MITK_PP_NODE_171(p) MITK_PP_IIF(p(171), 171, 172) +# define MITK_PP_NODE_174(p) MITK_PP_IIF(p(174), MITK_PP_NODE_173, MITK_PP_NODE_175) +# define MITK_PP_NODE_173(p) MITK_PP_IIF(p(173), 173, 174) +# define MITK_PP_NODE_175(p) MITK_PP_IIF(p(175), 175, 176) +# define MITK_PP_NODE_184(p) MITK_PP_IIF(p(184), MITK_PP_NODE_180, MITK_PP_NODE_188) +# define MITK_PP_NODE_180(p) MITK_PP_IIF(p(180), MITK_PP_NODE_178, MITK_PP_NODE_182) +# define MITK_PP_NODE_178(p) MITK_PP_IIF(p(178), MITK_PP_NODE_177, MITK_PP_NODE_179) +# define MITK_PP_NODE_177(p) MITK_PP_IIF(p(177), 177, 178) +# define MITK_PP_NODE_179(p) MITK_PP_IIF(p(179), 179, 180) +# define MITK_PP_NODE_182(p) MITK_PP_IIF(p(182), MITK_PP_NODE_181, MITK_PP_NODE_183) +# define MITK_PP_NODE_181(p) MITK_PP_IIF(p(181), 181, 182) +# define MITK_PP_NODE_183(p) MITK_PP_IIF(p(183), 183, 184) +# define MITK_PP_NODE_188(p) MITK_PP_IIF(p(188), MITK_PP_NODE_186, MITK_PP_NODE_190) +# define MITK_PP_NODE_186(p) MITK_PP_IIF(p(186), MITK_PP_NODE_185, MITK_PP_NODE_187) +# define MITK_PP_NODE_185(p) MITK_PP_IIF(p(185), 185, 186) +# define MITK_PP_NODE_187(p) MITK_PP_IIF(p(187), 187, 188) +# define MITK_PP_NODE_190(p) MITK_PP_IIF(p(190), MITK_PP_NODE_189, MITK_PP_NODE_191) +# define MITK_PP_NODE_189(p) MITK_PP_IIF(p(189), 189, 190) +# define MITK_PP_NODE_191(p) MITK_PP_IIF(p(191), 191, 192) +# define MITK_PP_NODE_224(p) MITK_PP_IIF(p(224), MITK_PP_NODE_208, MITK_PP_NODE_240) +# define MITK_PP_NODE_208(p) MITK_PP_IIF(p(208), MITK_PP_NODE_200, MITK_PP_NODE_216) +# define MITK_PP_NODE_200(p) MITK_PP_IIF(p(200), MITK_PP_NODE_196, MITK_PP_NODE_204) +# define MITK_PP_NODE_196(p) MITK_PP_IIF(p(196), MITK_PP_NODE_194, MITK_PP_NODE_198) +# define MITK_PP_NODE_194(p) MITK_PP_IIF(p(194), MITK_PP_NODE_193, MITK_PP_NODE_195) +# define MITK_PP_NODE_193(p) MITK_PP_IIF(p(193), 193, 194) +# define MITK_PP_NODE_195(p) MITK_PP_IIF(p(195), 195, 196) +# define MITK_PP_NODE_198(p) MITK_PP_IIF(p(198), MITK_PP_NODE_197, MITK_PP_NODE_199) +# define MITK_PP_NODE_197(p) MITK_PP_IIF(p(197), 197, 198) +# define MITK_PP_NODE_199(p) MITK_PP_IIF(p(199), 199, 200) +# define MITK_PP_NODE_204(p) MITK_PP_IIF(p(204), MITK_PP_NODE_202, MITK_PP_NODE_206) +# define MITK_PP_NODE_202(p) MITK_PP_IIF(p(202), MITK_PP_NODE_201, MITK_PP_NODE_203) +# define MITK_PP_NODE_201(p) MITK_PP_IIF(p(201), 201, 202) +# define MITK_PP_NODE_203(p) MITK_PP_IIF(p(203), 203, 204) +# define MITK_PP_NODE_206(p) MITK_PP_IIF(p(206), MITK_PP_NODE_205, MITK_PP_NODE_207) +# define MITK_PP_NODE_205(p) MITK_PP_IIF(p(205), 205, 206) +# define MITK_PP_NODE_207(p) MITK_PP_IIF(p(207), 207, 208) +# define MITK_PP_NODE_216(p) MITK_PP_IIF(p(216), MITK_PP_NODE_212, MITK_PP_NODE_220) +# define MITK_PP_NODE_212(p) MITK_PP_IIF(p(212), MITK_PP_NODE_210, MITK_PP_NODE_214) +# define MITK_PP_NODE_210(p) MITK_PP_IIF(p(210), MITK_PP_NODE_209, MITK_PP_NODE_211) +# define MITK_PP_NODE_209(p) MITK_PP_IIF(p(209), 209, 210) +# define MITK_PP_NODE_211(p) MITK_PP_IIF(p(211), 211, 212) +# define MITK_PP_NODE_214(p) MITK_PP_IIF(p(214), MITK_PP_NODE_213, MITK_PP_NODE_215) +# define MITK_PP_NODE_213(p) MITK_PP_IIF(p(213), 213, 214) +# define MITK_PP_NODE_215(p) MITK_PP_IIF(p(215), 215, 216) +# define MITK_PP_NODE_220(p) MITK_PP_IIF(p(220), MITK_PP_NODE_218, MITK_PP_NODE_222) +# define MITK_PP_NODE_218(p) MITK_PP_IIF(p(218), MITK_PP_NODE_217, MITK_PP_NODE_219) +# define MITK_PP_NODE_217(p) MITK_PP_IIF(p(217), 217, 218) +# define MITK_PP_NODE_219(p) MITK_PP_IIF(p(219), 219, 220) +# define MITK_PP_NODE_222(p) MITK_PP_IIF(p(222), MITK_PP_NODE_221, MITK_PP_NODE_223) +# define MITK_PP_NODE_221(p) MITK_PP_IIF(p(221), 221, 222) +# define MITK_PP_NODE_223(p) MITK_PP_IIF(p(223), 223, 224) +# define MITK_PP_NODE_240(p) MITK_PP_IIF(p(240), MITK_PP_NODE_232, MITK_PP_NODE_248) +# define MITK_PP_NODE_232(p) MITK_PP_IIF(p(232), MITK_PP_NODE_228, MITK_PP_NODE_236) +# define MITK_PP_NODE_228(p) MITK_PP_IIF(p(228), MITK_PP_NODE_226, MITK_PP_NODE_230) +# define MITK_PP_NODE_226(p) MITK_PP_IIF(p(226), MITK_PP_NODE_225, MITK_PP_NODE_227) +# define MITK_PP_NODE_225(p) MITK_PP_IIF(p(225), 225, 226) +# define MITK_PP_NODE_227(p) MITK_PP_IIF(p(227), 227, 228) +# define MITK_PP_NODE_230(p) MITK_PP_IIF(p(230), MITK_PP_NODE_229, MITK_PP_NODE_231) +# define MITK_PP_NODE_229(p) MITK_PP_IIF(p(229), 229, 230) +# define MITK_PP_NODE_231(p) MITK_PP_IIF(p(231), 231, 232) +# define MITK_PP_NODE_236(p) MITK_PP_IIF(p(236), MITK_PP_NODE_234, MITK_PP_NODE_238) +# define MITK_PP_NODE_234(p) MITK_PP_IIF(p(234), MITK_PP_NODE_233, MITK_PP_NODE_235) +# define MITK_PP_NODE_233(p) MITK_PP_IIF(p(233), 233, 234) +# define MITK_PP_NODE_235(p) MITK_PP_IIF(p(235), 235, 236) +# define MITK_PP_NODE_238(p) MITK_PP_IIF(p(238), MITK_PP_NODE_237, MITK_PP_NODE_239) +# define MITK_PP_NODE_237(p) MITK_PP_IIF(p(237), 237, 238) +# define MITK_PP_NODE_239(p) MITK_PP_IIF(p(239), 239, 240) +# define MITK_PP_NODE_248(p) MITK_PP_IIF(p(248), MITK_PP_NODE_244, MITK_PP_NODE_252) +# define MITK_PP_NODE_244(p) MITK_PP_IIF(p(244), MITK_PP_NODE_242, MITK_PP_NODE_246) +# define MITK_PP_NODE_242(p) MITK_PP_IIF(p(242), MITK_PP_NODE_241, MITK_PP_NODE_243) +# define MITK_PP_NODE_241(p) MITK_PP_IIF(p(241), 241, 242) +# define MITK_PP_NODE_243(p) MITK_PP_IIF(p(243), 243, 244) +# define MITK_PP_NODE_246(p) MITK_PP_IIF(p(246), MITK_PP_NODE_245, MITK_PP_NODE_247) +# define MITK_PP_NODE_245(p) MITK_PP_IIF(p(245), 245, 246) +# define MITK_PP_NODE_247(p) MITK_PP_IIF(p(247), 247, 248) +# define MITK_PP_NODE_252(p) MITK_PP_IIF(p(252), MITK_PP_NODE_250, MITK_PP_NODE_254) +# define MITK_PP_NODE_250(p) MITK_PP_IIF(p(250), MITK_PP_NODE_249, MITK_PP_NODE_251) +# define MITK_PP_NODE_249(p) MITK_PP_IIF(p(249), 249, 250) +# define MITK_PP_NODE_251(p) MITK_PP_IIF(p(251), 251, 252) +# define MITK_PP_NODE_254(p) MITK_PP_IIF(p(254), MITK_PP_NODE_253, MITK_PP_NODE_255) +# define MITK_PP_NODE_253(p) MITK_PP_IIF(p(253), 253, 254) +# define MITK_PP_NODE_255(p) MITK_PP_IIF(p(255), 255, 256) +# +# endif +# endif diff --git a/Core/Code/Algorithms/mitkPPDetailDMCAutoRec.h b/Core/Code/Algorithms/mitkPPDetailDMCAutoRec.h new file mode 100644 index 0000000000..c1ca946f47 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPDetailDMCAutoRec.h @@ -0,0 +1,286 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_DETAIL_AUTO_REC_HPP +# define MITK_PREPROCESSOR_DETAIL_AUTO_REC_HPP +# +# include "mitkPPControlIIf.h" +# +# /* MITK_PP_AUTO_REC */ +# +# define MITK_PP_AUTO_REC(pred, n) MITK_PP_NODE_ENTRY_ ## n(pred) +# +# define MITK_PP_NODE_ENTRY_256(p) MITK_PP_NODE_128(p)(p)(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_128(p) MITK_PP_NODE_64(p)(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_64(p) MITK_PP_NODE_32(p)(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_32(p) MITK_PP_NODE_16(p)(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_16(p) MITK_PP_NODE_8(p)(p)(p)(p) +# define MITK_PP_NODE_ENTRY_8(p) MITK_PP_NODE_4(p)(p)(p) +# define MITK_PP_NODE_ENTRY_4(p) MITK_PP_NODE_2(p)(p) +# define MITK_PP_NODE_ENTRY_2(p) MITK_PP_NODE_1(p) +# +# define MITK_PP_NODE_128(p) MITK_PP_IIF(p##(128), MITK_PP_NODE_64, MITK_PP_NODE_192) +# define MITK_PP_NODE_64(p) MITK_PP_IIF(p##(64), MITK_PP_NODE_32, MITK_PP_NODE_96) +# define MITK_PP_NODE_32(p) MITK_PP_IIF(p##(32), MITK_PP_NODE_16, MITK_PP_NODE_48) +# define MITK_PP_NODE_16(p) MITK_PP_IIF(p##(16), MITK_PP_NODE_8, MITK_PP_NODE_24) +# define MITK_PP_NODE_8(p) MITK_PP_IIF(p##(8), MITK_PP_NODE_4, MITK_PP_NODE_12) +# define MITK_PP_NODE_4(p) MITK_PP_IIF(p##(4), MITK_PP_NODE_2, MITK_PP_NODE_6) +# define MITK_PP_NODE_2(p) MITK_PP_IIF(p##(2), MITK_PP_NODE_1, MITK_PP_NODE_3) +# define MITK_PP_NODE_1(p) MITK_PP_IIF(p##(1), 1, 2) +# define MITK_PP_NODE_3(p) MITK_PP_IIF(p##(3), 3, 4) +# define MITK_PP_NODE_6(p) MITK_PP_IIF(p##(6), MITK_PP_NODE_5, MITK_PP_NODE_7) +# define MITK_PP_NODE_5(p) MITK_PP_IIF(p##(5), 5, 6) +# define MITK_PP_NODE_7(p) MITK_PP_IIF(p##(7), 7, 8) +# define MITK_PP_NODE_12(p) MITK_PP_IIF(p##(12), MITK_PP_NODE_10, MITK_PP_NODE_14) +# define MITK_PP_NODE_10(p) MITK_PP_IIF(p##(10), MITK_PP_NODE_9, MITK_PP_NODE_11) +# define MITK_PP_NODE_9(p) MITK_PP_IIF(p##(9), 9, 10) +# define MITK_PP_NODE_11(p) MITK_PP_IIF(p##(11), 11, 12) +# define MITK_PP_NODE_14(p) MITK_PP_IIF(p##(14), MITK_PP_NODE_13, MITK_PP_NODE_15) +# define MITK_PP_NODE_13(p) MITK_PP_IIF(p##(13), 13, 14) +# define MITK_PP_NODE_15(p) MITK_PP_IIF(p##(15), 15, 16) +# define MITK_PP_NODE_24(p) MITK_PP_IIF(p##(24), MITK_PP_NODE_20, MITK_PP_NODE_28) +# define MITK_PP_NODE_20(p) MITK_PP_IIF(p##(20), MITK_PP_NODE_18, MITK_PP_NODE_22) +# define MITK_PP_NODE_18(p) MITK_PP_IIF(p##(18), MITK_PP_NODE_17, MITK_PP_NODE_19) +# define MITK_PP_NODE_17(p) MITK_PP_IIF(p##(17), 17, 18) +# define MITK_PP_NODE_19(p) MITK_PP_IIF(p##(19), 19, 20) +# define MITK_PP_NODE_22(p) MITK_PP_IIF(p##(22), MITK_PP_NODE_21, MITK_PP_NODE_23) +# define MITK_PP_NODE_21(p) MITK_PP_IIF(p##(21), 21, 22) +# define MITK_PP_NODE_23(p) MITK_PP_IIF(p##(23), 23, 24) +# define MITK_PP_NODE_28(p) MITK_PP_IIF(p##(28), MITK_PP_NODE_26, MITK_PP_NODE_30) +# define MITK_PP_NODE_26(p) MITK_PP_IIF(p##(26), MITK_PP_NODE_25, MITK_PP_NODE_27) +# define MITK_PP_NODE_25(p) MITK_PP_IIF(p##(25), 25, 26) +# define MITK_PP_NODE_27(p) MITK_PP_IIF(p##(27), 27, 28) +# define MITK_PP_NODE_30(p) MITK_PP_IIF(p##(30), MITK_PP_NODE_29, MITK_PP_NODE_31) +# define MITK_PP_NODE_29(p) MITK_PP_IIF(p##(29), 29, 30) +# define MITK_PP_NODE_31(p) MITK_PP_IIF(p##(31), 31, 32) +# define MITK_PP_NODE_48(p) MITK_PP_IIF(p##(48), MITK_PP_NODE_40, MITK_PP_NODE_56) +# define MITK_PP_NODE_40(p) MITK_PP_IIF(p##(40), MITK_PP_NODE_36, MITK_PP_NODE_44) +# define MITK_PP_NODE_36(p) MITK_PP_IIF(p##(36), MITK_PP_NODE_34, MITK_PP_NODE_38) +# define MITK_PP_NODE_34(p) MITK_PP_IIF(p##(34), MITK_PP_NODE_33, MITK_PP_NODE_35) +# define MITK_PP_NODE_33(p) MITK_PP_IIF(p##(33), 33, 34) +# define MITK_PP_NODE_35(p) MITK_PP_IIF(p##(35), 35, 36) +# define MITK_PP_NODE_38(p) MITK_PP_IIF(p##(38), MITK_PP_NODE_37, MITK_PP_NODE_39) +# define MITK_PP_NODE_37(p) MITK_PP_IIF(p##(37), 37, 38) +# define MITK_PP_NODE_39(p) MITK_PP_IIF(p##(39), 39, 40) +# define MITK_PP_NODE_44(p) MITK_PP_IIF(p##(44), MITK_PP_NODE_42, MITK_PP_NODE_46) +# define MITK_PP_NODE_42(p) MITK_PP_IIF(p##(42), MITK_PP_NODE_41, MITK_PP_NODE_43) +# define MITK_PP_NODE_41(p) MITK_PP_IIF(p##(41), 41, 42) +# define MITK_PP_NODE_43(p) MITK_PP_IIF(p##(43), 43, 44) +# define MITK_PP_NODE_46(p) MITK_PP_IIF(p##(46), MITK_PP_NODE_45, MITK_PP_NODE_47) +# define MITK_PP_NODE_45(p) MITK_PP_IIF(p##(45), 45, 46) +# define MITK_PP_NODE_47(p) MITK_PP_IIF(p##(47), 47, 48) +# define MITK_PP_NODE_56(p) MITK_PP_IIF(p##(56), MITK_PP_NODE_52, MITK_PP_NODE_60) +# define MITK_PP_NODE_52(p) MITK_PP_IIF(p##(52), MITK_PP_NODE_50, MITK_PP_NODE_54) +# define MITK_PP_NODE_50(p) MITK_PP_IIF(p##(50), MITK_PP_NODE_49, MITK_PP_NODE_51) +# define MITK_PP_NODE_49(p) MITK_PP_IIF(p##(49), 49, 50) +# define MITK_PP_NODE_51(p) MITK_PP_IIF(p##(51), 51, 52) +# define MITK_PP_NODE_54(p) MITK_PP_IIF(p##(54), MITK_PP_NODE_53, MITK_PP_NODE_55) +# define MITK_PP_NODE_53(p) MITK_PP_IIF(p##(53), 53, 54) +# define MITK_PP_NODE_55(p) MITK_PP_IIF(p##(55), 55, 56) +# define MITK_PP_NODE_60(p) MITK_PP_IIF(p##(60), MITK_PP_NODE_58, MITK_PP_NODE_62) +# define MITK_PP_NODE_58(p) MITK_PP_IIF(p##(58), MITK_PP_NODE_57, MITK_PP_NODE_59) +# define MITK_PP_NODE_57(p) MITK_PP_IIF(p##(57), 57, 58) +# define MITK_PP_NODE_59(p) MITK_PP_IIF(p##(59), 59, 60) +# define MITK_PP_NODE_62(p) MITK_PP_IIF(p##(62), MITK_PP_NODE_61, MITK_PP_NODE_63) +# define MITK_PP_NODE_61(p) MITK_PP_IIF(p##(61), 61, 62) +# define MITK_PP_NODE_63(p) MITK_PP_IIF(p##(63), 63, 64) +# define MITK_PP_NODE_96(p) MITK_PP_IIF(p##(96), MITK_PP_NODE_80, MITK_PP_NODE_112) +# define MITK_PP_NODE_80(p) MITK_PP_IIF(p##(80), MITK_PP_NODE_72, MITK_PP_NODE_88) +# define MITK_PP_NODE_72(p) MITK_PP_IIF(p##(72), MITK_PP_NODE_68, MITK_PP_NODE_76) +# define MITK_PP_NODE_68(p) MITK_PP_IIF(p##(68), MITK_PP_NODE_66, MITK_PP_NODE_70) +# define MITK_PP_NODE_66(p) MITK_PP_IIF(p##(66), MITK_PP_NODE_65, MITK_PP_NODE_67) +# define MITK_PP_NODE_65(p) MITK_PP_IIF(p##(65), 65, 66) +# define MITK_PP_NODE_67(p) MITK_PP_IIF(p##(67), 67, 68) +# define MITK_PP_NODE_70(p) MITK_PP_IIF(p##(70), MITK_PP_NODE_69, MITK_PP_NODE_71) +# define MITK_PP_NODE_69(p) MITK_PP_IIF(p##(69), 69, 70) +# define MITK_PP_NODE_71(p) MITK_PP_IIF(p##(71), 71, 72) +# define MITK_PP_NODE_76(p) MITK_PP_IIF(p##(76), MITK_PP_NODE_74, MITK_PP_NODE_78) +# define MITK_PP_NODE_74(p) MITK_PP_IIF(p##(74), MITK_PP_NODE_73, MITK_PP_NODE_75) +# define MITK_PP_NODE_73(p) MITK_PP_IIF(p##(73), 73, 74) +# define MITK_PP_NODE_75(p) MITK_PP_IIF(p##(75), 75, 76) +# define MITK_PP_NODE_78(p) MITK_PP_IIF(p##(78), MITK_PP_NODE_77, MITK_PP_NODE_79) +# define MITK_PP_NODE_77(p) MITK_PP_IIF(p##(77), 77, 78) +# define MITK_PP_NODE_79(p) MITK_PP_IIF(p##(79), 79, 80) +# define MITK_PP_NODE_88(p) MITK_PP_IIF(p##(88), MITK_PP_NODE_84, MITK_PP_NODE_92) +# define MITK_PP_NODE_84(p) MITK_PP_IIF(p##(84), MITK_PP_NODE_82, MITK_PP_NODE_86) +# define MITK_PP_NODE_82(p) MITK_PP_IIF(p##(82), MITK_PP_NODE_81, MITK_PP_NODE_83) +# define MITK_PP_NODE_81(p) MITK_PP_IIF(p##(81), 81, 82) +# define MITK_PP_NODE_83(p) MITK_PP_IIF(p##(83), 83, 84) +# define MITK_PP_NODE_86(p) MITK_PP_IIF(p##(86), MITK_PP_NODE_85, MITK_PP_NODE_87) +# define MITK_PP_NODE_85(p) MITK_PP_IIF(p##(85), 85, 86) +# define MITK_PP_NODE_87(p) MITK_PP_IIF(p##(87), 87, 88) +# define MITK_PP_NODE_92(p) MITK_PP_IIF(p##(92), MITK_PP_NODE_90, MITK_PP_NODE_94) +# define MITK_PP_NODE_90(p) MITK_PP_IIF(p##(90), MITK_PP_NODE_89, MITK_PP_NODE_91) +# define MITK_PP_NODE_89(p) MITK_PP_IIF(p##(89), 89, 90) +# define MITK_PP_NODE_91(p) MITK_PP_IIF(p##(91), 91, 92) +# define MITK_PP_NODE_94(p) MITK_PP_IIF(p##(94), MITK_PP_NODE_93, MITK_PP_NODE_95) +# define MITK_PP_NODE_93(p) MITK_PP_IIF(p##(93), 93, 94) +# define MITK_PP_NODE_95(p) MITK_PP_IIF(p##(95), 95, 96) +# define MITK_PP_NODE_112(p) MITK_PP_IIF(p##(112), MITK_PP_NODE_104, MITK_PP_NODE_120) +# define MITK_PP_NODE_104(p) MITK_PP_IIF(p##(104), MITK_PP_NODE_100, MITK_PP_NODE_108) +# define MITK_PP_NODE_100(p) MITK_PP_IIF(p##(100), MITK_PP_NODE_98, MITK_PP_NODE_102) +# define MITK_PP_NODE_98(p) MITK_PP_IIF(p##(98), MITK_PP_NODE_97, MITK_PP_NODE_99) +# define MITK_PP_NODE_97(p) MITK_PP_IIF(p##(97), 97, 98) +# define MITK_PP_NODE_99(p) MITK_PP_IIF(p##(99), 99, 100) +# define MITK_PP_NODE_102(p) MITK_PP_IIF(p##(102), MITK_PP_NODE_101, MITK_PP_NODE_103) +# define MITK_PP_NODE_101(p) MITK_PP_IIF(p##(101), 101, 102) +# define MITK_PP_NODE_103(p) MITK_PP_IIF(p##(103), 103, 104) +# define MITK_PP_NODE_108(p) MITK_PP_IIF(p##(108), MITK_PP_NODE_106, MITK_PP_NODE_110) +# define MITK_PP_NODE_106(p) MITK_PP_IIF(p##(106), MITK_PP_NODE_105, MITK_PP_NODE_107) +# define MITK_PP_NODE_105(p) MITK_PP_IIF(p##(105), 105, 106) +# define MITK_PP_NODE_107(p) MITK_PP_IIF(p##(107), 107, 108) +# define MITK_PP_NODE_110(p) MITK_PP_IIF(p##(110), MITK_PP_NODE_109, MITK_PP_NODE_111) +# define MITK_PP_NODE_109(p) MITK_PP_IIF(p##(109), 109, 110) +# define MITK_PP_NODE_111(p) MITK_PP_IIF(p##(111), 111, 112) +# define MITK_PP_NODE_120(p) MITK_PP_IIF(p##(120), MITK_PP_NODE_116, MITK_PP_NODE_124) +# define MITK_PP_NODE_116(p) MITK_PP_IIF(p##(116), MITK_PP_NODE_114, MITK_PP_NODE_118) +# define MITK_PP_NODE_114(p) MITK_PP_IIF(p##(114), MITK_PP_NODE_113, MITK_PP_NODE_115) +# define MITK_PP_NODE_113(p) MITK_PP_IIF(p##(113), 113, 114) +# define MITK_PP_NODE_115(p) MITK_PP_IIF(p##(115), 115, 116) +# define MITK_PP_NODE_118(p) MITK_PP_IIF(p##(118), MITK_PP_NODE_117, MITK_PP_NODE_119) +# define MITK_PP_NODE_117(p) MITK_PP_IIF(p##(117), 117, 118) +# define MITK_PP_NODE_119(p) MITK_PP_IIF(p##(119), 119, 120) +# define MITK_PP_NODE_124(p) MITK_PP_IIF(p##(124), MITK_PP_NODE_122, MITK_PP_NODE_126) +# define MITK_PP_NODE_122(p) MITK_PP_IIF(p##(122), MITK_PP_NODE_121, MITK_PP_NODE_123) +# define MITK_PP_NODE_121(p) MITK_PP_IIF(p##(121), 121, 122) +# define MITK_PP_NODE_123(p) MITK_PP_IIF(p##(123), 123, 124) +# define MITK_PP_NODE_126(p) MITK_PP_IIF(p##(126), MITK_PP_NODE_125, MITK_PP_NODE_127) +# define MITK_PP_NODE_125(p) MITK_PP_IIF(p##(125), 125, 126) +# define MITK_PP_NODE_127(p) MITK_PP_IIF(p##(127), 127, 128) +# define MITK_PP_NODE_192(p) MITK_PP_IIF(p##(192), MITK_PP_NODE_160, MITK_PP_NODE_224) +# define MITK_PP_NODE_160(p) MITK_PP_IIF(p##(160), MITK_PP_NODE_144, MITK_PP_NODE_176) +# define MITK_PP_NODE_144(p) MITK_PP_IIF(p##(144), MITK_PP_NODE_136, MITK_PP_NODE_152) +# define MITK_PP_NODE_136(p) MITK_PP_IIF(p##(136), MITK_PP_NODE_132, MITK_PP_NODE_140) +# define MITK_PP_NODE_132(p) MITK_PP_IIF(p##(132), MITK_PP_NODE_130, MITK_PP_NODE_134) +# define MITK_PP_NODE_130(p) MITK_PP_IIF(p##(130), MITK_PP_NODE_129, MITK_PP_NODE_131) +# define MITK_PP_NODE_129(p) MITK_PP_IIF(p##(129), 129, 130) +# define MITK_PP_NODE_131(p) MITK_PP_IIF(p##(131), 131, 132) +# define MITK_PP_NODE_134(p) MITK_PP_IIF(p##(134), MITK_PP_NODE_133, MITK_PP_NODE_135) +# define MITK_PP_NODE_133(p) MITK_PP_IIF(p##(133), 133, 134) +# define MITK_PP_NODE_135(p) MITK_PP_IIF(p##(135), 135, 136) +# define MITK_PP_NODE_140(p) MITK_PP_IIF(p##(140), MITK_PP_NODE_138, MITK_PP_NODE_142) +# define MITK_PP_NODE_138(p) MITK_PP_IIF(p##(138), MITK_PP_NODE_137, MITK_PP_NODE_139) +# define MITK_PP_NODE_137(p) MITK_PP_IIF(p##(137), 137, 138) +# define MITK_PP_NODE_139(p) MITK_PP_IIF(p##(139), 139, 140) +# define MITK_PP_NODE_142(p) MITK_PP_IIF(p##(142), MITK_PP_NODE_141, MITK_PP_NODE_143) +# define MITK_PP_NODE_141(p) MITK_PP_IIF(p##(141), 141, 142) +# define MITK_PP_NODE_143(p) MITK_PP_IIF(p##(143), 143, 144) +# define MITK_PP_NODE_152(p) MITK_PP_IIF(p##(152), MITK_PP_NODE_148, MITK_PP_NODE_156) +# define MITK_PP_NODE_148(p) MITK_PP_IIF(p##(148), MITK_PP_NODE_146, MITK_PP_NODE_150) +# define MITK_PP_NODE_146(p) MITK_PP_IIF(p##(146), MITK_PP_NODE_145, MITK_PP_NODE_147) +# define MITK_PP_NODE_145(p) MITK_PP_IIF(p##(145), 145, 146) +# define MITK_PP_NODE_147(p) MITK_PP_IIF(p##(147), 147, 148) +# define MITK_PP_NODE_150(p) MITK_PP_IIF(p##(150), MITK_PP_NODE_149, MITK_PP_NODE_151) +# define MITK_PP_NODE_149(p) MITK_PP_IIF(p##(149), 149, 150) +# define MITK_PP_NODE_151(p) MITK_PP_IIF(p##(151), 151, 152) +# define MITK_PP_NODE_156(p) MITK_PP_IIF(p##(156), MITK_PP_NODE_154, MITK_PP_NODE_158) +# define MITK_PP_NODE_154(p) MITK_PP_IIF(p##(154), MITK_PP_NODE_153, MITK_PP_NODE_155) +# define MITK_PP_NODE_153(p) MITK_PP_IIF(p##(153), 153, 154) +# define MITK_PP_NODE_155(p) MITK_PP_IIF(p##(155), 155, 156) +# define MITK_PP_NODE_158(p) MITK_PP_IIF(p##(158), MITK_PP_NODE_157, MITK_PP_NODE_159) +# define MITK_PP_NODE_157(p) MITK_PP_IIF(p##(157), 157, 158) +# define MITK_PP_NODE_159(p) MITK_PP_IIF(p##(159), 159, 160) +# define MITK_PP_NODE_176(p) MITK_PP_IIF(p##(176), MITK_PP_NODE_168, MITK_PP_NODE_184) +# define MITK_PP_NODE_168(p) MITK_PP_IIF(p##(168), MITK_PP_NODE_164, MITK_PP_NODE_172) +# define MITK_PP_NODE_164(p) MITK_PP_IIF(p##(164), MITK_PP_NODE_162, MITK_PP_NODE_166) +# define MITK_PP_NODE_162(p) MITK_PP_IIF(p##(162), MITK_PP_NODE_161, MITK_PP_NODE_163) +# define MITK_PP_NODE_161(p) MITK_PP_IIF(p##(161), 161, 162) +# define MITK_PP_NODE_163(p) MITK_PP_IIF(p##(163), 163, 164) +# define MITK_PP_NODE_166(p) MITK_PP_IIF(p##(166), MITK_PP_NODE_165, MITK_PP_NODE_167) +# define MITK_PP_NODE_165(p) MITK_PP_IIF(p##(165), 165, 166) +# define MITK_PP_NODE_167(p) MITK_PP_IIF(p##(167), 167, 168) +# define MITK_PP_NODE_172(p) MITK_PP_IIF(p##(172), MITK_PP_NODE_170, MITK_PP_NODE_174) +# define MITK_PP_NODE_170(p) MITK_PP_IIF(p##(170), MITK_PP_NODE_169, MITK_PP_NODE_171) +# define MITK_PP_NODE_169(p) MITK_PP_IIF(p##(169), 169, 170) +# define MITK_PP_NODE_171(p) MITK_PP_IIF(p##(171), 171, 172) +# define MITK_PP_NODE_174(p) MITK_PP_IIF(p##(174), MITK_PP_NODE_173, MITK_PP_NODE_175) +# define MITK_PP_NODE_173(p) MITK_PP_IIF(p##(173), 173, 174) +# define MITK_PP_NODE_175(p) MITK_PP_IIF(p##(175), 175, 176) +# define MITK_PP_NODE_184(p) MITK_PP_IIF(p##(184), MITK_PP_NODE_180, MITK_PP_NODE_188) +# define MITK_PP_NODE_180(p) MITK_PP_IIF(p##(180), MITK_PP_NODE_178, MITK_PP_NODE_182) +# define MITK_PP_NODE_178(p) MITK_PP_IIF(p##(178), MITK_PP_NODE_177, MITK_PP_NODE_179) +# define MITK_PP_NODE_177(p) MITK_PP_IIF(p##(177), 177, 178) +# define MITK_PP_NODE_179(p) MITK_PP_IIF(p##(179), 179, 180) +# define MITK_PP_NODE_182(p) MITK_PP_IIF(p##(182), MITK_PP_NODE_181, MITK_PP_NODE_183) +# define MITK_PP_NODE_181(p) MITK_PP_IIF(p##(181), 181, 182) +# define MITK_PP_NODE_183(p) MITK_PP_IIF(p##(183), 183, 184) +# define MITK_PP_NODE_188(p) MITK_PP_IIF(p##(188), MITK_PP_NODE_186, MITK_PP_NODE_190) +# define MITK_PP_NODE_186(p) MITK_PP_IIF(p##(186), MITK_PP_NODE_185, MITK_PP_NODE_187) +# define MITK_PP_NODE_185(p) MITK_PP_IIF(p##(185), 185, 186) +# define MITK_PP_NODE_187(p) MITK_PP_IIF(p##(187), 187, 188) +# define MITK_PP_NODE_190(p) MITK_PP_IIF(p##(190), MITK_PP_NODE_189, MITK_PP_NODE_191) +# define MITK_PP_NODE_189(p) MITK_PP_IIF(p##(189), 189, 190) +# define MITK_PP_NODE_191(p) MITK_PP_IIF(p##(191), 191, 192) +# define MITK_PP_NODE_224(p) MITK_PP_IIF(p##(224), MITK_PP_NODE_208, MITK_PP_NODE_240) +# define MITK_PP_NODE_208(p) MITK_PP_IIF(p##(208), MITK_PP_NODE_200, MITK_PP_NODE_216) +# define MITK_PP_NODE_200(p) MITK_PP_IIF(p##(200), MITK_PP_NODE_196, MITK_PP_NODE_204) +# define MITK_PP_NODE_196(p) MITK_PP_IIF(p##(196), MITK_PP_NODE_194, MITK_PP_NODE_198) +# define MITK_PP_NODE_194(p) MITK_PP_IIF(p##(194), MITK_PP_NODE_193, MITK_PP_NODE_195) +# define MITK_PP_NODE_193(p) MITK_PP_IIF(p##(193), 193, 194) +# define MITK_PP_NODE_195(p) MITK_PP_IIF(p##(195), 195, 196) +# define MITK_PP_NODE_198(p) MITK_PP_IIF(p##(198), MITK_PP_NODE_197, MITK_PP_NODE_199) +# define MITK_PP_NODE_197(p) MITK_PP_IIF(p##(197), 197, 198) +# define MITK_PP_NODE_199(p) MITK_PP_IIF(p##(199), 199, 200) +# define MITK_PP_NODE_204(p) MITK_PP_IIF(p##(204), MITK_PP_NODE_202, MITK_PP_NODE_206) +# define MITK_PP_NODE_202(p) MITK_PP_IIF(p##(202), MITK_PP_NODE_201, MITK_PP_NODE_203) +# define MITK_PP_NODE_201(p) MITK_PP_IIF(p##(201), 201, 202) +# define MITK_PP_NODE_203(p) MITK_PP_IIF(p##(203), 203, 204) +# define MITK_PP_NODE_206(p) MITK_PP_IIF(p##(206), MITK_PP_NODE_205, MITK_PP_NODE_207) +# define MITK_PP_NODE_205(p) MITK_PP_IIF(p##(205), 205, 206) +# define MITK_PP_NODE_207(p) MITK_PP_IIF(p##(207), 207, 208) +# define MITK_PP_NODE_216(p) MITK_PP_IIF(p##(216), MITK_PP_NODE_212, MITK_PP_NODE_220) +# define MITK_PP_NODE_212(p) MITK_PP_IIF(p##(212), MITK_PP_NODE_210, MITK_PP_NODE_214) +# define MITK_PP_NODE_210(p) MITK_PP_IIF(p##(210), MITK_PP_NODE_209, MITK_PP_NODE_211) +# define MITK_PP_NODE_209(p) MITK_PP_IIF(p##(209), 209, 210) +# define MITK_PP_NODE_211(p) MITK_PP_IIF(p##(211), 211, 212) +# define MITK_PP_NODE_214(p) MITK_PP_IIF(p##(214), MITK_PP_NODE_213, MITK_PP_NODE_215) +# define MITK_PP_NODE_213(p) MITK_PP_IIF(p##(213), 213, 214) +# define MITK_PP_NODE_215(p) MITK_PP_IIF(p##(215), 215, 216) +# define MITK_PP_NODE_220(p) MITK_PP_IIF(p##(220), MITK_PP_NODE_218, MITK_PP_NODE_222) +# define MITK_PP_NODE_218(p) MITK_PP_IIF(p##(218), MITK_PP_NODE_217, MITK_PP_NODE_219) +# define MITK_PP_NODE_217(p) MITK_PP_IIF(p##(217), 217, 218) +# define MITK_PP_NODE_219(p) MITK_PP_IIF(p##(219), 219, 220) +# define MITK_PP_NODE_222(p) MITK_PP_IIF(p##(222), MITK_PP_NODE_221, MITK_PP_NODE_223) +# define MITK_PP_NODE_221(p) MITK_PP_IIF(p##(221), 221, 222) +# define MITK_PP_NODE_223(p) MITK_PP_IIF(p##(223), 223, 224) +# define MITK_PP_NODE_240(p) MITK_PP_IIF(p##(240), MITK_PP_NODE_232, MITK_PP_NODE_248) +# define MITK_PP_NODE_232(p) MITK_PP_IIF(p##(232), MITK_PP_NODE_228, MITK_PP_NODE_236) +# define MITK_PP_NODE_228(p) MITK_PP_IIF(p##(228), MITK_PP_NODE_226, MITK_PP_NODE_230) +# define MITK_PP_NODE_226(p) MITK_PP_IIF(p##(226), MITK_PP_NODE_225, MITK_PP_NODE_227) +# define MITK_PP_NODE_225(p) MITK_PP_IIF(p##(225), 225, 226) +# define MITK_PP_NODE_227(p) MITK_PP_IIF(p##(227), 227, 228) +# define MITK_PP_NODE_230(p) MITK_PP_IIF(p##(230), MITK_PP_NODE_229, MITK_PP_NODE_231) +# define MITK_PP_NODE_229(p) MITK_PP_IIF(p##(229), 229, 230) +# define MITK_PP_NODE_231(p) MITK_PP_IIF(p##(231), 231, 232) +# define MITK_PP_NODE_236(p) MITK_PP_IIF(p##(236), MITK_PP_NODE_234, MITK_PP_NODE_238) +# define MITK_PP_NODE_234(p) MITK_PP_IIF(p##(234), MITK_PP_NODE_233, MITK_PP_NODE_235) +# define MITK_PP_NODE_233(p) MITK_PP_IIF(p##(233), 233, 234) +# define MITK_PP_NODE_235(p) MITK_PP_IIF(p##(235), 235, 236) +# define MITK_PP_NODE_238(p) MITK_PP_IIF(p##(238), MITK_PP_NODE_237, MITK_PP_NODE_239) +# define MITK_PP_NODE_237(p) MITK_PP_IIF(p##(237), 237, 238) +# define MITK_PP_NODE_239(p) MITK_PP_IIF(p##(239), 239, 240) +# define MITK_PP_NODE_248(p) MITK_PP_IIF(p##(248), MITK_PP_NODE_244, MITK_PP_NODE_252) +# define MITK_PP_NODE_244(p) MITK_PP_IIF(p##(244), MITK_PP_NODE_242, MITK_PP_NODE_246) +# define MITK_PP_NODE_242(p) MITK_PP_IIF(p##(242), MITK_PP_NODE_241, MITK_PP_NODE_243) +# define MITK_PP_NODE_241(p) MITK_PP_IIF(p##(241), 241, 242) +# define MITK_PP_NODE_243(p) MITK_PP_IIF(p##(243), 243, 244) +# define MITK_PP_NODE_246(p) MITK_PP_IIF(p##(246), MITK_PP_NODE_245, MITK_PP_NODE_247) +# define MITK_PP_NODE_245(p) MITK_PP_IIF(p##(245), 245, 246) +# define MITK_PP_NODE_247(p) MITK_PP_IIF(p##(247), 247, 248) +# define MITK_PP_NODE_252(p) MITK_PP_IIF(p##(252), MITK_PP_NODE_250, MITK_PP_NODE_254) +# define MITK_PP_NODE_250(p) MITK_PP_IIF(p##(250), MITK_PP_NODE_249, MITK_PP_NODE_251) +# define MITK_PP_NODE_249(p) MITK_PP_IIF(p##(249), 249, 250) +# define MITK_PP_NODE_251(p) MITK_PP_IIF(p##(251), 251, 252) +# define MITK_PP_NODE_254(p) MITK_PP_IIF(p##(254), MITK_PP_NODE_253, MITK_PP_NODE_255) +# define MITK_PP_NODE_253(p) MITK_PP_IIF(p##(253), 253, 254) +# define MITK_PP_NODE_255(p) MITK_PP_IIF(p##(255), 255, 256) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPExpand.h b/Core/Code/Algorithms/mitkPPExpand.h new file mode 100644 index 0000000000..3d05a298b8 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPExpand.h @@ -0,0 +1,17 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_EXPAND_HPP +# define MITK_PREPROCESSOR_EXPAND_HPP +# +# include "mitkPPFacilitiesExpand.h" +# +# endif diff --git a/Core/Code/Algorithms/mitkPPFacilitiesEmpty.h b/Core/Code/Algorithms/mitkPPFacilitiesEmpty.h new file mode 100644 index 0000000000..3cb10588ce --- /dev/null +++ b/Core/Code/Algorithms/mitkPPFacilitiesEmpty.h @@ -0,0 +1,21 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_FACILITIES_EMPTY_HPP +# define MITK_PREPROCESSOR_FACILITIES_EMPTY_HPP +# +# /* MITK_PP_EMPTY */ +# +# define MITK_PP_EMPTY() +# +# endif diff --git a/Core/Code/Algorithms/mitkPPFacilitiesExpand.h b/Core/Code/Algorithms/mitkPPFacilitiesExpand.h new file mode 100644 index 0000000000..f6f128160f --- /dev/null +++ b/Core/Code/Algorithms/mitkPPFacilitiesExpand.h @@ -0,0 +1,28 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_FACILITIES_EXPAND_HPP +# define MITK_PREPROCESSOR_FACILITIES_EXPAND_HPP +# +# include "mitkPPConfig.h" +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() && ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_DMC() +# define MITK_PP_EXPAND(x) MITK_PP_EXPAND_I(x) +# else +# define MITK_PP_EXPAND(x) MITK_PP_EXPAND_OO((x)) +# define MITK_PP_EXPAND_OO(par) MITK_PP_EXPAND_I ## par +# endif +# +# define MITK_PP_EXPAND_I(x) x +# +# endif diff --git a/Core/Code/Algorithms/mitkPPLogicalBool.h b/Core/Code/Algorithms/mitkPPLogicalBool.h new file mode 100644 index 0000000000..c69e4ae4f9 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPLogicalBool.h @@ -0,0 +1,288 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_LOGICAL_BOOL_HPP +# define MITK_PREPROCESSOR_LOGICAL_BOOL_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_BOOL */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_BOOL(x) MITK_PP_BOOL_I(x) +# else +# define MITK_PP_BOOL(x) MITK_PP_BOOL_OO((x)) +# define MITK_PP_BOOL_OO(par) MITK_PP_BOOL_I ## par +# endif +# +# define MITK_PP_BOOL_I(x) MITK_PP_BOOL_ ## x +# +# define MITK_PP_BOOL_0 0 +# define MITK_PP_BOOL_1 1 +# define MITK_PP_BOOL_2 1 +# define MITK_PP_BOOL_3 1 +# define MITK_PP_BOOL_4 1 +# define MITK_PP_BOOL_5 1 +# define MITK_PP_BOOL_6 1 +# define MITK_PP_BOOL_7 1 +# define MITK_PP_BOOL_8 1 +# define MITK_PP_BOOL_9 1 +# define MITK_PP_BOOL_10 1 +# define MITK_PP_BOOL_11 1 +# define MITK_PP_BOOL_12 1 +# define MITK_PP_BOOL_13 1 +# define MITK_PP_BOOL_14 1 +# define MITK_PP_BOOL_15 1 +# define MITK_PP_BOOL_16 1 +# define MITK_PP_BOOL_17 1 +# define MITK_PP_BOOL_18 1 +# define MITK_PP_BOOL_19 1 +# define MITK_PP_BOOL_20 1 +# define MITK_PP_BOOL_21 1 +# define MITK_PP_BOOL_22 1 +# define MITK_PP_BOOL_23 1 +# define MITK_PP_BOOL_24 1 +# define MITK_PP_BOOL_25 1 +# define MITK_PP_BOOL_26 1 +# define MITK_PP_BOOL_27 1 +# define MITK_PP_BOOL_28 1 +# define MITK_PP_BOOL_29 1 +# define MITK_PP_BOOL_30 1 +# define MITK_PP_BOOL_31 1 +# define MITK_PP_BOOL_32 1 +# define MITK_PP_BOOL_33 1 +# define MITK_PP_BOOL_34 1 +# define MITK_PP_BOOL_35 1 +# define MITK_PP_BOOL_36 1 +# define MITK_PP_BOOL_37 1 +# define MITK_PP_BOOL_38 1 +# define MITK_PP_BOOL_39 1 +# define MITK_PP_BOOL_40 1 +# define MITK_PP_BOOL_41 1 +# define MITK_PP_BOOL_42 1 +# define MITK_PP_BOOL_43 1 +# define MITK_PP_BOOL_44 1 +# define MITK_PP_BOOL_45 1 +# define MITK_PP_BOOL_46 1 +# define MITK_PP_BOOL_47 1 +# define MITK_PP_BOOL_48 1 +# define MITK_PP_BOOL_49 1 +# define MITK_PP_BOOL_50 1 +# define MITK_PP_BOOL_51 1 +# define MITK_PP_BOOL_52 1 +# define MITK_PP_BOOL_53 1 +# define MITK_PP_BOOL_54 1 +# define MITK_PP_BOOL_55 1 +# define MITK_PP_BOOL_56 1 +# define MITK_PP_BOOL_57 1 +# define MITK_PP_BOOL_58 1 +# define MITK_PP_BOOL_59 1 +# define MITK_PP_BOOL_60 1 +# define MITK_PP_BOOL_61 1 +# define MITK_PP_BOOL_62 1 +# define MITK_PP_BOOL_63 1 +# define MITK_PP_BOOL_64 1 +# define MITK_PP_BOOL_65 1 +# define MITK_PP_BOOL_66 1 +# define MITK_PP_BOOL_67 1 +# define MITK_PP_BOOL_68 1 +# define MITK_PP_BOOL_69 1 +# define MITK_PP_BOOL_70 1 +# define MITK_PP_BOOL_71 1 +# define MITK_PP_BOOL_72 1 +# define MITK_PP_BOOL_73 1 +# define MITK_PP_BOOL_74 1 +# define MITK_PP_BOOL_75 1 +# define MITK_PP_BOOL_76 1 +# define MITK_PP_BOOL_77 1 +# define MITK_PP_BOOL_78 1 +# define MITK_PP_BOOL_79 1 +# define MITK_PP_BOOL_80 1 +# define MITK_PP_BOOL_81 1 +# define MITK_PP_BOOL_82 1 +# define MITK_PP_BOOL_83 1 +# define MITK_PP_BOOL_84 1 +# define MITK_PP_BOOL_85 1 +# define MITK_PP_BOOL_86 1 +# define MITK_PP_BOOL_87 1 +# define MITK_PP_BOOL_88 1 +# define MITK_PP_BOOL_89 1 +# define MITK_PP_BOOL_90 1 +# define MITK_PP_BOOL_91 1 +# define MITK_PP_BOOL_92 1 +# define MITK_PP_BOOL_93 1 +# define MITK_PP_BOOL_94 1 +# define MITK_PP_BOOL_95 1 +# define MITK_PP_BOOL_96 1 +# define MITK_PP_BOOL_97 1 +# define MITK_PP_BOOL_98 1 +# define MITK_PP_BOOL_99 1 +# define MITK_PP_BOOL_100 1 +# define MITK_PP_BOOL_101 1 +# define MITK_PP_BOOL_102 1 +# define MITK_PP_BOOL_103 1 +# define MITK_PP_BOOL_104 1 +# define MITK_PP_BOOL_105 1 +# define MITK_PP_BOOL_106 1 +# define MITK_PP_BOOL_107 1 +# define MITK_PP_BOOL_108 1 +# define MITK_PP_BOOL_109 1 +# define MITK_PP_BOOL_110 1 +# define MITK_PP_BOOL_111 1 +# define MITK_PP_BOOL_112 1 +# define MITK_PP_BOOL_113 1 +# define MITK_PP_BOOL_114 1 +# define MITK_PP_BOOL_115 1 +# define MITK_PP_BOOL_116 1 +# define MITK_PP_BOOL_117 1 +# define MITK_PP_BOOL_118 1 +# define MITK_PP_BOOL_119 1 +# define MITK_PP_BOOL_120 1 +# define MITK_PP_BOOL_121 1 +# define MITK_PP_BOOL_122 1 +# define MITK_PP_BOOL_123 1 +# define MITK_PP_BOOL_124 1 +# define MITK_PP_BOOL_125 1 +# define MITK_PP_BOOL_126 1 +# define MITK_PP_BOOL_127 1 +# define MITK_PP_BOOL_128 1 +# define MITK_PP_BOOL_129 1 +# define MITK_PP_BOOL_130 1 +# define MITK_PP_BOOL_131 1 +# define MITK_PP_BOOL_132 1 +# define MITK_PP_BOOL_133 1 +# define MITK_PP_BOOL_134 1 +# define MITK_PP_BOOL_135 1 +# define MITK_PP_BOOL_136 1 +# define MITK_PP_BOOL_137 1 +# define MITK_PP_BOOL_138 1 +# define MITK_PP_BOOL_139 1 +# define MITK_PP_BOOL_140 1 +# define MITK_PP_BOOL_141 1 +# define MITK_PP_BOOL_142 1 +# define MITK_PP_BOOL_143 1 +# define MITK_PP_BOOL_144 1 +# define MITK_PP_BOOL_145 1 +# define MITK_PP_BOOL_146 1 +# define MITK_PP_BOOL_147 1 +# define MITK_PP_BOOL_148 1 +# define MITK_PP_BOOL_149 1 +# define MITK_PP_BOOL_150 1 +# define MITK_PP_BOOL_151 1 +# define MITK_PP_BOOL_152 1 +# define MITK_PP_BOOL_153 1 +# define MITK_PP_BOOL_154 1 +# define MITK_PP_BOOL_155 1 +# define MITK_PP_BOOL_156 1 +# define MITK_PP_BOOL_157 1 +# define MITK_PP_BOOL_158 1 +# define MITK_PP_BOOL_159 1 +# define MITK_PP_BOOL_160 1 +# define MITK_PP_BOOL_161 1 +# define MITK_PP_BOOL_162 1 +# define MITK_PP_BOOL_163 1 +# define MITK_PP_BOOL_164 1 +# define MITK_PP_BOOL_165 1 +# define MITK_PP_BOOL_166 1 +# define MITK_PP_BOOL_167 1 +# define MITK_PP_BOOL_168 1 +# define MITK_PP_BOOL_169 1 +# define MITK_PP_BOOL_170 1 +# define MITK_PP_BOOL_171 1 +# define MITK_PP_BOOL_172 1 +# define MITK_PP_BOOL_173 1 +# define MITK_PP_BOOL_174 1 +# define MITK_PP_BOOL_175 1 +# define MITK_PP_BOOL_176 1 +# define MITK_PP_BOOL_177 1 +# define MITK_PP_BOOL_178 1 +# define MITK_PP_BOOL_179 1 +# define MITK_PP_BOOL_180 1 +# define MITK_PP_BOOL_181 1 +# define MITK_PP_BOOL_182 1 +# define MITK_PP_BOOL_183 1 +# define MITK_PP_BOOL_184 1 +# define MITK_PP_BOOL_185 1 +# define MITK_PP_BOOL_186 1 +# define MITK_PP_BOOL_187 1 +# define MITK_PP_BOOL_188 1 +# define MITK_PP_BOOL_189 1 +# define MITK_PP_BOOL_190 1 +# define MITK_PP_BOOL_191 1 +# define MITK_PP_BOOL_192 1 +# define MITK_PP_BOOL_193 1 +# define MITK_PP_BOOL_194 1 +# define MITK_PP_BOOL_195 1 +# define MITK_PP_BOOL_196 1 +# define MITK_PP_BOOL_197 1 +# define MITK_PP_BOOL_198 1 +# define MITK_PP_BOOL_199 1 +# define MITK_PP_BOOL_200 1 +# define MITK_PP_BOOL_201 1 +# define MITK_PP_BOOL_202 1 +# define MITK_PP_BOOL_203 1 +# define MITK_PP_BOOL_204 1 +# define MITK_PP_BOOL_205 1 +# define MITK_PP_BOOL_206 1 +# define MITK_PP_BOOL_207 1 +# define MITK_PP_BOOL_208 1 +# define MITK_PP_BOOL_209 1 +# define MITK_PP_BOOL_210 1 +# define MITK_PP_BOOL_211 1 +# define MITK_PP_BOOL_212 1 +# define MITK_PP_BOOL_213 1 +# define MITK_PP_BOOL_214 1 +# define MITK_PP_BOOL_215 1 +# define MITK_PP_BOOL_216 1 +# define MITK_PP_BOOL_217 1 +# define MITK_PP_BOOL_218 1 +# define MITK_PP_BOOL_219 1 +# define MITK_PP_BOOL_220 1 +# define MITK_PP_BOOL_221 1 +# define MITK_PP_BOOL_222 1 +# define MITK_PP_BOOL_223 1 +# define MITK_PP_BOOL_224 1 +# define MITK_PP_BOOL_225 1 +# define MITK_PP_BOOL_226 1 +# define MITK_PP_BOOL_227 1 +# define MITK_PP_BOOL_228 1 +# define MITK_PP_BOOL_229 1 +# define MITK_PP_BOOL_230 1 +# define MITK_PP_BOOL_231 1 +# define MITK_PP_BOOL_232 1 +# define MITK_PP_BOOL_233 1 +# define MITK_PP_BOOL_234 1 +# define MITK_PP_BOOL_235 1 +# define MITK_PP_BOOL_236 1 +# define MITK_PP_BOOL_237 1 +# define MITK_PP_BOOL_238 1 +# define MITK_PP_BOOL_239 1 +# define MITK_PP_BOOL_240 1 +# define MITK_PP_BOOL_241 1 +# define MITK_PP_BOOL_242 1 +# define MITK_PP_BOOL_243 1 +# define MITK_PP_BOOL_244 1 +# define MITK_PP_BOOL_245 1 +# define MITK_PP_BOOL_246 1 +# define MITK_PP_BOOL_247 1 +# define MITK_PP_BOOL_248 1 +# define MITK_PP_BOOL_249 1 +# define MITK_PP_BOOL_250 1 +# define MITK_PP_BOOL_251 1 +# define MITK_PP_BOOL_252 1 +# define MITK_PP_BOOL_253 1 +# define MITK_PP_BOOL_254 1 +# define MITK_PP_BOOL_255 1 +# define MITK_PP_BOOL_256 1 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPRepetitionDetailDMCFor.h b/Core/Code/Algorithms/mitkPPRepetitionDetailDMCFor.h new file mode 100644 index 0000000000..1d80d7fd02 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPRepetitionDetailDMCFor.h @@ -0,0 +1,536 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_REPETITION_DETAIL_FOR_HPP +# define MITK_PREPROCESSOR_REPETITION_DETAIL_FOR_HPP +# +# include "mitkPPControlExprIIf.h" +# include "mitkPPControlIIf.h" +# include "mitkPPLogicalBool.h" +# include "mitkPPTupleEat.h" +# +# define MITK_PP_FOR_1(s, p, o, m) MITK_PP_FOR_1_C(MITK_PP_BOOL(p##(2, s)), s, p, o, m) +# define MITK_PP_FOR_2(s, p, o, m) MITK_PP_FOR_2_C(MITK_PP_BOOL(p##(3, s)), s, p, o, m) +# define MITK_PP_FOR_3(s, p, o, m) MITK_PP_FOR_3_C(MITK_PP_BOOL(p##(4, s)), s, p, o, m) +# define MITK_PP_FOR_4(s, p, o, m) MITK_PP_FOR_4_C(MITK_PP_BOOL(p##(5, s)), s, p, o, m) +# define MITK_PP_FOR_5(s, p, o, m) MITK_PP_FOR_5_C(MITK_PP_BOOL(p##(6, s)), s, p, o, m) +# define MITK_PP_FOR_6(s, p, o, m) MITK_PP_FOR_6_C(MITK_PP_BOOL(p##(7, s)), s, p, o, m) +# define MITK_PP_FOR_7(s, p, o, m) MITK_PP_FOR_7_C(MITK_PP_BOOL(p##(8, s)), s, p, o, m) +# define MITK_PP_FOR_8(s, p, o, m) MITK_PP_FOR_8_C(MITK_PP_BOOL(p##(9, s)), s, p, o, m) +# define MITK_PP_FOR_9(s, p, o, m) MITK_PP_FOR_9_C(MITK_PP_BOOL(p##(10, s)), s, p, o, m) +# define MITK_PP_FOR_10(s, p, o, m) MITK_PP_FOR_10_C(MITK_PP_BOOL(p##(11, s)), s, p, o, m) +# define MITK_PP_FOR_11(s, p, o, m) MITK_PP_FOR_11_C(MITK_PP_BOOL(p##(12, s)), s, p, o, m) +# define MITK_PP_FOR_12(s, p, o, m) MITK_PP_FOR_12_C(MITK_PP_BOOL(p##(13, s)), s, p, o, m) +# define MITK_PP_FOR_13(s, p, o, m) MITK_PP_FOR_13_C(MITK_PP_BOOL(p##(14, s)), s, p, o, m) +# define MITK_PP_FOR_14(s, p, o, m) MITK_PP_FOR_14_C(MITK_PP_BOOL(p##(15, s)), s, p, o, m) +# define MITK_PP_FOR_15(s, p, o, m) MITK_PP_FOR_15_C(MITK_PP_BOOL(p##(16, s)), s, p, o, m) +# define MITK_PP_FOR_16(s, p, o, m) MITK_PP_FOR_16_C(MITK_PP_BOOL(p##(17, s)), s, p, o, m) +# define MITK_PP_FOR_17(s, p, o, m) MITK_PP_FOR_17_C(MITK_PP_BOOL(p##(18, s)), s, p, o, m) +# define MITK_PP_FOR_18(s, p, o, m) MITK_PP_FOR_18_C(MITK_PP_BOOL(p##(19, s)), s, p, o, m) +# define MITK_PP_FOR_19(s, p, o, m) MITK_PP_FOR_19_C(MITK_PP_BOOL(p##(20, s)), s, p, o, m) +# define MITK_PP_FOR_20(s, p, o, m) MITK_PP_FOR_20_C(MITK_PP_BOOL(p##(21, s)), s, p, o, m) +# define MITK_PP_FOR_21(s, p, o, m) MITK_PP_FOR_21_C(MITK_PP_BOOL(p##(22, s)), s, p, o, m) +# define MITK_PP_FOR_22(s, p, o, m) MITK_PP_FOR_22_C(MITK_PP_BOOL(p##(23, s)), s, p, o, m) +# define MITK_PP_FOR_23(s, p, o, m) MITK_PP_FOR_23_C(MITK_PP_BOOL(p##(24, s)), s, p, o, m) +# define MITK_PP_FOR_24(s, p, o, m) MITK_PP_FOR_24_C(MITK_PP_BOOL(p##(25, s)), s, p, o, m) +# define MITK_PP_FOR_25(s, p, o, m) MITK_PP_FOR_25_C(MITK_PP_BOOL(p##(26, s)), s, p, o, m) +# define MITK_PP_FOR_26(s, p, o, m) MITK_PP_FOR_26_C(MITK_PP_BOOL(p##(27, s)), s, p, o, m) +# define MITK_PP_FOR_27(s, p, o, m) MITK_PP_FOR_27_C(MITK_PP_BOOL(p##(28, s)), s, p, o, m) +# define MITK_PP_FOR_28(s, p, o, m) MITK_PP_FOR_28_C(MITK_PP_BOOL(p##(29, s)), s, p, o, m) +# define MITK_PP_FOR_29(s, p, o, m) MITK_PP_FOR_29_C(MITK_PP_BOOL(p##(30, s)), s, p, o, m) +# define MITK_PP_FOR_30(s, p, o, m) MITK_PP_FOR_30_C(MITK_PP_BOOL(p##(31, s)), s, p, o, m) +# define MITK_PP_FOR_31(s, p, o, m) MITK_PP_FOR_31_C(MITK_PP_BOOL(p##(32, s)), s, p, o, m) +# define MITK_PP_FOR_32(s, p, o, m) MITK_PP_FOR_32_C(MITK_PP_BOOL(p##(33, s)), s, p, o, m) +# define MITK_PP_FOR_33(s, p, o, m) MITK_PP_FOR_33_C(MITK_PP_BOOL(p##(34, s)), s, p, o, m) +# define MITK_PP_FOR_34(s, p, o, m) MITK_PP_FOR_34_C(MITK_PP_BOOL(p##(35, s)), s, p, o, m) +# define MITK_PP_FOR_35(s, p, o, m) MITK_PP_FOR_35_C(MITK_PP_BOOL(p##(36, s)), s, p, o, m) +# define MITK_PP_FOR_36(s, p, o, m) MITK_PP_FOR_36_C(MITK_PP_BOOL(p##(37, s)), s, p, o, m) +# define MITK_PP_FOR_37(s, p, o, m) MITK_PP_FOR_37_C(MITK_PP_BOOL(p##(38, s)), s, p, o, m) +# define MITK_PP_FOR_38(s, p, o, m) MITK_PP_FOR_38_C(MITK_PP_BOOL(p##(39, s)), s, p, o, m) +# define MITK_PP_FOR_39(s, p, o, m) MITK_PP_FOR_39_C(MITK_PP_BOOL(p##(40, s)), s, p, o, m) +# define MITK_PP_FOR_40(s, p, o, m) MITK_PP_FOR_40_C(MITK_PP_BOOL(p##(41, s)), s, p, o, m) +# define MITK_PP_FOR_41(s, p, o, m) MITK_PP_FOR_41_C(MITK_PP_BOOL(p##(42, s)), s, p, o, m) +# define MITK_PP_FOR_42(s, p, o, m) MITK_PP_FOR_42_C(MITK_PP_BOOL(p##(43, s)), s, p, o, m) +# define MITK_PP_FOR_43(s, p, o, m) MITK_PP_FOR_43_C(MITK_PP_BOOL(p##(44, s)), s, p, o, m) +# define MITK_PP_FOR_44(s, p, o, m) MITK_PP_FOR_44_C(MITK_PP_BOOL(p##(45, s)), s, p, o, m) +# define MITK_PP_FOR_45(s, p, o, m) MITK_PP_FOR_45_C(MITK_PP_BOOL(p##(46, s)), s, p, o, m) +# define MITK_PP_FOR_46(s, p, o, m) MITK_PP_FOR_46_C(MITK_PP_BOOL(p##(47, s)), s, p, o, m) +# define MITK_PP_FOR_47(s, p, o, m) MITK_PP_FOR_47_C(MITK_PP_BOOL(p##(48, s)), s, p, o, m) +# define MITK_PP_FOR_48(s, p, o, m) MITK_PP_FOR_48_C(MITK_PP_BOOL(p##(49, s)), s, p, o, m) +# define MITK_PP_FOR_49(s, p, o, m) MITK_PP_FOR_49_C(MITK_PP_BOOL(p##(50, s)), s, p, o, m) +# define MITK_PP_FOR_50(s, p, o, m) MITK_PP_FOR_50_C(MITK_PP_BOOL(p##(51, s)), s, p, o, m) +# define MITK_PP_FOR_51(s, p, o, m) MITK_PP_FOR_51_C(MITK_PP_BOOL(p##(52, s)), s, p, o, m) +# define MITK_PP_FOR_52(s, p, o, m) MITK_PP_FOR_52_C(MITK_PP_BOOL(p##(53, s)), s, p, o, m) +# define MITK_PP_FOR_53(s, p, o, m) MITK_PP_FOR_53_C(MITK_PP_BOOL(p##(54, s)), s, p, o, m) +# define MITK_PP_FOR_54(s, p, o, m) MITK_PP_FOR_54_C(MITK_PP_BOOL(p##(55, s)), s, p, o, m) +# define MITK_PP_FOR_55(s, p, o, m) MITK_PP_FOR_55_C(MITK_PP_BOOL(p##(56, s)), s, p, o, m) +# define MITK_PP_FOR_56(s, p, o, m) MITK_PP_FOR_56_C(MITK_PP_BOOL(p##(57, s)), s, p, o, m) +# define MITK_PP_FOR_57(s, p, o, m) MITK_PP_FOR_57_C(MITK_PP_BOOL(p##(58, s)), s, p, o, m) +# define MITK_PP_FOR_58(s, p, o, m) MITK_PP_FOR_58_C(MITK_PP_BOOL(p##(59, s)), s, p, o, m) +# define MITK_PP_FOR_59(s, p, o, m) MITK_PP_FOR_59_C(MITK_PP_BOOL(p##(60, s)), s, p, o, m) +# define MITK_PP_FOR_60(s, p, o, m) MITK_PP_FOR_60_C(MITK_PP_BOOL(p##(61, s)), s, p, o, m) +# define MITK_PP_FOR_61(s, p, o, m) MITK_PP_FOR_61_C(MITK_PP_BOOL(p##(62, s)), s, p, o, m) +# define MITK_PP_FOR_62(s, p, o, m) MITK_PP_FOR_62_C(MITK_PP_BOOL(p##(63, s)), s, p, o, m) +# define MITK_PP_FOR_63(s, p, o, m) MITK_PP_FOR_63_C(MITK_PP_BOOL(p##(64, s)), s, p, o, m) +# define MITK_PP_FOR_64(s, p, o, m) MITK_PP_FOR_64_C(MITK_PP_BOOL(p##(65, s)), s, p, o, m) +# define MITK_PP_FOR_65(s, p, o, m) MITK_PP_FOR_65_C(MITK_PP_BOOL(p##(66, s)), s, p, o, m) +# define MITK_PP_FOR_66(s, p, o, m) MITK_PP_FOR_66_C(MITK_PP_BOOL(p##(67, s)), s, p, o, m) +# define MITK_PP_FOR_67(s, p, o, m) MITK_PP_FOR_67_C(MITK_PP_BOOL(p##(68, s)), s, p, o, m) +# define MITK_PP_FOR_68(s, p, o, m) MITK_PP_FOR_68_C(MITK_PP_BOOL(p##(69, s)), s, p, o, m) +# define MITK_PP_FOR_69(s, p, o, m) MITK_PP_FOR_69_C(MITK_PP_BOOL(p##(70, s)), s, p, o, m) +# define MITK_PP_FOR_70(s, p, o, m) MITK_PP_FOR_70_C(MITK_PP_BOOL(p##(71, s)), s, p, o, m) +# define MITK_PP_FOR_71(s, p, o, m) MITK_PP_FOR_71_C(MITK_PP_BOOL(p##(72, s)), s, p, o, m) +# define MITK_PP_FOR_72(s, p, o, m) MITK_PP_FOR_72_C(MITK_PP_BOOL(p##(73, s)), s, p, o, m) +# define MITK_PP_FOR_73(s, p, o, m) MITK_PP_FOR_73_C(MITK_PP_BOOL(p##(74, s)), s, p, o, m) +# define MITK_PP_FOR_74(s, p, o, m) MITK_PP_FOR_74_C(MITK_PP_BOOL(p##(75, s)), s, p, o, m) +# define MITK_PP_FOR_75(s, p, o, m) MITK_PP_FOR_75_C(MITK_PP_BOOL(p##(76, s)), s, p, o, m) +# define MITK_PP_FOR_76(s, p, o, m) MITK_PP_FOR_76_C(MITK_PP_BOOL(p##(77, s)), s, p, o, m) +# define MITK_PP_FOR_77(s, p, o, m) MITK_PP_FOR_77_C(MITK_PP_BOOL(p##(78, s)), s, p, o, m) +# define MITK_PP_FOR_78(s, p, o, m) MITK_PP_FOR_78_C(MITK_PP_BOOL(p##(79, s)), s, p, o, m) +# define MITK_PP_FOR_79(s, p, o, m) MITK_PP_FOR_79_C(MITK_PP_BOOL(p##(80, s)), s, p, o, m) +# define MITK_PP_FOR_80(s, p, o, m) MITK_PP_FOR_80_C(MITK_PP_BOOL(p##(81, s)), s, p, o, m) +# define MITK_PP_FOR_81(s, p, o, m) MITK_PP_FOR_81_C(MITK_PP_BOOL(p##(82, s)), s, p, o, m) +# define MITK_PP_FOR_82(s, p, o, m) MITK_PP_FOR_82_C(MITK_PP_BOOL(p##(83, s)), s, p, o, m) +# define MITK_PP_FOR_83(s, p, o, m) MITK_PP_FOR_83_C(MITK_PP_BOOL(p##(84, s)), s, p, o, m) +# define MITK_PP_FOR_84(s, p, o, m) MITK_PP_FOR_84_C(MITK_PP_BOOL(p##(85, s)), s, p, o, m) +# define MITK_PP_FOR_85(s, p, o, m) MITK_PP_FOR_85_C(MITK_PP_BOOL(p##(86, s)), s, p, o, m) +# define MITK_PP_FOR_86(s, p, o, m) MITK_PP_FOR_86_C(MITK_PP_BOOL(p##(87, s)), s, p, o, m) +# define MITK_PP_FOR_87(s, p, o, m) MITK_PP_FOR_87_C(MITK_PP_BOOL(p##(88, s)), s, p, o, m) +# define MITK_PP_FOR_88(s, p, o, m) MITK_PP_FOR_88_C(MITK_PP_BOOL(p##(89, s)), s, p, o, m) +# define MITK_PP_FOR_89(s, p, o, m) MITK_PP_FOR_89_C(MITK_PP_BOOL(p##(90, s)), s, p, o, m) +# define MITK_PP_FOR_90(s, p, o, m) MITK_PP_FOR_90_C(MITK_PP_BOOL(p##(91, s)), s, p, o, m) +# define MITK_PP_FOR_91(s, p, o, m) MITK_PP_FOR_91_C(MITK_PP_BOOL(p##(92, s)), s, p, o, m) +# define MITK_PP_FOR_92(s, p, o, m) MITK_PP_FOR_92_C(MITK_PP_BOOL(p##(93, s)), s, p, o, m) +# define MITK_PP_FOR_93(s, p, o, m) MITK_PP_FOR_93_C(MITK_PP_BOOL(p##(94, s)), s, p, o, m) +# define MITK_PP_FOR_94(s, p, o, m) MITK_PP_FOR_94_C(MITK_PP_BOOL(p##(95, s)), s, p, o, m) +# define MITK_PP_FOR_95(s, p, o, m) MITK_PP_FOR_95_C(MITK_PP_BOOL(p##(96, s)), s, p, o, m) +# define MITK_PP_FOR_96(s, p, o, m) MITK_PP_FOR_96_C(MITK_PP_BOOL(p##(97, s)), s, p, o, m) +# define MITK_PP_FOR_97(s, p, o, m) MITK_PP_FOR_97_C(MITK_PP_BOOL(p##(98, s)), s, p, o, m) +# define MITK_PP_FOR_98(s, p, o, m) MITK_PP_FOR_98_C(MITK_PP_BOOL(p##(99, s)), s, p, o, m) +# define MITK_PP_FOR_99(s, p, o, m) MITK_PP_FOR_99_C(MITK_PP_BOOL(p##(100, s)), s, p, o, m) +# define MITK_PP_FOR_100(s, p, o, m) MITK_PP_FOR_100_C(MITK_PP_BOOL(p##(101, s)), s, p, o, m) +# define MITK_PP_FOR_101(s, p, o, m) MITK_PP_FOR_101_C(MITK_PP_BOOL(p##(102, s)), s, p, o, m) +# define MITK_PP_FOR_102(s, p, o, m) MITK_PP_FOR_102_C(MITK_PP_BOOL(p##(103, s)), s, p, o, m) +# define MITK_PP_FOR_103(s, p, o, m) MITK_PP_FOR_103_C(MITK_PP_BOOL(p##(104, s)), s, p, o, m) +# define MITK_PP_FOR_104(s, p, o, m) MITK_PP_FOR_104_C(MITK_PP_BOOL(p##(105, s)), s, p, o, m) +# define MITK_PP_FOR_105(s, p, o, m) MITK_PP_FOR_105_C(MITK_PP_BOOL(p##(106, s)), s, p, o, m) +# define MITK_PP_FOR_106(s, p, o, m) MITK_PP_FOR_106_C(MITK_PP_BOOL(p##(107, s)), s, p, o, m) +# define MITK_PP_FOR_107(s, p, o, m) MITK_PP_FOR_107_C(MITK_PP_BOOL(p##(108, s)), s, p, o, m) +# define MITK_PP_FOR_108(s, p, o, m) MITK_PP_FOR_108_C(MITK_PP_BOOL(p##(109, s)), s, p, o, m) +# define MITK_PP_FOR_109(s, p, o, m) MITK_PP_FOR_109_C(MITK_PP_BOOL(p##(110, s)), s, p, o, m) +# define MITK_PP_FOR_110(s, p, o, m) MITK_PP_FOR_110_C(MITK_PP_BOOL(p##(111, s)), s, p, o, m) +# define MITK_PP_FOR_111(s, p, o, m) MITK_PP_FOR_111_C(MITK_PP_BOOL(p##(112, s)), s, p, o, m) +# define MITK_PP_FOR_112(s, p, o, m) MITK_PP_FOR_112_C(MITK_PP_BOOL(p##(113, s)), s, p, o, m) +# define MITK_PP_FOR_113(s, p, o, m) MITK_PP_FOR_113_C(MITK_PP_BOOL(p##(114, s)), s, p, o, m) +# define MITK_PP_FOR_114(s, p, o, m) MITK_PP_FOR_114_C(MITK_PP_BOOL(p##(115, s)), s, p, o, m) +# define MITK_PP_FOR_115(s, p, o, m) MITK_PP_FOR_115_C(MITK_PP_BOOL(p##(116, s)), s, p, o, m) +# define MITK_PP_FOR_116(s, p, o, m) MITK_PP_FOR_116_C(MITK_PP_BOOL(p##(117, s)), s, p, o, m) +# define MITK_PP_FOR_117(s, p, o, m) MITK_PP_FOR_117_C(MITK_PP_BOOL(p##(118, s)), s, p, o, m) +# define MITK_PP_FOR_118(s, p, o, m) MITK_PP_FOR_118_C(MITK_PP_BOOL(p##(119, s)), s, p, o, m) +# define MITK_PP_FOR_119(s, p, o, m) MITK_PP_FOR_119_C(MITK_PP_BOOL(p##(120, s)), s, p, o, m) +# define MITK_PP_FOR_120(s, p, o, m) MITK_PP_FOR_120_C(MITK_PP_BOOL(p##(121, s)), s, p, o, m) +# define MITK_PP_FOR_121(s, p, o, m) MITK_PP_FOR_121_C(MITK_PP_BOOL(p##(122, s)), s, p, o, m) +# define MITK_PP_FOR_122(s, p, o, m) MITK_PP_FOR_122_C(MITK_PP_BOOL(p##(123, s)), s, p, o, m) +# define MITK_PP_FOR_123(s, p, o, m) MITK_PP_FOR_123_C(MITK_PP_BOOL(p##(124, s)), s, p, o, m) +# define MITK_PP_FOR_124(s, p, o, m) MITK_PP_FOR_124_C(MITK_PP_BOOL(p##(125, s)), s, p, o, m) +# define MITK_PP_FOR_125(s, p, o, m) MITK_PP_FOR_125_C(MITK_PP_BOOL(p##(126, s)), s, p, o, m) +# define MITK_PP_FOR_126(s, p, o, m) MITK_PP_FOR_126_C(MITK_PP_BOOL(p##(127, s)), s, p, o, m) +# define MITK_PP_FOR_127(s, p, o, m) MITK_PP_FOR_127_C(MITK_PP_BOOL(p##(128, s)), s, p, o, m) +# define MITK_PP_FOR_128(s, p, o, m) MITK_PP_FOR_128_C(MITK_PP_BOOL(p##(129, s)), s, p, o, m) +# define MITK_PP_FOR_129(s, p, o, m) MITK_PP_FOR_129_C(MITK_PP_BOOL(p##(130, s)), s, p, o, m) +# define MITK_PP_FOR_130(s, p, o, m) MITK_PP_FOR_130_C(MITK_PP_BOOL(p##(131, s)), s, p, o, m) +# define MITK_PP_FOR_131(s, p, o, m) MITK_PP_FOR_131_C(MITK_PP_BOOL(p##(132, s)), s, p, o, m) +# define MITK_PP_FOR_132(s, p, o, m) MITK_PP_FOR_132_C(MITK_PP_BOOL(p##(133, s)), s, p, o, m) +# define MITK_PP_FOR_133(s, p, o, m) MITK_PP_FOR_133_C(MITK_PP_BOOL(p##(134, s)), s, p, o, m) +# define MITK_PP_FOR_134(s, p, o, m) MITK_PP_FOR_134_C(MITK_PP_BOOL(p##(135, s)), s, p, o, m) +# define MITK_PP_FOR_135(s, p, o, m) MITK_PP_FOR_135_C(MITK_PP_BOOL(p##(136, s)), s, p, o, m) +# define MITK_PP_FOR_136(s, p, o, m) MITK_PP_FOR_136_C(MITK_PP_BOOL(p##(137, s)), s, p, o, m) +# define MITK_PP_FOR_137(s, p, o, m) MITK_PP_FOR_137_C(MITK_PP_BOOL(p##(138, s)), s, p, o, m) +# define MITK_PP_FOR_138(s, p, o, m) MITK_PP_FOR_138_C(MITK_PP_BOOL(p##(139, s)), s, p, o, m) +# define MITK_PP_FOR_139(s, p, o, m) MITK_PP_FOR_139_C(MITK_PP_BOOL(p##(140, s)), s, p, o, m) +# define MITK_PP_FOR_140(s, p, o, m) MITK_PP_FOR_140_C(MITK_PP_BOOL(p##(141, s)), s, p, o, m) +# define MITK_PP_FOR_141(s, p, o, m) MITK_PP_FOR_141_C(MITK_PP_BOOL(p##(142, s)), s, p, o, m) +# define MITK_PP_FOR_142(s, p, o, m) MITK_PP_FOR_142_C(MITK_PP_BOOL(p##(143, s)), s, p, o, m) +# define MITK_PP_FOR_143(s, p, o, m) MITK_PP_FOR_143_C(MITK_PP_BOOL(p##(144, s)), s, p, o, m) +# define MITK_PP_FOR_144(s, p, o, m) MITK_PP_FOR_144_C(MITK_PP_BOOL(p##(145, s)), s, p, o, m) +# define MITK_PP_FOR_145(s, p, o, m) MITK_PP_FOR_145_C(MITK_PP_BOOL(p##(146, s)), s, p, o, m) +# define MITK_PP_FOR_146(s, p, o, m) MITK_PP_FOR_146_C(MITK_PP_BOOL(p##(147, s)), s, p, o, m) +# define MITK_PP_FOR_147(s, p, o, m) MITK_PP_FOR_147_C(MITK_PP_BOOL(p##(148, s)), s, p, o, m) +# define MITK_PP_FOR_148(s, p, o, m) MITK_PP_FOR_148_C(MITK_PP_BOOL(p##(149, s)), s, p, o, m) +# define MITK_PP_FOR_149(s, p, o, m) MITK_PP_FOR_149_C(MITK_PP_BOOL(p##(150, s)), s, p, o, m) +# define MITK_PP_FOR_150(s, p, o, m) MITK_PP_FOR_150_C(MITK_PP_BOOL(p##(151, s)), s, p, o, m) +# define MITK_PP_FOR_151(s, p, o, m) MITK_PP_FOR_151_C(MITK_PP_BOOL(p##(152, s)), s, p, o, m) +# define MITK_PP_FOR_152(s, p, o, m) MITK_PP_FOR_152_C(MITK_PP_BOOL(p##(153, s)), s, p, o, m) +# define MITK_PP_FOR_153(s, p, o, m) MITK_PP_FOR_153_C(MITK_PP_BOOL(p##(154, s)), s, p, o, m) +# define MITK_PP_FOR_154(s, p, o, m) MITK_PP_FOR_154_C(MITK_PP_BOOL(p##(155, s)), s, p, o, m) +# define MITK_PP_FOR_155(s, p, o, m) MITK_PP_FOR_155_C(MITK_PP_BOOL(p##(156, s)), s, p, o, m) +# define MITK_PP_FOR_156(s, p, o, m) MITK_PP_FOR_156_C(MITK_PP_BOOL(p##(157, s)), s, p, o, m) +# define MITK_PP_FOR_157(s, p, o, m) MITK_PP_FOR_157_C(MITK_PP_BOOL(p##(158, s)), s, p, o, m) +# define MITK_PP_FOR_158(s, p, o, m) MITK_PP_FOR_158_C(MITK_PP_BOOL(p##(159, s)), s, p, o, m) +# define MITK_PP_FOR_159(s, p, o, m) MITK_PP_FOR_159_C(MITK_PP_BOOL(p##(160, s)), s, p, o, m) +# define MITK_PP_FOR_160(s, p, o, m) MITK_PP_FOR_160_C(MITK_PP_BOOL(p##(161, s)), s, p, o, m) +# define MITK_PP_FOR_161(s, p, o, m) MITK_PP_FOR_161_C(MITK_PP_BOOL(p##(162, s)), s, p, o, m) +# define MITK_PP_FOR_162(s, p, o, m) MITK_PP_FOR_162_C(MITK_PP_BOOL(p##(163, s)), s, p, o, m) +# define MITK_PP_FOR_163(s, p, o, m) MITK_PP_FOR_163_C(MITK_PP_BOOL(p##(164, s)), s, p, o, m) +# define MITK_PP_FOR_164(s, p, o, m) MITK_PP_FOR_164_C(MITK_PP_BOOL(p##(165, s)), s, p, o, m) +# define MITK_PP_FOR_165(s, p, o, m) MITK_PP_FOR_165_C(MITK_PP_BOOL(p##(166, s)), s, p, o, m) +# define MITK_PP_FOR_166(s, p, o, m) MITK_PP_FOR_166_C(MITK_PP_BOOL(p##(167, s)), s, p, o, m) +# define MITK_PP_FOR_167(s, p, o, m) MITK_PP_FOR_167_C(MITK_PP_BOOL(p##(168, s)), s, p, o, m) +# define MITK_PP_FOR_168(s, p, o, m) MITK_PP_FOR_168_C(MITK_PP_BOOL(p##(169, s)), s, p, o, m) +# define MITK_PP_FOR_169(s, p, o, m) MITK_PP_FOR_169_C(MITK_PP_BOOL(p##(170, s)), s, p, o, m) +# define MITK_PP_FOR_170(s, p, o, m) MITK_PP_FOR_170_C(MITK_PP_BOOL(p##(171, s)), s, p, o, m) +# define MITK_PP_FOR_171(s, p, o, m) MITK_PP_FOR_171_C(MITK_PP_BOOL(p##(172, s)), s, p, o, m) +# define MITK_PP_FOR_172(s, p, o, m) MITK_PP_FOR_172_C(MITK_PP_BOOL(p##(173, s)), s, p, o, m) +# define MITK_PP_FOR_173(s, p, o, m) MITK_PP_FOR_173_C(MITK_PP_BOOL(p##(174, s)), s, p, o, m) +# define MITK_PP_FOR_174(s, p, o, m) MITK_PP_FOR_174_C(MITK_PP_BOOL(p##(175, s)), s, p, o, m) +# define MITK_PP_FOR_175(s, p, o, m) MITK_PP_FOR_175_C(MITK_PP_BOOL(p##(176, s)), s, p, o, m) +# define MITK_PP_FOR_176(s, p, o, m) MITK_PP_FOR_176_C(MITK_PP_BOOL(p##(177, s)), s, p, o, m) +# define MITK_PP_FOR_177(s, p, o, m) MITK_PP_FOR_177_C(MITK_PP_BOOL(p##(178, s)), s, p, o, m) +# define MITK_PP_FOR_178(s, p, o, m) MITK_PP_FOR_178_C(MITK_PP_BOOL(p##(179, s)), s, p, o, m) +# define MITK_PP_FOR_179(s, p, o, m) MITK_PP_FOR_179_C(MITK_PP_BOOL(p##(180, s)), s, p, o, m) +# define MITK_PP_FOR_180(s, p, o, m) MITK_PP_FOR_180_C(MITK_PP_BOOL(p##(181, s)), s, p, o, m) +# define MITK_PP_FOR_181(s, p, o, m) MITK_PP_FOR_181_C(MITK_PP_BOOL(p##(182, s)), s, p, o, m) +# define MITK_PP_FOR_182(s, p, o, m) MITK_PP_FOR_182_C(MITK_PP_BOOL(p##(183, s)), s, p, o, m) +# define MITK_PP_FOR_183(s, p, o, m) MITK_PP_FOR_183_C(MITK_PP_BOOL(p##(184, s)), s, p, o, m) +# define MITK_PP_FOR_184(s, p, o, m) MITK_PP_FOR_184_C(MITK_PP_BOOL(p##(185, s)), s, p, o, m) +# define MITK_PP_FOR_185(s, p, o, m) MITK_PP_FOR_185_C(MITK_PP_BOOL(p##(186, s)), s, p, o, m) +# define MITK_PP_FOR_186(s, p, o, m) MITK_PP_FOR_186_C(MITK_PP_BOOL(p##(187, s)), s, p, o, m) +# define MITK_PP_FOR_187(s, p, o, m) MITK_PP_FOR_187_C(MITK_PP_BOOL(p##(188, s)), s, p, o, m) +# define MITK_PP_FOR_188(s, p, o, m) MITK_PP_FOR_188_C(MITK_PP_BOOL(p##(189, s)), s, p, o, m) +# define MITK_PP_FOR_189(s, p, o, m) MITK_PP_FOR_189_C(MITK_PP_BOOL(p##(190, s)), s, p, o, m) +# define MITK_PP_FOR_190(s, p, o, m) MITK_PP_FOR_190_C(MITK_PP_BOOL(p##(191, s)), s, p, o, m) +# define MITK_PP_FOR_191(s, p, o, m) MITK_PP_FOR_191_C(MITK_PP_BOOL(p##(192, s)), s, p, o, m) +# define MITK_PP_FOR_192(s, p, o, m) MITK_PP_FOR_192_C(MITK_PP_BOOL(p##(193, s)), s, p, o, m) +# define MITK_PP_FOR_193(s, p, o, m) MITK_PP_FOR_193_C(MITK_PP_BOOL(p##(194, s)), s, p, o, m) +# define MITK_PP_FOR_194(s, p, o, m) MITK_PP_FOR_194_C(MITK_PP_BOOL(p##(195, s)), s, p, o, m) +# define MITK_PP_FOR_195(s, p, o, m) MITK_PP_FOR_195_C(MITK_PP_BOOL(p##(196, s)), s, p, o, m) +# define MITK_PP_FOR_196(s, p, o, m) MITK_PP_FOR_196_C(MITK_PP_BOOL(p##(197, s)), s, p, o, m) +# define MITK_PP_FOR_197(s, p, o, m) MITK_PP_FOR_197_C(MITK_PP_BOOL(p##(198, s)), s, p, o, m) +# define MITK_PP_FOR_198(s, p, o, m) MITK_PP_FOR_198_C(MITK_PP_BOOL(p##(199, s)), s, p, o, m) +# define MITK_PP_FOR_199(s, p, o, m) MITK_PP_FOR_199_C(MITK_PP_BOOL(p##(200, s)), s, p, o, m) +# define MITK_PP_FOR_200(s, p, o, m) MITK_PP_FOR_200_C(MITK_PP_BOOL(p##(201, s)), s, p, o, m) +# define MITK_PP_FOR_201(s, p, o, m) MITK_PP_FOR_201_C(MITK_PP_BOOL(p##(202, s)), s, p, o, m) +# define MITK_PP_FOR_202(s, p, o, m) MITK_PP_FOR_202_C(MITK_PP_BOOL(p##(203, s)), s, p, o, m) +# define MITK_PP_FOR_203(s, p, o, m) MITK_PP_FOR_203_C(MITK_PP_BOOL(p##(204, s)), s, p, o, m) +# define MITK_PP_FOR_204(s, p, o, m) MITK_PP_FOR_204_C(MITK_PP_BOOL(p##(205, s)), s, p, o, m) +# define MITK_PP_FOR_205(s, p, o, m) MITK_PP_FOR_205_C(MITK_PP_BOOL(p##(206, s)), s, p, o, m) +# define MITK_PP_FOR_206(s, p, o, m) MITK_PP_FOR_206_C(MITK_PP_BOOL(p##(207, s)), s, p, o, m) +# define MITK_PP_FOR_207(s, p, o, m) MITK_PP_FOR_207_C(MITK_PP_BOOL(p##(208, s)), s, p, o, m) +# define MITK_PP_FOR_208(s, p, o, m) MITK_PP_FOR_208_C(MITK_PP_BOOL(p##(209, s)), s, p, o, m) +# define MITK_PP_FOR_209(s, p, o, m) MITK_PP_FOR_209_C(MITK_PP_BOOL(p##(210, s)), s, p, o, m) +# define MITK_PP_FOR_210(s, p, o, m) MITK_PP_FOR_210_C(MITK_PP_BOOL(p##(211, s)), s, p, o, m) +# define MITK_PP_FOR_211(s, p, o, m) MITK_PP_FOR_211_C(MITK_PP_BOOL(p##(212, s)), s, p, o, m) +# define MITK_PP_FOR_212(s, p, o, m) MITK_PP_FOR_212_C(MITK_PP_BOOL(p##(213, s)), s, p, o, m) +# define MITK_PP_FOR_213(s, p, o, m) MITK_PP_FOR_213_C(MITK_PP_BOOL(p##(214, s)), s, p, o, m) +# define MITK_PP_FOR_214(s, p, o, m) MITK_PP_FOR_214_C(MITK_PP_BOOL(p##(215, s)), s, p, o, m) +# define MITK_PP_FOR_215(s, p, o, m) MITK_PP_FOR_215_C(MITK_PP_BOOL(p##(216, s)), s, p, o, m) +# define MITK_PP_FOR_216(s, p, o, m) MITK_PP_FOR_216_C(MITK_PP_BOOL(p##(217, s)), s, p, o, m) +# define MITK_PP_FOR_217(s, p, o, m) MITK_PP_FOR_217_C(MITK_PP_BOOL(p##(218, s)), s, p, o, m) +# define MITK_PP_FOR_218(s, p, o, m) MITK_PP_FOR_218_C(MITK_PP_BOOL(p##(219, s)), s, p, o, m) +# define MITK_PP_FOR_219(s, p, o, m) MITK_PP_FOR_219_C(MITK_PP_BOOL(p##(220, s)), s, p, o, m) +# define MITK_PP_FOR_220(s, p, o, m) MITK_PP_FOR_220_C(MITK_PP_BOOL(p##(221, s)), s, p, o, m) +# define MITK_PP_FOR_221(s, p, o, m) MITK_PP_FOR_221_C(MITK_PP_BOOL(p##(222, s)), s, p, o, m) +# define MITK_PP_FOR_222(s, p, o, m) MITK_PP_FOR_222_C(MITK_PP_BOOL(p##(223, s)), s, p, o, m) +# define MITK_PP_FOR_223(s, p, o, m) MITK_PP_FOR_223_C(MITK_PP_BOOL(p##(224, s)), s, p, o, m) +# define MITK_PP_FOR_224(s, p, o, m) MITK_PP_FOR_224_C(MITK_PP_BOOL(p##(225, s)), s, p, o, m) +# define MITK_PP_FOR_225(s, p, o, m) MITK_PP_FOR_225_C(MITK_PP_BOOL(p##(226, s)), s, p, o, m) +# define MITK_PP_FOR_226(s, p, o, m) MITK_PP_FOR_226_C(MITK_PP_BOOL(p##(227, s)), s, p, o, m) +# define MITK_PP_FOR_227(s, p, o, m) MITK_PP_FOR_227_C(MITK_PP_BOOL(p##(228, s)), s, p, o, m) +# define MITK_PP_FOR_228(s, p, o, m) MITK_PP_FOR_228_C(MITK_PP_BOOL(p##(229, s)), s, p, o, m) +# define MITK_PP_FOR_229(s, p, o, m) MITK_PP_FOR_229_C(MITK_PP_BOOL(p##(230, s)), s, p, o, m) +# define MITK_PP_FOR_230(s, p, o, m) MITK_PP_FOR_230_C(MITK_PP_BOOL(p##(231, s)), s, p, o, m) +# define MITK_PP_FOR_231(s, p, o, m) MITK_PP_FOR_231_C(MITK_PP_BOOL(p##(232, s)), s, p, o, m) +# define MITK_PP_FOR_232(s, p, o, m) MITK_PP_FOR_232_C(MITK_PP_BOOL(p##(233, s)), s, p, o, m) +# define MITK_PP_FOR_233(s, p, o, m) MITK_PP_FOR_233_C(MITK_PP_BOOL(p##(234, s)), s, p, o, m) +# define MITK_PP_FOR_234(s, p, o, m) MITK_PP_FOR_234_C(MITK_PP_BOOL(p##(235, s)), s, p, o, m) +# define MITK_PP_FOR_235(s, p, o, m) MITK_PP_FOR_235_C(MITK_PP_BOOL(p##(236, s)), s, p, o, m) +# define MITK_PP_FOR_236(s, p, o, m) MITK_PP_FOR_236_C(MITK_PP_BOOL(p##(237, s)), s, p, o, m) +# define MITK_PP_FOR_237(s, p, o, m) MITK_PP_FOR_237_C(MITK_PP_BOOL(p##(238, s)), s, p, o, m) +# define MITK_PP_FOR_238(s, p, o, m) MITK_PP_FOR_238_C(MITK_PP_BOOL(p##(239, s)), s, p, o, m) +# define MITK_PP_FOR_239(s, p, o, m) MITK_PP_FOR_239_C(MITK_PP_BOOL(p##(240, s)), s, p, o, m) +# define MITK_PP_FOR_240(s, p, o, m) MITK_PP_FOR_240_C(MITK_PP_BOOL(p##(241, s)), s, p, o, m) +# define MITK_PP_FOR_241(s, p, o, m) MITK_PP_FOR_241_C(MITK_PP_BOOL(p##(242, s)), s, p, o, m) +# define MITK_PP_FOR_242(s, p, o, m) MITK_PP_FOR_242_C(MITK_PP_BOOL(p##(243, s)), s, p, o, m) +# define MITK_PP_FOR_243(s, p, o, m) MITK_PP_FOR_243_C(MITK_PP_BOOL(p##(244, s)), s, p, o, m) +# define MITK_PP_FOR_244(s, p, o, m) MITK_PP_FOR_244_C(MITK_PP_BOOL(p##(245, s)), s, p, o, m) +# define MITK_PP_FOR_245(s, p, o, m) MITK_PP_FOR_245_C(MITK_PP_BOOL(p##(246, s)), s, p, o, m) +# define MITK_PP_FOR_246(s, p, o, m) MITK_PP_FOR_246_C(MITK_PP_BOOL(p##(247, s)), s, p, o, m) +# define MITK_PP_FOR_247(s, p, o, m) MITK_PP_FOR_247_C(MITK_PP_BOOL(p##(248, s)), s, p, o, m) +# define MITK_PP_FOR_248(s, p, o, m) MITK_PP_FOR_248_C(MITK_PP_BOOL(p##(249, s)), s, p, o, m) +# define MITK_PP_FOR_249(s, p, o, m) MITK_PP_FOR_249_C(MITK_PP_BOOL(p##(250, s)), s, p, o, m) +# define MITK_PP_FOR_250(s, p, o, m) MITK_PP_FOR_250_C(MITK_PP_BOOL(p##(251, s)), s, p, o, m) +# define MITK_PP_FOR_251(s, p, o, m) MITK_PP_FOR_251_C(MITK_PP_BOOL(p##(252, s)), s, p, o, m) +# define MITK_PP_FOR_252(s, p, o, m) MITK_PP_FOR_252_C(MITK_PP_BOOL(p##(253, s)), s, p, o, m) +# define MITK_PP_FOR_253(s, p, o, m) MITK_PP_FOR_253_C(MITK_PP_BOOL(p##(254, s)), s, p, o, m) +# define MITK_PP_FOR_254(s, p, o, m) MITK_PP_FOR_254_C(MITK_PP_BOOL(p##(255, s)), s, p, o, m) +# define MITK_PP_FOR_255(s, p, o, m) MITK_PP_FOR_255_C(MITK_PP_BOOL(p##(256, s)), s, p, o, m) +# define MITK_PP_FOR_256(s, p, o, m) MITK_PP_FOR_256_C(MITK_PP_BOOL(p##(257, s)), s, p, o, m) +# +# define MITK_PP_FOR_1_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(2, s) MITK_PP_IIF(c, MITK_PP_FOR_2, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(2, s), p, o, m) +# define MITK_PP_FOR_2_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(3, s) MITK_PP_IIF(c, MITK_PP_FOR_3, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(3, s), p, o, m) +# define MITK_PP_FOR_3_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(4, s) MITK_PP_IIF(c, MITK_PP_FOR_4, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(4, s), p, o, m) +# define MITK_PP_FOR_4_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(5, s) MITK_PP_IIF(c, MITK_PP_FOR_5, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(5, s), p, o, m) +# define MITK_PP_FOR_5_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(6, s) MITK_PP_IIF(c, MITK_PP_FOR_6, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(6, s), p, o, m) +# define MITK_PP_FOR_6_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(7, s) MITK_PP_IIF(c, MITK_PP_FOR_7, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(7, s), p, o, m) +# define MITK_PP_FOR_7_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(8, s) MITK_PP_IIF(c, MITK_PP_FOR_8, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(8, s), p, o, m) +# define MITK_PP_FOR_8_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(9, s) MITK_PP_IIF(c, MITK_PP_FOR_9, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(9, s), p, o, m) +# define MITK_PP_FOR_9_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(10, s) MITK_PP_IIF(c, MITK_PP_FOR_10, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(10, s), p, o, m) +# define MITK_PP_FOR_10_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(11, s) MITK_PP_IIF(c, MITK_PP_FOR_11, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(11, s), p, o, m) +# define MITK_PP_FOR_11_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(12, s) MITK_PP_IIF(c, MITK_PP_FOR_12, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(12, s), p, o, m) +# define MITK_PP_FOR_12_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(13, s) MITK_PP_IIF(c, MITK_PP_FOR_13, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(13, s), p, o, m) +# define MITK_PP_FOR_13_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(14, s) MITK_PP_IIF(c, MITK_PP_FOR_14, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(14, s), p, o, m) +# define MITK_PP_FOR_14_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(15, s) MITK_PP_IIF(c, MITK_PP_FOR_15, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(15, s), p, o, m) +# define MITK_PP_FOR_15_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(16, s) MITK_PP_IIF(c, MITK_PP_FOR_16, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(16, s), p, o, m) +# define MITK_PP_FOR_16_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(17, s) MITK_PP_IIF(c, MITK_PP_FOR_17, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(17, s), p, o, m) +# define MITK_PP_FOR_17_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(18, s) MITK_PP_IIF(c, MITK_PP_FOR_18, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(18, s), p, o, m) +# define MITK_PP_FOR_18_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(19, s) MITK_PP_IIF(c, MITK_PP_FOR_19, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(19, s), p, o, m) +# define MITK_PP_FOR_19_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(20, s) MITK_PP_IIF(c, MITK_PP_FOR_20, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(20, s), p, o, m) +# define MITK_PP_FOR_20_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(21, s) MITK_PP_IIF(c, MITK_PP_FOR_21, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(21, s), p, o, m) +# define MITK_PP_FOR_21_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(22, s) MITK_PP_IIF(c, MITK_PP_FOR_22, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(22, s), p, o, m) +# define MITK_PP_FOR_22_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(23, s) MITK_PP_IIF(c, MITK_PP_FOR_23, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(23, s), p, o, m) +# define MITK_PP_FOR_23_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(24, s) MITK_PP_IIF(c, MITK_PP_FOR_24, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(24, s), p, o, m) +# define MITK_PP_FOR_24_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(25, s) MITK_PP_IIF(c, MITK_PP_FOR_25, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(25, s), p, o, m) +# define MITK_PP_FOR_25_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(26, s) MITK_PP_IIF(c, MITK_PP_FOR_26, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(26, s), p, o, m) +# define MITK_PP_FOR_26_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(27, s) MITK_PP_IIF(c, MITK_PP_FOR_27, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(27, s), p, o, m) +# define MITK_PP_FOR_27_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(28, s) MITK_PP_IIF(c, MITK_PP_FOR_28, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(28, s), p, o, m) +# define MITK_PP_FOR_28_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(29, s) MITK_PP_IIF(c, MITK_PP_FOR_29, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(29, s), p, o, m) +# define MITK_PP_FOR_29_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(30, s) MITK_PP_IIF(c, MITK_PP_FOR_30, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(30, s), p, o, m) +# define MITK_PP_FOR_30_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(31, s) MITK_PP_IIF(c, MITK_PP_FOR_31, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(31, s), p, o, m) +# define MITK_PP_FOR_31_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(32, s) MITK_PP_IIF(c, MITK_PP_FOR_32, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(32, s), p, o, m) +# define MITK_PP_FOR_32_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(33, s) MITK_PP_IIF(c, MITK_PP_FOR_33, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(33, s), p, o, m) +# define MITK_PP_FOR_33_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(34, s) MITK_PP_IIF(c, MITK_PP_FOR_34, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(34, s), p, o, m) +# define MITK_PP_FOR_34_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(35, s) MITK_PP_IIF(c, MITK_PP_FOR_35, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(35, s), p, o, m) +# define MITK_PP_FOR_35_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(36, s) MITK_PP_IIF(c, MITK_PP_FOR_36, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(36, s), p, o, m) +# define MITK_PP_FOR_36_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(37, s) MITK_PP_IIF(c, MITK_PP_FOR_37, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(37, s), p, o, m) +# define MITK_PP_FOR_37_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(38, s) MITK_PP_IIF(c, MITK_PP_FOR_38, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(38, s), p, o, m) +# define MITK_PP_FOR_38_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(39, s) MITK_PP_IIF(c, MITK_PP_FOR_39, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(39, s), p, o, m) +# define MITK_PP_FOR_39_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(40, s) MITK_PP_IIF(c, MITK_PP_FOR_40, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(40, s), p, o, m) +# define MITK_PP_FOR_40_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(41, s) MITK_PP_IIF(c, MITK_PP_FOR_41, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(41, s), p, o, m) +# define MITK_PP_FOR_41_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(42, s) MITK_PP_IIF(c, MITK_PP_FOR_42, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(42, s), p, o, m) +# define MITK_PP_FOR_42_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(43, s) MITK_PP_IIF(c, MITK_PP_FOR_43, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(43, s), p, o, m) +# define MITK_PP_FOR_43_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(44, s) MITK_PP_IIF(c, MITK_PP_FOR_44, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(44, s), p, o, m) +# define MITK_PP_FOR_44_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(45, s) MITK_PP_IIF(c, MITK_PP_FOR_45, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(45, s), p, o, m) +# define MITK_PP_FOR_45_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(46, s) MITK_PP_IIF(c, MITK_PP_FOR_46, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(46, s), p, o, m) +# define MITK_PP_FOR_46_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(47, s) MITK_PP_IIF(c, MITK_PP_FOR_47, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(47, s), p, o, m) +# define MITK_PP_FOR_47_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(48, s) MITK_PP_IIF(c, MITK_PP_FOR_48, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(48, s), p, o, m) +# define MITK_PP_FOR_48_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(49, s) MITK_PP_IIF(c, MITK_PP_FOR_49, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(49, s), p, o, m) +# define MITK_PP_FOR_49_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(50, s) MITK_PP_IIF(c, MITK_PP_FOR_50, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(50, s), p, o, m) +# define MITK_PP_FOR_50_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(51, s) MITK_PP_IIF(c, MITK_PP_FOR_51, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(51, s), p, o, m) +# define MITK_PP_FOR_51_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(52, s) MITK_PP_IIF(c, MITK_PP_FOR_52, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(52, s), p, o, m) +# define MITK_PP_FOR_52_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(53, s) MITK_PP_IIF(c, MITK_PP_FOR_53, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(53, s), p, o, m) +# define MITK_PP_FOR_53_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(54, s) MITK_PP_IIF(c, MITK_PP_FOR_54, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(54, s), p, o, m) +# define MITK_PP_FOR_54_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(55, s) MITK_PP_IIF(c, MITK_PP_FOR_55, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(55, s), p, o, m) +# define MITK_PP_FOR_55_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(56, s) MITK_PP_IIF(c, MITK_PP_FOR_56, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(56, s), p, o, m) +# define MITK_PP_FOR_56_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(57, s) MITK_PP_IIF(c, MITK_PP_FOR_57, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(57, s), p, o, m) +# define MITK_PP_FOR_57_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(58, s) MITK_PP_IIF(c, MITK_PP_FOR_58, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(58, s), p, o, m) +# define MITK_PP_FOR_58_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(59, s) MITK_PP_IIF(c, MITK_PP_FOR_59, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(59, s), p, o, m) +# define MITK_PP_FOR_59_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(60, s) MITK_PP_IIF(c, MITK_PP_FOR_60, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(60, s), p, o, m) +# define MITK_PP_FOR_60_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(61, s) MITK_PP_IIF(c, MITK_PP_FOR_61, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(61, s), p, o, m) +# define MITK_PP_FOR_61_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(62, s) MITK_PP_IIF(c, MITK_PP_FOR_62, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(62, s), p, o, m) +# define MITK_PP_FOR_62_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(63, s) MITK_PP_IIF(c, MITK_PP_FOR_63, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(63, s), p, o, m) +# define MITK_PP_FOR_63_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(64, s) MITK_PP_IIF(c, MITK_PP_FOR_64, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(64, s), p, o, m) +# define MITK_PP_FOR_64_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(65, s) MITK_PP_IIF(c, MITK_PP_FOR_65, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(65, s), p, o, m) +# define MITK_PP_FOR_65_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(66, s) MITK_PP_IIF(c, MITK_PP_FOR_66, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(66, s), p, o, m) +# define MITK_PP_FOR_66_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(67, s) MITK_PP_IIF(c, MITK_PP_FOR_67, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(67, s), p, o, m) +# define MITK_PP_FOR_67_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(68, s) MITK_PP_IIF(c, MITK_PP_FOR_68, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(68, s), p, o, m) +# define MITK_PP_FOR_68_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(69, s) MITK_PP_IIF(c, MITK_PP_FOR_69, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(69, s), p, o, m) +# define MITK_PP_FOR_69_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(70, s) MITK_PP_IIF(c, MITK_PP_FOR_70, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(70, s), p, o, m) +# define MITK_PP_FOR_70_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(71, s) MITK_PP_IIF(c, MITK_PP_FOR_71, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(71, s), p, o, m) +# define MITK_PP_FOR_71_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(72, s) MITK_PP_IIF(c, MITK_PP_FOR_72, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(72, s), p, o, m) +# define MITK_PP_FOR_72_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(73, s) MITK_PP_IIF(c, MITK_PP_FOR_73, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(73, s), p, o, m) +# define MITK_PP_FOR_73_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(74, s) MITK_PP_IIF(c, MITK_PP_FOR_74, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(74, s), p, o, m) +# define MITK_PP_FOR_74_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(75, s) MITK_PP_IIF(c, MITK_PP_FOR_75, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(75, s), p, o, m) +# define MITK_PP_FOR_75_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(76, s) MITK_PP_IIF(c, MITK_PP_FOR_76, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(76, s), p, o, m) +# define MITK_PP_FOR_76_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(77, s) MITK_PP_IIF(c, MITK_PP_FOR_77, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(77, s), p, o, m) +# define MITK_PP_FOR_77_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(78, s) MITK_PP_IIF(c, MITK_PP_FOR_78, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(78, s), p, o, m) +# define MITK_PP_FOR_78_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(79, s) MITK_PP_IIF(c, MITK_PP_FOR_79, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(79, s), p, o, m) +# define MITK_PP_FOR_79_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(80, s) MITK_PP_IIF(c, MITK_PP_FOR_80, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(80, s), p, o, m) +# define MITK_PP_FOR_80_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(81, s) MITK_PP_IIF(c, MITK_PP_FOR_81, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(81, s), p, o, m) +# define MITK_PP_FOR_81_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(82, s) MITK_PP_IIF(c, MITK_PP_FOR_82, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(82, s), p, o, m) +# define MITK_PP_FOR_82_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(83, s) MITK_PP_IIF(c, MITK_PP_FOR_83, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(83, s), p, o, m) +# define MITK_PP_FOR_83_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(84, s) MITK_PP_IIF(c, MITK_PP_FOR_84, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(84, s), p, o, m) +# define MITK_PP_FOR_84_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(85, s) MITK_PP_IIF(c, MITK_PP_FOR_85, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(85, s), p, o, m) +# define MITK_PP_FOR_85_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(86, s) MITK_PP_IIF(c, MITK_PP_FOR_86, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(86, s), p, o, m) +# define MITK_PP_FOR_86_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(87, s) MITK_PP_IIF(c, MITK_PP_FOR_87, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(87, s), p, o, m) +# define MITK_PP_FOR_87_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(88, s) MITK_PP_IIF(c, MITK_PP_FOR_88, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(88, s), p, o, m) +# define MITK_PP_FOR_88_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(89, s) MITK_PP_IIF(c, MITK_PP_FOR_89, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(89, s), p, o, m) +# define MITK_PP_FOR_89_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(90, s) MITK_PP_IIF(c, MITK_PP_FOR_90, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(90, s), p, o, m) +# define MITK_PP_FOR_90_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(91, s) MITK_PP_IIF(c, MITK_PP_FOR_91, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(91, s), p, o, m) +# define MITK_PP_FOR_91_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(92, s) MITK_PP_IIF(c, MITK_PP_FOR_92, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(92, s), p, o, m) +# define MITK_PP_FOR_92_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(93, s) MITK_PP_IIF(c, MITK_PP_FOR_93, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(93, s), p, o, m) +# define MITK_PP_FOR_93_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(94, s) MITK_PP_IIF(c, MITK_PP_FOR_94, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(94, s), p, o, m) +# define MITK_PP_FOR_94_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(95, s) MITK_PP_IIF(c, MITK_PP_FOR_95, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(95, s), p, o, m) +# define MITK_PP_FOR_95_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(96, s) MITK_PP_IIF(c, MITK_PP_FOR_96, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(96, s), p, o, m) +# define MITK_PP_FOR_96_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(97, s) MITK_PP_IIF(c, MITK_PP_FOR_97, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(97, s), p, o, m) +# define MITK_PP_FOR_97_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(98, s) MITK_PP_IIF(c, MITK_PP_FOR_98, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(98, s), p, o, m) +# define MITK_PP_FOR_98_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(99, s) MITK_PP_IIF(c, MITK_PP_FOR_99, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(99, s), p, o, m) +# define MITK_PP_FOR_99_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(100, s) MITK_PP_IIF(c, MITK_PP_FOR_100, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(100, s), p, o, m) +# define MITK_PP_FOR_100_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(101, s) MITK_PP_IIF(c, MITK_PP_FOR_101, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(101, s), p, o, m) +# define MITK_PP_FOR_101_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(102, s) MITK_PP_IIF(c, MITK_PP_FOR_102, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(102, s), p, o, m) +# define MITK_PP_FOR_102_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(103, s) MITK_PP_IIF(c, MITK_PP_FOR_103, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(103, s), p, o, m) +# define MITK_PP_FOR_103_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(104, s) MITK_PP_IIF(c, MITK_PP_FOR_104, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(104, s), p, o, m) +# define MITK_PP_FOR_104_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(105, s) MITK_PP_IIF(c, MITK_PP_FOR_105, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(105, s), p, o, m) +# define MITK_PP_FOR_105_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(106, s) MITK_PP_IIF(c, MITK_PP_FOR_106, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(106, s), p, o, m) +# define MITK_PP_FOR_106_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(107, s) MITK_PP_IIF(c, MITK_PP_FOR_107, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(107, s), p, o, m) +# define MITK_PP_FOR_107_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(108, s) MITK_PP_IIF(c, MITK_PP_FOR_108, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(108, s), p, o, m) +# define MITK_PP_FOR_108_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(109, s) MITK_PP_IIF(c, MITK_PP_FOR_109, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(109, s), p, o, m) +# define MITK_PP_FOR_109_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(110, s) MITK_PP_IIF(c, MITK_PP_FOR_110, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(110, s), p, o, m) +# define MITK_PP_FOR_110_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(111, s) MITK_PP_IIF(c, MITK_PP_FOR_111, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(111, s), p, o, m) +# define MITK_PP_FOR_111_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(112, s) MITK_PP_IIF(c, MITK_PP_FOR_112, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(112, s), p, o, m) +# define MITK_PP_FOR_112_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(113, s) MITK_PP_IIF(c, MITK_PP_FOR_113, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(113, s), p, o, m) +# define MITK_PP_FOR_113_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(114, s) MITK_PP_IIF(c, MITK_PP_FOR_114, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(114, s), p, o, m) +# define MITK_PP_FOR_114_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(115, s) MITK_PP_IIF(c, MITK_PP_FOR_115, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(115, s), p, o, m) +# define MITK_PP_FOR_115_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(116, s) MITK_PP_IIF(c, MITK_PP_FOR_116, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(116, s), p, o, m) +# define MITK_PP_FOR_116_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(117, s) MITK_PP_IIF(c, MITK_PP_FOR_117, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(117, s), p, o, m) +# define MITK_PP_FOR_117_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(118, s) MITK_PP_IIF(c, MITK_PP_FOR_118, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(118, s), p, o, m) +# define MITK_PP_FOR_118_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(119, s) MITK_PP_IIF(c, MITK_PP_FOR_119, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(119, s), p, o, m) +# define MITK_PP_FOR_119_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(120, s) MITK_PP_IIF(c, MITK_PP_FOR_120, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(120, s), p, o, m) +# define MITK_PP_FOR_120_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(121, s) MITK_PP_IIF(c, MITK_PP_FOR_121, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(121, s), p, o, m) +# define MITK_PP_FOR_121_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(122, s) MITK_PP_IIF(c, MITK_PP_FOR_122, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(122, s), p, o, m) +# define MITK_PP_FOR_122_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(123, s) MITK_PP_IIF(c, MITK_PP_FOR_123, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(123, s), p, o, m) +# define MITK_PP_FOR_123_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(124, s) MITK_PP_IIF(c, MITK_PP_FOR_124, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(124, s), p, o, m) +# define MITK_PP_FOR_124_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(125, s) MITK_PP_IIF(c, MITK_PP_FOR_125, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(125, s), p, o, m) +# define MITK_PP_FOR_125_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(126, s) MITK_PP_IIF(c, MITK_PP_FOR_126, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(126, s), p, o, m) +# define MITK_PP_FOR_126_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(127, s) MITK_PP_IIF(c, MITK_PP_FOR_127, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(127, s), p, o, m) +# define MITK_PP_FOR_127_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(128, s) MITK_PP_IIF(c, MITK_PP_FOR_128, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(128, s), p, o, m) +# define MITK_PP_FOR_128_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(129, s) MITK_PP_IIF(c, MITK_PP_FOR_129, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(129, s), p, o, m) +# define MITK_PP_FOR_129_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(130, s) MITK_PP_IIF(c, MITK_PP_FOR_130, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(130, s), p, o, m) +# define MITK_PP_FOR_130_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(131, s) MITK_PP_IIF(c, MITK_PP_FOR_131, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(131, s), p, o, m) +# define MITK_PP_FOR_131_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(132, s) MITK_PP_IIF(c, MITK_PP_FOR_132, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(132, s), p, o, m) +# define MITK_PP_FOR_132_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(133, s) MITK_PP_IIF(c, MITK_PP_FOR_133, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(133, s), p, o, m) +# define MITK_PP_FOR_133_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(134, s) MITK_PP_IIF(c, MITK_PP_FOR_134, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(134, s), p, o, m) +# define MITK_PP_FOR_134_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(135, s) MITK_PP_IIF(c, MITK_PP_FOR_135, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(135, s), p, o, m) +# define MITK_PP_FOR_135_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(136, s) MITK_PP_IIF(c, MITK_PP_FOR_136, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(136, s), p, o, m) +# define MITK_PP_FOR_136_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(137, s) MITK_PP_IIF(c, MITK_PP_FOR_137, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(137, s), p, o, m) +# define MITK_PP_FOR_137_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(138, s) MITK_PP_IIF(c, MITK_PP_FOR_138, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(138, s), p, o, m) +# define MITK_PP_FOR_138_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(139, s) MITK_PP_IIF(c, MITK_PP_FOR_139, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(139, s), p, o, m) +# define MITK_PP_FOR_139_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(140, s) MITK_PP_IIF(c, MITK_PP_FOR_140, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(140, s), p, o, m) +# define MITK_PP_FOR_140_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(141, s) MITK_PP_IIF(c, MITK_PP_FOR_141, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(141, s), p, o, m) +# define MITK_PP_FOR_141_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(142, s) MITK_PP_IIF(c, MITK_PP_FOR_142, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(142, s), p, o, m) +# define MITK_PP_FOR_142_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(143, s) MITK_PP_IIF(c, MITK_PP_FOR_143, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(143, s), p, o, m) +# define MITK_PP_FOR_143_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(144, s) MITK_PP_IIF(c, MITK_PP_FOR_144, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(144, s), p, o, m) +# define MITK_PP_FOR_144_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(145, s) MITK_PP_IIF(c, MITK_PP_FOR_145, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(145, s), p, o, m) +# define MITK_PP_FOR_145_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(146, s) MITK_PP_IIF(c, MITK_PP_FOR_146, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(146, s), p, o, m) +# define MITK_PP_FOR_146_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(147, s) MITK_PP_IIF(c, MITK_PP_FOR_147, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(147, s), p, o, m) +# define MITK_PP_FOR_147_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(148, s) MITK_PP_IIF(c, MITK_PP_FOR_148, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(148, s), p, o, m) +# define MITK_PP_FOR_148_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(149, s) MITK_PP_IIF(c, MITK_PP_FOR_149, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(149, s), p, o, m) +# define MITK_PP_FOR_149_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(150, s) MITK_PP_IIF(c, MITK_PP_FOR_150, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(150, s), p, o, m) +# define MITK_PP_FOR_150_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(151, s) MITK_PP_IIF(c, MITK_PP_FOR_151, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(151, s), p, o, m) +# define MITK_PP_FOR_151_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(152, s) MITK_PP_IIF(c, MITK_PP_FOR_152, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(152, s), p, o, m) +# define MITK_PP_FOR_152_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(153, s) MITK_PP_IIF(c, MITK_PP_FOR_153, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(153, s), p, o, m) +# define MITK_PP_FOR_153_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(154, s) MITK_PP_IIF(c, MITK_PP_FOR_154, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(154, s), p, o, m) +# define MITK_PP_FOR_154_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(155, s) MITK_PP_IIF(c, MITK_PP_FOR_155, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(155, s), p, o, m) +# define MITK_PP_FOR_155_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(156, s) MITK_PP_IIF(c, MITK_PP_FOR_156, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(156, s), p, o, m) +# define MITK_PP_FOR_156_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(157, s) MITK_PP_IIF(c, MITK_PP_FOR_157, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(157, s), p, o, m) +# define MITK_PP_FOR_157_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(158, s) MITK_PP_IIF(c, MITK_PP_FOR_158, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(158, s), p, o, m) +# define MITK_PP_FOR_158_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(159, s) MITK_PP_IIF(c, MITK_PP_FOR_159, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(159, s), p, o, m) +# define MITK_PP_FOR_159_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(160, s) MITK_PP_IIF(c, MITK_PP_FOR_160, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(160, s), p, o, m) +# define MITK_PP_FOR_160_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(161, s) MITK_PP_IIF(c, MITK_PP_FOR_161, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(161, s), p, o, m) +# define MITK_PP_FOR_161_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(162, s) MITK_PP_IIF(c, MITK_PP_FOR_162, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(162, s), p, o, m) +# define MITK_PP_FOR_162_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(163, s) MITK_PP_IIF(c, MITK_PP_FOR_163, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(163, s), p, o, m) +# define MITK_PP_FOR_163_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(164, s) MITK_PP_IIF(c, MITK_PP_FOR_164, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(164, s), p, o, m) +# define MITK_PP_FOR_164_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(165, s) MITK_PP_IIF(c, MITK_PP_FOR_165, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(165, s), p, o, m) +# define MITK_PP_FOR_165_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(166, s) MITK_PP_IIF(c, MITK_PP_FOR_166, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(166, s), p, o, m) +# define MITK_PP_FOR_166_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(167, s) MITK_PP_IIF(c, MITK_PP_FOR_167, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(167, s), p, o, m) +# define MITK_PP_FOR_167_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(168, s) MITK_PP_IIF(c, MITK_PP_FOR_168, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(168, s), p, o, m) +# define MITK_PP_FOR_168_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(169, s) MITK_PP_IIF(c, MITK_PP_FOR_169, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(169, s), p, o, m) +# define MITK_PP_FOR_169_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(170, s) MITK_PP_IIF(c, MITK_PP_FOR_170, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(170, s), p, o, m) +# define MITK_PP_FOR_170_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(171, s) MITK_PP_IIF(c, MITK_PP_FOR_171, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(171, s), p, o, m) +# define MITK_PP_FOR_171_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(172, s) MITK_PP_IIF(c, MITK_PP_FOR_172, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(172, s), p, o, m) +# define MITK_PP_FOR_172_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(173, s) MITK_PP_IIF(c, MITK_PP_FOR_173, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(173, s), p, o, m) +# define MITK_PP_FOR_173_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(174, s) MITK_PP_IIF(c, MITK_PP_FOR_174, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(174, s), p, o, m) +# define MITK_PP_FOR_174_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(175, s) MITK_PP_IIF(c, MITK_PP_FOR_175, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(175, s), p, o, m) +# define MITK_PP_FOR_175_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(176, s) MITK_PP_IIF(c, MITK_PP_FOR_176, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(176, s), p, o, m) +# define MITK_PP_FOR_176_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(177, s) MITK_PP_IIF(c, MITK_PP_FOR_177, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(177, s), p, o, m) +# define MITK_PP_FOR_177_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(178, s) MITK_PP_IIF(c, MITK_PP_FOR_178, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(178, s), p, o, m) +# define MITK_PP_FOR_178_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(179, s) MITK_PP_IIF(c, MITK_PP_FOR_179, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(179, s), p, o, m) +# define MITK_PP_FOR_179_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(180, s) MITK_PP_IIF(c, MITK_PP_FOR_180, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(180, s), p, o, m) +# define MITK_PP_FOR_180_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(181, s) MITK_PP_IIF(c, MITK_PP_FOR_181, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(181, s), p, o, m) +# define MITK_PP_FOR_181_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(182, s) MITK_PP_IIF(c, MITK_PP_FOR_182, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(182, s), p, o, m) +# define MITK_PP_FOR_182_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(183, s) MITK_PP_IIF(c, MITK_PP_FOR_183, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(183, s), p, o, m) +# define MITK_PP_FOR_183_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(184, s) MITK_PP_IIF(c, MITK_PP_FOR_184, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(184, s), p, o, m) +# define MITK_PP_FOR_184_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(185, s) MITK_PP_IIF(c, MITK_PP_FOR_185, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(185, s), p, o, m) +# define MITK_PP_FOR_185_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(186, s) MITK_PP_IIF(c, MITK_PP_FOR_186, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(186, s), p, o, m) +# define MITK_PP_FOR_186_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(187, s) MITK_PP_IIF(c, MITK_PP_FOR_187, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(187, s), p, o, m) +# define MITK_PP_FOR_187_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(188, s) MITK_PP_IIF(c, MITK_PP_FOR_188, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(188, s), p, o, m) +# define MITK_PP_FOR_188_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(189, s) MITK_PP_IIF(c, MITK_PP_FOR_189, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(189, s), p, o, m) +# define MITK_PP_FOR_189_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(190, s) MITK_PP_IIF(c, MITK_PP_FOR_190, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(190, s), p, o, m) +# define MITK_PP_FOR_190_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(191, s) MITK_PP_IIF(c, MITK_PP_FOR_191, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(191, s), p, o, m) +# define MITK_PP_FOR_191_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(192, s) MITK_PP_IIF(c, MITK_PP_FOR_192, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(192, s), p, o, m) +# define MITK_PP_FOR_192_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(193, s) MITK_PP_IIF(c, MITK_PP_FOR_193, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(193, s), p, o, m) +# define MITK_PP_FOR_193_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(194, s) MITK_PP_IIF(c, MITK_PP_FOR_194, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(194, s), p, o, m) +# define MITK_PP_FOR_194_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(195, s) MITK_PP_IIF(c, MITK_PP_FOR_195, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(195, s), p, o, m) +# define MITK_PP_FOR_195_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(196, s) MITK_PP_IIF(c, MITK_PP_FOR_196, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(196, s), p, o, m) +# define MITK_PP_FOR_196_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(197, s) MITK_PP_IIF(c, MITK_PP_FOR_197, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(197, s), p, o, m) +# define MITK_PP_FOR_197_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(198, s) MITK_PP_IIF(c, MITK_PP_FOR_198, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(198, s), p, o, m) +# define MITK_PP_FOR_198_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(199, s) MITK_PP_IIF(c, MITK_PP_FOR_199, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(199, s), p, o, m) +# define MITK_PP_FOR_199_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(200, s) MITK_PP_IIF(c, MITK_PP_FOR_200, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(200, s), p, o, m) +# define MITK_PP_FOR_200_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(201, s) MITK_PP_IIF(c, MITK_PP_FOR_201, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(201, s), p, o, m) +# define MITK_PP_FOR_201_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(202, s) MITK_PP_IIF(c, MITK_PP_FOR_202, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(202, s), p, o, m) +# define MITK_PP_FOR_202_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(203, s) MITK_PP_IIF(c, MITK_PP_FOR_203, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(203, s), p, o, m) +# define MITK_PP_FOR_203_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(204, s) MITK_PP_IIF(c, MITK_PP_FOR_204, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(204, s), p, o, m) +# define MITK_PP_FOR_204_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(205, s) MITK_PP_IIF(c, MITK_PP_FOR_205, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(205, s), p, o, m) +# define MITK_PP_FOR_205_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(206, s) MITK_PP_IIF(c, MITK_PP_FOR_206, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(206, s), p, o, m) +# define MITK_PP_FOR_206_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(207, s) MITK_PP_IIF(c, MITK_PP_FOR_207, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(207, s), p, o, m) +# define MITK_PP_FOR_207_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(208, s) MITK_PP_IIF(c, MITK_PP_FOR_208, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(208, s), p, o, m) +# define MITK_PP_FOR_208_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(209, s) MITK_PP_IIF(c, MITK_PP_FOR_209, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(209, s), p, o, m) +# define MITK_PP_FOR_209_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(210, s) MITK_PP_IIF(c, MITK_PP_FOR_210, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(210, s), p, o, m) +# define MITK_PP_FOR_210_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(211, s) MITK_PP_IIF(c, MITK_PP_FOR_211, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(211, s), p, o, m) +# define MITK_PP_FOR_211_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(212, s) MITK_PP_IIF(c, MITK_PP_FOR_212, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(212, s), p, o, m) +# define MITK_PP_FOR_212_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(213, s) MITK_PP_IIF(c, MITK_PP_FOR_213, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(213, s), p, o, m) +# define MITK_PP_FOR_213_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(214, s) MITK_PP_IIF(c, MITK_PP_FOR_214, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(214, s), p, o, m) +# define MITK_PP_FOR_214_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(215, s) MITK_PP_IIF(c, MITK_PP_FOR_215, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(215, s), p, o, m) +# define MITK_PP_FOR_215_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(216, s) MITK_PP_IIF(c, MITK_PP_FOR_216, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(216, s), p, o, m) +# define MITK_PP_FOR_216_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(217, s) MITK_PP_IIF(c, MITK_PP_FOR_217, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(217, s), p, o, m) +# define MITK_PP_FOR_217_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(218, s) MITK_PP_IIF(c, MITK_PP_FOR_218, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(218, s), p, o, m) +# define MITK_PP_FOR_218_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(219, s) MITK_PP_IIF(c, MITK_PP_FOR_219, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(219, s), p, o, m) +# define MITK_PP_FOR_219_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(220, s) MITK_PP_IIF(c, MITK_PP_FOR_220, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(220, s), p, o, m) +# define MITK_PP_FOR_220_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(221, s) MITK_PP_IIF(c, MITK_PP_FOR_221, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(221, s), p, o, m) +# define MITK_PP_FOR_221_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(222, s) MITK_PP_IIF(c, MITK_PP_FOR_222, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(222, s), p, o, m) +# define MITK_PP_FOR_222_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(223, s) MITK_PP_IIF(c, MITK_PP_FOR_223, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(223, s), p, o, m) +# define MITK_PP_FOR_223_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(224, s) MITK_PP_IIF(c, MITK_PP_FOR_224, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(224, s), p, o, m) +# define MITK_PP_FOR_224_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(225, s) MITK_PP_IIF(c, MITK_PP_FOR_225, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(225, s), p, o, m) +# define MITK_PP_FOR_225_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(226, s) MITK_PP_IIF(c, MITK_PP_FOR_226, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(226, s), p, o, m) +# define MITK_PP_FOR_226_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(227, s) MITK_PP_IIF(c, MITK_PP_FOR_227, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(227, s), p, o, m) +# define MITK_PP_FOR_227_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(228, s) MITK_PP_IIF(c, MITK_PP_FOR_228, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(228, s), p, o, m) +# define MITK_PP_FOR_228_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(229, s) MITK_PP_IIF(c, MITK_PP_FOR_229, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(229, s), p, o, m) +# define MITK_PP_FOR_229_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(230, s) MITK_PP_IIF(c, MITK_PP_FOR_230, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(230, s), p, o, m) +# define MITK_PP_FOR_230_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(231, s) MITK_PP_IIF(c, MITK_PP_FOR_231, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(231, s), p, o, m) +# define MITK_PP_FOR_231_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(232, s) MITK_PP_IIF(c, MITK_PP_FOR_232, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(232, s), p, o, m) +# define MITK_PP_FOR_232_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(233, s) MITK_PP_IIF(c, MITK_PP_FOR_233, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(233, s), p, o, m) +# define MITK_PP_FOR_233_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(234, s) MITK_PP_IIF(c, MITK_PP_FOR_234, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(234, s), p, o, m) +# define MITK_PP_FOR_234_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(235, s) MITK_PP_IIF(c, MITK_PP_FOR_235, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(235, s), p, o, m) +# define MITK_PP_FOR_235_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(236, s) MITK_PP_IIF(c, MITK_PP_FOR_236, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(236, s), p, o, m) +# define MITK_PP_FOR_236_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(237, s) MITK_PP_IIF(c, MITK_PP_FOR_237, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(237, s), p, o, m) +# define MITK_PP_FOR_237_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(238, s) MITK_PP_IIF(c, MITK_PP_FOR_238, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(238, s), p, o, m) +# define MITK_PP_FOR_238_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(239, s) MITK_PP_IIF(c, MITK_PP_FOR_239, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(239, s), p, o, m) +# define MITK_PP_FOR_239_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(240, s) MITK_PP_IIF(c, MITK_PP_FOR_240, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(240, s), p, o, m) +# define MITK_PP_FOR_240_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(241, s) MITK_PP_IIF(c, MITK_PP_FOR_241, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(241, s), p, o, m) +# define MITK_PP_FOR_241_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(242, s) MITK_PP_IIF(c, MITK_PP_FOR_242, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(242, s), p, o, m) +# define MITK_PP_FOR_242_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(243, s) MITK_PP_IIF(c, MITK_PP_FOR_243, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(243, s), p, o, m) +# define MITK_PP_FOR_243_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(244, s) MITK_PP_IIF(c, MITK_PP_FOR_244, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(244, s), p, o, m) +# define MITK_PP_FOR_244_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(245, s) MITK_PP_IIF(c, MITK_PP_FOR_245, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(245, s), p, o, m) +# define MITK_PP_FOR_245_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(246, s) MITK_PP_IIF(c, MITK_PP_FOR_246, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(246, s), p, o, m) +# define MITK_PP_FOR_246_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(247, s) MITK_PP_IIF(c, MITK_PP_FOR_247, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(247, s), p, o, m) +# define MITK_PP_FOR_247_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(248, s) MITK_PP_IIF(c, MITK_PP_FOR_248, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(248, s), p, o, m) +# define MITK_PP_FOR_248_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(249, s) MITK_PP_IIF(c, MITK_PP_FOR_249, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(249, s), p, o, m) +# define MITK_PP_FOR_249_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(250, s) MITK_PP_IIF(c, MITK_PP_FOR_250, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(250, s), p, o, m) +# define MITK_PP_FOR_250_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(251, s) MITK_PP_IIF(c, MITK_PP_FOR_251, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(251, s), p, o, m) +# define MITK_PP_FOR_251_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(252, s) MITK_PP_IIF(c, MITK_PP_FOR_252, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(252, s), p, o, m) +# define MITK_PP_FOR_252_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(253, s) MITK_PP_IIF(c, MITK_PP_FOR_253, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(253, s), p, o, m) +# define MITK_PP_FOR_253_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(254, s) MITK_PP_IIF(c, MITK_PP_FOR_254, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(254, s), p, o, m) +# define MITK_PP_FOR_254_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(255, s) MITK_PP_IIF(c, MITK_PP_FOR_255, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(255, s), p, o, m) +# define MITK_PP_FOR_255_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(256, s) MITK_PP_IIF(c, MITK_PP_FOR_256, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(256, s), p, o, m) +# define MITK_PP_FOR_256_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(257, s) MITK_PP_IIF(c, MITK_PP_FOR_257, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(257, s), p, o, m) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPRepetitionDetailEDGFor.h b/Core/Code/Algorithms/mitkPPRepetitionDetailEDGFor.h new file mode 100644 index 0000000000..44a214b635 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPRepetitionDetailEDGFor.h @@ -0,0 +1,534 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_REPETITION_DETAIL_EDG_FOR_HPP +# define MITK_PREPROCESSOR_REPETITION_DETAIL_EDG_FOR_HPP +# +# include "mitkPPControlIf.h" +# include "mitkPPTupleEat.h" +# +# define MITK_PP_FOR_1(s, p, o, m) MITK_PP_FOR_1_I(s, p, o, m) +# define MITK_PP_FOR_2(s, p, o, m) MITK_PP_FOR_2_I(s, p, o, m) +# define MITK_PP_FOR_3(s, p, o, m) MITK_PP_FOR_3_I(s, p, o, m) +# define MITK_PP_FOR_4(s, p, o, m) MITK_PP_FOR_4_I(s, p, o, m) +# define MITK_PP_FOR_5(s, p, o, m) MITK_PP_FOR_5_I(s, p, o, m) +# define MITK_PP_FOR_6(s, p, o, m) MITK_PP_FOR_6_I(s, p, o, m) +# define MITK_PP_FOR_7(s, p, o, m) MITK_PP_FOR_7_I(s, p, o, m) +# define MITK_PP_FOR_8(s, p, o, m) MITK_PP_FOR_8_I(s, p, o, m) +# define MITK_PP_FOR_9(s, p, o, m) MITK_PP_FOR_9_I(s, p, o, m) +# define MITK_PP_FOR_10(s, p, o, m) MITK_PP_FOR_10_I(s, p, o, m) +# define MITK_PP_FOR_11(s, p, o, m) MITK_PP_FOR_11_I(s, p, o, m) +# define MITK_PP_FOR_12(s, p, o, m) MITK_PP_FOR_12_I(s, p, o, m) +# define MITK_PP_FOR_13(s, p, o, m) MITK_PP_FOR_13_I(s, p, o, m) +# define MITK_PP_FOR_14(s, p, o, m) MITK_PP_FOR_14_I(s, p, o, m) +# define MITK_PP_FOR_15(s, p, o, m) MITK_PP_FOR_15_I(s, p, o, m) +# define MITK_PP_FOR_16(s, p, o, m) MITK_PP_FOR_16_I(s, p, o, m) +# define MITK_PP_FOR_17(s, p, o, m) MITK_PP_FOR_17_I(s, p, o, m) +# define MITK_PP_FOR_18(s, p, o, m) MITK_PP_FOR_18_I(s, p, o, m) +# define MITK_PP_FOR_19(s, p, o, m) MITK_PP_FOR_19_I(s, p, o, m) +# define MITK_PP_FOR_20(s, p, o, m) MITK_PP_FOR_20_I(s, p, o, m) +# define MITK_PP_FOR_21(s, p, o, m) MITK_PP_FOR_21_I(s, p, o, m) +# define MITK_PP_FOR_22(s, p, o, m) MITK_PP_FOR_22_I(s, p, o, m) +# define MITK_PP_FOR_23(s, p, o, m) MITK_PP_FOR_23_I(s, p, o, m) +# define MITK_PP_FOR_24(s, p, o, m) MITK_PP_FOR_24_I(s, p, o, m) +# define MITK_PP_FOR_25(s, p, o, m) MITK_PP_FOR_25_I(s, p, o, m) +# define MITK_PP_FOR_26(s, p, o, m) MITK_PP_FOR_26_I(s, p, o, m) +# define MITK_PP_FOR_27(s, p, o, m) MITK_PP_FOR_27_I(s, p, o, m) +# define MITK_PP_FOR_28(s, p, o, m) MITK_PP_FOR_28_I(s, p, o, m) +# define MITK_PP_FOR_29(s, p, o, m) MITK_PP_FOR_29_I(s, p, o, m) +# define MITK_PP_FOR_30(s, p, o, m) MITK_PP_FOR_30_I(s, p, o, m) +# define MITK_PP_FOR_31(s, p, o, m) MITK_PP_FOR_31_I(s, p, o, m) +# define MITK_PP_FOR_32(s, p, o, m) MITK_PP_FOR_32_I(s, p, o, m) +# define MITK_PP_FOR_33(s, p, o, m) MITK_PP_FOR_33_I(s, p, o, m) +# define MITK_PP_FOR_34(s, p, o, m) MITK_PP_FOR_34_I(s, p, o, m) +# define MITK_PP_FOR_35(s, p, o, m) MITK_PP_FOR_35_I(s, p, o, m) +# define MITK_PP_FOR_36(s, p, o, m) MITK_PP_FOR_36_I(s, p, o, m) +# define MITK_PP_FOR_37(s, p, o, m) MITK_PP_FOR_37_I(s, p, o, m) +# define MITK_PP_FOR_38(s, p, o, m) MITK_PP_FOR_38_I(s, p, o, m) +# define MITK_PP_FOR_39(s, p, o, m) MITK_PP_FOR_39_I(s, p, o, m) +# define MITK_PP_FOR_40(s, p, o, m) MITK_PP_FOR_40_I(s, p, o, m) +# define MITK_PP_FOR_41(s, p, o, m) MITK_PP_FOR_41_I(s, p, o, m) +# define MITK_PP_FOR_42(s, p, o, m) MITK_PP_FOR_42_I(s, p, o, m) +# define MITK_PP_FOR_43(s, p, o, m) MITK_PP_FOR_43_I(s, p, o, m) +# define MITK_PP_FOR_44(s, p, o, m) MITK_PP_FOR_44_I(s, p, o, m) +# define MITK_PP_FOR_45(s, p, o, m) MITK_PP_FOR_45_I(s, p, o, m) +# define MITK_PP_FOR_46(s, p, o, m) MITK_PP_FOR_46_I(s, p, o, m) +# define MITK_PP_FOR_47(s, p, o, m) MITK_PP_FOR_47_I(s, p, o, m) +# define MITK_PP_FOR_48(s, p, o, m) MITK_PP_FOR_48_I(s, p, o, m) +# define MITK_PP_FOR_49(s, p, o, m) MITK_PP_FOR_49_I(s, p, o, m) +# define MITK_PP_FOR_50(s, p, o, m) MITK_PP_FOR_50_I(s, p, o, m) +# define MITK_PP_FOR_51(s, p, o, m) MITK_PP_FOR_51_I(s, p, o, m) +# define MITK_PP_FOR_52(s, p, o, m) MITK_PP_FOR_52_I(s, p, o, m) +# define MITK_PP_FOR_53(s, p, o, m) MITK_PP_FOR_53_I(s, p, o, m) +# define MITK_PP_FOR_54(s, p, o, m) MITK_PP_FOR_54_I(s, p, o, m) +# define MITK_PP_FOR_55(s, p, o, m) MITK_PP_FOR_55_I(s, p, o, m) +# define MITK_PP_FOR_56(s, p, o, m) MITK_PP_FOR_56_I(s, p, o, m) +# define MITK_PP_FOR_57(s, p, o, m) MITK_PP_FOR_57_I(s, p, o, m) +# define MITK_PP_FOR_58(s, p, o, m) MITK_PP_FOR_58_I(s, p, o, m) +# define MITK_PP_FOR_59(s, p, o, m) MITK_PP_FOR_59_I(s, p, o, m) +# define MITK_PP_FOR_60(s, p, o, m) MITK_PP_FOR_60_I(s, p, o, m) +# define MITK_PP_FOR_61(s, p, o, m) MITK_PP_FOR_61_I(s, p, o, m) +# define MITK_PP_FOR_62(s, p, o, m) MITK_PP_FOR_62_I(s, p, o, m) +# define MITK_PP_FOR_63(s, p, o, m) MITK_PP_FOR_63_I(s, p, o, m) +# define MITK_PP_FOR_64(s, p, o, m) MITK_PP_FOR_64_I(s, p, o, m) +# define MITK_PP_FOR_65(s, p, o, m) MITK_PP_FOR_65_I(s, p, o, m) +# define MITK_PP_FOR_66(s, p, o, m) MITK_PP_FOR_66_I(s, p, o, m) +# define MITK_PP_FOR_67(s, p, o, m) MITK_PP_FOR_67_I(s, p, o, m) +# define MITK_PP_FOR_68(s, p, o, m) MITK_PP_FOR_68_I(s, p, o, m) +# define MITK_PP_FOR_69(s, p, o, m) MITK_PP_FOR_69_I(s, p, o, m) +# define MITK_PP_FOR_70(s, p, o, m) MITK_PP_FOR_70_I(s, p, o, m) +# define MITK_PP_FOR_71(s, p, o, m) MITK_PP_FOR_71_I(s, p, o, m) +# define MITK_PP_FOR_72(s, p, o, m) MITK_PP_FOR_72_I(s, p, o, m) +# define MITK_PP_FOR_73(s, p, o, m) MITK_PP_FOR_73_I(s, p, o, m) +# define MITK_PP_FOR_74(s, p, o, m) MITK_PP_FOR_74_I(s, p, o, m) +# define MITK_PP_FOR_75(s, p, o, m) MITK_PP_FOR_75_I(s, p, o, m) +# define MITK_PP_FOR_76(s, p, o, m) MITK_PP_FOR_76_I(s, p, o, m) +# define MITK_PP_FOR_77(s, p, o, m) MITK_PP_FOR_77_I(s, p, o, m) +# define MITK_PP_FOR_78(s, p, o, m) MITK_PP_FOR_78_I(s, p, o, m) +# define MITK_PP_FOR_79(s, p, o, m) MITK_PP_FOR_79_I(s, p, o, m) +# define MITK_PP_FOR_80(s, p, o, m) MITK_PP_FOR_80_I(s, p, o, m) +# define MITK_PP_FOR_81(s, p, o, m) MITK_PP_FOR_81_I(s, p, o, m) +# define MITK_PP_FOR_82(s, p, o, m) MITK_PP_FOR_82_I(s, p, o, m) +# define MITK_PP_FOR_83(s, p, o, m) MITK_PP_FOR_83_I(s, p, o, m) +# define MITK_PP_FOR_84(s, p, o, m) MITK_PP_FOR_84_I(s, p, o, m) +# define MITK_PP_FOR_85(s, p, o, m) MITK_PP_FOR_85_I(s, p, o, m) +# define MITK_PP_FOR_86(s, p, o, m) MITK_PP_FOR_86_I(s, p, o, m) +# define MITK_PP_FOR_87(s, p, o, m) MITK_PP_FOR_87_I(s, p, o, m) +# define MITK_PP_FOR_88(s, p, o, m) MITK_PP_FOR_88_I(s, p, o, m) +# define MITK_PP_FOR_89(s, p, o, m) MITK_PP_FOR_89_I(s, p, o, m) +# define MITK_PP_FOR_90(s, p, o, m) MITK_PP_FOR_90_I(s, p, o, m) +# define MITK_PP_FOR_91(s, p, o, m) MITK_PP_FOR_91_I(s, p, o, m) +# define MITK_PP_FOR_92(s, p, o, m) MITK_PP_FOR_92_I(s, p, o, m) +# define MITK_PP_FOR_93(s, p, o, m) MITK_PP_FOR_93_I(s, p, o, m) +# define MITK_PP_FOR_94(s, p, o, m) MITK_PP_FOR_94_I(s, p, o, m) +# define MITK_PP_FOR_95(s, p, o, m) MITK_PP_FOR_95_I(s, p, o, m) +# define MITK_PP_FOR_96(s, p, o, m) MITK_PP_FOR_96_I(s, p, o, m) +# define MITK_PP_FOR_97(s, p, o, m) MITK_PP_FOR_97_I(s, p, o, m) +# define MITK_PP_FOR_98(s, p, o, m) MITK_PP_FOR_98_I(s, p, o, m) +# define MITK_PP_FOR_99(s, p, o, m) MITK_PP_FOR_99_I(s, p, o, m) +# define MITK_PP_FOR_100(s, p, o, m) MITK_PP_FOR_100_I(s, p, o, m) +# define MITK_PP_FOR_101(s, p, o, m) MITK_PP_FOR_101_I(s, p, o, m) +# define MITK_PP_FOR_102(s, p, o, m) MITK_PP_FOR_102_I(s, p, o, m) +# define MITK_PP_FOR_103(s, p, o, m) MITK_PP_FOR_103_I(s, p, o, m) +# define MITK_PP_FOR_104(s, p, o, m) MITK_PP_FOR_104_I(s, p, o, m) +# define MITK_PP_FOR_105(s, p, o, m) MITK_PP_FOR_105_I(s, p, o, m) +# define MITK_PP_FOR_106(s, p, o, m) MITK_PP_FOR_106_I(s, p, o, m) +# define MITK_PP_FOR_107(s, p, o, m) MITK_PP_FOR_107_I(s, p, o, m) +# define MITK_PP_FOR_108(s, p, o, m) MITK_PP_FOR_108_I(s, p, o, m) +# define MITK_PP_FOR_109(s, p, o, m) MITK_PP_FOR_109_I(s, p, o, m) +# define MITK_PP_FOR_110(s, p, o, m) MITK_PP_FOR_110_I(s, p, o, m) +# define MITK_PP_FOR_111(s, p, o, m) MITK_PP_FOR_111_I(s, p, o, m) +# define MITK_PP_FOR_112(s, p, o, m) MITK_PP_FOR_112_I(s, p, o, m) +# define MITK_PP_FOR_113(s, p, o, m) MITK_PP_FOR_113_I(s, p, o, m) +# define MITK_PP_FOR_114(s, p, o, m) MITK_PP_FOR_114_I(s, p, o, m) +# define MITK_PP_FOR_115(s, p, o, m) MITK_PP_FOR_115_I(s, p, o, m) +# define MITK_PP_FOR_116(s, p, o, m) MITK_PP_FOR_116_I(s, p, o, m) +# define MITK_PP_FOR_117(s, p, o, m) MITK_PP_FOR_117_I(s, p, o, m) +# define MITK_PP_FOR_118(s, p, o, m) MITK_PP_FOR_118_I(s, p, o, m) +# define MITK_PP_FOR_119(s, p, o, m) MITK_PP_FOR_119_I(s, p, o, m) +# define MITK_PP_FOR_120(s, p, o, m) MITK_PP_FOR_120_I(s, p, o, m) +# define MITK_PP_FOR_121(s, p, o, m) MITK_PP_FOR_121_I(s, p, o, m) +# define MITK_PP_FOR_122(s, p, o, m) MITK_PP_FOR_122_I(s, p, o, m) +# define MITK_PP_FOR_123(s, p, o, m) MITK_PP_FOR_123_I(s, p, o, m) +# define MITK_PP_FOR_124(s, p, o, m) MITK_PP_FOR_124_I(s, p, o, m) +# define MITK_PP_FOR_125(s, p, o, m) MITK_PP_FOR_125_I(s, p, o, m) +# define MITK_PP_FOR_126(s, p, o, m) MITK_PP_FOR_126_I(s, p, o, m) +# define MITK_PP_FOR_127(s, p, o, m) MITK_PP_FOR_127_I(s, p, o, m) +# define MITK_PP_FOR_128(s, p, o, m) MITK_PP_FOR_128_I(s, p, o, m) +# define MITK_PP_FOR_129(s, p, o, m) MITK_PP_FOR_129_I(s, p, o, m) +# define MITK_PP_FOR_130(s, p, o, m) MITK_PP_FOR_130_I(s, p, o, m) +# define MITK_PP_FOR_131(s, p, o, m) MITK_PP_FOR_131_I(s, p, o, m) +# define MITK_PP_FOR_132(s, p, o, m) MITK_PP_FOR_132_I(s, p, o, m) +# define MITK_PP_FOR_133(s, p, o, m) MITK_PP_FOR_133_I(s, p, o, m) +# define MITK_PP_FOR_134(s, p, o, m) MITK_PP_FOR_134_I(s, p, o, m) +# define MITK_PP_FOR_135(s, p, o, m) MITK_PP_FOR_135_I(s, p, o, m) +# define MITK_PP_FOR_136(s, p, o, m) MITK_PP_FOR_136_I(s, p, o, m) +# define MITK_PP_FOR_137(s, p, o, m) MITK_PP_FOR_137_I(s, p, o, m) +# define MITK_PP_FOR_138(s, p, o, m) MITK_PP_FOR_138_I(s, p, o, m) +# define MITK_PP_FOR_139(s, p, o, m) MITK_PP_FOR_139_I(s, p, o, m) +# define MITK_PP_FOR_140(s, p, o, m) MITK_PP_FOR_140_I(s, p, o, m) +# define MITK_PP_FOR_141(s, p, o, m) MITK_PP_FOR_141_I(s, p, o, m) +# define MITK_PP_FOR_142(s, p, o, m) MITK_PP_FOR_142_I(s, p, o, m) +# define MITK_PP_FOR_143(s, p, o, m) MITK_PP_FOR_143_I(s, p, o, m) +# define MITK_PP_FOR_144(s, p, o, m) MITK_PP_FOR_144_I(s, p, o, m) +# define MITK_PP_FOR_145(s, p, o, m) MITK_PP_FOR_145_I(s, p, o, m) +# define MITK_PP_FOR_146(s, p, o, m) MITK_PP_FOR_146_I(s, p, o, m) +# define MITK_PP_FOR_147(s, p, o, m) MITK_PP_FOR_147_I(s, p, o, m) +# define MITK_PP_FOR_148(s, p, o, m) MITK_PP_FOR_148_I(s, p, o, m) +# define MITK_PP_FOR_149(s, p, o, m) MITK_PP_FOR_149_I(s, p, o, m) +# define MITK_PP_FOR_150(s, p, o, m) MITK_PP_FOR_150_I(s, p, o, m) +# define MITK_PP_FOR_151(s, p, o, m) MITK_PP_FOR_151_I(s, p, o, m) +# define MITK_PP_FOR_152(s, p, o, m) MITK_PP_FOR_152_I(s, p, o, m) +# define MITK_PP_FOR_153(s, p, o, m) MITK_PP_FOR_153_I(s, p, o, m) +# define MITK_PP_FOR_154(s, p, o, m) MITK_PP_FOR_154_I(s, p, o, m) +# define MITK_PP_FOR_155(s, p, o, m) MITK_PP_FOR_155_I(s, p, o, m) +# define MITK_PP_FOR_156(s, p, o, m) MITK_PP_FOR_156_I(s, p, o, m) +# define MITK_PP_FOR_157(s, p, o, m) MITK_PP_FOR_157_I(s, p, o, m) +# define MITK_PP_FOR_158(s, p, o, m) MITK_PP_FOR_158_I(s, p, o, m) +# define MITK_PP_FOR_159(s, p, o, m) MITK_PP_FOR_159_I(s, p, o, m) +# define MITK_PP_FOR_160(s, p, o, m) MITK_PP_FOR_160_I(s, p, o, m) +# define MITK_PP_FOR_161(s, p, o, m) MITK_PP_FOR_161_I(s, p, o, m) +# define MITK_PP_FOR_162(s, p, o, m) MITK_PP_FOR_162_I(s, p, o, m) +# define MITK_PP_FOR_163(s, p, o, m) MITK_PP_FOR_163_I(s, p, o, m) +# define MITK_PP_FOR_164(s, p, o, m) MITK_PP_FOR_164_I(s, p, o, m) +# define MITK_PP_FOR_165(s, p, o, m) MITK_PP_FOR_165_I(s, p, o, m) +# define MITK_PP_FOR_166(s, p, o, m) MITK_PP_FOR_166_I(s, p, o, m) +# define MITK_PP_FOR_167(s, p, o, m) MITK_PP_FOR_167_I(s, p, o, m) +# define MITK_PP_FOR_168(s, p, o, m) MITK_PP_FOR_168_I(s, p, o, m) +# define MITK_PP_FOR_169(s, p, o, m) MITK_PP_FOR_169_I(s, p, o, m) +# define MITK_PP_FOR_170(s, p, o, m) MITK_PP_FOR_170_I(s, p, o, m) +# define MITK_PP_FOR_171(s, p, o, m) MITK_PP_FOR_171_I(s, p, o, m) +# define MITK_PP_FOR_172(s, p, o, m) MITK_PP_FOR_172_I(s, p, o, m) +# define MITK_PP_FOR_173(s, p, o, m) MITK_PP_FOR_173_I(s, p, o, m) +# define MITK_PP_FOR_174(s, p, o, m) MITK_PP_FOR_174_I(s, p, o, m) +# define MITK_PP_FOR_175(s, p, o, m) MITK_PP_FOR_175_I(s, p, o, m) +# define MITK_PP_FOR_176(s, p, o, m) MITK_PP_FOR_176_I(s, p, o, m) +# define MITK_PP_FOR_177(s, p, o, m) MITK_PP_FOR_177_I(s, p, o, m) +# define MITK_PP_FOR_178(s, p, o, m) MITK_PP_FOR_178_I(s, p, o, m) +# define MITK_PP_FOR_179(s, p, o, m) MITK_PP_FOR_179_I(s, p, o, m) +# define MITK_PP_FOR_180(s, p, o, m) MITK_PP_FOR_180_I(s, p, o, m) +# define MITK_PP_FOR_181(s, p, o, m) MITK_PP_FOR_181_I(s, p, o, m) +# define MITK_PP_FOR_182(s, p, o, m) MITK_PP_FOR_182_I(s, p, o, m) +# define MITK_PP_FOR_183(s, p, o, m) MITK_PP_FOR_183_I(s, p, o, m) +# define MITK_PP_FOR_184(s, p, o, m) MITK_PP_FOR_184_I(s, p, o, m) +# define MITK_PP_FOR_185(s, p, o, m) MITK_PP_FOR_185_I(s, p, o, m) +# define MITK_PP_FOR_186(s, p, o, m) MITK_PP_FOR_186_I(s, p, o, m) +# define MITK_PP_FOR_187(s, p, o, m) MITK_PP_FOR_187_I(s, p, o, m) +# define MITK_PP_FOR_188(s, p, o, m) MITK_PP_FOR_188_I(s, p, o, m) +# define MITK_PP_FOR_189(s, p, o, m) MITK_PP_FOR_189_I(s, p, o, m) +# define MITK_PP_FOR_190(s, p, o, m) MITK_PP_FOR_190_I(s, p, o, m) +# define MITK_PP_FOR_191(s, p, o, m) MITK_PP_FOR_191_I(s, p, o, m) +# define MITK_PP_FOR_192(s, p, o, m) MITK_PP_FOR_192_I(s, p, o, m) +# define MITK_PP_FOR_193(s, p, o, m) MITK_PP_FOR_193_I(s, p, o, m) +# define MITK_PP_FOR_194(s, p, o, m) MITK_PP_FOR_194_I(s, p, o, m) +# define MITK_PP_FOR_195(s, p, o, m) MITK_PP_FOR_195_I(s, p, o, m) +# define MITK_PP_FOR_196(s, p, o, m) MITK_PP_FOR_196_I(s, p, o, m) +# define MITK_PP_FOR_197(s, p, o, m) MITK_PP_FOR_197_I(s, p, o, m) +# define MITK_PP_FOR_198(s, p, o, m) MITK_PP_FOR_198_I(s, p, o, m) +# define MITK_PP_FOR_199(s, p, o, m) MITK_PP_FOR_199_I(s, p, o, m) +# define MITK_PP_FOR_200(s, p, o, m) MITK_PP_FOR_200_I(s, p, o, m) +# define MITK_PP_FOR_201(s, p, o, m) MITK_PP_FOR_201_I(s, p, o, m) +# define MITK_PP_FOR_202(s, p, o, m) MITK_PP_FOR_202_I(s, p, o, m) +# define MITK_PP_FOR_203(s, p, o, m) MITK_PP_FOR_203_I(s, p, o, m) +# define MITK_PP_FOR_204(s, p, o, m) MITK_PP_FOR_204_I(s, p, o, m) +# define MITK_PP_FOR_205(s, p, o, m) MITK_PP_FOR_205_I(s, p, o, m) +# define MITK_PP_FOR_206(s, p, o, m) MITK_PP_FOR_206_I(s, p, o, m) +# define MITK_PP_FOR_207(s, p, o, m) MITK_PP_FOR_207_I(s, p, o, m) +# define MITK_PP_FOR_208(s, p, o, m) MITK_PP_FOR_208_I(s, p, o, m) +# define MITK_PP_FOR_209(s, p, o, m) MITK_PP_FOR_209_I(s, p, o, m) +# define MITK_PP_FOR_210(s, p, o, m) MITK_PP_FOR_210_I(s, p, o, m) +# define MITK_PP_FOR_211(s, p, o, m) MITK_PP_FOR_211_I(s, p, o, m) +# define MITK_PP_FOR_212(s, p, o, m) MITK_PP_FOR_212_I(s, p, o, m) +# define MITK_PP_FOR_213(s, p, o, m) MITK_PP_FOR_213_I(s, p, o, m) +# define MITK_PP_FOR_214(s, p, o, m) MITK_PP_FOR_214_I(s, p, o, m) +# define MITK_PP_FOR_215(s, p, o, m) MITK_PP_FOR_215_I(s, p, o, m) +# define MITK_PP_FOR_216(s, p, o, m) MITK_PP_FOR_216_I(s, p, o, m) +# define MITK_PP_FOR_217(s, p, o, m) MITK_PP_FOR_217_I(s, p, o, m) +# define MITK_PP_FOR_218(s, p, o, m) MITK_PP_FOR_218_I(s, p, o, m) +# define MITK_PP_FOR_219(s, p, o, m) MITK_PP_FOR_219_I(s, p, o, m) +# define MITK_PP_FOR_220(s, p, o, m) MITK_PP_FOR_220_I(s, p, o, m) +# define MITK_PP_FOR_221(s, p, o, m) MITK_PP_FOR_221_I(s, p, o, m) +# define MITK_PP_FOR_222(s, p, o, m) MITK_PP_FOR_222_I(s, p, o, m) +# define MITK_PP_FOR_223(s, p, o, m) MITK_PP_FOR_223_I(s, p, o, m) +# define MITK_PP_FOR_224(s, p, o, m) MITK_PP_FOR_224_I(s, p, o, m) +# define MITK_PP_FOR_225(s, p, o, m) MITK_PP_FOR_225_I(s, p, o, m) +# define MITK_PP_FOR_226(s, p, o, m) MITK_PP_FOR_226_I(s, p, o, m) +# define MITK_PP_FOR_227(s, p, o, m) MITK_PP_FOR_227_I(s, p, o, m) +# define MITK_PP_FOR_228(s, p, o, m) MITK_PP_FOR_228_I(s, p, o, m) +# define MITK_PP_FOR_229(s, p, o, m) MITK_PP_FOR_229_I(s, p, o, m) +# define MITK_PP_FOR_230(s, p, o, m) MITK_PP_FOR_230_I(s, p, o, m) +# define MITK_PP_FOR_231(s, p, o, m) MITK_PP_FOR_231_I(s, p, o, m) +# define MITK_PP_FOR_232(s, p, o, m) MITK_PP_FOR_232_I(s, p, o, m) +# define MITK_PP_FOR_233(s, p, o, m) MITK_PP_FOR_233_I(s, p, o, m) +# define MITK_PP_FOR_234(s, p, o, m) MITK_PP_FOR_234_I(s, p, o, m) +# define MITK_PP_FOR_235(s, p, o, m) MITK_PP_FOR_235_I(s, p, o, m) +# define MITK_PP_FOR_236(s, p, o, m) MITK_PP_FOR_236_I(s, p, o, m) +# define MITK_PP_FOR_237(s, p, o, m) MITK_PP_FOR_237_I(s, p, o, m) +# define MITK_PP_FOR_238(s, p, o, m) MITK_PP_FOR_238_I(s, p, o, m) +# define MITK_PP_FOR_239(s, p, o, m) MITK_PP_FOR_239_I(s, p, o, m) +# define MITK_PP_FOR_240(s, p, o, m) MITK_PP_FOR_240_I(s, p, o, m) +# define MITK_PP_FOR_241(s, p, o, m) MITK_PP_FOR_241_I(s, p, o, m) +# define MITK_PP_FOR_242(s, p, o, m) MITK_PP_FOR_242_I(s, p, o, m) +# define MITK_PP_FOR_243(s, p, o, m) MITK_PP_FOR_243_I(s, p, o, m) +# define MITK_PP_FOR_244(s, p, o, m) MITK_PP_FOR_244_I(s, p, o, m) +# define MITK_PP_FOR_245(s, p, o, m) MITK_PP_FOR_245_I(s, p, o, m) +# define MITK_PP_FOR_246(s, p, o, m) MITK_PP_FOR_246_I(s, p, o, m) +# define MITK_PP_FOR_247(s, p, o, m) MITK_PP_FOR_247_I(s, p, o, m) +# define MITK_PP_FOR_248(s, p, o, m) MITK_PP_FOR_248_I(s, p, o, m) +# define MITK_PP_FOR_249(s, p, o, m) MITK_PP_FOR_249_I(s, p, o, m) +# define MITK_PP_FOR_250(s, p, o, m) MITK_PP_FOR_250_I(s, p, o, m) +# define MITK_PP_FOR_251(s, p, o, m) MITK_PP_FOR_251_I(s, p, o, m) +# define MITK_PP_FOR_252(s, p, o, m) MITK_PP_FOR_252_I(s, p, o, m) +# define MITK_PP_FOR_253(s, p, o, m) MITK_PP_FOR_253_I(s, p, o, m) +# define MITK_PP_FOR_254(s, p, o, m) MITK_PP_FOR_254_I(s, p, o, m) +# define MITK_PP_FOR_255(s, p, o, m) MITK_PP_FOR_255_I(s, p, o, m) +# define MITK_PP_FOR_256(s, p, o, m) MITK_PP_FOR_256_I(s, p, o, m) +# +# define MITK_PP_FOR_1_I(s, p, o, m) MITK_PP_IF(p(2, s), m, MITK_PP_TUPLE_EAT_2)(2, s) MITK_PP_IF(p(2, s), MITK_PP_FOR_2, MITK_PP_TUPLE_EAT_4)(o(2, s), p, o, m) +# define MITK_PP_FOR_2_I(s, p, o, m) MITK_PP_IF(p(3, s), m, MITK_PP_TUPLE_EAT_2)(3, s) MITK_PP_IF(p(3, s), MITK_PP_FOR_3, MITK_PP_TUPLE_EAT_4)(o(3, s), p, o, m) +# define MITK_PP_FOR_3_I(s, p, o, m) MITK_PP_IF(p(4, s), m, MITK_PP_TUPLE_EAT_2)(4, s) MITK_PP_IF(p(4, s), MITK_PP_FOR_4, MITK_PP_TUPLE_EAT_4)(o(4, s), p, o, m) +# define MITK_PP_FOR_4_I(s, p, o, m) MITK_PP_IF(p(5, s), m, MITK_PP_TUPLE_EAT_2)(5, s) MITK_PP_IF(p(5, s), MITK_PP_FOR_5, MITK_PP_TUPLE_EAT_4)(o(5, s), p, o, m) +# define MITK_PP_FOR_5_I(s, p, o, m) MITK_PP_IF(p(6, s), m, MITK_PP_TUPLE_EAT_2)(6, s) MITK_PP_IF(p(6, s), MITK_PP_FOR_6, MITK_PP_TUPLE_EAT_4)(o(6, s), p, o, m) +# define MITK_PP_FOR_6_I(s, p, o, m) MITK_PP_IF(p(7, s), m, MITK_PP_TUPLE_EAT_2)(7, s) MITK_PP_IF(p(7, s), MITK_PP_FOR_7, MITK_PP_TUPLE_EAT_4)(o(7, s), p, o, m) +# define MITK_PP_FOR_7_I(s, p, o, m) MITK_PP_IF(p(8, s), m, MITK_PP_TUPLE_EAT_2)(8, s) MITK_PP_IF(p(8, s), MITK_PP_FOR_8, MITK_PP_TUPLE_EAT_4)(o(8, s), p, o, m) +# define MITK_PP_FOR_8_I(s, p, o, m) MITK_PP_IF(p(9, s), m, MITK_PP_TUPLE_EAT_2)(9, s) MITK_PP_IF(p(9, s), MITK_PP_FOR_9, MITK_PP_TUPLE_EAT_4)(o(9, s), p, o, m) +# define MITK_PP_FOR_9_I(s, p, o, m) MITK_PP_IF(p(10, s), m, MITK_PP_TUPLE_EAT_2)(10, s) MITK_PP_IF(p(10, s), MITK_PP_FOR_10, MITK_PP_TUPLE_EAT_4)(o(10, s), p, o, m) +# define MITK_PP_FOR_10_I(s, p, o, m) MITK_PP_IF(p(11, s), m, MITK_PP_TUPLE_EAT_2)(11, s) MITK_PP_IF(p(11, s), MITK_PP_FOR_11, MITK_PP_TUPLE_EAT_4)(o(11, s), p, o, m) +# define MITK_PP_FOR_11_I(s, p, o, m) MITK_PP_IF(p(12, s), m, MITK_PP_TUPLE_EAT_2)(12, s) MITK_PP_IF(p(12, s), MITK_PP_FOR_12, MITK_PP_TUPLE_EAT_4)(o(12, s), p, o, m) +# define MITK_PP_FOR_12_I(s, p, o, m) MITK_PP_IF(p(13, s), m, MITK_PP_TUPLE_EAT_2)(13, s) MITK_PP_IF(p(13, s), MITK_PP_FOR_13, MITK_PP_TUPLE_EAT_4)(o(13, s), p, o, m) +# define MITK_PP_FOR_13_I(s, p, o, m) MITK_PP_IF(p(14, s), m, MITK_PP_TUPLE_EAT_2)(14, s) MITK_PP_IF(p(14, s), MITK_PP_FOR_14, MITK_PP_TUPLE_EAT_4)(o(14, s), p, o, m) +# define MITK_PP_FOR_14_I(s, p, o, m) MITK_PP_IF(p(15, s), m, MITK_PP_TUPLE_EAT_2)(15, s) MITK_PP_IF(p(15, s), MITK_PP_FOR_15, MITK_PP_TUPLE_EAT_4)(o(15, s), p, o, m) +# define MITK_PP_FOR_15_I(s, p, o, m) MITK_PP_IF(p(16, s), m, MITK_PP_TUPLE_EAT_2)(16, s) MITK_PP_IF(p(16, s), MITK_PP_FOR_16, MITK_PP_TUPLE_EAT_4)(o(16, s), p, o, m) +# define MITK_PP_FOR_16_I(s, p, o, m) MITK_PP_IF(p(17, s), m, MITK_PP_TUPLE_EAT_2)(17, s) MITK_PP_IF(p(17, s), MITK_PP_FOR_17, MITK_PP_TUPLE_EAT_4)(o(17, s), p, o, m) +# define MITK_PP_FOR_17_I(s, p, o, m) MITK_PP_IF(p(18, s), m, MITK_PP_TUPLE_EAT_2)(18, s) MITK_PP_IF(p(18, s), MITK_PP_FOR_18, MITK_PP_TUPLE_EAT_4)(o(18, s), p, o, m) +# define MITK_PP_FOR_18_I(s, p, o, m) MITK_PP_IF(p(19, s), m, MITK_PP_TUPLE_EAT_2)(19, s) MITK_PP_IF(p(19, s), MITK_PP_FOR_19, MITK_PP_TUPLE_EAT_4)(o(19, s), p, o, m) +# define MITK_PP_FOR_19_I(s, p, o, m) MITK_PP_IF(p(20, s), m, MITK_PP_TUPLE_EAT_2)(20, s) MITK_PP_IF(p(20, s), MITK_PP_FOR_20, MITK_PP_TUPLE_EAT_4)(o(20, s), p, o, m) +# define MITK_PP_FOR_20_I(s, p, o, m) MITK_PP_IF(p(21, s), m, MITK_PP_TUPLE_EAT_2)(21, s) MITK_PP_IF(p(21, s), MITK_PP_FOR_21, MITK_PP_TUPLE_EAT_4)(o(21, s), p, o, m) +# define MITK_PP_FOR_21_I(s, p, o, m) MITK_PP_IF(p(22, s), m, MITK_PP_TUPLE_EAT_2)(22, s) MITK_PP_IF(p(22, s), MITK_PP_FOR_22, MITK_PP_TUPLE_EAT_4)(o(22, s), p, o, m) +# define MITK_PP_FOR_22_I(s, p, o, m) MITK_PP_IF(p(23, s), m, MITK_PP_TUPLE_EAT_2)(23, s) MITK_PP_IF(p(23, s), MITK_PP_FOR_23, MITK_PP_TUPLE_EAT_4)(o(23, s), p, o, m) +# define MITK_PP_FOR_23_I(s, p, o, m) MITK_PP_IF(p(24, s), m, MITK_PP_TUPLE_EAT_2)(24, s) MITK_PP_IF(p(24, s), MITK_PP_FOR_24, MITK_PP_TUPLE_EAT_4)(o(24, s), p, o, m) +# define MITK_PP_FOR_24_I(s, p, o, m) MITK_PP_IF(p(25, s), m, MITK_PP_TUPLE_EAT_2)(25, s) MITK_PP_IF(p(25, s), MITK_PP_FOR_25, MITK_PP_TUPLE_EAT_4)(o(25, s), p, o, m) +# define MITK_PP_FOR_25_I(s, p, o, m) MITK_PP_IF(p(26, s), m, MITK_PP_TUPLE_EAT_2)(26, s) MITK_PP_IF(p(26, s), MITK_PP_FOR_26, MITK_PP_TUPLE_EAT_4)(o(26, s), p, o, m) +# define MITK_PP_FOR_26_I(s, p, o, m) MITK_PP_IF(p(27, s), m, MITK_PP_TUPLE_EAT_2)(27, s) MITK_PP_IF(p(27, s), MITK_PP_FOR_27, MITK_PP_TUPLE_EAT_4)(o(27, s), p, o, m) +# define MITK_PP_FOR_27_I(s, p, o, m) MITK_PP_IF(p(28, s), m, MITK_PP_TUPLE_EAT_2)(28, s) MITK_PP_IF(p(28, s), MITK_PP_FOR_28, MITK_PP_TUPLE_EAT_4)(o(28, s), p, o, m) +# define MITK_PP_FOR_28_I(s, p, o, m) MITK_PP_IF(p(29, s), m, MITK_PP_TUPLE_EAT_2)(29, s) MITK_PP_IF(p(29, s), MITK_PP_FOR_29, MITK_PP_TUPLE_EAT_4)(o(29, s), p, o, m) +# define MITK_PP_FOR_29_I(s, p, o, m) MITK_PP_IF(p(30, s), m, MITK_PP_TUPLE_EAT_2)(30, s) MITK_PP_IF(p(30, s), MITK_PP_FOR_30, MITK_PP_TUPLE_EAT_4)(o(30, s), p, o, m) +# define MITK_PP_FOR_30_I(s, p, o, m) MITK_PP_IF(p(31, s), m, MITK_PP_TUPLE_EAT_2)(31, s) MITK_PP_IF(p(31, s), MITK_PP_FOR_31, MITK_PP_TUPLE_EAT_4)(o(31, s), p, o, m) +# define MITK_PP_FOR_31_I(s, p, o, m) MITK_PP_IF(p(32, s), m, MITK_PP_TUPLE_EAT_2)(32, s) MITK_PP_IF(p(32, s), MITK_PP_FOR_32, MITK_PP_TUPLE_EAT_4)(o(32, s), p, o, m) +# define MITK_PP_FOR_32_I(s, p, o, m) MITK_PP_IF(p(33, s), m, MITK_PP_TUPLE_EAT_2)(33, s) MITK_PP_IF(p(33, s), MITK_PP_FOR_33, MITK_PP_TUPLE_EAT_4)(o(33, s), p, o, m) +# define MITK_PP_FOR_33_I(s, p, o, m) MITK_PP_IF(p(34, s), m, MITK_PP_TUPLE_EAT_2)(34, s) MITK_PP_IF(p(34, s), MITK_PP_FOR_34, MITK_PP_TUPLE_EAT_4)(o(34, s), p, o, m) +# define MITK_PP_FOR_34_I(s, p, o, m) MITK_PP_IF(p(35, s), m, MITK_PP_TUPLE_EAT_2)(35, s) MITK_PP_IF(p(35, s), MITK_PP_FOR_35, MITK_PP_TUPLE_EAT_4)(o(35, s), p, o, m) +# define MITK_PP_FOR_35_I(s, p, o, m) MITK_PP_IF(p(36, s), m, MITK_PP_TUPLE_EAT_2)(36, s) MITK_PP_IF(p(36, s), MITK_PP_FOR_36, MITK_PP_TUPLE_EAT_4)(o(36, s), p, o, m) +# define MITK_PP_FOR_36_I(s, p, o, m) MITK_PP_IF(p(37, s), m, MITK_PP_TUPLE_EAT_2)(37, s) MITK_PP_IF(p(37, s), MITK_PP_FOR_37, MITK_PP_TUPLE_EAT_4)(o(37, s), p, o, m) +# define MITK_PP_FOR_37_I(s, p, o, m) MITK_PP_IF(p(38, s), m, MITK_PP_TUPLE_EAT_2)(38, s) MITK_PP_IF(p(38, s), MITK_PP_FOR_38, MITK_PP_TUPLE_EAT_4)(o(38, s), p, o, m) +# define MITK_PP_FOR_38_I(s, p, o, m) MITK_PP_IF(p(39, s), m, MITK_PP_TUPLE_EAT_2)(39, s) MITK_PP_IF(p(39, s), MITK_PP_FOR_39, MITK_PP_TUPLE_EAT_4)(o(39, s), p, o, m) +# define MITK_PP_FOR_39_I(s, p, o, m) MITK_PP_IF(p(40, s), m, MITK_PP_TUPLE_EAT_2)(40, s) MITK_PP_IF(p(40, s), MITK_PP_FOR_40, MITK_PP_TUPLE_EAT_4)(o(40, s), p, o, m) +# define MITK_PP_FOR_40_I(s, p, o, m) MITK_PP_IF(p(41, s), m, MITK_PP_TUPLE_EAT_2)(41, s) MITK_PP_IF(p(41, s), MITK_PP_FOR_41, MITK_PP_TUPLE_EAT_4)(o(41, s), p, o, m) +# define MITK_PP_FOR_41_I(s, p, o, m) MITK_PP_IF(p(42, s), m, MITK_PP_TUPLE_EAT_2)(42, s) MITK_PP_IF(p(42, s), MITK_PP_FOR_42, MITK_PP_TUPLE_EAT_4)(o(42, s), p, o, m) +# define MITK_PP_FOR_42_I(s, p, o, m) MITK_PP_IF(p(43, s), m, MITK_PP_TUPLE_EAT_2)(43, s) MITK_PP_IF(p(43, s), MITK_PP_FOR_43, MITK_PP_TUPLE_EAT_4)(o(43, s), p, o, m) +# define MITK_PP_FOR_43_I(s, p, o, m) MITK_PP_IF(p(44, s), m, MITK_PP_TUPLE_EAT_2)(44, s) MITK_PP_IF(p(44, s), MITK_PP_FOR_44, MITK_PP_TUPLE_EAT_4)(o(44, s), p, o, m) +# define MITK_PP_FOR_44_I(s, p, o, m) MITK_PP_IF(p(45, s), m, MITK_PP_TUPLE_EAT_2)(45, s) MITK_PP_IF(p(45, s), MITK_PP_FOR_45, MITK_PP_TUPLE_EAT_4)(o(45, s), p, o, m) +# define MITK_PP_FOR_45_I(s, p, o, m) MITK_PP_IF(p(46, s), m, MITK_PP_TUPLE_EAT_2)(46, s) MITK_PP_IF(p(46, s), MITK_PP_FOR_46, MITK_PP_TUPLE_EAT_4)(o(46, s), p, o, m) +# define MITK_PP_FOR_46_I(s, p, o, m) MITK_PP_IF(p(47, s), m, MITK_PP_TUPLE_EAT_2)(47, s) MITK_PP_IF(p(47, s), MITK_PP_FOR_47, MITK_PP_TUPLE_EAT_4)(o(47, s), p, o, m) +# define MITK_PP_FOR_47_I(s, p, o, m) MITK_PP_IF(p(48, s), m, MITK_PP_TUPLE_EAT_2)(48, s) MITK_PP_IF(p(48, s), MITK_PP_FOR_48, MITK_PP_TUPLE_EAT_4)(o(48, s), p, o, m) +# define MITK_PP_FOR_48_I(s, p, o, m) MITK_PP_IF(p(49, s), m, MITK_PP_TUPLE_EAT_2)(49, s) MITK_PP_IF(p(49, s), MITK_PP_FOR_49, MITK_PP_TUPLE_EAT_4)(o(49, s), p, o, m) +# define MITK_PP_FOR_49_I(s, p, o, m) MITK_PP_IF(p(50, s), m, MITK_PP_TUPLE_EAT_2)(50, s) MITK_PP_IF(p(50, s), MITK_PP_FOR_50, MITK_PP_TUPLE_EAT_4)(o(50, s), p, o, m) +# define MITK_PP_FOR_50_I(s, p, o, m) MITK_PP_IF(p(51, s), m, MITK_PP_TUPLE_EAT_2)(51, s) MITK_PP_IF(p(51, s), MITK_PP_FOR_51, MITK_PP_TUPLE_EAT_4)(o(51, s), p, o, m) +# define MITK_PP_FOR_51_I(s, p, o, m) MITK_PP_IF(p(52, s), m, MITK_PP_TUPLE_EAT_2)(52, s) MITK_PP_IF(p(52, s), MITK_PP_FOR_52, MITK_PP_TUPLE_EAT_4)(o(52, s), p, o, m) +# define MITK_PP_FOR_52_I(s, p, o, m) MITK_PP_IF(p(53, s), m, MITK_PP_TUPLE_EAT_2)(53, s) MITK_PP_IF(p(53, s), MITK_PP_FOR_53, MITK_PP_TUPLE_EAT_4)(o(53, s), p, o, m) +# define MITK_PP_FOR_53_I(s, p, o, m) MITK_PP_IF(p(54, s), m, MITK_PP_TUPLE_EAT_2)(54, s) MITK_PP_IF(p(54, s), MITK_PP_FOR_54, MITK_PP_TUPLE_EAT_4)(o(54, s), p, o, m) +# define MITK_PP_FOR_54_I(s, p, o, m) MITK_PP_IF(p(55, s), m, MITK_PP_TUPLE_EAT_2)(55, s) MITK_PP_IF(p(55, s), MITK_PP_FOR_55, MITK_PP_TUPLE_EAT_4)(o(55, s), p, o, m) +# define MITK_PP_FOR_55_I(s, p, o, m) MITK_PP_IF(p(56, s), m, MITK_PP_TUPLE_EAT_2)(56, s) MITK_PP_IF(p(56, s), MITK_PP_FOR_56, MITK_PP_TUPLE_EAT_4)(o(56, s), p, o, m) +# define MITK_PP_FOR_56_I(s, p, o, m) MITK_PP_IF(p(57, s), m, MITK_PP_TUPLE_EAT_2)(57, s) MITK_PP_IF(p(57, s), MITK_PP_FOR_57, MITK_PP_TUPLE_EAT_4)(o(57, s), p, o, m) +# define MITK_PP_FOR_57_I(s, p, o, m) MITK_PP_IF(p(58, s), m, MITK_PP_TUPLE_EAT_2)(58, s) MITK_PP_IF(p(58, s), MITK_PP_FOR_58, MITK_PP_TUPLE_EAT_4)(o(58, s), p, o, m) +# define MITK_PP_FOR_58_I(s, p, o, m) MITK_PP_IF(p(59, s), m, MITK_PP_TUPLE_EAT_2)(59, s) MITK_PP_IF(p(59, s), MITK_PP_FOR_59, MITK_PP_TUPLE_EAT_4)(o(59, s), p, o, m) +# define MITK_PP_FOR_59_I(s, p, o, m) MITK_PP_IF(p(60, s), m, MITK_PP_TUPLE_EAT_2)(60, s) MITK_PP_IF(p(60, s), MITK_PP_FOR_60, MITK_PP_TUPLE_EAT_4)(o(60, s), p, o, m) +# define MITK_PP_FOR_60_I(s, p, o, m) MITK_PP_IF(p(61, s), m, MITK_PP_TUPLE_EAT_2)(61, s) MITK_PP_IF(p(61, s), MITK_PP_FOR_61, MITK_PP_TUPLE_EAT_4)(o(61, s), p, o, m) +# define MITK_PP_FOR_61_I(s, p, o, m) MITK_PP_IF(p(62, s), m, MITK_PP_TUPLE_EAT_2)(62, s) MITK_PP_IF(p(62, s), MITK_PP_FOR_62, MITK_PP_TUPLE_EAT_4)(o(62, s), p, o, m) +# define MITK_PP_FOR_62_I(s, p, o, m) MITK_PP_IF(p(63, s), m, MITK_PP_TUPLE_EAT_2)(63, s) MITK_PP_IF(p(63, s), MITK_PP_FOR_63, MITK_PP_TUPLE_EAT_4)(o(63, s), p, o, m) +# define MITK_PP_FOR_63_I(s, p, o, m) MITK_PP_IF(p(64, s), m, MITK_PP_TUPLE_EAT_2)(64, s) MITK_PP_IF(p(64, s), MITK_PP_FOR_64, MITK_PP_TUPLE_EAT_4)(o(64, s), p, o, m) +# define MITK_PP_FOR_64_I(s, p, o, m) MITK_PP_IF(p(65, s), m, MITK_PP_TUPLE_EAT_2)(65, s) MITK_PP_IF(p(65, s), MITK_PP_FOR_65, MITK_PP_TUPLE_EAT_4)(o(65, s), p, o, m) +# define MITK_PP_FOR_65_I(s, p, o, m) MITK_PP_IF(p(66, s), m, MITK_PP_TUPLE_EAT_2)(66, s) MITK_PP_IF(p(66, s), MITK_PP_FOR_66, MITK_PP_TUPLE_EAT_4)(o(66, s), p, o, m) +# define MITK_PP_FOR_66_I(s, p, o, m) MITK_PP_IF(p(67, s), m, MITK_PP_TUPLE_EAT_2)(67, s) MITK_PP_IF(p(67, s), MITK_PP_FOR_67, MITK_PP_TUPLE_EAT_4)(o(67, s), p, o, m) +# define MITK_PP_FOR_67_I(s, p, o, m) MITK_PP_IF(p(68, s), m, MITK_PP_TUPLE_EAT_2)(68, s) MITK_PP_IF(p(68, s), MITK_PP_FOR_68, MITK_PP_TUPLE_EAT_4)(o(68, s), p, o, m) +# define MITK_PP_FOR_68_I(s, p, o, m) MITK_PP_IF(p(69, s), m, MITK_PP_TUPLE_EAT_2)(69, s) MITK_PP_IF(p(69, s), MITK_PP_FOR_69, MITK_PP_TUPLE_EAT_4)(o(69, s), p, o, m) +# define MITK_PP_FOR_69_I(s, p, o, m) MITK_PP_IF(p(70, s), m, MITK_PP_TUPLE_EAT_2)(70, s) MITK_PP_IF(p(70, s), MITK_PP_FOR_70, MITK_PP_TUPLE_EAT_4)(o(70, s), p, o, m) +# define MITK_PP_FOR_70_I(s, p, o, m) MITK_PP_IF(p(71, s), m, MITK_PP_TUPLE_EAT_2)(71, s) MITK_PP_IF(p(71, s), MITK_PP_FOR_71, MITK_PP_TUPLE_EAT_4)(o(71, s), p, o, m) +# define MITK_PP_FOR_71_I(s, p, o, m) MITK_PP_IF(p(72, s), m, MITK_PP_TUPLE_EAT_2)(72, s) MITK_PP_IF(p(72, s), MITK_PP_FOR_72, MITK_PP_TUPLE_EAT_4)(o(72, s), p, o, m) +# define MITK_PP_FOR_72_I(s, p, o, m) MITK_PP_IF(p(73, s), m, MITK_PP_TUPLE_EAT_2)(73, s) MITK_PP_IF(p(73, s), MITK_PP_FOR_73, MITK_PP_TUPLE_EAT_4)(o(73, s), p, o, m) +# define MITK_PP_FOR_73_I(s, p, o, m) MITK_PP_IF(p(74, s), m, MITK_PP_TUPLE_EAT_2)(74, s) MITK_PP_IF(p(74, s), MITK_PP_FOR_74, MITK_PP_TUPLE_EAT_4)(o(74, s), p, o, m) +# define MITK_PP_FOR_74_I(s, p, o, m) MITK_PP_IF(p(75, s), m, MITK_PP_TUPLE_EAT_2)(75, s) MITK_PP_IF(p(75, s), MITK_PP_FOR_75, MITK_PP_TUPLE_EAT_4)(o(75, s), p, o, m) +# define MITK_PP_FOR_75_I(s, p, o, m) MITK_PP_IF(p(76, s), m, MITK_PP_TUPLE_EAT_2)(76, s) MITK_PP_IF(p(76, s), MITK_PP_FOR_76, MITK_PP_TUPLE_EAT_4)(o(76, s), p, o, m) +# define MITK_PP_FOR_76_I(s, p, o, m) MITK_PP_IF(p(77, s), m, MITK_PP_TUPLE_EAT_2)(77, s) MITK_PP_IF(p(77, s), MITK_PP_FOR_77, MITK_PP_TUPLE_EAT_4)(o(77, s), p, o, m) +# define MITK_PP_FOR_77_I(s, p, o, m) MITK_PP_IF(p(78, s), m, MITK_PP_TUPLE_EAT_2)(78, s) MITK_PP_IF(p(78, s), MITK_PP_FOR_78, MITK_PP_TUPLE_EAT_4)(o(78, s), p, o, m) +# define MITK_PP_FOR_78_I(s, p, o, m) MITK_PP_IF(p(79, s), m, MITK_PP_TUPLE_EAT_2)(79, s) MITK_PP_IF(p(79, s), MITK_PP_FOR_79, MITK_PP_TUPLE_EAT_4)(o(79, s), p, o, m) +# define MITK_PP_FOR_79_I(s, p, o, m) MITK_PP_IF(p(80, s), m, MITK_PP_TUPLE_EAT_2)(80, s) MITK_PP_IF(p(80, s), MITK_PP_FOR_80, MITK_PP_TUPLE_EAT_4)(o(80, s), p, o, m) +# define MITK_PP_FOR_80_I(s, p, o, m) MITK_PP_IF(p(81, s), m, MITK_PP_TUPLE_EAT_2)(81, s) MITK_PP_IF(p(81, s), MITK_PP_FOR_81, MITK_PP_TUPLE_EAT_4)(o(81, s), p, o, m) +# define MITK_PP_FOR_81_I(s, p, o, m) MITK_PP_IF(p(82, s), m, MITK_PP_TUPLE_EAT_2)(82, s) MITK_PP_IF(p(82, s), MITK_PP_FOR_82, MITK_PP_TUPLE_EAT_4)(o(82, s), p, o, m) +# define MITK_PP_FOR_82_I(s, p, o, m) MITK_PP_IF(p(83, s), m, MITK_PP_TUPLE_EAT_2)(83, s) MITK_PP_IF(p(83, s), MITK_PP_FOR_83, MITK_PP_TUPLE_EAT_4)(o(83, s), p, o, m) +# define MITK_PP_FOR_83_I(s, p, o, m) MITK_PP_IF(p(84, s), m, MITK_PP_TUPLE_EAT_2)(84, s) MITK_PP_IF(p(84, s), MITK_PP_FOR_84, MITK_PP_TUPLE_EAT_4)(o(84, s), p, o, m) +# define MITK_PP_FOR_84_I(s, p, o, m) MITK_PP_IF(p(85, s), m, MITK_PP_TUPLE_EAT_2)(85, s) MITK_PP_IF(p(85, s), MITK_PP_FOR_85, MITK_PP_TUPLE_EAT_4)(o(85, s), p, o, m) +# define MITK_PP_FOR_85_I(s, p, o, m) MITK_PP_IF(p(86, s), m, MITK_PP_TUPLE_EAT_2)(86, s) MITK_PP_IF(p(86, s), MITK_PP_FOR_86, MITK_PP_TUPLE_EAT_4)(o(86, s), p, o, m) +# define MITK_PP_FOR_86_I(s, p, o, m) MITK_PP_IF(p(87, s), m, MITK_PP_TUPLE_EAT_2)(87, s) MITK_PP_IF(p(87, s), MITK_PP_FOR_87, MITK_PP_TUPLE_EAT_4)(o(87, s), p, o, m) +# define MITK_PP_FOR_87_I(s, p, o, m) MITK_PP_IF(p(88, s), m, MITK_PP_TUPLE_EAT_2)(88, s) MITK_PP_IF(p(88, s), MITK_PP_FOR_88, MITK_PP_TUPLE_EAT_4)(o(88, s), p, o, m) +# define MITK_PP_FOR_88_I(s, p, o, m) MITK_PP_IF(p(89, s), m, MITK_PP_TUPLE_EAT_2)(89, s) MITK_PP_IF(p(89, s), MITK_PP_FOR_89, MITK_PP_TUPLE_EAT_4)(o(89, s), p, o, m) +# define MITK_PP_FOR_89_I(s, p, o, m) MITK_PP_IF(p(90, s), m, MITK_PP_TUPLE_EAT_2)(90, s) MITK_PP_IF(p(90, s), MITK_PP_FOR_90, MITK_PP_TUPLE_EAT_4)(o(90, s), p, o, m) +# define MITK_PP_FOR_90_I(s, p, o, m) MITK_PP_IF(p(91, s), m, MITK_PP_TUPLE_EAT_2)(91, s) MITK_PP_IF(p(91, s), MITK_PP_FOR_91, MITK_PP_TUPLE_EAT_4)(o(91, s), p, o, m) +# define MITK_PP_FOR_91_I(s, p, o, m) MITK_PP_IF(p(92, s), m, MITK_PP_TUPLE_EAT_2)(92, s) MITK_PP_IF(p(92, s), MITK_PP_FOR_92, MITK_PP_TUPLE_EAT_4)(o(92, s), p, o, m) +# define MITK_PP_FOR_92_I(s, p, o, m) MITK_PP_IF(p(93, s), m, MITK_PP_TUPLE_EAT_2)(93, s) MITK_PP_IF(p(93, s), MITK_PP_FOR_93, MITK_PP_TUPLE_EAT_4)(o(93, s), p, o, m) +# define MITK_PP_FOR_93_I(s, p, o, m) MITK_PP_IF(p(94, s), m, MITK_PP_TUPLE_EAT_2)(94, s) MITK_PP_IF(p(94, s), MITK_PP_FOR_94, MITK_PP_TUPLE_EAT_4)(o(94, s), p, o, m) +# define MITK_PP_FOR_94_I(s, p, o, m) MITK_PP_IF(p(95, s), m, MITK_PP_TUPLE_EAT_2)(95, s) MITK_PP_IF(p(95, s), MITK_PP_FOR_95, MITK_PP_TUPLE_EAT_4)(o(95, s), p, o, m) +# define MITK_PP_FOR_95_I(s, p, o, m) MITK_PP_IF(p(96, s), m, MITK_PP_TUPLE_EAT_2)(96, s) MITK_PP_IF(p(96, s), MITK_PP_FOR_96, MITK_PP_TUPLE_EAT_4)(o(96, s), p, o, m) +# define MITK_PP_FOR_96_I(s, p, o, m) MITK_PP_IF(p(97, s), m, MITK_PP_TUPLE_EAT_2)(97, s) MITK_PP_IF(p(97, s), MITK_PP_FOR_97, MITK_PP_TUPLE_EAT_4)(o(97, s), p, o, m) +# define MITK_PP_FOR_97_I(s, p, o, m) MITK_PP_IF(p(98, s), m, MITK_PP_TUPLE_EAT_2)(98, s) MITK_PP_IF(p(98, s), MITK_PP_FOR_98, MITK_PP_TUPLE_EAT_4)(o(98, s), p, o, m) +# define MITK_PP_FOR_98_I(s, p, o, m) MITK_PP_IF(p(99, s), m, MITK_PP_TUPLE_EAT_2)(99, s) MITK_PP_IF(p(99, s), MITK_PP_FOR_99, MITK_PP_TUPLE_EAT_4)(o(99, s), p, o, m) +# define MITK_PP_FOR_99_I(s, p, o, m) MITK_PP_IF(p(100, s), m, MITK_PP_TUPLE_EAT_2)(100, s) MITK_PP_IF(p(100, s), MITK_PP_FOR_100, MITK_PP_TUPLE_EAT_4)(o(100, s), p, o, m) +# define MITK_PP_FOR_100_I(s, p, o, m) MITK_PP_IF(p(101, s), m, MITK_PP_TUPLE_EAT_2)(101, s) MITK_PP_IF(p(101, s), MITK_PP_FOR_101, MITK_PP_TUPLE_EAT_4)(o(101, s), p, o, m) +# define MITK_PP_FOR_101_I(s, p, o, m) MITK_PP_IF(p(102, s), m, MITK_PP_TUPLE_EAT_2)(102, s) MITK_PP_IF(p(102, s), MITK_PP_FOR_102, MITK_PP_TUPLE_EAT_4)(o(102, s), p, o, m) +# define MITK_PP_FOR_102_I(s, p, o, m) MITK_PP_IF(p(103, s), m, MITK_PP_TUPLE_EAT_2)(103, s) MITK_PP_IF(p(103, s), MITK_PP_FOR_103, MITK_PP_TUPLE_EAT_4)(o(103, s), p, o, m) +# define MITK_PP_FOR_103_I(s, p, o, m) MITK_PP_IF(p(104, s), m, MITK_PP_TUPLE_EAT_2)(104, s) MITK_PP_IF(p(104, s), MITK_PP_FOR_104, MITK_PP_TUPLE_EAT_4)(o(104, s), p, o, m) +# define MITK_PP_FOR_104_I(s, p, o, m) MITK_PP_IF(p(105, s), m, MITK_PP_TUPLE_EAT_2)(105, s) MITK_PP_IF(p(105, s), MITK_PP_FOR_105, MITK_PP_TUPLE_EAT_4)(o(105, s), p, o, m) +# define MITK_PP_FOR_105_I(s, p, o, m) MITK_PP_IF(p(106, s), m, MITK_PP_TUPLE_EAT_2)(106, s) MITK_PP_IF(p(106, s), MITK_PP_FOR_106, MITK_PP_TUPLE_EAT_4)(o(106, s), p, o, m) +# define MITK_PP_FOR_106_I(s, p, o, m) MITK_PP_IF(p(107, s), m, MITK_PP_TUPLE_EAT_2)(107, s) MITK_PP_IF(p(107, s), MITK_PP_FOR_107, MITK_PP_TUPLE_EAT_4)(o(107, s), p, o, m) +# define MITK_PP_FOR_107_I(s, p, o, m) MITK_PP_IF(p(108, s), m, MITK_PP_TUPLE_EAT_2)(108, s) MITK_PP_IF(p(108, s), MITK_PP_FOR_108, MITK_PP_TUPLE_EAT_4)(o(108, s), p, o, m) +# define MITK_PP_FOR_108_I(s, p, o, m) MITK_PP_IF(p(109, s), m, MITK_PP_TUPLE_EAT_2)(109, s) MITK_PP_IF(p(109, s), MITK_PP_FOR_109, MITK_PP_TUPLE_EAT_4)(o(109, s), p, o, m) +# define MITK_PP_FOR_109_I(s, p, o, m) MITK_PP_IF(p(110, s), m, MITK_PP_TUPLE_EAT_2)(110, s) MITK_PP_IF(p(110, s), MITK_PP_FOR_110, MITK_PP_TUPLE_EAT_4)(o(110, s), p, o, m) +# define MITK_PP_FOR_110_I(s, p, o, m) MITK_PP_IF(p(111, s), m, MITK_PP_TUPLE_EAT_2)(111, s) MITK_PP_IF(p(111, s), MITK_PP_FOR_111, MITK_PP_TUPLE_EAT_4)(o(111, s), p, o, m) +# define MITK_PP_FOR_111_I(s, p, o, m) MITK_PP_IF(p(112, s), m, MITK_PP_TUPLE_EAT_2)(112, s) MITK_PP_IF(p(112, s), MITK_PP_FOR_112, MITK_PP_TUPLE_EAT_4)(o(112, s), p, o, m) +# define MITK_PP_FOR_112_I(s, p, o, m) MITK_PP_IF(p(113, s), m, MITK_PP_TUPLE_EAT_2)(113, s) MITK_PP_IF(p(113, s), MITK_PP_FOR_113, MITK_PP_TUPLE_EAT_4)(o(113, s), p, o, m) +# define MITK_PP_FOR_113_I(s, p, o, m) MITK_PP_IF(p(114, s), m, MITK_PP_TUPLE_EAT_2)(114, s) MITK_PP_IF(p(114, s), MITK_PP_FOR_114, MITK_PP_TUPLE_EAT_4)(o(114, s), p, o, m) +# define MITK_PP_FOR_114_I(s, p, o, m) MITK_PP_IF(p(115, s), m, MITK_PP_TUPLE_EAT_2)(115, s) MITK_PP_IF(p(115, s), MITK_PP_FOR_115, MITK_PP_TUPLE_EAT_4)(o(115, s), p, o, m) +# define MITK_PP_FOR_115_I(s, p, o, m) MITK_PP_IF(p(116, s), m, MITK_PP_TUPLE_EAT_2)(116, s) MITK_PP_IF(p(116, s), MITK_PP_FOR_116, MITK_PP_TUPLE_EAT_4)(o(116, s), p, o, m) +# define MITK_PP_FOR_116_I(s, p, o, m) MITK_PP_IF(p(117, s), m, MITK_PP_TUPLE_EAT_2)(117, s) MITK_PP_IF(p(117, s), MITK_PP_FOR_117, MITK_PP_TUPLE_EAT_4)(o(117, s), p, o, m) +# define MITK_PP_FOR_117_I(s, p, o, m) MITK_PP_IF(p(118, s), m, MITK_PP_TUPLE_EAT_2)(118, s) MITK_PP_IF(p(118, s), MITK_PP_FOR_118, MITK_PP_TUPLE_EAT_4)(o(118, s), p, o, m) +# define MITK_PP_FOR_118_I(s, p, o, m) MITK_PP_IF(p(119, s), m, MITK_PP_TUPLE_EAT_2)(119, s) MITK_PP_IF(p(119, s), MITK_PP_FOR_119, MITK_PP_TUPLE_EAT_4)(o(119, s), p, o, m) +# define MITK_PP_FOR_119_I(s, p, o, m) MITK_PP_IF(p(120, s), m, MITK_PP_TUPLE_EAT_2)(120, s) MITK_PP_IF(p(120, s), MITK_PP_FOR_120, MITK_PP_TUPLE_EAT_4)(o(120, s), p, o, m) +# define MITK_PP_FOR_120_I(s, p, o, m) MITK_PP_IF(p(121, s), m, MITK_PP_TUPLE_EAT_2)(121, s) MITK_PP_IF(p(121, s), MITK_PP_FOR_121, MITK_PP_TUPLE_EAT_4)(o(121, s), p, o, m) +# define MITK_PP_FOR_121_I(s, p, o, m) MITK_PP_IF(p(122, s), m, MITK_PP_TUPLE_EAT_2)(122, s) MITK_PP_IF(p(122, s), MITK_PP_FOR_122, MITK_PP_TUPLE_EAT_4)(o(122, s), p, o, m) +# define MITK_PP_FOR_122_I(s, p, o, m) MITK_PP_IF(p(123, s), m, MITK_PP_TUPLE_EAT_2)(123, s) MITK_PP_IF(p(123, s), MITK_PP_FOR_123, MITK_PP_TUPLE_EAT_4)(o(123, s), p, o, m) +# define MITK_PP_FOR_123_I(s, p, o, m) MITK_PP_IF(p(124, s), m, MITK_PP_TUPLE_EAT_2)(124, s) MITK_PP_IF(p(124, s), MITK_PP_FOR_124, MITK_PP_TUPLE_EAT_4)(o(124, s), p, o, m) +# define MITK_PP_FOR_124_I(s, p, o, m) MITK_PP_IF(p(125, s), m, MITK_PP_TUPLE_EAT_2)(125, s) MITK_PP_IF(p(125, s), MITK_PP_FOR_125, MITK_PP_TUPLE_EAT_4)(o(125, s), p, o, m) +# define MITK_PP_FOR_125_I(s, p, o, m) MITK_PP_IF(p(126, s), m, MITK_PP_TUPLE_EAT_2)(126, s) MITK_PP_IF(p(126, s), MITK_PP_FOR_126, MITK_PP_TUPLE_EAT_4)(o(126, s), p, o, m) +# define MITK_PP_FOR_126_I(s, p, o, m) MITK_PP_IF(p(127, s), m, MITK_PP_TUPLE_EAT_2)(127, s) MITK_PP_IF(p(127, s), MITK_PP_FOR_127, MITK_PP_TUPLE_EAT_4)(o(127, s), p, o, m) +# define MITK_PP_FOR_127_I(s, p, o, m) MITK_PP_IF(p(128, s), m, MITK_PP_TUPLE_EAT_2)(128, s) MITK_PP_IF(p(128, s), MITK_PP_FOR_128, MITK_PP_TUPLE_EAT_4)(o(128, s), p, o, m) +# define MITK_PP_FOR_128_I(s, p, o, m) MITK_PP_IF(p(129, s), m, MITK_PP_TUPLE_EAT_2)(129, s) MITK_PP_IF(p(129, s), MITK_PP_FOR_129, MITK_PP_TUPLE_EAT_4)(o(129, s), p, o, m) +# define MITK_PP_FOR_129_I(s, p, o, m) MITK_PP_IF(p(130, s), m, MITK_PP_TUPLE_EAT_2)(130, s) MITK_PP_IF(p(130, s), MITK_PP_FOR_130, MITK_PP_TUPLE_EAT_4)(o(130, s), p, o, m) +# define MITK_PP_FOR_130_I(s, p, o, m) MITK_PP_IF(p(131, s), m, MITK_PP_TUPLE_EAT_2)(131, s) MITK_PP_IF(p(131, s), MITK_PP_FOR_131, MITK_PP_TUPLE_EAT_4)(o(131, s), p, o, m) +# define MITK_PP_FOR_131_I(s, p, o, m) MITK_PP_IF(p(132, s), m, MITK_PP_TUPLE_EAT_2)(132, s) MITK_PP_IF(p(132, s), MITK_PP_FOR_132, MITK_PP_TUPLE_EAT_4)(o(132, s), p, o, m) +# define MITK_PP_FOR_132_I(s, p, o, m) MITK_PP_IF(p(133, s), m, MITK_PP_TUPLE_EAT_2)(133, s) MITK_PP_IF(p(133, s), MITK_PP_FOR_133, MITK_PP_TUPLE_EAT_4)(o(133, s), p, o, m) +# define MITK_PP_FOR_133_I(s, p, o, m) MITK_PP_IF(p(134, s), m, MITK_PP_TUPLE_EAT_2)(134, s) MITK_PP_IF(p(134, s), MITK_PP_FOR_134, MITK_PP_TUPLE_EAT_4)(o(134, s), p, o, m) +# define MITK_PP_FOR_134_I(s, p, o, m) MITK_PP_IF(p(135, s), m, MITK_PP_TUPLE_EAT_2)(135, s) MITK_PP_IF(p(135, s), MITK_PP_FOR_135, MITK_PP_TUPLE_EAT_4)(o(135, s), p, o, m) +# define MITK_PP_FOR_135_I(s, p, o, m) MITK_PP_IF(p(136, s), m, MITK_PP_TUPLE_EAT_2)(136, s) MITK_PP_IF(p(136, s), MITK_PP_FOR_136, MITK_PP_TUPLE_EAT_4)(o(136, s), p, o, m) +# define MITK_PP_FOR_136_I(s, p, o, m) MITK_PP_IF(p(137, s), m, MITK_PP_TUPLE_EAT_2)(137, s) MITK_PP_IF(p(137, s), MITK_PP_FOR_137, MITK_PP_TUPLE_EAT_4)(o(137, s), p, o, m) +# define MITK_PP_FOR_137_I(s, p, o, m) MITK_PP_IF(p(138, s), m, MITK_PP_TUPLE_EAT_2)(138, s) MITK_PP_IF(p(138, s), MITK_PP_FOR_138, MITK_PP_TUPLE_EAT_4)(o(138, s), p, o, m) +# define MITK_PP_FOR_138_I(s, p, o, m) MITK_PP_IF(p(139, s), m, MITK_PP_TUPLE_EAT_2)(139, s) MITK_PP_IF(p(139, s), MITK_PP_FOR_139, MITK_PP_TUPLE_EAT_4)(o(139, s), p, o, m) +# define MITK_PP_FOR_139_I(s, p, o, m) MITK_PP_IF(p(140, s), m, MITK_PP_TUPLE_EAT_2)(140, s) MITK_PP_IF(p(140, s), MITK_PP_FOR_140, MITK_PP_TUPLE_EAT_4)(o(140, s), p, o, m) +# define MITK_PP_FOR_140_I(s, p, o, m) MITK_PP_IF(p(141, s), m, MITK_PP_TUPLE_EAT_2)(141, s) MITK_PP_IF(p(141, s), MITK_PP_FOR_141, MITK_PP_TUPLE_EAT_4)(o(141, s), p, o, m) +# define MITK_PP_FOR_141_I(s, p, o, m) MITK_PP_IF(p(142, s), m, MITK_PP_TUPLE_EAT_2)(142, s) MITK_PP_IF(p(142, s), MITK_PP_FOR_142, MITK_PP_TUPLE_EAT_4)(o(142, s), p, o, m) +# define MITK_PP_FOR_142_I(s, p, o, m) MITK_PP_IF(p(143, s), m, MITK_PP_TUPLE_EAT_2)(143, s) MITK_PP_IF(p(143, s), MITK_PP_FOR_143, MITK_PP_TUPLE_EAT_4)(o(143, s), p, o, m) +# define MITK_PP_FOR_143_I(s, p, o, m) MITK_PP_IF(p(144, s), m, MITK_PP_TUPLE_EAT_2)(144, s) MITK_PP_IF(p(144, s), MITK_PP_FOR_144, MITK_PP_TUPLE_EAT_4)(o(144, s), p, o, m) +# define MITK_PP_FOR_144_I(s, p, o, m) MITK_PP_IF(p(145, s), m, MITK_PP_TUPLE_EAT_2)(145, s) MITK_PP_IF(p(145, s), MITK_PP_FOR_145, MITK_PP_TUPLE_EAT_4)(o(145, s), p, o, m) +# define MITK_PP_FOR_145_I(s, p, o, m) MITK_PP_IF(p(146, s), m, MITK_PP_TUPLE_EAT_2)(146, s) MITK_PP_IF(p(146, s), MITK_PP_FOR_146, MITK_PP_TUPLE_EAT_4)(o(146, s), p, o, m) +# define MITK_PP_FOR_146_I(s, p, o, m) MITK_PP_IF(p(147, s), m, MITK_PP_TUPLE_EAT_2)(147, s) MITK_PP_IF(p(147, s), MITK_PP_FOR_147, MITK_PP_TUPLE_EAT_4)(o(147, s), p, o, m) +# define MITK_PP_FOR_147_I(s, p, o, m) MITK_PP_IF(p(148, s), m, MITK_PP_TUPLE_EAT_2)(148, s) MITK_PP_IF(p(148, s), MITK_PP_FOR_148, MITK_PP_TUPLE_EAT_4)(o(148, s), p, o, m) +# define MITK_PP_FOR_148_I(s, p, o, m) MITK_PP_IF(p(149, s), m, MITK_PP_TUPLE_EAT_2)(149, s) MITK_PP_IF(p(149, s), MITK_PP_FOR_149, MITK_PP_TUPLE_EAT_4)(o(149, s), p, o, m) +# define MITK_PP_FOR_149_I(s, p, o, m) MITK_PP_IF(p(150, s), m, MITK_PP_TUPLE_EAT_2)(150, s) MITK_PP_IF(p(150, s), MITK_PP_FOR_150, MITK_PP_TUPLE_EAT_4)(o(150, s), p, o, m) +# define MITK_PP_FOR_150_I(s, p, o, m) MITK_PP_IF(p(151, s), m, MITK_PP_TUPLE_EAT_2)(151, s) MITK_PP_IF(p(151, s), MITK_PP_FOR_151, MITK_PP_TUPLE_EAT_4)(o(151, s), p, o, m) +# define MITK_PP_FOR_151_I(s, p, o, m) MITK_PP_IF(p(152, s), m, MITK_PP_TUPLE_EAT_2)(152, s) MITK_PP_IF(p(152, s), MITK_PP_FOR_152, MITK_PP_TUPLE_EAT_4)(o(152, s), p, o, m) +# define MITK_PP_FOR_152_I(s, p, o, m) MITK_PP_IF(p(153, s), m, MITK_PP_TUPLE_EAT_2)(153, s) MITK_PP_IF(p(153, s), MITK_PP_FOR_153, MITK_PP_TUPLE_EAT_4)(o(153, s), p, o, m) +# define MITK_PP_FOR_153_I(s, p, o, m) MITK_PP_IF(p(154, s), m, MITK_PP_TUPLE_EAT_2)(154, s) MITK_PP_IF(p(154, s), MITK_PP_FOR_154, MITK_PP_TUPLE_EAT_4)(o(154, s), p, o, m) +# define MITK_PP_FOR_154_I(s, p, o, m) MITK_PP_IF(p(155, s), m, MITK_PP_TUPLE_EAT_2)(155, s) MITK_PP_IF(p(155, s), MITK_PP_FOR_155, MITK_PP_TUPLE_EAT_4)(o(155, s), p, o, m) +# define MITK_PP_FOR_155_I(s, p, o, m) MITK_PP_IF(p(156, s), m, MITK_PP_TUPLE_EAT_2)(156, s) MITK_PP_IF(p(156, s), MITK_PP_FOR_156, MITK_PP_TUPLE_EAT_4)(o(156, s), p, o, m) +# define MITK_PP_FOR_156_I(s, p, o, m) MITK_PP_IF(p(157, s), m, MITK_PP_TUPLE_EAT_2)(157, s) MITK_PP_IF(p(157, s), MITK_PP_FOR_157, MITK_PP_TUPLE_EAT_4)(o(157, s), p, o, m) +# define MITK_PP_FOR_157_I(s, p, o, m) MITK_PP_IF(p(158, s), m, MITK_PP_TUPLE_EAT_2)(158, s) MITK_PP_IF(p(158, s), MITK_PP_FOR_158, MITK_PP_TUPLE_EAT_4)(o(158, s), p, o, m) +# define MITK_PP_FOR_158_I(s, p, o, m) MITK_PP_IF(p(159, s), m, MITK_PP_TUPLE_EAT_2)(159, s) MITK_PP_IF(p(159, s), MITK_PP_FOR_159, MITK_PP_TUPLE_EAT_4)(o(159, s), p, o, m) +# define MITK_PP_FOR_159_I(s, p, o, m) MITK_PP_IF(p(160, s), m, MITK_PP_TUPLE_EAT_2)(160, s) MITK_PP_IF(p(160, s), MITK_PP_FOR_160, MITK_PP_TUPLE_EAT_4)(o(160, s), p, o, m) +# define MITK_PP_FOR_160_I(s, p, o, m) MITK_PP_IF(p(161, s), m, MITK_PP_TUPLE_EAT_2)(161, s) MITK_PP_IF(p(161, s), MITK_PP_FOR_161, MITK_PP_TUPLE_EAT_4)(o(161, s), p, o, m) +# define MITK_PP_FOR_161_I(s, p, o, m) MITK_PP_IF(p(162, s), m, MITK_PP_TUPLE_EAT_2)(162, s) MITK_PP_IF(p(162, s), MITK_PP_FOR_162, MITK_PP_TUPLE_EAT_4)(o(162, s), p, o, m) +# define MITK_PP_FOR_162_I(s, p, o, m) MITK_PP_IF(p(163, s), m, MITK_PP_TUPLE_EAT_2)(163, s) MITK_PP_IF(p(163, s), MITK_PP_FOR_163, MITK_PP_TUPLE_EAT_4)(o(163, s), p, o, m) +# define MITK_PP_FOR_163_I(s, p, o, m) MITK_PP_IF(p(164, s), m, MITK_PP_TUPLE_EAT_2)(164, s) MITK_PP_IF(p(164, s), MITK_PP_FOR_164, MITK_PP_TUPLE_EAT_4)(o(164, s), p, o, m) +# define MITK_PP_FOR_164_I(s, p, o, m) MITK_PP_IF(p(165, s), m, MITK_PP_TUPLE_EAT_2)(165, s) MITK_PP_IF(p(165, s), MITK_PP_FOR_165, MITK_PP_TUPLE_EAT_4)(o(165, s), p, o, m) +# define MITK_PP_FOR_165_I(s, p, o, m) MITK_PP_IF(p(166, s), m, MITK_PP_TUPLE_EAT_2)(166, s) MITK_PP_IF(p(166, s), MITK_PP_FOR_166, MITK_PP_TUPLE_EAT_4)(o(166, s), p, o, m) +# define MITK_PP_FOR_166_I(s, p, o, m) MITK_PP_IF(p(167, s), m, MITK_PP_TUPLE_EAT_2)(167, s) MITK_PP_IF(p(167, s), MITK_PP_FOR_167, MITK_PP_TUPLE_EAT_4)(o(167, s), p, o, m) +# define MITK_PP_FOR_167_I(s, p, o, m) MITK_PP_IF(p(168, s), m, MITK_PP_TUPLE_EAT_2)(168, s) MITK_PP_IF(p(168, s), MITK_PP_FOR_168, MITK_PP_TUPLE_EAT_4)(o(168, s), p, o, m) +# define MITK_PP_FOR_168_I(s, p, o, m) MITK_PP_IF(p(169, s), m, MITK_PP_TUPLE_EAT_2)(169, s) MITK_PP_IF(p(169, s), MITK_PP_FOR_169, MITK_PP_TUPLE_EAT_4)(o(169, s), p, o, m) +# define MITK_PP_FOR_169_I(s, p, o, m) MITK_PP_IF(p(170, s), m, MITK_PP_TUPLE_EAT_2)(170, s) MITK_PP_IF(p(170, s), MITK_PP_FOR_170, MITK_PP_TUPLE_EAT_4)(o(170, s), p, o, m) +# define MITK_PP_FOR_170_I(s, p, o, m) MITK_PP_IF(p(171, s), m, MITK_PP_TUPLE_EAT_2)(171, s) MITK_PP_IF(p(171, s), MITK_PP_FOR_171, MITK_PP_TUPLE_EAT_4)(o(171, s), p, o, m) +# define MITK_PP_FOR_171_I(s, p, o, m) MITK_PP_IF(p(172, s), m, MITK_PP_TUPLE_EAT_2)(172, s) MITK_PP_IF(p(172, s), MITK_PP_FOR_172, MITK_PP_TUPLE_EAT_4)(o(172, s), p, o, m) +# define MITK_PP_FOR_172_I(s, p, o, m) MITK_PP_IF(p(173, s), m, MITK_PP_TUPLE_EAT_2)(173, s) MITK_PP_IF(p(173, s), MITK_PP_FOR_173, MITK_PP_TUPLE_EAT_4)(o(173, s), p, o, m) +# define MITK_PP_FOR_173_I(s, p, o, m) MITK_PP_IF(p(174, s), m, MITK_PP_TUPLE_EAT_2)(174, s) MITK_PP_IF(p(174, s), MITK_PP_FOR_174, MITK_PP_TUPLE_EAT_4)(o(174, s), p, o, m) +# define MITK_PP_FOR_174_I(s, p, o, m) MITK_PP_IF(p(175, s), m, MITK_PP_TUPLE_EAT_2)(175, s) MITK_PP_IF(p(175, s), MITK_PP_FOR_175, MITK_PP_TUPLE_EAT_4)(o(175, s), p, o, m) +# define MITK_PP_FOR_175_I(s, p, o, m) MITK_PP_IF(p(176, s), m, MITK_PP_TUPLE_EAT_2)(176, s) MITK_PP_IF(p(176, s), MITK_PP_FOR_176, MITK_PP_TUPLE_EAT_4)(o(176, s), p, o, m) +# define MITK_PP_FOR_176_I(s, p, o, m) MITK_PP_IF(p(177, s), m, MITK_PP_TUPLE_EAT_2)(177, s) MITK_PP_IF(p(177, s), MITK_PP_FOR_177, MITK_PP_TUPLE_EAT_4)(o(177, s), p, o, m) +# define MITK_PP_FOR_177_I(s, p, o, m) MITK_PP_IF(p(178, s), m, MITK_PP_TUPLE_EAT_2)(178, s) MITK_PP_IF(p(178, s), MITK_PP_FOR_178, MITK_PP_TUPLE_EAT_4)(o(178, s), p, o, m) +# define MITK_PP_FOR_178_I(s, p, o, m) MITK_PP_IF(p(179, s), m, MITK_PP_TUPLE_EAT_2)(179, s) MITK_PP_IF(p(179, s), MITK_PP_FOR_179, MITK_PP_TUPLE_EAT_4)(o(179, s), p, o, m) +# define MITK_PP_FOR_179_I(s, p, o, m) MITK_PP_IF(p(180, s), m, MITK_PP_TUPLE_EAT_2)(180, s) MITK_PP_IF(p(180, s), MITK_PP_FOR_180, MITK_PP_TUPLE_EAT_4)(o(180, s), p, o, m) +# define MITK_PP_FOR_180_I(s, p, o, m) MITK_PP_IF(p(181, s), m, MITK_PP_TUPLE_EAT_2)(181, s) MITK_PP_IF(p(181, s), MITK_PP_FOR_181, MITK_PP_TUPLE_EAT_4)(o(181, s), p, o, m) +# define MITK_PP_FOR_181_I(s, p, o, m) MITK_PP_IF(p(182, s), m, MITK_PP_TUPLE_EAT_2)(182, s) MITK_PP_IF(p(182, s), MITK_PP_FOR_182, MITK_PP_TUPLE_EAT_4)(o(182, s), p, o, m) +# define MITK_PP_FOR_182_I(s, p, o, m) MITK_PP_IF(p(183, s), m, MITK_PP_TUPLE_EAT_2)(183, s) MITK_PP_IF(p(183, s), MITK_PP_FOR_183, MITK_PP_TUPLE_EAT_4)(o(183, s), p, o, m) +# define MITK_PP_FOR_183_I(s, p, o, m) MITK_PP_IF(p(184, s), m, MITK_PP_TUPLE_EAT_2)(184, s) MITK_PP_IF(p(184, s), MITK_PP_FOR_184, MITK_PP_TUPLE_EAT_4)(o(184, s), p, o, m) +# define MITK_PP_FOR_184_I(s, p, o, m) MITK_PP_IF(p(185, s), m, MITK_PP_TUPLE_EAT_2)(185, s) MITK_PP_IF(p(185, s), MITK_PP_FOR_185, MITK_PP_TUPLE_EAT_4)(o(185, s), p, o, m) +# define MITK_PP_FOR_185_I(s, p, o, m) MITK_PP_IF(p(186, s), m, MITK_PP_TUPLE_EAT_2)(186, s) MITK_PP_IF(p(186, s), MITK_PP_FOR_186, MITK_PP_TUPLE_EAT_4)(o(186, s), p, o, m) +# define MITK_PP_FOR_186_I(s, p, o, m) MITK_PP_IF(p(187, s), m, MITK_PP_TUPLE_EAT_2)(187, s) MITK_PP_IF(p(187, s), MITK_PP_FOR_187, MITK_PP_TUPLE_EAT_4)(o(187, s), p, o, m) +# define MITK_PP_FOR_187_I(s, p, o, m) MITK_PP_IF(p(188, s), m, MITK_PP_TUPLE_EAT_2)(188, s) MITK_PP_IF(p(188, s), MITK_PP_FOR_188, MITK_PP_TUPLE_EAT_4)(o(188, s), p, o, m) +# define MITK_PP_FOR_188_I(s, p, o, m) MITK_PP_IF(p(189, s), m, MITK_PP_TUPLE_EAT_2)(189, s) MITK_PP_IF(p(189, s), MITK_PP_FOR_189, MITK_PP_TUPLE_EAT_4)(o(189, s), p, o, m) +# define MITK_PP_FOR_189_I(s, p, o, m) MITK_PP_IF(p(190, s), m, MITK_PP_TUPLE_EAT_2)(190, s) MITK_PP_IF(p(190, s), MITK_PP_FOR_190, MITK_PP_TUPLE_EAT_4)(o(190, s), p, o, m) +# define MITK_PP_FOR_190_I(s, p, o, m) MITK_PP_IF(p(191, s), m, MITK_PP_TUPLE_EAT_2)(191, s) MITK_PP_IF(p(191, s), MITK_PP_FOR_191, MITK_PP_TUPLE_EAT_4)(o(191, s), p, o, m) +# define MITK_PP_FOR_191_I(s, p, o, m) MITK_PP_IF(p(192, s), m, MITK_PP_TUPLE_EAT_2)(192, s) MITK_PP_IF(p(192, s), MITK_PP_FOR_192, MITK_PP_TUPLE_EAT_4)(o(192, s), p, o, m) +# define MITK_PP_FOR_192_I(s, p, o, m) MITK_PP_IF(p(193, s), m, MITK_PP_TUPLE_EAT_2)(193, s) MITK_PP_IF(p(193, s), MITK_PP_FOR_193, MITK_PP_TUPLE_EAT_4)(o(193, s), p, o, m) +# define MITK_PP_FOR_193_I(s, p, o, m) MITK_PP_IF(p(194, s), m, MITK_PP_TUPLE_EAT_2)(194, s) MITK_PP_IF(p(194, s), MITK_PP_FOR_194, MITK_PP_TUPLE_EAT_4)(o(194, s), p, o, m) +# define MITK_PP_FOR_194_I(s, p, o, m) MITK_PP_IF(p(195, s), m, MITK_PP_TUPLE_EAT_2)(195, s) MITK_PP_IF(p(195, s), MITK_PP_FOR_195, MITK_PP_TUPLE_EAT_4)(o(195, s), p, o, m) +# define MITK_PP_FOR_195_I(s, p, o, m) MITK_PP_IF(p(196, s), m, MITK_PP_TUPLE_EAT_2)(196, s) MITK_PP_IF(p(196, s), MITK_PP_FOR_196, MITK_PP_TUPLE_EAT_4)(o(196, s), p, o, m) +# define MITK_PP_FOR_196_I(s, p, o, m) MITK_PP_IF(p(197, s), m, MITK_PP_TUPLE_EAT_2)(197, s) MITK_PP_IF(p(197, s), MITK_PP_FOR_197, MITK_PP_TUPLE_EAT_4)(o(197, s), p, o, m) +# define MITK_PP_FOR_197_I(s, p, o, m) MITK_PP_IF(p(198, s), m, MITK_PP_TUPLE_EAT_2)(198, s) MITK_PP_IF(p(198, s), MITK_PP_FOR_198, MITK_PP_TUPLE_EAT_4)(o(198, s), p, o, m) +# define MITK_PP_FOR_198_I(s, p, o, m) MITK_PP_IF(p(199, s), m, MITK_PP_TUPLE_EAT_2)(199, s) MITK_PP_IF(p(199, s), MITK_PP_FOR_199, MITK_PP_TUPLE_EAT_4)(o(199, s), p, o, m) +# define MITK_PP_FOR_199_I(s, p, o, m) MITK_PP_IF(p(200, s), m, MITK_PP_TUPLE_EAT_2)(200, s) MITK_PP_IF(p(200, s), MITK_PP_FOR_200, MITK_PP_TUPLE_EAT_4)(o(200, s), p, o, m) +# define MITK_PP_FOR_200_I(s, p, o, m) MITK_PP_IF(p(201, s), m, MITK_PP_TUPLE_EAT_2)(201, s) MITK_PP_IF(p(201, s), MITK_PP_FOR_201, MITK_PP_TUPLE_EAT_4)(o(201, s), p, o, m) +# define MITK_PP_FOR_201_I(s, p, o, m) MITK_PP_IF(p(202, s), m, MITK_PP_TUPLE_EAT_2)(202, s) MITK_PP_IF(p(202, s), MITK_PP_FOR_202, MITK_PP_TUPLE_EAT_4)(o(202, s), p, o, m) +# define MITK_PP_FOR_202_I(s, p, o, m) MITK_PP_IF(p(203, s), m, MITK_PP_TUPLE_EAT_2)(203, s) MITK_PP_IF(p(203, s), MITK_PP_FOR_203, MITK_PP_TUPLE_EAT_4)(o(203, s), p, o, m) +# define MITK_PP_FOR_203_I(s, p, o, m) MITK_PP_IF(p(204, s), m, MITK_PP_TUPLE_EAT_2)(204, s) MITK_PP_IF(p(204, s), MITK_PP_FOR_204, MITK_PP_TUPLE_EAT_4)(o(204, s), p, o, m) +# define MITK_PP_FOR_204_I(s, p, o, m) MITK_PP_IF(p(205, s), m, MITK_PP_TUPLE_EAT_2)(205, s) MITK_PP_IF(p(205, s), MITK_PP_FOR_205, MITK_PP_TUPLE_EAT_4)(o(205, s), p, o, m) +# define MITK_PP_FOR_205_I(s, p, o, m) MITK_PP_IF(p(206, s), m, MITK_PP_TUPLE_EAT_2)(206, s) MITK_PP_IF(p(206, s), MITK_PP_FOR_206, MITK_PP_TUPLE_EAT_4)(o(206, s), p, o, m) +# define MITK_PP_FOR_206_I(s, p, o, m) MITK_PP_IF(p(207, s), m, MITK_PP_TUPLE_EAT_2)(207, s) MITK_PP_IF(p(207, s), MITK_PP_FOR_207, MITK_PP_TUPLE_EAT_4)(o(207, s), p, o, m) +# define MITK_PP_FOR_207_I(s, p, o, m) MITK_PP_IF(p(208, s), m, MITK_PP_TUPLE_EAT_2)(208, s) MITK_PP_IF(p(208, s), MITK_PP_FOR_208, MITK_PP_TUPLE_EAT_4)(o(208, s), p, o, m) +# define MITK_PP_FOR_208_I(s, p, o, m) MITK_PP_IF(p(209, s), m, MITK_PP_TUPLE_EAT_2)(209, s) MITK_PP_IF(p(209, s), MITK_PP_FOR_209, MITK_PP_TUPLE_EAT_4)(o(209, s), p, o, m) +# define MITK_PP_FOR_209_I(s, p, o, m) MITK_PP_IF(p(210, s), m, MITK_PP_TUPLE_EAT_2)(210, s) MITK_PP_IF(p(210, s), MITK_PP_FOR_210, MITK_PP_TUPLE_EAT_4)(o(210, s), p, o, m) +# define MITK_PP_FOR_210_I(s, p, o, m) MITK_PP_IF(p(211, s), m, MITK_PP_TUPLE_EAT_2)(211, s) MITK_PP_IF(p(211, s), MITK_PP_FOR_211, MITK_PP_TUPLE_EAT_4)(o(211, s), p, o, m) +# define MITK_PP_FOR_211_I(s, p, o, m) MITK_PP_IF(p(212, s), m, MITK_PP_TUPLE_EAT_2)(212, s) MITK_PP_IF(p(212, s), MITK_PP_FOR_212, MITK_PP_TUPLE_EAT_4)(o(212, s), p, o, m) +# define MITK_PP_FOR_212_I(s, p, o, m) MITK_PP_IF(p(213, s), m, MITK_PP_TUPLE_EAT_2)(213, s) MITK_PP_IF(p(213, s), MITK_PP_FOR_213, MITK_PP_TUPLE_EAT_4)(o(213, s), p, o, m) +# define MITK_PP_FOR_213_I(s, p, o, m) MITK_PP_IF(p(214, s), m, MITK_PP_TUPLE_EAT_2)(214, s) MITK_PP_IF(p(214, s), MITK_PP_FOR_214, MITK_PP_TUPLE_EAT_4)(o(214, s), p, o, m) +# define MITK_PP_FOR_214_I(s, p, o, m) MITK_PP_IF(p(215, s), m, MITK_PP_TUPLE_EAT_2)(215, s) MITK_PP_IF(p(215, s), MITK_PP_FOR_215, MITK_PP_TUPLE_EAT_4)(o(215, s), p, o, m) +# define MITK_PP_FOR_215_I(s, p, o, m) MITK_PP_IF(p(216, s), m, MITK_PP_TUPLE_EAT_2)(216, s) MITK_PP_IF(p(216, s), MITK_PP_FOR_216, MITK_PP_TUPLE_EAT_4)(o(216, s), p, o, m) +# define MITK_PP_FOR_216_I(s, p, o, m) MITK_PP_IF(p(217, s), m, MITK_PP_TUPLE_EAT_2)(217, s) MITK_PP_IF(p(217, s), MITK_PP_FOR_217, MITK_PP_TUPLE_EAT_4)(o(217, s), p, o, m) +# define MITK_PP_FOR_217_I(s, p, o, m) MITK_PP_IF(p(218, s), m, MITK_PP_TUPLE_EAT_2)(218, s) MITK_PP_IF(p(218, s), MITK_PP_FOR_218, MITK_PP_TUPLE_EAT_4)(o(218, s), p, o, m) +# define MITK_PP_FOR_218_I(s, p, o, m) MITK_PP_IF(p(219, s), m, MITK_PP_TUPLE_EAT_2)(219, s) MITK_PP_IF(p(219, s), MITK_PP_FOR_219, MITK_PP_TUPLE_EAT_4)(o(219, s), p, o, m) +# define MITK_PP_FOR_219_I(s, p, o, m) MITK_PP_IF(p(220, s), m, MITK_PP_TUPLE_EAT_2)(220, s) MITK_PP_IF(p(220, s), MITK_PP_FOR_220, MITK_PP_TUPLE_EAT_4)(o(220, s), p, o, m) +# define MITK_PP_FOR_220_I(s, p, o, m) MITK_PP_IF(p(221, s), m, MITK_PP_TUPLE_EAT_2)(221, s) MITK_PP_IF(p(221, s), MITK_PP_FOR_221, MITK_PP_TUPLE_EAT_4)(o(221, s), p, o, m) +# define MITK_PP_FOR_221_I(s, p, o, m) MITK_PP_IF(p(222, s), m, MITK_PP_TUPLE_EAT_2)(222, s) MITK_PP_IF(p(222, s), MITK_PP_FOR_222, MITK_PP_TUPLE_EAT_4)(o(222, s), p, o, m) +# define MITK_PP_FOR_222_I(s, p, o, m) MITK_PP_IF(p(223, s), m, MITK_PP_TUPLE_EAT_2)(223, s) MITK_PP_IF(p(223, s), MITK_PP_FOR_223, MITK_PP_TUPLE_EAT_4)(o(223, s), p, o, m) +# define MITK_PP_FOR_223_I(s, p, o, m) MITK_PP_IF(p(224, s), m, MITK_PP_TUPLE_EAT_2)(224, s) MITK_PP_IF(p(224, s), MITK_PP_FOR_224, MITK_PP_TUPLE_EAT_4)(o(224, s), p, o, m) +# define MITK_PP_FOR_224_I(s, p, o, m) MITK_PP_IF(p(225, s), m, MITK_PP_TUPLE_EAT_2)(225, s) MITK_PP_IF(p(225, s), MITK_PP_FOR_225, MITK_PP_TUPLE_EAT_4)(o(225, s), p, o, m) +# define MITK_PP_FOR_225_I(s, p, o, m) MITK_PP_IF(p(226, s), m, MITK_PP_TUPLE_EAT_2)(226, s) MITK_PP_IF(p(226, s), MITK_PP_FOR_226, MITK_PP_TUPLE_EAT_4)(o(226, s), p, o, m) +# define MITK_PP_FOR_226_I(s, p, o, m) MITK_PP_IF(p(227, s), m, MITK_PP_TUPLE_EAT_2)(227, s) MITK_PP_IF(p(227, s), MITK_PP_FOR_227, MITK_PP_TUPLE_EAT_4)(o(227, s), p, o, m) +# define MITK_PP_FOR_227_I(s, p, o, m) MITK_PP_IF(p(228, s), m, MITK_PP_TUPLE_EAT_2)(228, s) MITK_PP_IF(p(228, s), MITK_PP_FOR_228, MITK_PP_TUPLE_EAT_4)(o(228, s), p, o, m) +# define MITK_PP_FOR_228_I(s, p, o, m) MITK_PP_IF(p(229, s), m, MITK_PP_TUPLE_EAT_2)(229, s) MITK_PP_IF(p(229, s), MITK_PP_FOR_229, MITK_PP_TUPLE_EAT_4)(o(229, s), p, o, m) +# define MITK_PP_FOR_229_I(s, p, o, m) MITK_PP_IF(p(230, s), m, MITK_PP_TUPLE_EAT_2)(230, s) MITK_PP_IF(p(230, s), MITK_PP_FOR_230, MITK_PP_TUPLE_EAT_4)(o(230, s), p, o, m) +# define MITK_PP_FOR_230_I(s, p, o, m) MITK_PP_IF(p(231, s), m, MITK_PP_TUPLE_EAT_2)(231, s) MITK_PP_IF(p(231, s), MITK_PP_FOR_231, MITK_PP_TUPLE_EAT_4)(o(231, s), p, o, m) +# define MITK_PP_FOR_231_I(s, p, o, m) MITK_PP_IF(p(232, s), m, MITK_PP_TUPLE_EAT_2)(232, s) MITK_PP_IF(p(232, s), MITK_PP_FOR_232, MITK_PP_TUPLE_EAT_4)(o(232, s), p, o, m) +# define MITK_PP_FOR_232_I(s, p, o, m) MITK_PP_IF(p(233, s), m, MITK_PP_TUPLE_EAT_2)(233, s) MITK_PP_IF(p(233, s), MITK_PP_FOR_233, MITK_PP_TUPLE_EAT_4)(o(233, s), p, o, m) +# define MITK_PP_FOR_233_I(s, p, o, m) MITK_PP_IF(p(234, s), m, MITK_PP_TUPLE_EAT_2)(234, s) MITK_PP_IF(p(234, s), MITK_PP_FOR_234, MITK_PP_TUPLE_EAT_4)(o(234, s), p, o, m) +# define MITK_PP_FOR_234_I(s, p, o, m) MITK_PP_IF(p(235, s), m, MITK_PP_TUPLE_EAT_2)(235, s) MITK_PP_IF(p(235, s), MITK_PP_FOR_235, MITK_PP_TUPLE_EAT_4)(o(235, s), p, o, m) +# define MITK_PP_FOR_235_I(s, p, o, m) MITK_PP_IF(p(236, s), m, MITK_PP_TUPLE_EAT_2)(236, s) MITK_PP_IF(p(236, s), MITK_PP_FOR_236, MITK_PP_TUPLE_EAT_4)(o(236, s), p, o, m) +# define MITK_PP_FOR_236_I(s, p, o, m) MITK_PP_IF(p(237, s), m, MITK_PP_TUPLE_EAT_2)(237, s) MITK_PP_IF(p(237, s), MITK_PP_FOR_237, MITK_PP_TUPLE_EAT_4)(o(237, s), p, o, m) +# define MITK_PP_FOR_237_I(s, p, o, m) MITK_PP_IF(p(238, s), m, MITK_PP_TUPLE_EAT_2)(238, s) MITK_PP_IF(p(238, s), MITK_PP_FOR_238, MITK_PP_TUPLE_EAT_4)(o(238, s), p, o, m) +# define MITK_PP_FOR_238_I(s, p, o, m) MITK_PP_IF(p(239, s), m, MITK_PP_TUPLE_EAT_2)(239, s) MITK_PP_IF(p(239, s), MITK_PP_FOR_239, MITK_PP_TUPLE_EAT_4)(o(239, s), p, o, m) +# define MITK_PP_FOR_239_I(s, p, o, m) MITK_PP_IF(p(240, s), m, MITK_PP_TUPLE_EAT_2)(240, s) MITK_PP_IF(p(240, s), MITK_PP_FOR_240, MITK_PP_TUPLE_EAT_4)(o(240, s), p, o, m) +# define MITK_PP_FOR_240_I(s, p, o, m) MITK_PP_IF(p(241, s), m, MITK_PP_TUPLE_EAT_2)(241, s) MITK_PP_IF(p(241, s), MITK_PP_FOR_241, MITK_PP_TUPLE_EAT_4)(o(241, s), p, o, m) +# define MITK_PP_FOR_241_I(s, p, o, m) MITK_PP_IF(p(242, s), m, MITK_PP_TUPLE_EAT_2)(242, s) MITK_PP_IF(p(242, s), MITK_PP_FOR_242, MITK_PP_TUPLE_EAT_4)(o(242, s), p, o, m) +# define MITK_PP_FOR_242_I(s, p, o, m) MITK_PP_IF(p(243, s), m, MITK_PP_TUPLE_EAT_2)(243, s) MITK_PP_IF(p(243, s), MITK_PP_FOR_243, MITK_PP_TUPLE_EAT_4)(o(243, s), p, o, m) +# define MITK_PP_FOR_243_I(s, p, o, m) MITK_PP_IF(p(244, s), m, MITK_PP_TUPLE_EAT_2)(244, s) MITK_PP_IF(p(244, s), MITK_PP_FOR_244, MITK_PP_TUPLE_EAT_4)(o(244, s), p, o, m) +# define MITK_PP_FOR_244_I(s, p, o, m) MITK_PP_IF(p(245, s), m, MITK_PP_TUPLE_EAT_2)(245, s) MITK_PP_IF(p(245, s), MITK_PP_FOR_245, MITK_PP_TUPLE_EAT_4)(o(245, s), p, o, m) +# define MITK_PP_FOR_245_I(s, p, o, m) MITK_PP_IF(p(246, s), m, MITK_PP_TUPLE_EAT_2)(246, s) MITK_PP_IF(p(246, s), MITK_PP_FOR_246, MITK_PP_TUPLE_EAT_4)(o(246, s), p, o, m) +# define MITK_PP_FOR_246_I(s, p, o, m) MITK_PP_IF(p(247, s), m, MITK_PP_TUPLE_EAT_2)(247, s) MITK_PP_IF(p(247, s), MITK_PP_FOR_247, MITK_PP_TUPLE_EAT_4)(o(247, s), p, o, m) +# define MITK_PP_FOR_247_I(s, p, o, m) MITK_PP_IF(p(248, s), m, MITK_PP_TUPLE_EAT_2)(248, s) MITK_PP_IF(p(248, s), MITK_PP_FOR_248, MITK_PP_TUPLE_EAT_4)(o(248, s), p, o, m) +# define MITK_PP_FOR_248_I(s, p, o, m) MITK_PP_IF(p(249, s), m, MITK_PP_TUPLE_EAT_2)(249, s) MITK_PP_IF(p(249, s), MITK_PP_FOR_249, MITK_PP_TUPLE_EAT_4)(o(249, s), p, o, m) +# define MITK_PP_FOR_249_I(s, p, o, m) MITK_PP_IF(p(250, s), m, MITK_PP_TUPLE_EAT_2)(250, s) MITK_PP_IF(p(250, s), MITK_PP_FOR_250, MITK_PP_TUPLE_EAT_4)(o(250, s), p, o, m) +# define MITK_PP_FOR_250_I(s, p, o, m) MITK_PP_IF(p(251, s), m, MITK_PP_TUPLE_EAT_2)(251, s) MITK_PP_IF(p(251, s), MITK_PP_FOR_251, MITK_PP_TUPLE_EAT_4)(o(251, s), p, o, m) +# define MITK_PP_FOR_251_I(s, p, o, m) MITK_PP_IF(p(252, s), m, MITK_PP_TUPLE_EAT_2)(252, s) MITK_PP_IF(p(252, s), MITK_PP_FOR_252, MITK_PP_TUPLE_EAT_4)(o(252, s), p, o, m) +# define MITK_PP_FOR_252_I(s, p, o, m) MITK_PP_IF(p(253, s), m, MITK_PP_TUPLE_EAT_2)(253, s) MITK_PP_IF(p(253, s), MITK_PP_FOR_253, MITK_PP_TUPLE_EAT_4)(o(253, s), p, o, m) +# define MITK_PP_FOR_253_I(s, p, o, m) MITK_PP_IF(p(254, s), m, MITK_PP_TUPLE_EAT_2)(254, s) MITK_PP_IF(p(254, s), MITK_PP_FOR_254, MITK_PP_TUPLE_EAT_4)(o(254, s), p, o, m) +# define MITK_PP_FOR_254_I(s, p, o, m) MITK_PP_IF(p(255, s), m, MITK_PP_TUPLE_EAT_2)(255, s) MITK_PP_IF(p(255, s), MITK_PP_FOR_255, MITK_PP_TUPLE_EAT_4)(o(255, s), p, o, m) +# define MITK_PP_FOR_255_I(s, p, o, m) MITK_PP_IF(p(256, s), m, MITK_PP_TUPLE_EAT_2)(256, s) MITK_PP_IF(p(256, s), MITK_PP_FOR_256, MITK_PP_TUPLE_EAT_4)(o(256, s), p, o, m) +# define MITK_PP_FOR_256_I(s, p, o, m) MITK_PP_IF(p(257, s), m, MITK_PP_TUPLE_EAT_2)(257, s) MITK_PP_IF(p(257, s), MITK_PP_FOR_257, MITK_PP_TUPLE_EAT_4)(o(257, s), p, o, m) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPRepetitionDetailFor.h b/Core/Code/Algorithms/mitkPPRepetitionDetailFor.h new file mode 100644 index 0000000000..e642ff7ffb --- /dev/null +++ b/Core/Code/Algorithms/mitkPPRepetitionDetailFor.h @@ -0,0 +1,536 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_REPETITION_DETAIL_FOR_HPP +# define MITK_PREPROCESSOR_REPETITION_DETAIL_FOR_HPP +# +# include "mitkPPControlExprIIf.h" +# include "mitkPPControlIIf.h" +# include "mitkPPLogicalBool.h" +# include "mitkPPTupleEat.h" +# +# define MITK_PP_FOR_1(s, p, o, m) MITK_PP_FOR_1_C(MITK_PP_BOOL(p(2, s)), s, p, o, m) +# define MITK_PP_FOR_2(s, p, o, m) MITK_PP_FOR_2_C(MITK_PP_BOOL(p(3, s)), s, p, o, m) +# define MITK_PP_FOR_3(s, p, o, m) MITK_PP_FOR_3_C(MITK_PP_BOOL(p(4, s)), s, p, o, m) +# define MITK_PP_FOR_4(s, p, o, m) MITK_PP_FOR_4_C(MITK_PP_BOOL(p(5, s)), s, p, o, m) +# define MITK_PP_FOR_5(s, p, o, m) MITK_PP_FOR_5_C(MITK_PP_BOOL(p(6, s)), s, p, o, m) +# define MITK_PP_FOR_6(s, p, o, m) MITK_PP_FOR_6_C(MITK_PP_BOOL(p(7, s)), s, p, o, m) +# define MITK_PP_FOR_7(s, p, o, m) MITK_PP_FOR_7_C(MITK_PP_BOOL(p(8, s)), s, p, o, m) +# define MITK_PP_FOR_8(s, p, o, m) MITK_PP_FOR_8_C(MITK_PP_BOOL(p(9, s)), s, p, o, m) +# define MITK_PP_FOR_9(s, p, o, m) MITK_PP_FOR_9_C(MITK_PP_BOOL(p(10, s)), s, p, o, m) +# define MITK_PP_FOR_10(s, p, o, m) MITK_PP_FOR_10_C(MITK_PP_BOOL(p(11, s)), s, p, o, m) +# define MITK_PP_FOR_11(s, p, o, m) MITK_PP_FOR_11_C(MITK_PP_BOOL(p(12, s)), s, p, o, m) +# define MITK_PP_FOR_12(s, p, o, m) MITK_PP_FOR_12_C(MITK_PP_BOOL(p(13, s)), s, p, o, m) +# define MITK_PP_FOR_13(s, p, o, m) MITK_PP_FOR_13_C(MITK_PP_BOOL(p(14, s)), s, p, o, m) +# define MITK_PP_FOR_14(s, p, o, m) MITK_PP_FOR_14_C(MITK_PP_BOOL(p(15, s)), s, p, o, m) +# define MITK_PP_FOR_15(s, p, o, m) MITK_PP_FOR_15_C(MITK_PP_BOOL(p(16, s)), s, p, o, m) +# define MITK_PP_FOR_16(s, p, o, m) MITK_PP_FOR_16_C(MITK_PP_BOOL(p(17, s)), s, p, o, m) +# define MITK_PP_FOR_17(s, p, o, m) MITK_PP_FOR_17_C(MITK_PP_BOOL(p(18, s)), s, p, o, m) +# define MITK_PP_FOR_18(s, p, o, m) MITK_PP_FOR_18_C(MITK_PP_BOOL(p(19, s)), s, p, o, m) +# define MITK_PP_FOR_19(s, p, o, m) MITK_PP_FOR_19_C(MITK_PP_BOOL(p(20, s)), s, p, o, m) +# define MITK_PP_FOR_20(s, p, o, m) MITK_PP_FOR_20_C(MITK_PP_BOOL(p(21, s)), s, p, o, m) +# define MITK_PP_FOR_21(s, p, o, m) MITK_PP_FOR_21_C(MITK_PP_BOOL(p(22, s)), s, p, o, m) +# define MITK_PP_FOR_22(s, p, o, m) MITK_PP_FOR_22_C(MITK_PP_BOOL(p(23, s)), s, p, o, m) +# define MITK_PP_FOR_23(s, p, o, m) MITK_PP_FOR_23_C(MITK_PP_BOOL(p(24, s)), s, p, o, m) +# define MITK_PP_FOR_24(s, p, o, m) MITK_PP_FOR_24_C(MITK_PP_BOOL(p(25, s)), s, p, o, m) +# define MITK_PP_FOR_25(s, p, o, m) MITK_PP_FOR_25_C(MITK_PP_BOOL(p(26, s)), s, p, o, m) +# define MITK_PP_FOR_26(s, p, o, m) MITK_PP_FOR_26_C(MITK_PP_BOOL(p(27, s)), s, p, o, m) +# define MITK_PP_FOR_27(s, p, o, m) MITK_PP_FOR_27_C(MITK_PP_BOOL(p(28, s)), s, p, o, m) +# define MITK_PP_FOR_28(s, p, o, m) MITK_PP_FOR_28_C(MITK_PP_BOOL(p(29, s)), s, p, o, m) +# define MITK_PP_FOR_29(s, p, o, m) MITK_PP_FOR_29_C(MITK_PP_BOOL(p(30, s)), s, p, o, m) +# define MITK_PP_FOR_30(s, p, o, m) MITK_PP_FOR_30_C(MITK_PP_BOOL(p(31, s)), s, p, o, m) +# define MITK_PP_FOR_31(s, p, o, m) MITK_PP_FOR_31_C(MITK_PP_BOOL(p(32, s)), s, p, o, m) +# define MITK_PP_FOR_32(s, p, o, m) MITK_PP_FOR_32_C(MITK_PP_BOOL(p(33, s)), s, p, o, m) +# define MITK_PP_FOR_33(s, p, o, m) MITK_PP_FOR_33_C(MITK_PP_BOOL(p(34, s)), s, p, o, m) +# define MITK_PP_FOR_34(s, p, o, m) MITK_PP_FOR_34_C(MITK_PP_BOOL(p(35, s)), s, p, o, m) +# define MITK_PP_FOR_35(s, p, o, m) MITK_PP_FOR_35_C(MITK_PP_BOOL(p(36, s)), s, p, o, m) +# define MITK_PP_FOR_36(s, p, o, m) MITK_PP_FOR_36_C(MITK_PP_BOOL(p(37, s)), s, p, o, m) +# define MITK_PP_FOR_37(s, p, o, m) MITK_PP_FOR_37_C(MITK_PP_BOOL(p(38, s)), s, p, o, m) +# define MITK_PP_FOR_38(s, p, o, m) MITK_PP_FOR_38_C(MITK_PP_BOOL(p(39, s)), s, p, o, m) +# define MITK_PP_FOR_39(s, p, o, m) MITK_PP_FOR_39_C(MITK_PP_BOOL(p(40, s)), s, p, o, m) +# define MITK_PP_FOR_40(s, p, o, m) MITK_PP_FOR_40_C(MITK_PP_BOOL(p(41, s)), s, p, o, m) +# define MITK_PP_FOR_41(s, p, o, m) MITK_PP_FOR_41_C(MITK_PP_BOOL(p(42, s)), s, p, o, m) +# define MITK_PP_FOR_42(s, p, o, m) MITK_PP_FOR_42_C(MITK_PP_BOOL(p(43, s)), s, p, o, m) +# define MITK_PP_FOR_43(s, p, o, m) MITK_PP_FOR_43_C(MITK_PP_BOOL(p(44, s)), s, p, o, m) +# define MITK_PP_FOR_44(s, p, o, m) MITK_PP_FOR_44_C(MITK_PP_BOOL(p(45, s)), s, p, o, m) +# define MITK_PP_FOR_45(s, p, o, m) MITK_PP_FOR_45_C(MITK_PP_BOOL(p(46, s)), s, p, o, m) +# define MITK_PP_FOR_46(s, p, o, m) MITK_PP_FOR_46_C(MITK_PP_BOOL(p(47, s)), s, p, o, m) +# define MITK_PP_FOR_47(s, p, o, m) MITK_PP_FOR_47_C(MITK_PP_BOOL(p(48, s)), s, p, o, m) +# define MITK_PP_FOR_48(s, p, o, m) MITK_PP_FOR_48_C(MITK_PP_BOOL(p(49, s)), s, p, o, m) +# define MITK_PP_FOR_49(s, p, o, m) MITK_PP_FOR_49_C(MITK_PP_BOOL(p(50, s)), s, p, o, m) +# define MITK_PP_FOR_50(s, p, o, m) MITK_PP_FOR_50_C(MITK_PP_BOOL(p(51, s)), s, p, o, m) +# define MITK_PP_FOR_51(s, p, o, m) MITK_PP_FOR_51_C(MITK_PP_BOOL(p(52, s)), s, p, o, m) +# define MITK_PP_FOR_52(s, p, o, m) MITK_PP_FOR_52_C(MITK_PP_BOOL(p(53, s)), s, p, o, m) +# define MITK_PP_FOR_53(s, p, o, m) MITK_PP_FOR_53_C(MITK_PP_BOOL(p(54, s)), s, p, o, m) +# define MITK_PP_FOR_54(s, p, o, m) MITK_PP_FOR_54_C(MITK_PP_BOOL(p(55, s)), s, p, o, m) +# define MITK_PP_FOR_55(s, p, o, m) MITK_PP_FOR_55_C(MITK_PP_BOOL(p(56, s)), s, p, o, m) +# define MITK_PP_FOR_56(s, p, o, m) MITK_PP_FOR_56_C(MITK_PP_BOOL(p(57, s)), s, p, o, m) +# define MITK_PP_FOR_57(s, p, o, m) MITK_PP_FOR_57_C(MITK_PP_BOOL(p(58, s)), s, p, o, m) +# define MITK_PP_FOR_58(s, p, o, m) MITK_PP_FOR_58_C(MITK_PP_BOOL(p(59, s)), s, p, o, m) +# define MITK_PP_FOR_59(s, p, o, m) MITK_PP_FOR_59_C(MITK_PP_BOOL(p(60, s)), s, p, o, m) +# define MITK_PP_FOR_60(s, p, o, m) MITK_PP_FOR_60_C(MITK_PP_BOOL(p(61, s)), s, p, o, m) +# define MITK_PP_FOR_61(s, p, o, m) MITK_PP_FOR_61_C(MITK_PP_BOOL(p(62, s)), s, p, o, m) +# define MITK_PP_FOR_62(s, p, o, m) MITK_PP_FOR_62_C(MITK_PP_BOOL(p(63, s)), s, p, o, m) +# define MITK_PP_FOR_63(s, p, o, m) MITK_PP_FOR_63_C(MITK_PP_BOOL(p(64, s)), s, p, o, m) +# define MITK_PP_FOR_64(s, p, o, m) MITK_PP_FOR_64_C(MITK_PP_BOOL(p(65, s)), s, p, o, m) +# define MITK_PP_FOR_65(s, p, o, m) MITK_PP_FOR_65_C(MITK_PP_BOOL(p(66, s)), s, p, o, m) +# define MITK_PP_FOR_66(s, p, o, m) MITK_PP_FOR_66_C(MITK_PP_BOOL(p(67, s)), s, p, o, m) +# define MITK_PP_FOR_67(s, p, o, m) MITK_PP_FOR_67_C(MITK_PP_BOOL(p(68, s)), s, p, o, m) +# define MITK_PP_FOR_68(s, p, o, m) MITK_PP_FOR_68_C(MITK_PP_BOOL(p(69, s)), s, p, o, m) +# define MITK_PP_FOR_69(s, p, o, m) MITK_PP_FOR_69_C(MITK_PP_BOOL(p(70, s)), s, p, o, m) +# define MITK_PP_FOR_70(s, p, o, m) MITK_PP_FOR_70_C(MITK_PP_BOOL(p(71, s)), s, p, o, m) +# define MITK_PP_FOR_71(s, p, o, m) MITK_PP_FOR_71_C(MITK_PP_BOOL(p(72, s)), s, p, o, m) +# define MITK_PP_FOR_72(s, p, o, m) MITK_PP_FOR_72_C(MITK_PP_BOOL(p(73, s)), s, p, o, m) +# define MITK_PP_FOR_73(s, p, o, m) MITK_PP_FOR_73_C(MITK_PP_BOOL(p(74, s)), s, p, o, m) +# define MITK_PP_FOR_74(s, p, o, m) MITK_PP_FOR_74_C(MITK_PP_BOOL(p(75, s)), s, p, o, m) +# define MITK_PP_FOR_75(s, p, o, m) MITK_PP_FOR_75_C(MITK_PP_BOOL(p(76, s)), s, p, o, m) +# define MITK_PP_FOR_76(s, p, o, m) MITK_PP_FOR_76_C(MITK_PP_BOOL(p(77, s)), s, p, o, m) +# define MITK_PP_FOR_77(s, p, o, m) MITK_PP_FOR_77_C(MITK_PP_BOOL(p(78, s)), s, p, o, m) +# define MITK_PP_FOR_78(s, p, o, m) MITK_PP_FOR_78_C(MITK_PP_BOOL(p(79, s)), s, p, o, m) +# define MITK_PP_FOR_79(s, p, o, m) MITK_PP_FOR_79_C(MITK_PP_BOOL(p(80, s)), s, p, o, m) +# define MITK_PP_FOR_80(s, p, o, m) MITK_PP_FOR_80_C(MITK_PP_BOOL(p(81, s)), s, p, o, m) +# define MITK_PP_FOR_81(s, p, o, m) MITK_PP_FOR_81_C(MITK_PP_BOOL(p(82, s)), s, p, o, m) +# define MITK_PP_FOR_82(s, p, o, m) MITK_PP_FOR_82_C(MITK_PP_BOOL(p(83, s)), s, p, o, m) +# define MITK_PP_FOR_83(s, p, o, m) MITK_PP_FOR_83_C(MITK_PP_BOOL(p(84, s)), s, p, o, m) +# define MITK_PP_FOR_84(s, p, o, m) MITK_PP_FOR_84_C(MITK_PP_BOOL(p(85, s)), s, p, o, m) +# define MITK_PP_FOR_85(s, p, o, m) MITK_PP_FOR_85_C(MITK_PP_BOOL(p(86, s)), s, p, o, m) +# define MITK_PP_FOR_86(s, p, o, m) MITK_PP_FOR_86_C(MITK_PP_BOOL(p(87, s)), s, p, o, m) +# define MITK_PP_FOR_87(s, p, o, m) MITK_PP_FOR_87_C(MITK_PP_BOOL(p(88, s)), s, p, o, m) +# define MITK_PP_FOR_88(s, p, o, m) MITK_PP_FOR_88_C(MITK_PP_BOOL(p(89, s)), s, p, o, m) +# define MITK_PP_FOR_89(s, p, o, m) MITK_PP_FOR_89_C(MITK_PP_BOOL(p(90, s)), s, p, o, m) +# define MITK_PP_FOR_90(s, p, o, m) MITK_PP_FOR_90_C(MITK_PP_BOOL(p(91, s)), s, p, o, m) +# define MITK_PP_FOR_91(s, p, o, m) MITK_PP_FOR_91_C(MITK_PP_BOOL(p(92, s)), s, p, o, m) +# define MITK_PP_FOR_92(s, p, o, m) MITK_PP_FOR_92_C(MITK_PP_BOOL(p(93, s)), s, p, o, m) +# define MITK_PP_FOR_93(s, p, o, m) MITK_PP_FOR_93_C(MITK_PP_BOOL(p(94, s)), s, p, o, m) +# define MITK_PP_FOR_94(s, p, o, m) MITK_PP_FOR_94_C(MITK_PP_BOOL(p(95, s)), s, p, o, m) +# define MITK_PP_FOR_95(s, p, o, m) MITK_PP_FOR_95_C(MITK_PP_BOOL(p(96, s)), s, p, o, m) +# define MITK_PP_FOR_96(s, p, o, m) MITK_PP_FOR_96_C(MITK_PP_BOOL(p(97, s)), s, p, o, m) +# define MITK_PP_FOR_97(s, p, o, m) MITK_PP_FOR_97_C(MITK_PP_BOOL(p(98, s)), s, p, o, m) +# define MITK_PP_FOR_98(s, p, o, m) MITK_PP_FOR_98_C(MITK_PP_BOOL(p(99, s)), s, p, o, m) +# define MITK_PP_FOR_99(s, p, o, m) MITK_PP_FOR_99_C(MITK_PP_BOOL(p(100, s)), s, p, o, m) +# define MITK_PP_FOR_100(s, p, o, m) MITK_PP_FOR_100_C(MITK_PP_BOOL(p(101, s)), s, p, o, m) +# define MITK_PP_FOR_101(s, p, o, m) MITK_PP_FOR_101_C(MITK_PP_BOOL(p(102, s)), s, p, o, m) +# define MITK_PP_FOR_102(s, p, o, m) MITK_PP_FOR_102_C(MITK_PP_BOOL(p(103, s)), s, p, o, m) +# define MITK_PP_FOR_103(s, p, o, m) MITK_PP_FOR_103_C(MITK_PP_BOOL(p(104, s)), s, p, o, m) +# define MITK_PP_FOR_104(s, p, o, m) MITK_PP_FOR_104_C(MITK_PP_BOOL(p(105, s)), s, p, o, m) +# define MITK_PP_FOR_105(s, p, o, m) MITK_PP_FOR_105_C(MITK_PP_BOOL(p(106, s)), s, p, o, m) +# define MITK_PP_FOR_106(s, p, o, m) MITK_PP_FOR_106_C(MITK_PP_BOOL(p(107, s)), s, p, o, m) +# define MITK_PP_FOR_107(s, p, o, m) MITK_PP_FOR_107_C(MITK_PP_BOOL(p(108, s)), s, p, o, m) +# define MITK_PP_FOR_108(s, p, o, m) MITK_PP_FOR_108_C(MITK_PP_BOOL(p(109, s)), s, p, o, m) +# define MITK_PP_FOR_109(s, p, o, m) MITK_PP_FOR_109_C(MITK_PP_BOOL(p(110, s)), s, p, o, m) +# define MITK_PP_FOR_110(s, p, o, m) MITK_PP_FOR_110_C(MITK_PP_BOOL(p(111, s)), s, p, o, m) +# define MITK_PP_FOR_111(s, p, o, m) MITK_PP_FOR_111_C(MITK_PP_BOOL(p(112, s)), s, p, o, m) +# define MITK_PP_FOR_112(s, p, o, m) MITK_PP_FOR_112_C(MITK_PP_BOOL(p(113, s)), s, p, o, m) +# define MITK_PP_FOR_113(s, p, o, m) MITK_PP_FOR_113_C(MITK_PP_BOOL(p(114, s)), s, p, o, m) +# define MITK_PP_FOR_114(s, p, o, m) MITK_PP_FOR_114_C(MITK_PP_BOOL(p(115, s)), s, p, o, m) +# define MITK_PP_FOR_115(s, p, o, m) MITK_PP_FOR_115_C(MITK_PP_BOOL(p(116, s)), s, p, o, m) +# define MITK_PP_FOR_116(s, p, o, m) MITK_PP_FOR_116_C(MITK_PP_BOOL(p(117, s)), s, p, o, m) +# define MITK_PP_FOR_117(s, p, o, m) MITK_PP_FOR_117_C(MITK_PP_BOOL(p(118, s)), s, p, o, m) +# define MITK_PP_FOR_118(s, p, o, m) MITK_PP_FOR_118_C(MITK_PP_BOOL(p(119, s)), s, p, o, m) +# define MITK_PP_FOR_119(s, p, o, m) MITK_PP_FOR_119_C(MITK_PP_BOOL(p(120, s)), s, p, o, m) +# define MITK_PP_FOR_120(s, p, o, m) MITK_PP_FOR_120_C(MITK_PP_BOOL(p(121, s)), s, p, o, m) +# define MITK_PP_FOR_121(s, p, o, m) MITK_PP_FOR_121_C(MITK_PP_BOOL(p(122, s)), s, p, o, m) +# define MITK_PP_FOR_122(s, p, o, m) MITK_PP_FOR_122_C(MITK_PP_BOOL(p(123, s)), s, p, o, m) +# define MITK_PP_FOR_123(s, p, o, m) MITK_PP_FOR_123_C(MITK_PP_BOOL(p(124, s)), s, p, o, m) +# define MITK_PP_FOR_124(s, p, o, m) MITK_PP_FOR_124_C(MITK_PP_BOOL(p(125, s)), s, p, o, m) +# define MITK_PP_FOR_125(s, p, o, m) MITK_PP_FOR_125_C(MITK_PP_BOOL(p(126, s)), s, p, o, m) +# define MITK_PP_FOR_126(s, p, o, m) MITK_PP_FOR_126_C(MITK_PP_BOOL(p(127, s)), s, p, o, m) +# define MITK_PP_FOR_127(s, p, o, m) MITK_PP_FOR_127_C(MITK_PP_BOOL(p(128, s)), s, p, o, m) +# define MITK_PP_FOR_128(s, p, o, m) MITK_PP_FOR_128_C(MITK_PP_BOOL(p(129, s)), s, p, o, m) +# define MITK_PP_FOR_129(s, p, o, m) MITK_PP_FOR_129_C(MITK_PP_BOOL(p(130, s)), s, p, o, m) +# define MITK_PP_FOR_130(s, p, o, m) MITK_PP_FOR_130_C(MITK_PP_BOOL(p(131, s)), s, p, o, m) +# define MITK_PP_FOR_131(s, p, o, m) MITK_PP_FOR_131_C(MITK_PP_BOOL(p(132, s)), s, p, o, m) +# define MITK_PP_FOR_132(s, p, o, m) MITK_PP_FOR_132_C(MITK_PP_BOOL(p(133, s)), s, p, o, m) +# define MITK_PP_FOR_133(s, p, o, m) MITK_PP_FOR_133_C(MITK_PP_BOOL(p(134, s)), s, p, o, m) +# define MITK_PP_FOR_134(s, p, o, m) MITK_PP_FOR_134_C(MITK_PP_BOOL(p(135, s)), s, p, o, m) +# define MITK_PP_FOR_135(s, p, o, m) MITK_PP_FOR_135_C(MITK_PP_BOOL(p(136, s)), s, p, o, m) +# define MITK_PP_FOR_136(s, p, o, m) MITK_PP_FOR_136_C(MITK_PP_BOOL(p(137, s)), s, p, o, m) +# define MITK_PP_FOR_137(s, p, o, m) MITK_PP_FOR_137_C(MITK_PP_BOOL(p(138, s)), s, p, o, m) +# define MITK_PP_FOR_138(s, p, o, m) MITK_PP_FOR_138_C(MITK_PP_BOOL(p(139, s)), s, p, o, m) +# define MITK_PP_FOR_139(s, p, o, m) MITK_PP_FOR_139_C(MITK_PP_BOOL(p(140, s)), s, p, o, m) +# define MITK_PP_FOR_140(s, p, o, m) MITK_PP_FOR_140_C(MITK_PP_BOOL(p(141, s)), s, p, o, m) +# define MITK_PP_FOR_141(s, p, o, m) MITK_PP_FOR_141_C(MITK_PP_BOOL(p(142, s)), s, p, o, m) +# define MITK_PP_FOR_142(s, p, o, m) MITK_PP_FOR_142_C(MITK_PP_BOOL(p(143, s)), s, p, o, m) +# define MITK_PP_FOR_143(s, p, o, m) MITK_PP_FOR_143_C(MITK_PP_BOOL(p(144, s)), s, p, o, m) +# define MITK_PP_FOR_144(s, p, o, m) MITK_PP_FOR_144_C(MITK_PP_BOOL(p(145, s)), s, p, o, m) +# define MITK_PP_FOR_145(s, p, o, m) MITK_PP_FOR_145_C(MITK_PP_BOOL(p(146, s)), s, p, o, m) +# define MITK_PP_FOR_146(s, p, o, m) MITK_PP_FOR_146_C(MITK_PP_BOOL(p(147, s)), s, p, o, m) +# define MITK_PP_FOR_147(s, p, o, m) MITK_PP_FOR_147_C(MITK_PP_BOOL(p(148, s)), s, p, o, m) +# define MITK_PP_FOR_148(s, p, o, m) MITK_PP_FOR_148_C(MITK_PP_BOOL(p(149, s)), s, p, o, m) +# define MITK_PP_FOR_149(s, p, o, m) MITK_PP_FOR_149_C(MITK_PP_BOOL(p(150, s)), s, p, o, m) +# define MITK_PP_FOR_150(s, p, o, m) MITK_PP_FOR_150_C(MITK_PP_BOOL(p(151, s)), s, p, o, m) +# define MITK_PP_FOR_151(s, p, o, m) MITK_PP_FOR_151_C(MITK_PP_BOOL(p(152, s)), s, p, o, m) +# define MITK_PP_FOR_152(s, p, o, m) MITK_PP_FOR_152_C(MITK_PP_BOOL(p(153, s)), s, p, o, m) +# define MITK_PP_FOR_153(s, p, o, m) MITK_PP_FOR_153_C(MITK_PP_BOOL(p(154, s)), s, p, o, m) +# define MITK_PP_FOR_154(s, p, o, m) MITK_PP_FOR_154_C(MITK_PP_BOOL(p(155, s)), s, p, o, m) +# define MITK_PP_FOR_155(s, p, o, m) MITK_PP_FOR_155_C(MITK_PP_BOOL(p(156, s)), s, p, o, m) +# define MITK_PP_FOR_156(s, p, o, m) MITK_PP_FOR_156_C(MITK_PP_BOOL(p(157, s)), s, p, o, m) +# define MITK_PP_FOR_157(s, p, o, m) MITK_PP_FOR_157_C(MITK_PP_BOOL(p(158, s)), s, p, o, m) +# define MITK_PP_FOR_158(s, p, o, m) MITK_PP_FOR_158_C(MITK_PP_BOOL(p(159, s)), s, p, o, m) +# define MITK_PP_FOR_159(s, p, o, m) MITK_PP_FOR_159_C(MITK_PP_BOOL(p(160, s)), s, p, o, m) +# define MITK_PP_FOR_160(s, p, o, m) MITK_PP_FOR_160_C(MITK_PP_BOOL(p(161, s)), s, p, o, m) +# define MITK_PP_FOR_161(s, p, o, m) MITK_PP_FOR_161_C(MITK_PP_BOOL(p(162, s)), s, p, o, m) +# define MITK_PP_FOR_162(s, p, o, m) MITK_PP_FOR_162_C(MITK_PP_BOOL(p(163, s)), s, p, o, m) +# define MITK_PP_FOR_163(s, p, o, m) MITK_PP_FOR_163_C(MITK_PP_BOOL(p(164, s)), s, p, o, m) +# define MITK_PP_FOR_164(s, p, o, m) MITK_PP_FOR_164_C(MITK_PP_BOOL(p(165, s)), s, p, o, m) +# define MITK_PP_FOR_165(s, p, o, m) MITK_PP_FOR_165_C(MITK_PP_BOOL(p(166, s)), s, p, o, m) +# define MITK_PP_FOR_166(s, p, o, m) MITK_PP_FOR_166_C(MITK_PP_BOOL(p(167, s)), s, p, o, m) +# define MITK_PP_FOR_167(s, p, o, m) MITK_PP_FOR_167_C(MITK_PP_BOOL(p(168, s)), s, p, o, m) +# define MITK_PP_FOR_168(s, p, o, m) MITK_PP_FOR_168_C(MITK_PP_BOOL(p(169, s)), s, p, o, m) +# define MITK_PP_FOR_169(s, p, o, m) MITK_PP_FOR_169_C(MITK_PP_BOOL(p(170, s)), s, p, o, m) +# define MITK_PP_FOR_170(s, p, o, m) MITK_PP_FOR_170_C(MITK_PP_BOOL(p(171, s)), s, p, o, m) +# define MITK_PP_FOR_171(s, p, o, m) MITK_PP_FOR_171_C(MITK_PP_BOOL(p(172, s)), s, p, o, m) +# define MITK_PP_FOR_172(s, p, o, m) MITK_PP_FOR_172_C(MITK_PP_BOOL(p(173, s)), s, p, o, m) +# define MITK_PP_FOR_173(s, p, o, m) MITK_PP_FOR_173_C(MITK_PP_BOOL(p(174, s)), s, p, o, m) +# define MITK_PP_FOR_174(s, p, o, m) MITK_PP_FOR_174_C(MITK_PP_BOOL(p(175, s)), s, p, o, m) +# define MITK_PP_FOR_175(s, p, o, m) MITK_PP_FOR_175_C(MITK_PP_BOOL(p(176, s)), s, p, o, m) +# define MITK_PP_FOR_176(s, p, o, m) MITK_PP_FOR_176_C(MITK_PP_BOOL(p(177, s)), s, p, o, m) +# define MITK_PP_FOR_177(s, p, o, m) MITK_PP_FOR_177_C(MITK_PP_BOOL(p(178, s)), s, p, o, m) +# define MITK_PP_FOR_178(s, p, o, m) MITK_PP_FOR_178_C(MITK_PP_BOOL(p(179, s)), s, p, o, m) +# define MITK_PP_FOR_179(s, p, o, m) MITK_PP_FOR_179_C(MITK_PP_BOOL(p(180, s)), s, p, o, m) +# define MITK_PP_FOR_180(s, p, o, m) MITK_PP_FOR_180_C(MITK_PP_BOOL(p(181, s)), s, p, o, m) +# define MITK_PP_FOR_181(s, p, o, m) MITK_PP_FOR_181_C(MITK_PP_BOOL(p(182, s)), s, p, o, m) +# define MITK_PP_FOR_182(s, p, o, m) MITK_PP_FOR_182_C(MITK_PP_BOOL(p(183, s)), s, p, o, m) +# define MITK_PP_FOR_183(s, p, o, m) MITK_PP_FOR_183_C(MITK_PP_BOOL(p(184, s)), s, p, o, m) +# define MITK_PP_FOR_184(s, p, o, m) MITK_PP_FOR_184_C(MITK_PP_BOOL(p(185, s)), s, p, o, m) +# define MITK_PP_FOR_185(s, p, o, m) MITK_PP_FOR_185_C(MITK_PP_BOOL(p(186, s)), s, p, o, m) +# define MITK_PP_FOR_186(s, p, o, m) MITK_PP_FOR_186_C(MITK_PP_BOOL(p(187, s)), s, p, o, m) +# define MITK_PP_FOR_187(s, p, o, m) MITK_PP_FOR_187_C(MITK_PP_BOOL(p(188, s)), s, p, o, m) +# define MITK_PP_FOR_188(s, p, o, m) MITK_PP_FOR_188_C(MITK_PP_BOOL(p(189, s)), s, p, o, m) +# define MITK_PP_FOR_189(s, p, o, m) MITK_PP_FOR_189_C(MITK_PP_BOOL(p(190, s)), s, p, o, m) +# define MITK_PP_FOR_190(s, p, o, m) MITK_PP_FOR_190_C(MITK_PP_BOOL(p(191, s)), s, p, o, m) +# define MITK_PP_FOR_191(s, p, o, m) MITK_PP_FOR_191_C(MITK_PP_BOOL(p(192, s)), s, p, o, m) +# define MITK_PP_FOR_192(s, p, o, m) MITK_PP_FOR_192_C(MITK_PP_BOOL(p(193, s)), s, p, o, m) +# define MITK_PP_FOR_193(s, p, o, m) MITK_PP_FOR_193_C(MITK_PP_BOOL(p(194, s)), s, p, o, m) +# define MITK_PP_FOR_194(s, p, o, m) MITK_PP_FOR_194_C(MITK_PP_BOOL(p(195, s)), s, p, o, m) +# define MITK_PP_FOR_195(s, p, o, m) MITK_PP_FOR_195_C(MITK_PP_BOOL(p(196, s)), s, p, o, m) +# define MITK_PP_FOR_196(s, p, o, m) MITK_PP_FOR_196_C(MITK_PP_BOOL(p(197, s)), s, p, o, m) +# define MITK_PP_FOR_197(s, p, o, m) MITK_PP_FOR_197_C(MITK_PP_BOOL(p(198, s)), s, p, o, m) +# define MITK_PP_FOR_198(s, p, o, m) MITK_PP_FOR_198_C(MITK_PP_BOOL(p(199, s)), s, p, o, m) +# define MITK_PP_FOR_199(s, p, o, m) MITK_PP_FOR_199_C(MITK_PP_BOOL(p(200, s)), s, p, o, m) +# define MITK_PP_FOR_200(s, p, o, m) MITK_PP_FOR_200_C(MITK_PP_BOOL(p(201, s)), s, p, o, m) +# define MITK_PP_FOR_201(s, p, o, m) MITK_PP_FOR_201_C(MITK_PP_BOOL(p(202, s)), s, p, o, m) +# define MITK_PP_FOR_202(s, p, o, m) MITK_PP_FOR_202_C(MITK_PP_BOOL(p(203, s)), s, p, o, m) +# define MITK_PP_FOR_203(s, p, o, m) MITK_PP_FOR_203_C(MITK_PP_BOOL(p(204, s)), s, p, o, m) +# define MITK_PP_FOR_204(s, p, o, m) MITK_PP_FOR_204_C(MITK_PP_BOOL(p(205, s)), s, p, o, m) +# define MITK_PP_FOR_205(s, p, o, m) MITK_PP_FOR_205_C(MITK_PP_BOOL(p(206, s)), s, p, o, m) +# define MITK_PP_FOR_206(s, p, o, m) MITK_PP_FOR_206_C(MITK_PP_BOOL(p(207, s)), s, p, o, m) +# define MITK_PP_FOR_207(s, p, o, m) MITK_PP_FOR_207_C(MITK_PP_BOOL(p(208, s)), s, p, o, m) +# define MITK_PP_FOR_208(s, p, o, m) MITK_PP_FOR_208_C(MITK_PP_BOOL(p(209, s)), s, p, o, m) +# define MITK_PP_FOR_209(s, p, o, m) MITK_PP_FOR_209_C(MITK_PP_BOOL(p(210, s)), s, p, o, m) +# define MITK_PP_FOR_210(s, p, o, m) MITK_PP_FOR_210_C(MITK_PP_BOOL(p(211, s)), s, p, o, m) +# define MITK_PP_FOR_211(s, p, o, m) MITK_PP_FOR_211_C(MITK_PP_BOOL(p(212, s)), s, p, o, m) +# define MITK_PP_FOR_212(s, p, o, m) MITK_PP_FOR_212_C(MITK_PP_BOOL(p(213, s)), s, p, o, m) +# define MITK_PP_FOR_213(s, p, o, m) MITK_PP_FOR_213_C(MITK_PP_BOOL(p(214, s)), s, p, o, m) +# define MITK_PP_FOR_214(s, p, o, m) MITK_PP_FOR_214_C(MITK_PP_BOOL(p(215, s)), s, p, o, m) +# define MITK_PP_FOR_215(s, p, o, m) MITK_PP_FOR_215_C(MITK_PP_BOOL(p(216, s)), s, p, o, m) +# define MITK_PP_FOR_216(s, p, o, m) MITK_PP_FOR_216_C(MITK_PP_BOOL(p(217, s)), s, p, o, m) +# define MITK_PP_FOR_217(s, p, o, m) MITK_PP_FOR_217_C(MITK_PP_BOOL(p(218, s)), s, p, o, m) +# define MITK_PP_FOR_218(s, p, o, m) MITK_PP_FOR_218_C(MITK_PP_BOOL(p(219, s)), s, p, o, m) +# define MITK_PP_FOR_219(s, p, o, m) MITK_PP_FOR_219_C(MITK_PP_BOOL(p(220, s)), s, p, o, m) +# define MITK_PP_FOR_220(s, p, o, m) MITK_PP_FOR_220_C(MITK_PP_BOOL(p(221, s)), s, p, o, m) +# define MITK_PP_FOR_221(s, p, o, m) MITK_PP_FOR_221_C(MITK_PP_BOOL(p(222, s)), s, p, o, m) +# define MITK_PP_FOR_222(s, p, o, m) MITK_PP_FOR_222_C(MITK_PP_BOOL(p(223, s)), s, p, o, m) +# define MITK_PP_FOR_223(s, p, o, m) MITK_PP_FOR_223_C(MITK_PP_BOOL(p(224, s)), s, p, o, m) +# define MITK_PP_FOR_224(s, p, o, m) MITK_PP_FOR_224_C(MITK_PP_BOOL(p(225, s)), s, p, o, m) +# define MITK_PP_FOR_225(s, p, o, m) MITK_PP_FOR_225_C(MITK_PP_BOOL(p(226, s)), s, p, o, m) +# define MITK_PP_FOR_226(s, p, o, m) MITK_PP_FOR_226_C(MITK_PP_BOOL(p(227, s)), s, p, o, m) +# define MITK_PP_FOR_227(s, p, o, m) MITK_PP_FOR_227_C(MITK_PP_BOOL(p(228, s)), s, p, o, m) +# define MITK_PP_FOR_228(s, p, o, m) MITK_PP_FOR_228_C(MITK_PP_BOOL(p(229, s)), s, p, o, m) +# define MITK_PP_FOR_229(s, p, o, m) MITK_PP_FOR_229_C(MITK_PP_BOOL(p(230, s)), s, p, o, m) +# define MITK_PP_FOR_230(s, p, o, m) MITK_PP_FOR_230_C(MITK_PP_BOOL(p(231, s)), s, p, o, m) +# define MITK_PP_FOR_231(s, p, o, m) MITK_PP_FOR_231_C(MITK_PP_BOOL(p(232, s)), s, p, o, m) +# define MITK_PP_FOR_232(s, p, o, m) MITK_PP_FOR_232_C(MITK_PP_BOOL(p(233, s)), s, p, o, m) +# define MITK_PP_FOR_233(s, p, o, m) MITK_PP_FOR_233_C(MITK_PP_BOOL(p(234, s)), s, p, o, m) +# define MITK_PP_FOR_234(s, p, o, m) MITK_PP_FOR_234_C(MITK_PP_BOOL(p(235, s)), s, p, o, m) +# define MITK_PP_FOR_235(s, p, o, m) MITK_PP_FOR_235_C(MITK_PP_BOOL(p(236, s)), s, p, o, m) +# define MITK_PP_FOR_236(s, p, o, m) MITK_PP_FOR_236_C(MITK_PP_BOOL(p(237, s)), s, p, o, m) +# define MITK_PP_FOR_237(s, p, o, m) MITK_PP_FOR_237_C(MITK_PP_BOOL(p(238, s)), s, p, o, m) +# define MITK_PP_FOR_238(s, p, o, m) MITK_PP_FOR_238_C(MITK_PP_BOOL(p(239, s)), s, p, o, m) +# define MITK_PP_FOR_239(s, p, o, m) MITK_PP_FOR_239_C(MITK_PP_BOOL(p(240, s)), s, p, o, m) +# define MITK_PP_FOR_240(s, p, o, m) MITK_PP_FOR_240_C(MITK_PP_BOOL(p(241, s)), s, p, o, m) +# define MITK_PP_FOR_241(s, p, o, m) MITK_PP_FOR_241_C(MITK_PP_BOOL(p(242, s)), s, p, o, m) +# define MITK_PP_FOR_242(s, p, o, m) MITK_PP_FOR_242_C(MITK_PP_BOOL(p(243, s)), s, p, o, m) +# define MITK_PP_FOR_243(s, p, o, m) MITK_PP_FOR_243_C(MITK_PP_BOOL(p(244, s)), s, p, o, m) +# define MITK_PP_FOR_244(s, p, o, m) MITK_PP_FOR_244_C(MITK_PP_BOOL(p(245, s)), s, p, o, m) +# define MITK_PP_FOR_245(s, p, o, m) MITK_PP_FOR_245_C(MITK_PP_BOOL(p(246, s)), s, p, o, m) +# define MITK_PP_FOR_246(s, p, o, m) MITK_PP_FOR_246_C(MITK_PP_BOOL(p(247, s)), s, p, o, m) +# define MITK_PP_FOR_247(s, p, o, m) MITK_PP_FOR_247_C(MITK_PP_BOOL(p(248, s)), s, p, o, m) +# define MITK_PP_FOR_248(s, p, o, m) MITK_PP_FOR_248_C(MITK_PP_BOOL(p(249, s)), s, p, o, m) +# define MITK_PP_FOR_249(s, p, o, m) MITK_PP_FOR_249_C(MITK_PP_BOOL(p(250, s)), s, p, o, m) +# define MITK_PP_FOR_250(s, p, o, m) MITK_PP_FOR_250_C(MITK_PP_BOOL(p(251, s)), s, p, o, m) +# define MITK_PP_FOR_251(s, p, o, m) MITK_PP_FOR_251_C(MITK_PP_BOOL(p(252, s)), s, p, o, m) +# define MITK_PP_FOR_252(s, p, o, m) MITK_PP_FOR_252_C(MITK_PP_BOOL(p(253, s)), s, p, o, m) +# define MITK_PP_FOR_253(s, p, o, m) MITK_PP_FOR_253_C(MITK_PP_BOOL(p(254, s)), s, p, o, m) +# define MITK_PP_FOR_254(s, p, o, m) MITK_PP_FOR_254_C(MITK_PP_BOOL(p(255, s)), s, p, o, m) +# define MITK_PP_FOR_255(s, p, o, m) MITK_PP_FOR_255_C(MITK_PP_BOOL(p(256, s)), s, p, o, m) +# define MITK_PP_FOR_256(s, p, o, m) MITK_PP_FOR_256_C(MITK_PP_BOOL(p(257, s)), s, p, o, m) +# +# define MITK_PP_FOR_1_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(2, s) MITK_PP_IIF(c, MITK_PP_FOR_2, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(2, s), p, o, m) +# define MITK_PP_FOR_2_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(3, s) MITK_PP_IIF(c, MITK_PP_FOR_3, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(3, s), p, o, m) +# define MITK_PP_FOR_3_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(4, s) MITK_PP_IIF(c, MITK_PP_FOR_4, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(4, s), p, o, m) +# define MITK_PP_FOR_4_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(5, s) MITK_PP_IIF(c, MITK_PP_FOR_5, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(5, s), p, o, m) +# define MITK_PP_FOR_5_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(6, s) MITK_PP_IIF(c, MITK_PP_FOR_6, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(6, s), p, o, m) +# define MITK_PP_FOR_6_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(7, s) MITK_PP_IIF(c, MITK_PP_FOR_7, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(7, s), p, o, m) +# define MITK_PP_FOR_7_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(8, s) MITK_PP_IIF(c, MITK_PP_FOR_8, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(8, s), p, o, m) +# define MITK_PP_FOR_8_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(9, s) MITK_PP_IIF(c, MITK_PP_FOR_9, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(9, s), p, o, m) +# define MITK_PP_FOR_9_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(10, s) MITK_PP_IIF(c, MITK_PP_FOR_10, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(10, s), p, o, m) +# define MITK_PP_FOR_10_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(11, s) MITK_PP_IIF(c, MITK_PP_FOR_11, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(11, s), p, o, m) +# define MITK_PP_FOR_11_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(12, s) MITK_PP_IIF(c, MITK_PP_FOR_12, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(12, s), p, o, m) +# define MITK_PP_FOR_12_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(13, s) MITK_PP_IIF(c, MITK_PP_FOR_13, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(13, s), p, o, m) +# define MITK_PP_FOR_13_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(14, s) MITK_PP_IIF(c, MITK_PP_FOR_14, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(14, s), p, o, m) +# define MITK_PP_FOR_14_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(15, s) MITK_PP_IIF(c, MITK_PP_FOR_15, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(15, s), p, o, m) +# define MITK_PP_FOR_15_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(16, s) MITK_PP_IIF(c, MITK_PP_FOR_16, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(16, s), p, o, m) +# define MITK_PP_FOR_16_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(17, s) MITK_PP_IIF(c, MITK_PP_FOR_17, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(17, s), p, o, m) +# define MITK_PP_FOR_17_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(18, s) MITK_PP_IIF(c, MITK_PP_FOR_18, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(18, s), p, o, m) +# define MITK_PP_FOR_18_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(19, s) MITK_PP_IIF(c, MITK_PP_FOR_19, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(19, s), p, o, m) +# define MITK_PP_FOR_19_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(20, s) MITK_PP_IIF(c, MITK_PP_FOR_20, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(20, s), p, o, m) +# define MITK_PP_FOR_20_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(21, s) MITK_PP_IIF(c, MITK_PP_FOR_21, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(21, s), p, o, m) +# define MITK_PP_FOR_21_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(22, s) MITK_PP_IIF(c, MITK_PP_FOR_22, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(22, s), p, o, m) +# define MITK_PP_FOR_22_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(23, s) MITK_PP_IIF(c, MITK_PP_FOR_23, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(23, s), p, o, m) +# define MITK_PP_FOR_23_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(24, s) MITK_PP_IIF(c, MITK_PP_FOR_24, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(24, s), p, o, m) +# define MITK_PP_FOR_24_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(25, s) MITK_PP_IIF(c, MITK_PP_FOR_25, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(25, s), p, o, m) +# define MITK_PP_FOR_25_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(26, s) MITK_PP_IIF(c, MITK_PP_FOR_26, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(26, s), p, o, m) +# define MITK_PP_FOR_26_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(27, s) MITK_PP_IIF(c, MITK_PP_FOR_27, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(27, s), p, o, m) +# define MITK_PP_FOR_27_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(28, s) MITK_PP_IIF(c, MITK_PP_FOR_28, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(28, s), p, o, m) +# define MITK_PP_FOR_28_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(29, s) MITK_PP_IIF(c, MITK_PP_FOR_29, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(29, s), p, o, m) +# define MITK_PP_FOR_29_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(30, s) MITK_PP_IIF(c, MITK_PP_FOR_30, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(30, s), p, o, m) +# define MITK_PP_FOR_30_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(31, s) MITK_PP_IIF(c, MITK_PP_FOR_31, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(31, s), p, o, m) +# define MITK_PP_FOR_31_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(32, s) MITK_PP_IIF(c, MITK_PP_FOR_32, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(32, s), p, o, m) +# define MITK_PP_FOR_32_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(33, s) MITK_PP_IIF(c, MITK_PP_FOR_33, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(33, s), p, o, m) +# define MITK_PP_FOR_33_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(34, s) MITK_PP_IIF(c, MITK_PP_FOR_34, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(34, s), p, o, m) +# define MITK_PP_FOR_34_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(35, s) MITK_PP_IIF(c, MITK_PP_FOR_35, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(35, s), p, o, m) +# define MITK_PP_FOR_35_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(36, s) MITK_PP_IIF(c, MITK_PP_FOR_36, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(36, s), p, o, m) +# define MITK_PP_FOR_36_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(37, s) MITK_PP_IIF(c, MITK_PP_FOR_37, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(37, s), p, o, m) +# define MITK_PP_FOR_37_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(38, s) MITK_PP_IIF(c, MITK_PP_FOR_38, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(38, s), p, o, m) +# define MITK_PP_FOR_38_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(39, s) MITK_PP_IIF(c, MITK_PP_FOR_39, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(39, s), p, o, m) +# define MITK_PP_FOR_39_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(40, s) MITK_PP_IIF(c, MITK_PP_FOR_40, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(40, s), p, o, m) +# define MITK_PP_FOR_40_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(41, s) MITK_PP_IIF(c, MITK_PP_FOR_41, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(41, s), p, o, m) +# define MITK_PP_FOR_41_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(42, s) MITK_PP_IIF(c, MITK_PP_FOR_42, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(42, s), p, o, m) +# define MITK_PP_FOR_42_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(43, s) MITK_PP_IIF(c, MITK_PP_FOR_43, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(43, s), p, o, m) +# define MITK_PP_FOR_43_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(44, s) MITK_PP_IIF(c, MITK_PP_FOR_44, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(44, s), p, o, m) +# define MITK_PP_FOR_44_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(45, s) MITK_PP_IIF(c, MITK_PP_FOR_45, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(45, s), p, o, m) +# define MITK_PP_FOR_45_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(46, s) MITK_PP_IIF(c, MITK_PP_FOR_46, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(46, s), p, o, m) +# define MITK_PP_FOR_46_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(47, s) MITK_PP_IIF(c, MITK_PP_FOR_47, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(47, s), p, o, m) +# define MITK_PP_FOR_47_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(48, s) MITK_PP_IIF(c, MITK_PP_FOR_48, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(48, s), p, o, m) +# define MITK_PP_FOR_48_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(49, s) MITK_PP_IIF(c, MITK_PP_FOR_49, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(49, s), p, o, m) +# define MITK_PP_FOR_49_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(50, s) MITK_PP_IIF(c, MITK_PP_FOR_50, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(50, s), p, o, m) +# define MITK_PP_FOR_50_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(51, s) MITK_PP_IIF(c, MITK_PP_FOR_51, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(51, s), p, o, m) +# define MITK_PP_FOR_51_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(52, s) MITK_PP_IIF(c, MITK_PP_FOR_52, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(52, s), p, o, m) +# define MITK_PP_FOR_52_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(53, s) MITK_PP_IIF(c, MITK_PP_FOR_53, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(53, s), p, o, m) +# define MITK_PP_FOR_53_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(54, s) MITK_PP_IIF(c, MITK_PP_FOR_54, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(54, s), p, o, m) +# define MITK_PP_FOR_54_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(55, s) MITK_PP_IIF(c, MITK_PP_FOR_55, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(55, s), p, o, m) +# define MITK_PP_FOR_55_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(56, s) MITK_PP_IIF(c, MITK_PP_FOR_56, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(56, s), p, o, m) +# define MITK_PP_FOR_56_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(57, s) MITK_PP_IIF(c, MITK_PP_FOR_57, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(57, s), p, o, m) +# define MITK_PP_FOR_57_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(58, s) MITK_PP_IIF(c, MITK_PP_FOR_58, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(58, s), p, o, m) +# define MITK_PP_FOR_58_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(59, s) MITK_PP_IIF(c, MITK_PP_FOR_59, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(59, s), p, o, m) +# define MITK_PP_FOR_59_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(60, s) MITK_PP_IIF(c, MITK_PP_FOR_60, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(60, s), p, o, m) +# define MITK_PP_FOR_60_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(61, s) MITK_PP_IIF(c, MITK_PP_FOR_61, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(61, s), p, o, m) +# define MITK_PP_FOR_61_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(62, s) MITK_PP_IIF(c, MITK_PP_FOR_62, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(62, s), p, o, m) +# define MITK_PP_FOR_62_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(63, s) MITK_PP_IIF(c, MITK_PP_FOR_63, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(63, s), p, o, m) +# define MITK_PP_FOR_63_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(64, s) MITK_PP_IIF(c, MITK_PP_FOR_64, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(64, s), p, o, m) +# define MITK_PP_FOR_64_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(65, s) MITK_PP_IIF(c, MITK_PP_FOR_65, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(65, s), p, o, m) +# define MITK_PP_FOR_65_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(66, s) MITK_PP_IIF(c, MITK_PP_FOR_66, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(66, s), p, o, m) +# define MITK_PP_FOR_66_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(67, s) MITK_PP_IIF(c, MITK_PP_FOR_67, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(67, s), p, o, m) +# define MITK_PP_FOR_67_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(68, s) MITK_PP_IIF(c, MITK_PP_FOR_68, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(68, s), p, o, m) +# define MITK_PP_FOR_68_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(69, s) MITK_PP_IIF(c, MITK_PP_FOR_69, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(69, s), p, o, m) +# define MITK_PP_FOR_69_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(70, s) MITK_PP_IIF(c, MITK_PP_FOR_70, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(70, s), p, o, m) +# define MITK_PP_FOR_70_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(71, s) MITK_PP_IIF(c, MITK_PP_FOR_71, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(71, s), p, o, m) +# define MITK_PP_FOR_71_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(72, s) MITK_PP_IIF(c, MITK_PP_FOR_72, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(72, s), p, o, m) +# define MITK_PP_FOR_72_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(73, s) MITK_PP_IIF(c, MITK_PP_FOR_73, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(73, s), p, o, m) +# define MITK_PP_FOR_73_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(74, s) MITK_PP_IIF(c, MITK_PP_FOR_74, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(74, s), p, o, m) +# define MITK_PP_FOR_74_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(75, s) MITK_PP_IIF(c, MITK_PP_FOR_75, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(75, s), p, o, m) +# define MITK_PP_FOR_75_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(76, s) MITK_PP_IIF(c, MITK_PP_FOR_76, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(76, s), p, o, m) +# define MITK_PP_FOR_76_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(77, s) MITK_PP_IIF(c, MITK_PP_FOR_77, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(77, s), p, o, m) +# define MITK_PP_FOR_77_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(78, s) MITK_PP_IIF(c, MITK_PP_FOR_78, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(78, s), p, o, m) +# define MITK_PP_FOR_78_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(79, s) MITK_PP_IIF(c, MITK_PP_FOR_79, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(79, s), p, o, m) +# define MITK_PP_FOR_79_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(80, s) MITK_PP_IIF(c, MITK_PP_FOR_80, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(80, s), p, o, m) +# define MITK_PP_FOR_80_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(81, s) MITK_PP_IIF(c, MITK_PP_FOR_81, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(81, s), p, o, m) +# define MITK_PP_FOR_81_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(82, s) MITK_PP_IIF(c, MITK_PP_FOR_82, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(82, s), p, o, m) +# define MITK_PP_FOR_82_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(83, s) MITK_PP_IIF(c, MITK_PP_FOR_83, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(83, s), p, o, m) +# define MITK_PP_FOR_83_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(84, s) MITK_PP_IIF(c, MITK_PP_FOR_84, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(84, s), p, o, m) +# define MITK_PP_FOR_84_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(85, s) MITK_PP_IIF(c, MITK_PP_FOR_85, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(85, s), p, o, m) +# define MITK_PP_FOR_85_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(86, s) MITK_PP_IIF(c, MITK_PP_FOR_86, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(86, s), p, o, m) +# define MITK_PP_FOR_86_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(87, s) MITK_PP_IIF(c, MITK_PP_FOR_87, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(87, s), p, o, m) +# define MITK_PP_FOR_87_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(88, s) MITK_PP_IIF(c, MITK_PP_FOR_88, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(88, s), p, o, m) +# define MITK_PP_FOR_88_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(89, s) MITK_PP_IIF(c, MITK_PP_FOR_89, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(89, s), p, o, m) +# define MITK_PP_FOR_89_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(90, s) MITK_PP_IIF(c, MITK_PP_FOR_90, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(90, s), p, o, m) +# define MITK_PP_FOR_90_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(91, s) MITK_PP_IIF(c, MITK_PP_FOR_91, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(91, s), p, o, m) +# define MITK_PP_FOR_91_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(92, s) MITK_PP_IIF(c, MITK_PP_FOR_92, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(92, s), p, o, m) +# define MITK_PP_FOR_92_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(93, s) MITK_PP_IIF(c, MITK_PP_FOR_93, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(93, s), p, o, m) +# define MITK_PP_FOR_93_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(94, s) MITK_PP_IIF(c, MITK_PP_FOR_94, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(94, s), p, o, m) +# define MITK_PP_FOR_94_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(95, s) MITK_PP_IIF(c, MITK_PP_FOR_95, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(95, s), p, o, m) +# define MITK_PP_FOR_95_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(96, s) MITK_PP_IIF(c, MITK_PP_FOR_96, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(96, s), p, o, m) +# define MITK_PP_FOR_96_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(97, s) MITK_PP_IIF(c, MITK_PP_FOR_97, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(97, s), p, o, m) +# define MITK_PP_FOR_97_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(98, s) MITK_PP_IIF(c, MITK_PP_FOR_98, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(98, s), p, o, m) +# define MITK_PP_FOR_98_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(99, s) MITK_PP_IIF(c, MITK_PP_FOR_99, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(99, s), p, o, m) +# define MITK_PP_FOR_99_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(100, s) MITK_PP_IIF(c, MITK_PP_FOR_100, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(100, s), p, o, m) +# define MITK_PP_FOR_100_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(101, s) MITK_PP_IIF(c, MITK_PP_FOR_101, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(101, s), p, o, m) +# define MITK_PP_FOR_101_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(102, s) MITK_PP_IIF(c, MITK_PP_FOR_102, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(102, s), p, o, m) +# define MITK_PP_FOR_102_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(103, s) MITK_PP_IIF(c, MITK_PP_FOR_103, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(103, s), p, o, m) +# define MITK_PP_FOR_103_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(104, s) MITK_PP_IIF(c, MITK_PP_FOR_104, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(104, s), p, o, m) +# define MITK_PP_FOR_104_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(105, s) MITK_PP_IIF(c, MITK_PP_FOR_105, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(105, s), p, o, m) +# define MITK_PP_FOR_105_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(106, s) MITK_PP_IIF(c, MITK_PP_FOR_106, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(106, s), p, o, m) +# define MITK_PP_FOR_106_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(107, s) MITK_PP_IIF(c, MITK_PP_FOR_107, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(107, s), p, o, m) +# define MITK_PP_FOR_107_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(108, s) MITK_PP_IIF(c, MITK_PP_FOR_108, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(108, s), p, o, m) +# define MITK_PP_FOR_108_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(109, s) MITK_PP_IIF(c, MITK_PP_FOR_109, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(109, s), p, o, m) +# define MITK_PP_FOR_109_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(110, s) MITK_PP_IIF(c, MITK_PP_FOR_110, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(110, s), p, o, m) +# define MITK_PP_FOR_110_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(111, s) MITK_PP_IIF(c, MITK_PP_FOR_111, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(111, s), p, o, m) +# define MITK_PP_FOR_111_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(112, s) MITK_PP_IIF(c, MITK_PP_FOR_112, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(112, s), p, o, m) +# define MITK_PP_FOR_112_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(113, s) MITK_PP_IIF(c, MITK_PP_FOR_113, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(113, s), p, o, m) +# define MITK_PP_FOR_113_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(114, s) MITK_PP_IIF(c, MITK_PP_FOR_114, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(114, s), p, o, m) +# define MITK_PP_FOR_114_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(115, s) MITK_PP_IIF(c, MITK_PP_FOR_115, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(115, s), p, o, m) +# define MITK_PP_FOR_115_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(116, s) MITK_PP_IIF(c, MITK_PP_FOR_116, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(116, s), p, o, m) +# define MITK_PP_FOR_116_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(117, s) MITK_PP_IIF(c, MITK_PP_FOR_117, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(117, s), p, o, m) +# define MITK_PP_FOR_117_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(118, s) MITK_PP_IIF(c, MITK_PP_FOR_118, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(118, s), p, o, m) +# define MITK_PP_FOR_118_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(119, s) MITK_PP_IIF(c, MITK_PP_FOR_119, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(119, s), p, o, m) +# define MITK_PP_FOR_119_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(120, s) MITK_PP_IIF(c, MITK_PP_FOR_120, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(120, s), p, o, m) +# define MITK_PP_FOR_120_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(121, s) MITK_PP_IIF(c, MITK_PP_FOR_121, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(121, s), p, o, m) +# define MITK_PP_FOR_121_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(122, s) MITK_PP_IIF(c, MITK_PP_FOR_122, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(122, s), p, o, m) +# define MITK_PP_FOR_122_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(123, s) MITK_PP_IIF(c, MITK_PP_FOR_123, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(123, s), p, o, m) +# define MITK_PP_FOR_123_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(124, s) MITK_PP_IIF(c, MITK_PP_FOR_124, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(124, s), p, o, m) +# define MITK_PP_FOR_124_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(125, s) MITK_PP_IIF(c, MITK_PP_FOR_125, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(125, s), p, o, m) +# define MITK_PP_FOR_125_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(126, s) MITK_PP_IIF(c, MITK_PP_FOR_126, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(126, s), p, o, m) +# define MITK_PP_FOR_126_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(127, s) MITK_PP_IIF(c, MITK_PP_FOR_127, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(127, s), p, o, m) +# define MITK_PP_FOR_127_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(128, s) MITK_PP_IIF(c, MITK_PP_FOR_128, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(128, s), p, o, m) +# define MITK_PP_FOR_128_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(129, s) MITK_PP_IIF(c, MITK_PP_FOR_129, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(129, s), p, o, m) +# define MITK_PP_FOR_129_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(130, s) MITK_PP_IIF(c, MITK_PP_FOR_130, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(130, s), p, o, m) +# define MITK_PP_FOR_130_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(131, s) MITK_PP_IIF(c, MITK_PP_FOR_131, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(131, s), p, o, m) +# define MITK_PP_FOR_131_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(132, s) MITK_PP_IIF(c, MITK_PP_FOR_132, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(132, s), p, o, m) +# define MITK_PP_FOR_132_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(133, s) MITK_PP_IIF(c, MITK_PP_FOR_133, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(133, s), p, o, m) +# define MITK_PP_FOR_133_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(134, s) MITK_PP_IIF(c, MITK_PP_FOR_134, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(134, s), p, o, m) +# define MITK_PP_FOR_134_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(135, s) MITK_PP_IIF(c, MITK_PP_FOR_135, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(135, s), p, o, m) +# define MITK_PP_FOR_135_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(136, s) MITK_PP_IIF(c, MITK_PP_FOR_136, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(136, s), p, o, m) +# define MITK_PP_FOR_136_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(137, s) MITK_PP_IIF(c, MITK_PP_FOR_137, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(137, s), p, o, m) +# define MITK_PP_FOR_137_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(138, s) MITK_PP_IIF(c, MITK_PP_FOR_138, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(138, s), p, o, m) +# define MITK_PP_FOR_138_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(139, s) MITK_PP_IIF(c, MITK_PP_FOR_139, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(139, s), p, o, m) +# define MITK_PP_FOR_139_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(140, s) MITK_PP_IIF(c, MITK_PP_FOR_140, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(140, s), p, o, m) +# define MITK_PP_FOR_140_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(141, s) MITK_PP_IIF(c, MITK_PP_FOR_141, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(141, s), p, o, m) +# define MITK_PP_FOR_141_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(142, s) MITK_PP_IIF(c, MITK_PP_FOR_142, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(142, s), p, o, m) +# define MITK_PP_FOR_142_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(143, s) MITK_PP_IIF(c, MITK_PP_FOR_143, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(143, s), p, o, m) +# define MITK_PP_FOR_143_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(144, s) MITK_PP_IIF(c, MITK_PP_FOR_144, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(144, s), p, o, m) +# define MITK_PP_FOR_144_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(145, s) MITK_PP_IIF(c, MITK_PP_FOR_145, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(145, s), p, o, m) +# define MITK_PP_FOR_145_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(146, s) MITK_PP_IIF(c, MITK_PP_FOR_146, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(146, s), p, o, m) +# define MITK_PP_FOR_146_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(147, s) MITK_PP_IIF(c, MITK_PP_FOR_147, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(147, s), p, o, m) +# define MITK_PP_FOR_147_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(148, s) MITK_PP_IIF(c, MITK_PP_FOR_148, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(148, s), p, o, m) +# define MITK_PP_FOR_148_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(149, s) MITK_PP_IIF(c, MITK_PP_FOR_149, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(149, s), p, o, m) +# define MITK_PP_FOR_149_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(150, s) MITK_PP_IIF(c, MITK_PP_FOR_150, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(150, s), p, o, m) +# define MITK_PP_FOR_150_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(151, s) MITK_PP_IIF(c, MITK_PP_FOR_151, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(151, s), p, o, m) +# define MITK_PP_FOR_151_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(152, s) MITK_PP_IIF(c, MITK_PP_FOR_152, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(152, s), p, o, m) +# define MITK_PP_FOR_152_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(153, s) MITK_PP_IIF(c, MITK_PP_FOR_153, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(153, s), p, o, m) +# define MITK_PP_FOR_153_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(154, s) MITK_PP_IIF(c, MITK_PP_FOR_154, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(154, s), p, o, m) +# define MITK_PP_FOR_154_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(155, s) MITK_PP_IIF(c, MITK_PP_FOR_155, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(155, s), p, o, m) +# define MITK_PP_FOR_155_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(156, s) MITK_PP_IIF(c, MITK_PP_FOR_156, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(156, s), p, o, m) +# define MITK_PP_FOR_156_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(157, s) MITK_PP_IIF(c, MITK_PP_FOR_157, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(157, s), p, o, m) +# define MITK_PP_FOR_157_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(158, s) MITK_PP_IIF(c, MITK_PP_FOR_158, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(158, s), p, o, m) +# define MITK_PP_FOR_158_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(159, s) MITK_PP_IIF(c, MITK_PP_FOR_159, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(159, s), p, o, m) +# define MITK_PP_FOR_159_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(160, s) MITK_PP_IIF(c, MITK_PP_FOR_160, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(160, s), p, o, m) +# define MITK_PP_FOR_160_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(161, s) MITK_PP_IIF(c, MITK_PP_FOR_161, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(161, s), p, o, m) +# define MITK_PP_FOR_161_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(162, s) MITK_PP_IIF(c, MITK_PP_FOR_162, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(162, s), p, o, m) +# define MITK_PP_FOR_162_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(163, s) MITK_PP_IIF(c, MITK_PP_FOR_163, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(163, s), p, o, m) +# define MITK_PP_FOR_163_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(164, s) MITK_PP_IIF(c, MITK_PP_FOR_164, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(164, s), p, o, m) +# define MITK_PP_FOR_164_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(165, s) MITK_PP_IIF(c, MITK_PP_FOR_165, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(165, s), p, o, m) +# define MITK_PP_FOR_165_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(166, s) MITK_PP_IIF(c, MITK_PP_FOR_166, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(166, s), p, o, m) +# define MITK_PP_FOR_166_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(167, s) MITK_PP_IIF(c, MITK_PP_FOR_167, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(167, s), p, o, m) +# define MITK_PP_FOR_167_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(168, s) MITK_PP_IIF(c, MITK_PP_FOR_168, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(168, s), p, o, m) +# define MITK_PP_FOR_168_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(169, s) MITK_PP_IIF(c, MITK_PP_FOR_169, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(169, s), p, o, m) +# define MITK_PP_FOR_169_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(170, s) MITK_PP_IIF(c, MITK_PP_FOR_170, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(170, s), p, o, m) +# define MITK_PP_FOR_170_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(171, s) MITK_PP_IIF(c, MITK_PP_FOR_171, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(171, s), p, o, m) +# define MITK_PP_FOR_171_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(172, s) MITK_PP_IIF(c, MITK_PP_FOR_172, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(172, s), p, o, m) +# define MITK_PP_FOR_172_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(173, s) MITK_PP_IIF(c, MITK_PP_FOR_173, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(173, s), p, o, m) +# define MITK_PP_FOR_173_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(174, s) MITK_PP_IIF(c, MITK_PP_FOR_174, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(174, s), p, o, m) +# define MITK_PP_FOR_174_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(175, s) MITK_PP_IIF(c, MITK_PP_FOR_175, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(175, s), p, o, m) +# define MITK_PP_FOR_175_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(176, s) MITK_PP_IIF(c, MITK_PP_FOR_176, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(176, s), p, o, m) +# define MITK_PP_FOR_176_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(177, s) MITK_PP_IIF(c, MITK_PP_FOR_177, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(177, s), p, o, m) +# define MITK_PP_FOR_177_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(178, s) MITK_PP_IIF(c, MITK_PP_FOR_178, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(178, s), p, o, m) +# define MITK_PP_FOR_178_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(179, s) MITK_PP_IIF(c, MITK_PP_FOR_179, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(179, s), p, o, m) +# define MITK_PP_FOR_179_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(180, s) MITK_PP_IIF(c, MITK_PP_FOR_180, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(180, s), p, o, m) +# define MITK_PP_FOR_180_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(181, s) MITK_PP_IIF(c, MITK_PP_FOR_181, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(181, s), p, o, m) +# define MITK_PP_FOR_181_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(182, s) MITK_PP_IIF(c, MITK_PP_FOR_182, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(182, s), p, o, m) +# define MITK_PP_FOR_182_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(183, s) MITK_PP_IIF(c, MITK_PP_FOR_183, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(183, s), p, o, m) +# define MITK_PP_FOR_183_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(184, s) MITK_PP_IIF(c, MITK_PP_FOR_184, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(184, s), p, o, m) +# define MITK_PP_FOR_184_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(185, s) MITK_PP_IIF(c, MITK_PP_FOR_185, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(185, s), p, o, m) +# define MITK_PP_FOR_185_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(186, s) MITK_PP_IIF(c, MITK_PP_FOR_186, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(186, s), p, o, m) +# define MITK_PP_FOR_186_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(187, s) MITK_PP_IIF(c, MITK_PP_FOR_187, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(187, s), p, o, m) +# define MITK_PP_FOR_187_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(188, s) MITK_PP_IIF(c, MITK_PP_FOR_188, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(188, s), p, o, m) +# define MITK_PP_FOR_188_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(189, s) MITK_PP_IIF(c, MITK_PP_FOR_189, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(189, s), p, o, m) +# define MITK_PP_FOR_189_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(190, s) MITK_PP_IIF(c, MITK_PP_FOR_190, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(190, s), p, o, m) +# define MITK_PP_FOR_190_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(191, s) MITK_PP_IIF(c, MITK_PP_FOR_191, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(191, s), p, o, m) +# define MITK_PP_FOR_191_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(192, s) MITK_PP_IIF(c, MITK_PP_FOR_192, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(192, s), p, o, m) +# define MITK_PP_FOR_192_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(193, s) MITK_PP_IIF(c, MITK_PP_FOR_193, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(193, s), p, o, m) +# define MITK_PP_FOR_193_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(194, s) MITK_PP_IIF(c, MITK_PP_FOR_194, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(194, s), p, o, m) +# define MITK_PP_FOR_194_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(195, s) MITK_PP_IIF(c, MITK_PP_FOR_195, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(195, s), p, o, m) +# define MITK_PP_FOR_195_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(196, s) MITK_PP_IIF(c, MITK_PP_FOR_196, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(196, s), p, o, m) +# define MITK_PP_FOR_196_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(197, s) MITK_PP_IIF(c, MITK_PP_FOR_197, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(197, s), p, o, m) +# define MITK_PP_FOR_197_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(198, s) MITK_PP_IIF(c, MITK_PP_FOR_198, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(198, s), p, o, m) +# define MITK_PP_FOR_198_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(199, s) MITK_PP_IIF(c, MITK_PP_FOR_199, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(199, s), p, o, m) +# define MITK_PP_FOR_199_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(200, s) MITK_PP_IIF(c, MITK_PP_FOR_200, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(200, s), p, o, m) +# define MITK_PP_FOR_200_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(201, s) MITK_PP_IIF(c, MITK_PP_FOR_201, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(201, s), p, o, m) +# define MITK_PP_FOR_201_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(202, s) MITK_PP_IIF(c, MITK_PP_FOR_202, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(202, s), p, o, m) +# define MITK_PP_FOR_202_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(203, s) MITK_PP_IIF(c, MITK_PP_FOR_203, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(203, s), p, o, m) +# define MITK_PP_FOR_203_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(204, s) MITK_PP_IIF(c, MITK_PP_FOR_204, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(204, s), p, o, m) +# define MITK_PP_FOR_204_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(205, s) MITK_PP_IIF(c, MITK_PP_FOR_205, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(205, s), p, o, m) +# define MITK_PP_FOR_205_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(206, s) MITK_PP_IIF(c, MITK_PP_FOR_206, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(206, s), p, o, m) +# define MITK_PP_FOR_206_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(207, s) MITK_PP_IIF(c, MITK_PP_FOR_207, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(207, s), p, o, m) +# define MITK_PP_FOR_207_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(208, s) MITK_PP_IIF(c, MITK_PP_FOR_208, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(208, s), p, o, m) +# define MITK_PP_FOR_208_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(209, s) MITK_PP_IIF(c, MITK_PP_FOR_209, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(209, s), p, o, m) +# define MITK_PP_FOR_209_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(210, s) MITK_PP_IIF(c, MITK_PP_FOR_210, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(210, s), p, o, m) +# define MITK_PP_FOR_210_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(211, s) MITK_PP_IIF(c, MITK_PP_FOR_211, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(211, s), p, o, m) +# define MITK_PP_FOR_211_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(212, s) MITK_PP_IIF(c, MITK_PP_FOR_212, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(212, s), p, o, m) +# define MITK_PP_FOR_212_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(213, s) MITK_PP_IIF(c, MITK_PP_FOR_213, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(213, s), p, o, m) +# define MITK_PP_FOR_213_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(214, s) MITK_PP_IIF(c, MITK_PP_FOR_214, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(214, s), p, o, m) +# define MITK_PP_FOR_214_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(215, s) MITK_PP_IIF(c, MITK_PP_FOR_215, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(215, s), p, o, m) +# define MITK_PP_FOR_215_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(216, s) MITK_PP_IIF(c, MITK_PP_FOR_216, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(216, s), p, o, m) +# define MITK_PP_FOR_216_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(217, s) MITK_PP_IIF(c, MITK_PP_FOR_217, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(217, s), p, o, m) +# define MITK_PP_FOR_217_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(218, s) MITK_PP_IIF(c, MITK_PP_FOR_218, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(218, s), p, o, m) +# define MITK_PP_FOR_218_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(219, s) MITK_PP_IIF(c, MITK_PP_FOR_219, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(219, s), p, o, m) +# define MITK_PP_FOR_219_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(220, s) MITK_PP_IIF(c, MITK_PP_FOR_220, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(220, s), p, o, m) +# define MITK_PP_FOR_220_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(221, s) MITK_PP_IIF(c, MITK_PP_FOR_221, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(221, s), p, o, m) +# define MITK_PP_FOR_221_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(222, s) MITK_PP_IIF(c, MITK_PP_FOR_222, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(222, s), p, o, m) +# define MITK_PP_FOR_222_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(223, s) MITK_PP_IIF(c, MITK_PP_FOR_223, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(223, s), p, o, m) +# define MITK_PP_FOR_223_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(224, s) MITK_PP_IIF(c, MITK_PP_FOR_224, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(224, s), p, o, m) +# define MITK_PP_FOR_224_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(225, s) MITK_PP_IIF(c, MITK_PP_FOR_225, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(225, s), p, o, m) +# define MITK_PP_FOR_225_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(226, s) MITK_PP_IIF(c, MITK_PP_FOR_226, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(226, s), p, o, m) +# define MITK_PP_FOR_226_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(227, s) MITK_PP_IIF(c, MITK_PP_FOR_227, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(227, s), p, o, m) +# define MITK_PP_FOR_227_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(228, s) MITK_PP_IIF(c, MITK_PP_FOR_228, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(228, s), p, o, m) +# define MITK_PP_FOR_228_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(229, s) MITK_PP_IIF(c, MITK_PP_FOR_229, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(229, s), p, o, m) +# define MITK_PP_FOR_229_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(230, s) MITK_PP_IIF(c, MITK_PP_FOR_230, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(230, s), p, o, m) +# define MITK_PP_FOR_230_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(231, s) MITK_PP_IIF(c, MITK_PP_FOR_231, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(231, s), p, o, m) +# define MITK_PP_FOR_231_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(232, s) MITK_PP_IIF(c, MITK_PP_FOR_232, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(232, s), p, o, m) +# define MITK_PP_FOR_232_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(233, s) MITK_PP_IIF(c, MITK_PP_FOR_233, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(233, s), p, o, m) +# define MITK_PP_FOR_233_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(234, s) MITK_PP_IIF(c, MITK_PP_FOR_234, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(234, s), p, o, m) +# define MITK_PP_FOR_234_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(235, s) MITK_PP_IIF(c, MITK_PP_FOR_235, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(235, s), p, o, m) +# define MITK_PP_FOR_235_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(236, s) MITK_PP_IIF(c, MITK_PP_FOR_236, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(236, s), p, o, m) +# define MITK_PP_FOR_236_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(237, s) MITK_PP_IIF(c, MITK_PP_FOR_237, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(237, s), p, o, m) +# define MITK_PP_FOR_237_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(238, s) MITK_PP_IIF(c, MITK_PP_FOR_238, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(238, s), p, o, m) +# define MITK_PP_FOR_238_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(239, s) MITK_PP_IIF(c, MITK_PP_FOR_239, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(239, s), p, o, m) +# define MITK_PP_FOR_239_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(240, s) MITK_PP_IIF(c, MITK_PP_FOR_240, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(240, s), p, o, m) +# define MITK_PP_FOR_240_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(241, s) MITK_PP_IIF(c, MITK_PP_FOR_241, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(241, s), p, o, m) +# define MITK_PP_FOR_241_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(242, s) MITK_PP_IIF(c, MITK_PP_FOR_242, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(242, s), p, o, m) +# define MITK_PP_FOR_242_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(243, s) MITK_PP_IIF(c, MITK_PP_FOR_243, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(243, s), p, o, m) +# define MITK_PP_FOR_243_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(244, s) MITK_PP_IIF(c, MITK_PP_FOR_244, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(244, s), p, o, m) +# define MITK_PP_FOR_244_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(245, s) MITK_PP_IIF(c, MITK_PP_FOR_245, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(245, s), p, o, m) +# define MITK_PP_FOR_245_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(246, s) MITK_PP_IIF(c, MITK_PP_FOR_246, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(246, s), p, o, m) +# define MITK_PP_FOR_246_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(247, s) MITK_PP_IIF(c, MITK_PP_FOR_247, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(247, s), p, o, m) +# define MITK_PP_FOR_247_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(248, s) MITK_PP_IIF(c, MITK_PP_FOR_248, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(248, s), p, o, m) +# define MITK_PP_FOR_248_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(249, s) MITK_PP_IIF(c, MITK_PP_FOR_249, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(249, s), p, o, m) +# define MITK_PP_FOR_249_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(250, s) MITK_PP_IIF(c, MITK_PP_FOR_250, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(250, s), p, o, m) +# define MITK_PP_FOR_250_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(251, s) MITK_PP_IIF(c, MITK_PP_FOR_251, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(251, s), p, o, m) +# define MITK_PP_FOR_251_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(252, s) MITK_PP_IIF(c, MITK_PP_FOR_252, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(252, s), p, o, m) +# define MITK_PP_FOR_252_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(253, s) MITK_PP_IIF(c, MITK_PP_FOR_253, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(253, s), p, o, m) +# define MITK_PP_FOR_253_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(254, s) MITK_PP_IIF(c, MITK_PP_FOR_254, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(254, s), p, o, m) +# define MITK_PP_FOR_254_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(255, s) MITK_PP_IIF(c, MITK_PP_FOR_255, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(255, s), p, o, m) +# define MITK_PP_FOR_255_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(256, s) MITK_PP_IIF(c, MITK_PP_FOR_256, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(256, s), p, o, m) +# define MITK_PP_FOR_256_C(c, s, p, o, m) MITK_PP_IIF(c, m, MITK_PP_TUPLE_EAT_2)(257, s) MITK_PP_IIF(c, MITK_PP_FOR_257, MITK_PP_TUPLE_EAT_4)(MITK_PP_EXPR_IIF(c, o)(257, s), p, o, m) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPRepetitionDetailMSVCFor.h b/Core/Code/Algorithms/mitkPPRepetitionDetailMSVCFor.h new file mode 100644 index 0000000000..3edbebb55f --- /dev/null +++ b/Core/Code/Algorithms/mitkPPRepetitionDetailMSVCFor.h @@ -0,0 +1,277 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_REPETITION_DETAIL_MSVC_FOR_HPP +# define MITK_PREPROCESSOR_REPETITION_DETAIL_MSVC_FOR_HPP +# +# include "mitkPPControlIf.h" +# include "mitkPPTupleEat.h" +# +# define MITK_PP_FOR_1(s, p, o, m) MITK_PP_IF(p(2, s), m, MITK_PP_TUPLE_EAT_2)(2, s) MITK_PP_IF(p(2, s), MITK_PP_FOR_2, MITK_PP_TUPLE_EAT_4)(o(2, s), p, o, m) +# define MITK_PP_FOR_2(s, p, o, m) MITK_PP_IF(p(3, s), m, MITK_PP_TUPLE_EAT_2)(3, s) MITK_PP_IF(p(3, s), MITK_PP_FOR_3, MITK_PP_TUPLE_EAT_4)(o(3, s), p, o, m) +# define MITK_PP_FOR_3(s, p, o, m) MITK_PP_IF(p(4, s), m, MITK_PP_TUPLE_EAT_2)(4, s) MITK_PP_IF(p(4, s), MITK_PP_FOR_4, MITK_PP_TUPLE_EAT_4)(o(4, s), p, o, m) +# define MITK_PP_FOR_4(s, p, o, m) MITK_PP_IF(p(5, s), m, MITK_PP_TUPLE_EAT_2)(5, s) MITK_PP_IF(p(5, s), MITK_PP_FOR_5, MITK_PP_TUPLE_EAT_4)(o(5, s), p, o, m) +# define MITK_PP_FOR_5(s, p, o, m) MITK_PP_IF(p(6, s), m, MITK_PP_TUPLE_EAT_2)(6, s) MITK_PP_IF(p(6, s), MITK_PP_FOR_6, MITK_PP_TUPLE_EAT_4)(o(6, s), p, o, m) +# define MITK_PP_FOR_6(s, p, o, m) MITK_PP_IF(p(7, s), m, MITK_PP_TUPLE_EAT_2)(7, s) MITK_PP_IF(p(7, s), MITK_PP_FOR_7, MITK_PP_TUPLE_EAT_4)(o(7, s), p, o, m) +# define MITK_PP_FOR_7(s, p, o, m) MITK_PP_IF(p(8, s), m, MITK_PP_TUPLE_EAT_2)(8, s) MITK_PP_IF(p(8, s), MITK_PP_FOR_8, MITK_PP_TUPLE_EAT_4)(o(8, s), p, o, m) +# define MITK_PP_FOR_8(s, p, o, m) MITK_PP_IF(p(9, s), m, MITK_PP_TUPLE_EAT_2)(9, s) MITK_PP_IF(p(9, s), MITK_PP_FOR_9, MITK_PP_TUPLE_EAT_4)(o(9, s), p, o, m) +# define MITK_PP_FOR_9(s, p, o, m) MITK_PP_IF(p(10, s), m, MITK_PP_TUPLE_EAT_2)(10, s) MITK_PP_IF(p(10, s), MITK_PP_FOR_10, MITK_PP_TUPLE_EAT_4)(o(10, s), p, o, m) +# define MITK_PP_FOR_10(s, p, o, m) MITK_PP_IF(p(11, s), m, MITK_PP_TUPLE_EAT_2)(11, s) MITK_PP_IF(p(11, s), MITK_PP_FOR_11, MITK_PP_TUPLE_EAT_4)(o(11, s), p, o, m) +# define MITK_PP_FOR_11(s, p, o, m) MITK_PP_IF(p(12, s), m, MITK_PP_TUPLE_EAT_2)(12, s) MITK_PP_IF(p(12, s), MITK_PP_FOR_12, MITK_PP_TUPLE_EAT_4)(o(12, s), p, o, m) +# define MITK_PP_FOR_12(s, p, o, m) MITK_PP_IF(p(13, s), m, MITK_PP_TUPLE_EAT_2)(13, s) MITK_PP_IF(p(13, s), MITK_PP_FOR_13, MITK_PP_TUPLE_EAT_4)(o(13, s), p, o, m) +# define MITK_PP_FOR_13(s, p, o, m) MITK_PP_IF(p(14, s), m, MITK_PP_TUPLE_EAT_2)(14, s) MITK_PP_IF(p(14, s), MITK_PP_FOR_14, MITK_PP_TUPLE_EAT_4)(o(14, s), p, o, m) +# define MITK_PP_FOR_14(s, p, o, m) MITK_PP_IF(p(15, s), m, MITK_PP_TUPLE_EAT_2)(15, s) MITK_PP_IF(p(15, s), MITK_PP_FOR_15, MITK_PP_TUPLE_EAT_4)(o(15, s), p, o, m) +# define MITK_PP_FOR_15(s, p, o, m) MITK_PP_IF(p(16, s), m, MITK_PP_TUPLE_EAT_2)(16, s) MITK_PP_IF(p(16, s), MITK_PP_FOR_16, MITK_PP_TUPLE_EAT_4)(o(16, s), p, o, m) +# define MITK_PP_FOR_16(s, p, o, m) MITK_PP_IF(p(17, s), m, MITK_PP_TUPLE_EAT_2)(17, s) MITK_PP_IF(p(17, s), MITK_PP_FOR_17, MITK_PP_TUPLE_EAT_4)(o(17, s), p, o, m) +# define MITK_PP_FOR_17(s, p, o, m) MITK_PP_IF(p(18, s), m, MITK_PP_TUPLE_EAT_2)(18, s) MITK_PP_IF(p(18, s), MITK_PP_FOR_18, MITK_PP_TUPLE_EAT_4)(o(18, s), p, o, m) +# define MITK_PP_FOR_18(s, p, o, m) MITK_PP_IF(p(19, s), m, MITK_PP_TUPLE_EAT_2)(19, s) MITK_PP_IF(p(19, s), MITK_PP_FOR_19, MITK_PP_TUPLE_EAT_4)(o(19, s), p, o, m) +# define MITK_PP_FOR_19(s, p, o, m) MITK_PP_IF(p(20, s), m, MITK_PP_TUPLE_EAT_2)(20, s) MITK_PP_IF(p(20, s), MITK_PP_FOR_20, MITK_PP_TUPLE_EAT_4)(o(20, s), p, o, m) +# define MITK_PP_FOR_20(s, p, o, m) MITK_PP_IF(p(21, s), m, MITK_PP_TUPLE_EAT_2)(21, s) MITK_PP_IF(p(21, s), MITK_PP_FOR_21, MITK_PP_TUPLE_EAT_4)(o(21, s), p, o, m) +# define MITK_PP_FOR_21(s, p, o, m) MITK_PP_IF(p(22, s), m, MITK_PP_TUPLE_EAT_2)(22, s) MITK_PP_IF(p(22, s), MITK_PP_FOR_22, MITK_PP_TUPLE_EAT_4)(o(22, s), p, o, m) +# define MITK_PP_FOR_22(s, p, o, m) MITK_PP_IF(p(23, s), m, MITK_PP_TUPLE_EAT_2)(23, s) MITK_PP_IF(p(23, s), MITK_PP_FOR_23, MITK_PP_TUPLE_EAT_4)(o(23, s), p, o, m) +# define MITK_PP_FOR_23(s, p, o, m) MITK_PP_IF(p(24, s), m, MITK_PP_TUPLE_EAT_2)(24, s) MITK_PP_IF(p(24, s), MITK_PP_FOR_24, MITK_PP_TUPLE_EAT_4)(o(24, s), p, o, m) +# define MITK_PP_FOR_24(s, p, o, m) MITK_PP_IF(p(25, s), m, MITK_PP_TUPLE_EAT_2)(25, s) MITK_PP_IF(p(25, s), MITK_PP_FOR_25, MITK_PP_TUPLE_EAT_4)(o(25, s), p, o, m) +# define MITK_PP_FOR_25(s, p, o, m) MITK_PP_IF(p(26, s), m, MITK_PP_TUPLE_EAT_2)(26, s) MITK_PP_IF(p(26, s), MITK_PP_FOR_26, MITK_PP_TUPLE_EAT_4)(o(26, s), p, o, m) +# define MITK_PP_FOR_26(s, p, o, m) MITK_PP_IF(p(27, s), m, MITK_PP_TUPLE_EAT_2)(27, s) MITK_PP_IF(p(27, s), MITK_PP_FOR_27, MITK_PP_TUPLE_EAT_4)(o(27, s), p, o, m) +# define MITK_PP_FOR_27(s, p, o, m) MITK_PP_IF(p(28, s), m, MITK_PP_TUPLE_EAT_2)(28, s) MITK_PP_IF(p(28, s), MITK_PP_FOR_28, MITK_PP_TUPLE_EAT_4)(o(28, s), p, o, m) +# define MITK_PP_FOR_28(s, p, o, m) MITK_PP_IF(p(29, s), m, MITK_PP_TUPLE_EAT_2)(29, s) MITK_PP_IF(p(29, s), MITK_PP_FOR_29, MITK_PP_TUPLE_EAT_4)(o(29, s), p, o, m) +# define MITK_PP_FOR_29(s, p, o, m) MITK_PP_IF(p(30, s), m, MITK_PP_TUPLE_EAT_2)(30, s) MITK_PP_IF(p(30, s), MITK_PP_FOR_30, MITK_PP_TUPLE_EAT_4)(o(30, s), p, o, m) +# define MITK_PP_FOR_30(s, p, o, m) MITK_PP_IF(p(31, s), m, MITK_PP_TUPLE_EAT_2)(31, s) MITK_PP_IF(p(31, s), MITK_PP_FOR_31, MITK_PP_TUPLE_EAT_4)(o(31, s), p, o, m) +# define MITK_PP_FOR_31(s, p, o, m) MITK_PP_IF(p(32, s), m, MITK_PP_TUPLE_EAT_2)(32, s) MITK_PP_IF(p(32, s), MITK_PP_FOR_32, MITK_PP_TUPLE_EAT_4)(o(32, s), p, o, m) +# define MITK_PP_FOR_32(s, p, o, m) MITK_PP_IF(p(33, s), m, MITK_PP_TUPLE_EAT_2)(33, s) MITK_PP_IF(p(33, s), MITK_PP_FOR_33, MITK_PP_TUPLE_EAT_4)(o(33, s), p, o, m) +# define MITK_PP_FOR_33(s, p, o, m) MITK_PP_IF(p(34, s), m, MITK_PP_TUPLE_EAT_2)(34, s) MITK_PP_IF(p(34, s), MITK_PP_FOR_34, MITK_PP_TUPLE_EAT_4)(o(34, s), p, o, m) +# define MITK_PP_FOR_34(s, p, o, m) MITK_PP_IF(p(35, s), m, MITK_PP_TUPLE_EAT_2)(35, s) MITK_PP_IF(p(35, s), MITK_PP_FOR_35, MITK_PP_TUPLE_EAT_4)(o(35, s), p, o, m) +# define MITK_PP_FOR_35(s, p, o, m) MITK_PP_IF(p(36, s), m, MITK_PP_TUPLE_EAT_2)(36, s) MITK_PP_IF(p(36, s), MITK_PP_FOR_36, MITK_PP_TUPLE_EAT_4)(o(36, s), p, o, m) +# define MITK_PP_FOR_36(s, p, o, m) MITK_PP_IF(p(37, s), m, MITK_PP_TUPLE_EAT_2)(37, s) MITK_PP_IF(p(37, s), MITK_PP_FOR_37, MITK_PP_TUPLE_EAT_4)(o(37, s), p, o, m) +# define MITK_PP_FOR_37(s, p, o, m) MITK_PP_IF(p(38, s), m, MITK_PP_TUPLE_EAT_2)(38, s) MITK_PP_IF(p(38, s), MITK_PP_FOR_38, MITK_PP_TUPLE_EAT_4)(o(38, s), p, o, m) +# define MITK_PP_FOR_38(s, p, o, m) MITK_PP_IF(p(39, s), m, MITK_PP_TUPLE_EAT_2)(39, s) MITK_PP_IF(p(39, s), MITK_PP_FOR_39, MITK_PP_TUPLE_EAT_4)(o(39, s), p, o, m) +# define MITK_PP_FOR_39(s, p, o, m) MITK_PP_IF(p(40, s), m, MITK_PP_TUPLE_EAT_2)(40, s) MITK_PP_IF(p(40, s), MITK_PP_FOR_40, MITK_PP_TUPLE_EAT_4)(o(40, s), p, o, m) +# define MITK_PP_FOR_40(s, p, o, m) MITK_PP_IF(p(41, s), m, MITK_PP_TUPLE_EAT_2)(41, s) MITK_PP_IF(p(41, s), MITK_PP_FOR_41, MITK_PP_TUPLE_EAT_4)(o(41, s), p, o, m) +# define MITK_PP_FOR_41(s, p, o, m) MITK_PP_IF(p(42, s), m, MITK_PP_TUPLE_EAT_2)(42, s) MITK_PP_IF(p(42, s), MITK_PP_FOR_42, MITK_PP_TUPLE_EAT_4)(o(42, s), p, o, m) +# define MITK_PP_FOR_42(s, p, o, m) MITK_PP_IF(p(43, s), m, MITK_PP_TUPLE_EAT_2)(43, s) MITK_PP_IF(p(43, s), MITK_PP_FOR_43, MITK_PP_TUPLE_EAT_4)(o(43, s), p, o, m) +# define MITK_PP_FOR_43(s, p, o, m) MITK_PP_IF(p(44, s), m, MITK_PP_TUPLE_EAT_2)(44, s) MITK_PP_IF(p(44, s), MITK_PP_FOR_44, MITK_PP_TUPLE_EAT_4)(o(44, s), p, o, m) +# define MITK_PP_FOR_44(s, p, o, m) MITK_PP_IF(p(45, s), m, MITK_PP_TUPLE_EAT_2)(45, s) MITK_PP_IF(p(45, s), MITK_PP_FOR_45, MITK_PP_TUPLE_EAT_4)(o(45, s), p, o, m) +# define MITK_PP_FOR_45(s, p, o, m) MITK_PP_IF(p(46, s), m, MITK_PP_TUPLE_EAT_2)(46, s) MITK_PP_IF(p(46, s), MITK_PP_FOR_46, MITK_PP_TUPLE_EAT_4)(o(46, s), p, o, m) +# define MITK_PP_FOR_46(s, p, o, m) MITK_PP_IF(p(47, s), m, MITK_PP_TUPLE_EAT_2)(47, s) MITK_PP_IF(p(47, s), MITK_PP_FOR_47, MITK_PP_TUPLE_EAT_4)(o(47, s), p, o, m) +# define MITK_PP_FOR_47(s, p, o, m) MITK_PP_IF(p(48, s), m, MITK_PP_TUPLE_EAT_2)(48, s) MITK_PP_IF(p(48, s), MITK_PP_FOR_48, MITK_PP_TUPLE_EAT_4)(o(48, s), p, o, m) +# define MITK_PP_FOR_48(s, p, o, m) MITK_PP_IF(p(49, s), m, MITK_PP_TUPLE_EAT_2)(49, s) MITK_PP_IF(p(49, s), MITK_PP_FOR_49, MITK_PP_TUPLE_EAT_4)(o(49, s), p, o, m) +# define MITK_PP_FOR_49(s, p, o, m) MITK_PP_IF(p(50, s), m, MITK_PP_TUPLE_EAT_2)(50, s) MITK_PP_IF(p(50, s), MITK_PP_FOR_50, MITK_PP_TUPLE_EAT_4)(o(50, s), p, o, m) +# define MITK_PP_FOR_50(s, p, o, m) MITK_PP_IF(p(51, s), m, MITK_PP_TUPLE_EAT_2)(51, s) MITK_PP_IF(p(51, s), MITK_PP_FOR_51, MITK_PP_TUPLE_EAT_4)(o(51, s), p, o, m) +# define MITK_PP_FOR_51(s, p, o, m) MITK_PP_IF(p(52, s), m, MITK_PP_TUPLE_EAT_2)(52, s) MITK_PP_IF(p(52, s), MITK_PP_FOR_52, MITK_PP_TUPLE_EAT_4)(o(52, s), p, o, m) +# define MITK_PP_FOR_52(s, p, o, m) MITK_PP_IF(p(53, s), m, MITK_PP_TUPLE_EAT_2)(53, s) MITK_PP_IF(p(53, s), MITK_PP_FOR_53, MITK_PP_TUPLE_EAT_4)(o(53, s), p, o, m) +# define MITK_PP_FOR_53(s, p, o, m) MITK_PP_IF(p(54, s), m, MITK_PP_TUPLE_EAT_2)(54, s) MITK_PP_IF(p(54, s), MITK_PP_FOR_54, MITK_PP_TUPLE_EAT_4)(o(54, s), p, o, m) +# define MITK_PP_FOR_54(s, p, o, m) MITK_PP_IF(p(55, s), m, MITK_PP_TUPLE_EAT_2)(55, s) MITK_PP_IF(p(55, s), MITK_PP_FOR_55, MITK_PP_TUPLE_EAT_4)(o(55, s), p, o, m) +# define MITK_PP_FOR_55(s, p, o, m) MITK_PP_IF(p(56, s), m, MITK_PP_TUPLE_EAT_2)(56, s) MITK_PP_IF(p(56, s), MITK_PP_FOR_56, MITK_PP_TUPLE_EAT_4)(o(56, s), p, o, m) +# define MITK_PP_FOR_56(s, p, o, m) MITK_PP_IF(p(57, s), m, MITK_PP_TUPLE_EAT_2)(57, s) MITK_PP_IF(p(57, s), MITK_PP_FOR_57, MITK_PP_TUPLE_EAT_4)(o(57, s), p, o, m) +# define MITK_PP_FOR_57(s, p, o, m) MITK_PP_IF(p(58, s), m, MITK_PP_TUPLE_EAT_2)(58, s) MITK_PP_IF(p(58, s), MITK_PP_FOR_58, MITK_PP_TUPLE_EAT_4)(o(58, s), p, o, m) +# define MITK_PP_FOR_58(s, p, o, m) MITK_PP_IF(p(59, s), m, MITK_PP_TUPLE_EAT_2)(59, s) MITK_PP_IF(p(59, s), MITK_PP_FOR_59, MITK_PP_TUPLE_EAT_4)(o(59, s), p, o, m) +# define MITK_PP_FOR_59(s, p, o, m) MITK_PP_IF(p(60, s), m, MITK_PP_TUPLE_EAT_2)(60, s) MITK_PP_IF(p(60, s), MITK_PP_FOR_60, MITK_PP_TUPLE_EAT_4)(o(60, s), p, o, m) +# define MITK_PP_FOR_60(s, p, o, m) MITK_PP_IF(p(61, s), m, MITK_PP_TUPLE_EAT_2)(61, s) MITK_PP_IF(p(61, s), MITK_PP_FOR_61, MITK_PP_TUPLE_EAT_4)(o(61, s), p, o, m) +# define MITK_PP_FOR_61(s, p, o, m) MITK_PP_IF(p(62, s), m, MITK_PP_TUPLE_EAT_2)(62, s) MITK_PP_IF(p(62, s), MITK_PP_FOR_62, MITK_PP_TUPLE_EAT_4)(o(62, s), p, o, m) +# define MITK_PP_FOR_62(s, p, o, m) MITK_PP_IF(p(63, s), m, MITK_PP_TUPLE_EAT_2)(63, s) MITK_PP_IF(p(63, s), MITK_PP_FOR_63, MITK_PP_TUPLE_EAT_4)(o(63, s), p, o, m) +# define MITK_PP_FOR_63(s, p, o, m) MITK_PP_IF(p(64, s), m, MITK_PP_TUPLE_EAT_2)(64, s) MITK_PP_IF(p(64, s), MITK_PP_FOR_64, MITK_PP_TUPLE_EAT_4)(o(64, s), p, o, m) +# define MITK_PP_FOR_64(s, p, o, m) MITK_PP_IF(p(65, s), m, MITK_PP_TUPLE_EAT_2)(65, s) MITK_PP_IF(p(65, s), MITK_PP_FOR_65, MITK_PP_TUPLE_EAT_4)(o(65, s), p, o, m) +# define MITK_PP_FOR_65(s, p, o, m) MITK_PP_IF(p(66, s), m, MITK_PP_TUPLE_EAT_2)(66, s) MITK_PP_IF(p(66, s), MITK_PP_FOR_66, MITK_PP_TUPLE_EAT_4)(o(66, s), p, o, m) +# define MITK_PP_FOR_66(s, p, o, m) MITK_PP_IF(p(67, s), m, MITK_PP_TUPLE_EAT_2)(67, s) MITK_PP_IF(p(67, s), MITK_PP_FOR_67, MITK_PP_TUPLE_EAT_4)(o(67, s), p, o, m) +# define MITK_PP_FOR_67(s, p, o, m) MITK_PP_IF(p(68, s), m, MITK_PP_TUPLE_EAT_2)(68, s) MITK_PP_IF(p(68, s), MITK_PP_FOR_68, MITK_PP_TUPLE_EAT_4)(o(68, s), p, o, m) +# define MITK_PP_FOR_68(s, p, o, m) MITK_PP_IF(p(69, s), m, MITK_PP_TUPLE_EAT_2)(69, s) MITK_PP_IF(p(69, s), MITK_PP_FOR_69, MITK_PP_TUPLE_EAT_4)(o(69, s), p, o, m) +# define MITK_PP_FOR_69(s, p, o, m) MITK_PP_IF(p(70, s), m, MITK_PP_TUPLE_EAT_2)(70, s) MITK_PP_IF(p(70, s), MITK_PP_FOR_70, MITK_PP_TUPLE_EAT_4)(o(70, s), p, o, m) +# define MITK_PP_FOR_70(s, p, o, m) MITK_PP_IF(p(71, s), m, MITK_PP_TUPLE_EAT_2)(71, s) MITK_PP_IF(p(71, s), MITK_PP_FOR_71, MITK_PP_TUPLE_EAT_4)(o(71, s), p, o, m) +# define MITK_PP_FOR_71(s, p, o, m) MITK_PP_IF(p(72, s), m, MITK_PP_TUPLE_EAT_2)(72, s) MITK_PP_IF(p(72, s), MITK_PP_FOR_72, MITK_PP_TUPLE_EAT_4)(o(72, s), p, o, m) +# define MITK_PP_FOR_72(s, p, o, m) MITK_PP_IF(p(73, s), m, MITK_PP_TUPLE_EAT_2)(73, s) MITK_PP_IF(p(73, s), MITK_PP_FOR_73, MITK_PP_TUPLE_EAT_4)(o(73, s), p, o, m) +# define MITK_PP_FOR_73(s, p, o, m) MITK_PP_IF(p(74, s), m, MITK_PP_TUPLE_EAT_2)(74, s) MITK_PP_IF(p(74, s), MITK_PP_FOR_74, MITK_PP_TUPLE_EAT_4)(o(74, s), p, o, m) +# define MITK_PP_FOR_74(s, p, o, m) MITK_PP_IF(p(75, s), m, MITK_PP_TUPLE_EAT_2)(75, s) MITK_PP_IF(p(75, s), MITK_PP_FOR_75, MITK_PP_TUPLE_EAT_4)(o(75, s), p, o, m) +# define MITK_PP_FOR_75(s, p, o, m) MITK_PP_IF(p(76, s), m, MITK_PP_TUPLE_EAT_2)(76, s) MITK_PP_IF(p(76, s), MITK_PP_FOR_76, MITK_PP_TUPLE_EAT_4)(o(76, s), p, o, m) +# define MITK_PP_FOR_76(s, p, o, m) MITK_PP_IF(p(77, s), m, MITK_PP_TUPLE_EAT_2)(77, s) MITK_PP_IF(p(77, s), MITK_PP_FOR_77, MITK_PP_TUPLE_EAT_4)(o(77, s), p, o, m) +# define MITK_PP_FOR_77(s, p, o, m) MITK_PP_IF(p(78, s), m, MITK_PP_TUPLE_EAT_2)(78, s) MITK_PP_IF(p(78, s), MITK_PP_FOR_78, MITK_PP_TUPLE_EAT_4)(o(78, s), p, o, m) +# define MITK_PP_FOR_78(s, p, o, m) MITK_PP_IF(p(79, s), m, MITK_PP_TUPLE_EAT_2)(79, s) MITK_PP_IF(p(79, s), MITK_PP_FOR_79, MITK_PP_TUPLE_EAT_4)(o(79, s), p, o, m) +# define MITK_PP_FOR_79(s, p, o, m) MITK_PP_IF(p(80, s), m, MITK_PP_TUPLE_EAT_2)(80, s) MITK_PP_IF(p(80, s), MITK_PP_FOR_80, MITK_PP_TUPLE_EAT_4)(o(80, s), p, o, m) +# define MITK_PP_FOR_80(s, p, o, m) MITK_PP_IF(p(81, s), m, MITK_PP_TUPLE_EAT_2)(81, s) MITK_PP_IF(p(81, s), MITK_PP_FOR_81, MITK_PP_TUPLE_EAT_4)(o(81, s), p, o, m) +# define MITK_PP_FOR_81(s, p, o, m) MITK_PP_IF(p(82, s), m, MITK_PP_TUPLE_EAT_2)(82, s) MITK_PP_IF(p(82, s), MITK_PP_FOR_82, MITK_PP_TUPLE_EAT_4)(o(82, s), p, o, m) +# define MITK_PP_FOR_82(s, p, o, m) MITK_PP_IF(p(83, s), m, MITK_PP_TUPLE_EAT_2)(83, s) MITK_PP_IF(p(83, s), MITK_PP_FOR_83, MITK_PP_TUPLE_EAT_4)(o(83, s), p, o, m) +# define MITK_PP_FOR_83(s, p, o, m) MITK_PP_IF(p(84, s), m, MITK_PP_TUPLE_EAT_2)(84, s) MITK_PP_IF(p(84, s), MITK_PP_FOR_84, MITK_PP_TUPLE_EAT_4)(o(84, s), p, o, m) +# define MITK_PP_FOR_84(s, p, o, m) MITK_PP_IF(p(85, s), m, MITK_PP_TUPLE_EAT_2)(85, s) MITK_PP_IF(p(85, s), MITK_PP_FOR_85, MITK_PP_TUPLE_EAT_4)(o(85, s), p, o, m) +# define MITK_PP_FOR_85(s, p, o, m) MITK_PP_IF(p(86, s), m, MITK_PP_TUPLE_EAT_2)(86, s) MITK_PP_IF(p(86, s), MITK_PP_FOR_86, MITK_PP_TUPLE_EAT_4)(o(86, s), p, o, m) +# define MITK_PP_FOR_86(s, p, o, m) MITK_PP_IF(p(87, s), m, MITK_PP_TUPLE_EAT_2)(87, s) MITK_PP_IF(p(87, s), MITK_PP_FOR_87, MITK_PP_TUPLE_EAT_4)(o(87, s), p, o, m) +# define MITK_PP_FOR_87(s, p, o, m) MITK_PP_IF(p(88, s), m, MITK_PP_TUPLE_EAT_2)(88, s) MITK_PP_IF(p(88, s), MITK_PP_FOR_88, MITK_PP_TUPLE_EAT_4)(o(88, s), p, o, m) +# define MITK_PP_FOR_88(s, p, o, m) MITK_PP_IF(p(89, s), m, MITK_PP_TUPLE_EAT_2)(89, s) MITK_PP_IF(p(89, s), MITK_PP_FOR_89, MITK_PP_TUPLE_EAT_4)(o(89, s), p, o, m) +# define MITK_PP_FOR_89(s, p, o, m) MITK_PP_IF(p(90, s), m, MITK_PP_TUPLE_EAT_2)(90, s) MITK_PP_IF(p(90, s), MITK_PP_FOR_90, MITK_PP_TUPLE_EAT_4)(o(90, s), p, o, m) +# define MITK_PP_FOR_90(s, p, o, m) MITK_PP_IF(p(91, s), m, MITK_PP_TUPLE_EAT_2)(91, s) MITK_PP_IF(p(91, s), MITK_PP_FOR_91, MITK_PP_TUPLE_EAT_4)(o(91, s), p, o, m) +# define MITK_PP_FOR_91(s, p, o, m) MITK_PP_IF(p(92, s), m, MITK_PP_TUPLE_EAT_2)(92, s) MITK_PP_IF(p(92, s), MITK_PP_FOR_92, MITK_PP_TUPLE_EAT_4)(o(92, s), p, o, m) +# define MITK_PP_FOR_92(s, p, o, m) MITK_PP_IF(p(93, s), m, MITK_PP_TUPLE_EAT_2)(93, s) MITK_PP_IF(p(93, s), MITK_PP_FOR_93, MITK_PP_TUPLE_EAT_4)(o(93, s), p, o, m) +# define MITK_PP_FOR_93(s, p, o, m) MITK_PP_IF(p(94, s), m, MITK_PP_TUPLE_EAT_2)(94, s) MITK_PP_IF(p(94, s), MITK_PP_FOR_94, MITK_PP_TUPLE_EAT_4)(o(94, s), p, o, m) +# define MITK_PP_FOR_94(s, p, o, m) MITK_PP_IF(p(95, s), m, MITK_PP_TUPLE_EAT_2)(95, s) MITK_PP_IF(p(95, s), MITK_PP_FOR_95, MITK_PP_TUPLE_EAT_4)(o(95, s), p, o, m) +# define MITK_PP_FOR_95(s, p, o, m) MITK_PP_IF(p(96, s), m, MITK_PP_TUPLE_EAT_2)(96, s) MITK_PP_IF(p(96, s), MITK_PP_FOR_96, MITK_PP_TUPLE_EAT_4)(o(96, s), p, o, m) +# define MITK_PP_FOR_96(s, p, o, m) MITK_PP_IF(p(97, s), m, MITK_PP_TUPLE_EAT_2)(97, s) MITK_PP_IF(p(97, s), MITK_PP_FOR_97, MITK_PP_TUPLE_EAT_4)(o(97, s), p, o, m) +# define MITK_PP_FOR_97(s, p, o, m) MITK_PP_IF(p(98, s), m, MITK_PP_TUPLE_EAT_2)(98, s) MITK_PP_IF(p(98, s), MITK_PP_FOR_98, MITK_PP_TUPLE_EAT_4)(o(98, s), p, o, m) +# define MITK_PP_FOR_98(s, p, o, m) MITK_PP_IF(p(99, s), m, MITK_PP_TUPLE_EAT_2)(99, s) MITK_PP_IF(p(99, s), MITK_PP_FOR_99, MITK_PP_TUPLE_EAT_4)(o(99, s), p, o, m) +# define MITK_PP_FOR_99(s, p, o, m) MITK_PP_IF(p(100, s), m, MITK_PP_TUPLE_EAT_2)(100, s) MITK_PP_IF(p(100, s), MITK_PP_FOR_100, MITK_PP_TUPLE_EAT_4)(o(100, s), p, o, m) +# define MITK_PP_FOR_100(s, p, o, m) MITK_PP_IF(p(101, s), m, MITK_PP_TUPLE_EAT_2)(101, s) MITK_PP_IF(p(101, s), MITK_PP_FOR_101, MITK_PP_TUPLE_EAT_4)(o(101, s), p, o, m) +# define MITK_PP_FOR_101(s, p, o, m) MITK_PP_IF(p(102, s), m, MITK_PP_TUPLE_EAT_2)(102, s) MITK_PP_IF(p(102, s), MITK_PP_FOR_102, MITK_PP_TUPLE_EAT_4)(o(102, s), p, o, m) +# define MITK_PP_FOR_102(s, p, o, m) MITK_PP_IF(p(103, s), m, MITK_PP_TUPLE_EAT_2)(103, s) MITK_PP_IF(p(103, s), MITK_PP_FOR_103, MITK_PP_TUPLE_EAT_4)(o(103, s), p, o, m) +# define MITK_PP_FOR_103(s, p, o, m) MITK_PP_IF(p(104, s), m, MITK_PP_TUPLE_EAT_2)(104, s) MITK_PP_IF(p(104, s), MITK_PP_FOR_104, MITK_PP_TUPLE_EAT_4)(o(104, s), p, o, m) +# define MITK_PP_FOR_104(s, p, o, m) MITK_PP_IF(p(105, s), m, MITK_PP_TUPLE_EAT_2)(105, s) MITK_PP_IF(p(105, s), MITK_PP_FOR_105, MITK_PP_TUPLE_EAT_4)(o(105, s), p, o, m) +# define MITK_PP_FOR_105(s, p, o, m) MITK_PP_IF(p(106, s), m, MITK_PP_TUPLE_EAT_2)(106, s) MITK_PP_IF(p(106, s), MITK_PP_FOR_106, MITK_PP_TUPLE_EAT_4)(o(106, s), p, o, m) +# define MITK_PP_FOR_106(s, p, o, m) MITK_PP_IF(p(107, s), m, MITK_PP_TUPLE_EAT_2)(107, s) MITK_PP_IF(p(107, s), MITK_PP_FOR_107, MITK_PP_TUPLE_EAT_4)(o(107, s), p, o, m) +# define MITK_PP_FOR_107(s, p, o, m) MITK_PP_IF(p(108, s), m, MITK_PP_TUPLE_EAT_2)(108, s) MITK_PP_IF(p(108, s), MITK_PP_FOR_108, MITK_PP_TUPLE_EAT_4)(o(108, s), p, o, m) +# define MITK_PP_FOR_108(s, p, o, m) MITK_PP_IF(p(109, s), m, MITK_PP_TUPLE_EAT_2)(109, s) MITK_PP_IF(p(109, s), MITK_PP_FOR_109, MITK_PP_TUPLE_EAT_4)(o(109, s), p, o, m) +# define MITK_PP_FOR_109(s, p, o, m) MITK_PP_IF(p(110, s), m, MITK_PP_TUPLE_EAT_2)(110, s) MITK_PP_IF(p(110, s), MITK_PP_FOR_110, MITK_PP_TUPLE_EAT_4)(o(110, s), p, o, m) +# define MITK_PP_FOR_110(s, p, o, m) MITK_PP_IF(p(111, s), m, MITK_PP_TUPLE_EAT_2)(111, s) MITK_PP_IF(p(111, s), MITK_PP_FOR_111, MITK_PP_TUPLE_EAT_4)(o(111, s), p, o, m) +# define MITK_PP_FOR_111(s, p, o, m) MITK_PP_IF(p(112, s), m, MITK_PP_TUPLE_EAT_2)(112, s) MITK_PP_IF(p(112, s), MITK_PP_FOR_112, MITK_PP_TUPLE_EAT_4)(o(112, s), p, o, m) +# define MITK_PP_FOR_112(s, p, o, m) MITK_PP_IF(p(113, s), m, MITK_PP_TUPLE_EAT_2)(113, s) MITK_PP_IF(p(113, s), MITK_PP_FOR_113, MITK_PP_TUPLE_EAT_4)(o(113, s), p, o, m) +# define MITK_PP_FOR_113(s, p, o, m) MITK_PP_IF(p(114, s), m, MITK_PP_TUPLE_EAT_2)(114, s) MITK_PP_IF(p(114, s), MITK_PP_FOR_114, MITK_PP_TUPLE_EAT_4)(o(114, s), p, o, m) +# define MITK_PP_FOR_114(s, p, o, m) MITK_PP_IF(p(115, s), m, MITK_PP_TUPLE_EAT_2)(115, s) MITK_PP_IF(p(115, s), MITK_PP_FOR_115, MITK_PP_TUPLE_EAT_4)(o(115, s), p, o, m) +# define MITK_PP_FOR_115(s, p, o, m) MITK_PP_IF(p(116, s), m, MITK_PP_TUPLE_EAT_2)(116, s) MITK_PP_IF(p(116, s), MITK_PP_FOR_116, MITK_PP_TUPLE_EAT_4)(o(116, s), p, o, m) +# define MITK_PP_FOR_116(s, p, o, m) MITK_PP_IF(p(117, s), m, MITK_PP_TUPLE_EAT_2)(117, s) MITK_PP_IF(p(117, s), MITK_PP_FOR_117, MITK_PP_TUPLE_EAT_4)(o(117, s), p, o, m) +# define MITK_PP_FOR_117(s, p, o, m) MITK_PP_IF(p(118, s), m, MITK_PP_TUPLE_EAT_2)(118, s) MITK_PP_IF(p(118, s), MITK_PP_FOR_118, MITK_PP_TUPLE_EAT_4)(o(118, s), p, o, m) +# define MITK_PP_FOR_118(s, p, o, m) MITK_PP_IF(p(119, s), m, MITK_PP_TUPLE_EAT_2)(119, s) MITK_PP_IF(p(119, s), MITK_PP_FOR_119, MITK_PP_TUPLE_EAT_4)(o(119, s), p, o, m) +# define MITK_PP_FOR_119(s, p, o, m) MITK_PP_IF(p(120, s), m, MITK_PP_TUPLE_EAT_2)(120, s) MITK_PP_IF(p(120, s), MITK_PP_FOR_120, MITK_PP_TUPLE_EAT_4)(o(120, s), p, o, m) +# define MITK_PP_FOR_120(s, p, o, m) MITK_PP_IF(p(121, s), m, MITK_PP_TUPLE_EAT_2)(121, s) MITK_PP_IF(p(121, s), MITK_PP_FOR_121, MITK_PP_TUPLE_EAT_4)(o(121, s), p, o, m) +# define MITK_PP_FOR_121(s, p, o, m) MITK_PP_IF(p(122, s), m, MITK_PP_TUPLE_EAT_2)(122, s) MITK_PP_IF(p(122, s), MITK_PP_FOR_122, MITK_PP_TUPLE_EAT_4)(o(122, s), p, o, m) +# define MITK_PP_FOR_122(s, p, o, m) MITK_PP_IF(p(123, s), m, MITK_PP_TUPLE_EAT_2)(123, s) MITK_PP_IF(p(123, s), MITK_PP_FOR_123, MITK_PP_TUPLE_EAT_4)(o(123, s), p, o, m) +# define MITK_PP_FOR_123(s, p, o, m) MITK_PP_IF(p(124, s), m, MITK_PP_TUPLE_EAT_2)(124, s) MITK_PP_IF(p(124, s), MITK_PP_FOR_124, MITK_PP_TUPLE_EAT_4)(o(124, s), p, o, m) +# define MITK_PP_FOR_124(s, p, o, m) MITK_PP_IF(p(125, s), m, MITK_PP_TUPLE_EAT_2)(125, s) MITK_PP_IF(p(125, s), MITK_PP_FOR_125, MITK_PP_TUPLE_EAT_4)(o(125, s), p, o, m) +# define MITK_PP_FOR_125(s, p, o, m) MITK_PP_IF(p(126, s), m, MITK_PP_TUPLE_EAT_2)(126, s) MITK_PP_IF(p(126, s), MITK_PP_FOR_126, MITK_PP_TUPLE_EAT_4)(o(126, s), p, o, m) +# define MITK_PP_FOR_126(s, p, o, m) MITK_PP_IF(p(127, s), m, MITK_PP_TUPLE_EAT_2)(127, s) MITK_PP_IF(p(127, s), MITK_PP_FOR_127, MITK_PP_TUPLE_EAT_4)(o(127, s), p, o, m) +# define MITK_PP_FOR_127(s, p, o, m) MITK_PP_IF(p(128, s), m, MITK_PP_TUPLE_EAT_2)(128, s) MITK_PP_IF(p(128, s), MITK_PP_FOR_128, MITK_PP_TUPLE_EAT_4)(o(128, s), p, o, m) +# define MITK_PP_FOR_128(s, p, o, m) MITK_PP_IF(p(129, s), m, MITK_PP_TUPLE_EAT_2)(129, s) MITK_PP_IF(p(129, s), MITK_PP_FOR_129, MITK_PP_TUPLE_EAT_4)(o(129, s), p, o, m) +# define MITK_PP_FOR_129(s, p, o, m) MITK_PP_IF(p(130, s), m, MITK_PP_TUPLE_EAT_2)(130, s) MITK_PP_IF(p(130, s), MITK_PP_FOR_130, MITK_PP_TUPLE_EAT_4)(o(130, s), p, o, m) +# define MITK_PP_FOR_130(s, p, o, m) MITK_PP_IF(p(131, s), m, MITK_PP_TUPLE_EAT_2)(131, s) MITK_PP_IF(p(131, s), MITK_PP_FOR_131, MITK_PP_TUPLE_EAT_4)(o(131, s), p, o, m) +# define MITK_PP_FOR_131(s, p, o, m) MITK_PP_IF(p(132, s), m, MITK_PP_TUPLE_EAT_2)(132, s) MITK_PP_IF(p(132, s), MITK_PP_FOR_132, MITK_PP_TUPLE_EAT_4)(o(132, s), p, o, m) +# define MITK_PP_FOR_132(s, p, o, m) MITK_PP_IF(p(133, s), m, MITK_PP_TUPLE_EAT_2)(133, s) MITK_PP_IF(p(133, s), MITK_PP_FOR_133, MITK_PP_TUPLE_EAT_4)(o(133, s), p, o, m) +# define MITK_PP_FOR_133(s, p, o, m) MITK_PP_IF(p(134, s), m, MITK_PP_TUPLE_EAT_2)(134, s) MITK_PP_IF(p(134, s), MITK_PP_FOR_134, MITK_PP_TUPLE_EAT_4)(o(134, s), p, o, m) +# define MITK_PP_FOR_134(s, p, o, m) MITK_PP_IF(p(135, s), m, MITK_PP_TUPLE_EAT_2)(135, s) MITK_PP_IF(p(135, s), MITK_PP_FOR_135, MITK_PP_TUPLE_EAT_4)(o(135, s), p, o, m) +# define MITK_PP_FOR_135(s, p, o, m) MITK_PP_IF(p(136, s), m, MITK_PP_TUPLE_EAT_2)(136, s) MITK_PP_IF(p(136, s), MITK_PP_FOR_136, MITK_PP_TUPLE_EAT_4)(o(136, s), p, o, m) +# define MITK_PP_FOR_136(s, p, o, m) MITK_PP_IF(p(137, s), m, MITK_PP_TUPLE_EAT_2)(137, s) MITK_PP_IF(p(137, s), MITK_PP_FOR_137, MITK_PP_TUPLE_EAT_4)(o(137, s), p, o, m) +# define MITK_PP_FOR_137(s, p, o, m) MITK_PP_IF(p(138, s), m, MITK_PP_TUPLE_EAT_2)(138, s) MITK_PP_IF(p(138, s), MITK_PP_FOR_138, MITK_PP_TUPLE_EAT_4)(o(138, s), p, o, m) +# define MITK_PP_FOR_138(s, p, o, m) MITK_PP_IF(p(139, s), m, MITK_PP_TUPLE_EAT_2)(139, s) MITK_PP_IF(p(139, s), MITK_PP_FOR_139, MITK_PP_TUPLE_EAT_4)(o(139, s), p, o, m) +# define MITK_PP_FOR_139(s, p, o, m) MITK_PP_IF(p(140, s), m, MITK_PP_TUPLE_EAT_2)(140, s) MITK_PP_IF(p(140, s), MITK_PP_FOR_140, MITK_PP_TUPLE_EAT_4)(o(140, s), p, o, m) +# define MITK_PP_FOR_140(s, p, o, m) MITK_PP_IF(p(141, s), m, MITK_PP_TUPLE_EAT_2)(141, s) MITK_PP_IF(p(141, s), MITK_PP_FOR_141, MITK_PP_TUPLE_EAT_4)(o(141, s), p, o, m) +# define MITK_PP_FOR_141(s, p, o, m) MITK_PP_IF(p(142, s), m, MITK_PP_TUPLE_EAT_2)(142, s) MITK_PP_IF(p(142, s), MITK_PP_FOR_142, MITK_PP_TUPLE_EAT_4)(o(142, s), p, o, m) +# define MITK_PP_FOR_142(s, p, o, m) MITK_PP_IF(p(143, s), m, MITK_PP_TUPLE_EAT_2)(143, s) MITK_PP_IF(p(143, s), MITK_PP_FOR_143, MITK_PP_TUPLE_EAT_4)(o(143, s), p, o, m) +# define MITK_PP_FOR_143(s, p, o, m) MITK_PP_IF(p(144, s), m, MITK_PP_TUPLE_EAT_2)(144, s) MITK_PP_IF(p(144, s), MITK_PP_FOR_144, MITK_PP_TUPLE_EAT_4)(o(144, s), p, o, m) +# define MITK_PP_FOR_144(s, p, o, m) MITK_PP_IF(p(145, s), m, MITK_PP_TUPLE_EAT_2)(145, s) MITK_PP_IF(p(145, s), MITK_PP_FOR_145, MITK_PP_TUPLE_EAT_4)(o(145, s), p, o, m) +# define MITK_PP_FOR_145(s, p, o, m) MITK_PP_IF(p(146, s), m, MITK_PP_TUPLE_EAT_2)(146, s) MITK_PP_IF(p(146, s), MITK_PP_FOR_146, MITK_PP_TUPLE_EAT_4)(o(146, s), p, o, m) +# define MITK_PP_FOR_146(s, p, o, m) MITK_PP_IF(p(147, s), m, MITK_PP_TUPLE_EAT_2)(147, s) MITK_PP_IF(p(147, s), MITK_PP_FOR_147, MITK_PP_TUPLE_EAT_4)(o(147, s), p, o, m) +# define MITK_PP_FOR_147(s, p, o, m) MITK_PP_IF(p(148, s), m, MITK_PP_TUPLE_EAT_2)(148, s) MITK_PP_IF(p(148, s), MITK_PP_FOR_148, MITK_PP_TUPLE_EAT_4)(o(148, s), p, o, m) +# define MITK_PP_FOR_148(s, p, o, m) MITK_PP_IF(p(149, s), m, MITK_PP_TUPLE_EAT_2)(149, s) MITK_PP_IF(p(149, s), MITK_PP_FOR_149, MITK_PP_TUPLE_EAT_4)(o(149, s), p, o, m) +# define MITK_PP_FOR_149(s, p, o, m) MITK_PP_IF(p(150, s), m, MITK_PP_TUPLE_EAT_2)(150, s) MITK_PP_IF(p(150, s), MITK_PP_FOR_150, MITK_PP_TUPLE_EAT_4)(o(150, s), p, o, m) +# define MITK_PP_FOR_150(s, p, o, m) MITK_PP_IF(p(151, s), m, MITK_PP_TUPLE_EAT_2)(151, s) MITK_PP_IF(p(151, s), MITK_PP_FOR_151, MITK_PP_TUPLE_EAT_4)(o(151, s), p, o, m) +# define MITK_PP_FOR_151(s, p, o, m) MITK_PP_IF(p(152, s), m, MITK_PP_TUPLE_EAT_2)(152, s) MITK_PP_IF(p(152, s), MITK_PP_FOR_152, MITK_PP_TUPLE_EAT_4)(o(152, s), p, o, m) +# define MITK_PP_FOR_152(s, p, o, m) MITK_PP_IF(p(153, s), m, MITK_PP_TUPLE_EAT_2)(153, s) MITK_PP_IF(p(153, s), MITK_PP_FOR_153, MITK_PP_TUPLE_EAT_4)(o(153, s), p, o, m) +# define MITK_PP_FOR_153(s, p, o, m) MITK_PP_IF(p(154, s), m, MITK_PP_TUPLE_EAT_2)(154, s) MITK_PP_IF(p(154, s), MITK_PP_FOR_154, MITK_PP_TUPLE_EAT_4)(o(154, s), p, o, m) +# define MITK_PP_FOR_154(s, p, o, m) MITK_PP_IF(p(155, s), m, MITK_PP_TUPLE_EAT_2)(155, s) MITK_PP_IF(p(155, s), MITK_PP_FOR_155, MITK_PP_TUPLE_EAT_4)(o(155, s), p, o, m) +# define MITK_PP_FOR_155(s, p, o, m) MITK_PP_IF(p(156, s), m, MITK_PP_TUPLE_EAT_2)(156, s) MITK_PP_IF(p(156, s), MITK_PP_FOR_156, MITK_PP_TUPLE_EAT_4)(o(156, s), p, o, m) +# define MITK_PP_FOR_156(s, p, o, m) MITK_PP_IF(p(157, s), m, MITK_PP_TUPLE_EAT_2)(157, s) MITK_PP_IF(p(157, s), MITK_PP_FOR_157, MITK_PP_TUPLE_EAT_4)(o(157, s), p, o, m) +# define MITK_PP_FOR_157(s, p, o, m) MITK_PP_IF(p(158, s), m, MITK_PP_TUPLE_EAT_2)(158, s) MITK_PP_IF(p(158, s), MITK_PP_FOR_158, MITK_PP_TUPLE_EAT_4)(o(158, s), p, o, m) +# define MITK_PP_FOR_158(s, p, o, m) MITK_PP_IF(p(159, s), m, MITK_PP_TUPLE_EAT_2)(159, s) MITK_PP_IF(p(159, s), MITK_PP_FOR_159, MITK_PP_TUPLE_EAT_4)(o(159, s), p, o, m) +# define MITK_PP_FOR_159(s, p, o, m) MITK_PP_IF(p(160, s), m, MITK_PP_TUPLE_EAT_2)(160, s) MITK_PP_IF(p(160, s), MITK_PP_FOR_160, MITK_PP_TUPLE_EAT_4)(o(160, s), p, o, m) +# define MITK_PP_FOR_160(s, p, o, m) MITK_PP_IF(p(161, s), m, MITK_PP_TUPLE_EAT_2)(161, s) MITK_PP_IF(p(161, s), MITK_PP_FOR_161, MITK_PP_TUPLE_EAT_4)(o(161, s), p, o, m) +# define MITK_PP_FOR_161(s, p, o, m) MITK_PP_IF(p(162, s), m, MITK_PP_TUPLE_EAT_2)(162, s) MITK_PP_IF(p(162, s), MITK_PP_FOR_162, MITK_PP_TUPLE_EAT_4)(o(162, s), p, o, m) +# define MITK_PP_FOR_162(s, p, o, m) MITK_PP_IF(p(163, s), m, MITK_PP_TUPLE_EAT_2)(163, s) MITK_PP_IF(p(163, s), MITK_PP_FOR_163, MITK_PP_TUPLE_EAT_4)(o(163, s), p, o, m) +# define MITK_PP_FOR_163(s, p, o, m) MITK_PP_IF(p(164, s), m, MITK_PP_TUPLE_EAT_2)(164, s) MITK_PP_IF(p(164, s), MITK_PP_FOR_164, MITK_PP_TUPLE_EAT_4)(o(164, s), p, o, m) +# define MITK_PP_FOR_164(s, p, o, m) MITK_PP_IF(p(165, s), m, MITK_PP_TUPLE_EAT_2)(165, s) MITK_PP_IF(p(165, s), MITK_PP_FOR_165, MITK_PP_TUPLE_EAT_4)(o(165, s), p, o, m) +# define MITK_PP_FOR_165(s, p, o, m) MITK_PP_IF(p(166, s), m, MITK_PP_TUPLE_EAT_2)(166, s) MITK_PP_IF(p(166, s), MITK_PP_FOR_166, MITK_PP_TUPLE_EAT_4)(o(166, s), p, o, m) +# define MITK_PP_FOR_166(s, p, o, m) MITK_PP_IF(p(167, s), m, MITK_PP_TUPLE_EAT_2)(167, s) MITK_PP_IF(p(167, s), MITK_PP_FOR_167, MITK_PP_TUPLE_EAT_4)(o(167, s), p, o, m) +# define MITK_PP_FOR_167(s, p, o, m) MITK_PP_IF(p(168, s), m, MITK_PP_TUPLE_EAT_2)(168, s) MITK_PP_IF(p(168, s), MITK_PP_FOR_168, MITK_PP_TUPLE_EAT_4)(o(168, s), p, o, m) +# define MITK_PP_FOR_168(s, p, o, m) MITK_PP_IF(p(169, s), m, MITK_PP_TUPLE_EAT_2)(169, s) MITK_PP_IF(p(169, s), MITK_PP_FOR_169, MITK_PP_TUPLE_EAT_4)(o(169, s), p, o, m) +# define MITK_PP_FOR_169(s, p, o, m) MITK_PP_IF(p(170, s), m, MITK_PP_TUPLE_EAT_2)(170, s) MITK_PP_IF(p(170, s), MITK_PP_FOR_170, MITK_PP_TUPLE_EAT_4)(o(170, s), p, o, m) +# define MITK_PP_FOR_170(s, p, o, m) MITK_PP_IF(p(171, s), m, MITK_PP_TUPLE_EAT_2)(171, s) MITK_PP_IF(p(171, s), MITK_PP_FOR_171, MITK_PP_TUPLE_EAT_4)(o(171, s), p, o, m) +# define MITK_PP_FOR_171(s, p, o, m) MITK_PP_IF(p(172, s), m, MITK_PP_TUPLE_EAT_2)(172, s) MITK_PP_IF(p(172, s), MITK_PP_FOR_172, MITK_PP_TUPLE_EAT_4)(o(172, s), p, o, m) +# define MITK_PP_FOR_172(s, p, o, m) MITK_PP_IF(p(173, s), m, MITK_PP_TUPLE_EAT_2)(173, s) MITK_PP_IF(p(173, s), MITK_PP_FOR_173, MITK_PP_TUPLE_EAT_4)(o(173, s), p, o, m) +# define MITK_PP_FOR_173(s, p, o, m) MITK_PP_IF(p(174, s), m, MITK_PP_TUPLE_EAT_2)(174, s) MITK_PP_IF(p(174, s), MITK_PP_FOR_174, MITK_PP_TUPLE_EAT_4)(o(174, s), p, o, m) +# define MITK_PP_FOR_174(s, p, o, m) MITK_PP_IF(p(175, s), m, MITK_PP_TUPLE_EAT_2)(175, s) MITK_PP_IF(p(175, s), MITK_PP_FOR_175, MITK_PP_TUPLE_EAT_4)(o(175, s), p, o, m) +# define MITK_PP_FOR_175(s, p, o, m) MITK_PP_IF(p(176, s), m, MITK_PP_TUPLE_EAT_2)(176, s) MITK_PP_IF(p(176, s), MITK_PP_FOR_176, MITK_PP_TUPLE_EAT_4)(o(176, s), p, o, m) +# define MITK_PP_FOR_176(s, p, o, m) MITK_PP_IF(p(177, s), m, MITK_PP_TUPLE_EAT_2)(177, s) MITK_PP_IF(p(177, s), MITK_PP_FOR_177, MITK_PP_TUPLE_EAT_4)(o(177, s), p, o, m) +# define MITK_PP_FOR_177(s, p, o, m) MITK_PP_IF(p(178, s), m, MITK_PP_TUPLE_EAT_2)(178, s) MITK_PP_IF(p(178, s), MITK_PP_FOR_178, MITK_PP_TUPLE_EAT_4)(o(178, s), p, o, m) +# define MITK_PP_FOR_178(s, p, o, m) MITK_PP_IF(p(179, s), m, MITK_PP_TUPLE_EAT_2)(179, s) MITK_PP_IF(p(179, s), MITK_PP_FOR_179, MITK_PP_TUPLE_EAT_4)(o(179, s), p, o, m) +# define MITK_PP_FOR_179(s, p, o, m) MITK_PP_IF(p(180, s), m, MITK_PP_TUPLE_EAT_2)(180, s) MITK_PP_IF(p(180, s), MITK_PP_FOR_180, MITK_PP_TUPLE_EAT_4)(o(180, s), p, o, m) +# define MITK_PP_FOR_180(s, p, o, m) MITK_PP_IF(p(181, s), m, MITK_PP_TUPLE_EAT_2)(181, s) MITK_PP_IF(p(181, s), MITK_PP_FOR_181, MITK_PP_TUPLE_EAT_4)(o(181, s), p, o, m) +# define MITK_PP_FOR_181(s, p, o, m) MITK_PP_IF(p(182, s), m, MITK_PP_TUPLE_EAT_2)(182, s) MITK_PP_IF(p(182, s), MITK_PP_FOR_182, MITK_PP_TUPLE_EAT_4)(o(182, s), p, o, m) +# define MITK_PP_FOR_182(s, p, o, m) MITK_PP_IF(p(183, s), m, MITK_PP_TUPLE_EAT_2)(183, s) MITK_PP_IF(p(183, s), MITK_PP_FOR_183, MITK_PP_TUPLE_EAT_4)(o(183, s), p, o, m) +# define MITK_PP_FOR_183(s, p, o, m) MITK_PP_IF(p(184, s), m, MITK_PP_TUPLE_EAT_2)(184, s) MITK_PP_IF(p(184, s), MITK_PP_FOR_184, MITK_PP_TUPLE_EAT_4)(o(184, s), p, o, m) +# define MITK_PP_FOR_184(s, p, o, m) MITK_PP_IF(p(185, s), m, MITK_PP_TUPLE_EAT_2)(185, s) MITK_PP_IF(p(185, s), MITK_PP_FOR_185, MITK_PP_TUPLE_EAT_4)(o(185, s), p, o, m) +# define MITK_PP_FOR_185(s, p, o, m) MITK_PP_IF(p(186, s), m, MITK_PP_TUPLE_EAT_2)(186, s) MITK_PP_IF(p(186, s), MITK_PP_FOR_186, MITK_PP_TUPLE_EAT_4)(o(186, s), p, o, m) +# define MITK_PP_FOR_186(s, p, o, m) MITK_PP_IF(p(187, s), m, MITK_PP_TUPLE_EAT_2)(187, s) MITK_PP_IF(p(187, s), MITK_PP_FOR_187, MITK_PP_TUPLE_EAT_4)(o(187, s), p, o, m) +# define MITK_PP_FOR_187(s, p, o, m) MITK_PP_IF(p(188, s), m, MITK_PP_TUPLE_EAT_2)(188, s) MITK_PP_IF(p(188, s), MITK_PP_FOR_188, MITK_PP_TUPLE_EAT_4)(o(188, s), p, o, m) +# define MITK_PP_FOR_188(s, p, o, m) MITK_PP_IF(p(189, s), m, MITK_PP_TUPLE_EAT_2)(189, s) MITK_PP_IF(p(189, s), MITK_PP_FOR_189, MITK_PP_TUPLE_EAT_4)(o(189, s), p, o, m) +# define MITK_PP_FOR_189(s, p, o, m) MITK_PP_IF(p(190, s), m, MITK_PP_TUPLE_EAT_2)(190, s) MITK_PP_IF(p(190, s), MITK_PP_FOR_190, MITK_PP_TUPLE_EAT_4)(o(190, s), p, o, m) +# define MITK_PP_FOR_190(s, p, o, m) MITK_PP_IF(p(191, s), m, MITK_PP_TUPLE_EAT_2)(191, s) MITK_PP_IF(p(191, s), MITK_PP_FOR_191, MITK_PP_TUPLE_EAT_4)(o(191, s), p, o, m) +# define MITK_PP_FOR_191(s, p, o, m) MITK_PP_IF(p(192, s), m, MITK_PP_TUPLE_EAT_2)(192, s) MITK_PP_IF(p(192, s), MITK_PP_FOR_192, MITK_PP_TUPLE_EAT_4)(o(192, s), p, o, m) +# define MITK_PP_FOR_192(s, p, o, m) MITK_PP_IF(p(193, s), m, MITK_PP_TUPLE_EAT_2)(193, s) MITK_PP_IF(p(193, s), MITK_PP_FOR_193, MITK_PP_TUPLE_EAT_4)(o(193, s), p, o, m) +# define MITK_PP_FOR_193(s, p, o, m) MITK_PP_IF(p(194, s), m, MITK_PP_TUPLE_EAT_2)(194, s) MITK_PP_IF(p(194, s), MITK_PP_FOR_194, MITK_PP_TUPLE_EAT_4)(o(194, s), p, o, m) +# define MITK_PP_FOR_194(s, p, o, m) MITK_PP_IF(p(195, s), m, MITK_PP_TUPLE_EAT_2)(195, s) MITK_PP_IF(p(195, s), MITK_PP_FOR_195, MITK_PP_TUPLE_EAT_4)(o(195, s), p, o, m) +# define MITK_PP_FOR_195(s, p, o, m) MITK_PP_IF(p(196, s), m, MITK_PP_TUPLE_EAT_2)(196, s) MITK_PP_IF(p(196, s), MITK_PP_FOR_196, MITK_PP_TUPLE_EAT_4)(o(196, s), p, o, m) +# define MITK_PP_FOR_196(s, p, o, m) MITK_PP_IF(p(197, s), m, MITK_PP_TUPLE_EAT_2)(197, s) MITK_PP_IF(p(197, s), MITK_PP_FOR_197, MITK_PP_TUPLE_EAT_4)(o(197, s), p, o, m) +# define MITK_PP_FOR_197(s, p, o, m) MITK_PP_IF(p(198, s), m, MITK_PP_TUPLE_EAT_2)(198, s) MITK_PP_IF(p(198, s), MITK_PP_FOR_198, MITK_PP_TUPLE_EAT_4)(o(198, s), p, o, m) +# define MITK_PP_FOR_198(s, p, o, m) MITK_PP_IF(p(199, s), m, MITK_PP_TUPLE_EAT_2)(199, s) MITK_PP_IF(p(199, s), MITK_PP_FOR_199, MITK_PP_TUPLE_EAT_4)(o(199, s), p, o, m) +# define MITK_PP_FOR_199(s, p, o, m) MITK_PP_IF(p(200, s), m, MITK_PP_TUPLE_EAT_2)(200, s) MITK_PP_IF(p(200, s), MITK_PP_FOR_200, MITK_PP_TUPLE_EAT_4)(o(200, s), p, o, m) +# define MITK_PP_FOR_200(s, p, o, m) MITK_PP_IF(p(201, s), m, MITK_PP_TUPLE_EAT_2)(201, s) MITK_PP_IF(p(201, s), MITK_PP_FOR_201, MITK_PP_TUPLE_EAT_4)(o(201, s), p, o, m) +# define MITK_PP_FOR_201(s, p, o, m) MITK_PP_IF(p(202, s), m, MITK_PP_TUPLE_EAT_2)(202, s) MITK_PP_IF(p(202, s), MITK_PP_FOR_202, MITK_PP_TUPLE_EAT_4)(o(202, s), p, o, m) +# define MITK_PP_FOR_202(s, p, o, m) MITK_PP_IF(p(203, s), m, MITK_PP_TUPLE_EAT_2)(203, s) MITK_PP_IF(p(203, s), MITK_PP_FOR_203, MITK_PP_TUPLE_EAT_4)(o(203, s), p, o, m) +# define MITK_PP_FOR_203(s, p, o, m) MITK_PP_IF(p(204, s), m, MITK_PP_TUPLE_EAT_2)(204, s) MITK_PP_IF(p(204, s), MITK_PP_FOR_204, MITK_PP_TUPLE_EAT_4)(o(204, s), p, o, m) +# define MITK_PP_FOR_204(s, p, o, m) MITK_PP_IF(p(205, s), m, MITK_PP_TUPLE_EAT_2)(205, s) MITK_PP_IF(p(205, s), MITK_PP_FOR_205, MITK_PP_TUPLE_EAT_4)(o(205, s), p, o, m) +# define MITK_PP_FOR_205(s, p, o, m) MITK_PP_IF(p(206, s), m, MITK_PP_TUPLE_EAT_2)(206, s) MITK_PP_IF(p(206, s), MITK_PP_FOR_206, MITK_PP_TUPLE_EAT_4)(o(206, s), p, o, m) +# define MITK_PP_FOR_206(s, p, o, m) MITK_PP_IF(p(207, s), m, MITK_PP_TUPLE_EAT_2)(207, s) MITK_PP_IF(p(207, s), MITK_PP_FOR_207, MITK_PP_TUPLE_EAT_4)(o(207, s), p, o, m) +# define MITK_PP_FOR_207(s, p, o, m) MITK_PP_IF(p(208, s), m, MITK_PP_TUPLE_EAT_2)(208, s) MITK_PP_IF(p(208, s), MITK_PP_FOR_208, MITK_PP_TUPLE_EAT_4)(o(208, s), p, o, m) +# define MITK_PP_FOR_208(s, p, o, m) MITK_PP_IF(p(209, s), m, MITK_PP_TUPLE_EAT_2)(209, s) MITK_PP_IF(p(209, s), MITK_PP_FOR_209, MITK_PP_TUPLE_EAT_4)(o(209, s), p, o, m) +# define MITK_PP_FOR_209(s, p, o, m) MITK_PP_IF(p(210, s), m, MITK_PP_TUPLE_EAT_2)(210, s) MITK_PP_IF(p(210, s), MITK_PP_FOR_210, MITK_PP_TUPLE_EAT_4)(o(210, s), p, o, m) +# define MITK_PP_FOR_210(s, p, o, m) MITK_PP_IF(p(211, s), m, MITK_PP_TUPLE_EAT_2)(211, s) MITK_PP_IF(p(211, s), MITK_PP_FOR_211, MITK_PP_TUPLE_EAT_4)(o(211, s), p, o, m) +# define MITK_PP_FOR_211(s, p, o, m) MITK_PP_IF(p(212, s), m, MITK_PP_TUPLE_EAT_2)(212, s) MITK_PP_IF(p(212, s), MITK_PP_FOR_212, MITK_PP_TUPLE_EAT_4)(o(212, s), p, o, m) +# define MITK_PP_FOR_212(s, p, o, m) MITK_PP_IF(p(213, s), m, MITK_PP_TUPLE_EAT_2)(213, s) MITK_PP_IF(p(213, s), MITK_PP_FOR_213, MITK_PP_TUPLE_EAT_4)(o(213, s), p, o, m) +# define MITK_PP_FOR_213(s, p, o, m) MITK_PP_IF(p(214, s), m, MITK_PP_TUPLE_EAT_2)(214, s) MITK_PP_IF(p(214, s), MITK_PP_FOR_214, MITK_PP_TUPLE_EAT_4)(o(214, s), p, o, m) +# define MITK_PP_FOR_214(s, p, o, m) MITK_PP_IF(p(215, s), m, MITK_PP_TUPLE_EAT_2)(215, s) MITK_PP_IF(p(215, s), MITK_PP_FOR_215, MITK_PP_TUPLE_EAT_4)(o(215, s), p, o, m) +# define MITK_PP_FOR_215(s, p, o, m) MITK_PP_IF(p(216, s), m, MITK_PP_TUPLE_EAT_2)(216, s) MITK_PP_IF(p(216, s), MITK_PP_FOR_216, MITK_PP_TUPLE_EAT_4)(o(216, s), p, o, m) +# define MITK_PP_FOR_216(s, p, o, m) MITK_PP_IF(p(217, s), m, MITK_PP_TUPLE_EAT_2)(217, s) MITK_PP_IF(p(217, s), MITK_PP_FOR_217, MITK_PP_TUPLE_EAT_4)(o(217, s), p, o, m) +# define MITK_PP_FOR_217(s, p, o, m) MITK_PP_IF(p(218, s), m, MITK_PP_TUPLE_EAT_2)(218, s) MITK_PP_IF(p(218, s), MITK_PP_FOR_218, MITK_PP_TUPLE_EAT_4)(o(218, s), p, o, m) +# define MITK_PP_FOR_218(s, p, o, m) MITK_PP_IF(p(219, s), m, MITK_PP_TUPLE_EAT_2)(219, s) MITK_PP_IF(p(219, s), MITK_PP_FOR_219, MITK_PP_TUPLE_EAT_4)(o(219, s), p, o, m) +# define MITK_PP_FOR_219(s, p, o, m) MITK_PP_IF(p(220, s), m, MITK_PP_TUPLE_EAT_2)(220, s) MITK_PP_IF(p(220, s), MITK_PP_FOR_220, MITK_PP_TUPLE_EAT_4)(o(220, s), p, o, m) +# define MITK_PP_FOR_220(s, p, o, m) MITK_PP_IF(p(221, s), m, MITK_PP_TUPLE_EAT_2)(221, s) MITK_PP_IF(p(221, s), MITK_PP_FOR_221, MITK_PP_TUPLE_EAT_4)(o(221, s), p, o, m) +# define MITK_PP_FOR_221(s, p, o, m) MITK_PP_IF(p(222, s), m, MITK_PP_TUPLE_EAT_2)(222, s) MITK_PP_IF(p(222, s), MITK_PP_FOR_222, MITK_PP_TUPLE_EAT_4)(o(222, s), p, o, m) +# define MITK_PP_FOR_222(s, p, o, m) MITK_PP_IF(p(223, s), m, MITK_PP_TUPLE_EAT_2)(223, s) MITK_PP_IF(p(223, s), MITK_PP_FOR_223, MITK_PP_TUPLE_EAT_4)(o(223, s), p, o, m) +# define MITK_PP_FOR_223(s, p, o, m) MITK_PP_IF(p(224, s), m, MITK_PP_TUPLE_EAT_2)(224, s) MITK_PP_IF(p(224, s), MITK_PP_FOR_224, MITK_PP_TUPLE_EAT_4)(o(224, s), p, o, m) +# define MITK_PP_FOR_224(s, p, o, m) MITK_PP_IF(p(225, s), m, MITK_PP_TUPLE_EAT_2)(225, s) MITK_PP_IF(p(225, s), MITK_PP_FOR_225, MITK_PP_TUPLE_EAT_4)(o(225, s), p, o, m) +# define MITK_PP_FOR_225(s, p, o, m) MITK_PP_IF(p(226, s), m, MITK_PP_TUPLE_EAT_2)(226, s) MITK_PP_IF(p(226, s), MITK_PP_FOR_226, MITK_PP_TUPLE_EAT_4)(o(226, s), p, o, m) +# define MITK_PP_FOR_226(s, p, o, m) MITK_PP_IF(p(227, s), m, MITK_PP_TUPLE_EAT_2)(227, s) MITK_PP_IF(p(227, s), MITK_PP_FOR_227, MITK_PP_TUPLE_EAT_4)(o(227, s), p, o, m) +# define MITK_PP_FOR_227(s, p, o, m) MITK_PP_IF(p(228, s), m, MITK_PP_TUPLE_EAT_2)(228, s) MITK_PP_IF(p(228, s), MITK_PP_FOR_228, MITK_PP_TUPLE_EAT_4)(o(228, s), p, o, m) +# define MITK_PP_FOR_228(s, p, o, m) MITK_PP_IF(p(229, s), m, MITK_PP_TUPLE_EAT_2)(229, s) MITK_PP_IF(p(229, s), MITK_PP_FOR_229, MITK_PP_TUPLE_EAT_4)(o(229, s), p, o, m) +# define MITK_PP_FOR_229(s, p, o, m) MITK_PP_IF(p(230, s), m, MITK_PP_TUPLE_EAT_2)(230, s) MITK_PP_IF(p(230, s), MITK_PP_FOR_230, MITK_PP_TUPLE_EAT_4)(o(230, s), p, o, m) +# define MITK_PP_FOR_230(s, p, o, m) MITK_PP_IF(p(231, s), m, MITK_PP_TUPLE_EAT_2)(231, s) MITK_PP_IF(p(231, s), MITK_PP_FOR_231, MITK_PP_TUPLE_EAT_4)(o(231, s), p, o, m) +# define MITK_PP_FOR_231(s, p, o, m) MITK_PP_IF(p(232, s), m, MITK_PP_TUPLE_EAT_2)(232, s) MITK_PP_IF(p(232, s), MITK_PP_FOR_232, MITK_PP_TUPLE_EAT_4)(o(232, s), p, o, m) +# define MITK_PP_FOR_232(s, p, o, m) MITK_PP_IF(p(233, s), m, MITK_PP_TUPLE_EAT_2)(233, s) MITK_PP_IF(p(233, s), MITK_PP_FOR_233, MITK_PP_TUPLE_EAT_4)(o(233, s), p, o, m) +# define MITK_PP_FOR_233(s, p, o, m) MITK_PP_IF(p(234, s), m, MITK_PP_TUPLE_EAT_2)(234, s) MITK_PP_IF(p(234, s), MITK_PP_FOR_234, MITK_PP_TUPLE_EAT_4)(o(234, s), p, o, m) +# define MITK_PP_FOR_234(s, p, o, m) MITK_PP_IF(p(235, s), m, MITK_PP_TUPLE_EAT_2)(235, s) MITK_PP_IF(p(235, s), MITK_PP_FOR_235, MITK_PP_TUPLE_EAT_4)(o(235, s), p, o, m) +# define MITK_PP_FOR_235(s, p, o, m) MITK_PP_IF(p(236, s), m, MITK_PP_TUPLE_EAT_2)(236, s) MITK_PP_IF(p(236, s), MITK_PP_FOR_236, MITK_PP_TUPLE_EAT_4)(o(236, s), p, o, m) +# define MITK_PP_FOR_236(s, p, o, m) MITK_PP_IF(p(237, s), m, MITK_PP_TUPLE_EAT_2)(237, s) MITK_PP_IF(p(237, s), MITK_PP_FOR_237, MITK_PP_TUPLE_EAT_4)(o(237, s), p, o, m) +# define MITK_PP_FOR_237(s, p, o, m) MITK_PP_IF(p(238, s), m, MITK_PP_TUPLE_EAT_2)(238, s) MITK_PP_IF(p(238, s), MITK_PP_FOR_238, MITK_PP_TUPLE_EAT_4)(o(238, s), p, o, m) +# define MITK_PP_FOR_238(s, p, o, m) MITK_PP_IF(p(239, s), m, MITK_PP_TUPLE_EAT_2)(239, s) MITK_PP_IF(p(239, s), MITK_PP_FOR_239, MITK_PP_TUPLE_EAT_4)(o(239, s), p, o, m) +# define MITK_PP_FOR_239(s, p, o, m) MITK_PP_IF(p(240, s), m, MITK_PP_TUPLE_EAT_2)(240, s) MITK_PP_IF(p(240, s), MITK_PP_FOR_240, MITK_PP_TUPLE_EAT_4)(o(240, s), p, o, m) +# define MITK_PP_FOR_240(s, p, o, m) MITK_PP_IF(p(241, s), m, MITK_PP_TUPLE_EAT_2)(241, s) MITK_PP_IF(p(241, s), MITK_PP_FOR_241, MITK_PP_TUPLE_EAT_4)(o(241, s), p, o, m) +# define MITK_PP_FOR_241(s, p, o, m) MITK_PP_IF(p(242, s), m, MITK_PP_TUPLE_EAT_2)(242, s) MITK_PP_IF(p(242, s), MITK_PP_FOR_242, MITK_PP_TUPLE_EAT_4)(o(242, s), p, o, m) +# define MITK_PP_FOR_242(s, p, o, m) MITK_PP_IF(p(243, s), m, MITK_PP_TUPLE_EAT_2)(243, s) MITK_PP_IF(p(243, s), MITK_PP_FOR_243, MITK_PP_TUPLE_EAT_4)(o(243, s), p, o, m) +# define MITK_PP_FOR_243(s, p, o, m) MITK_PP_IF(p(244, s), m, MITK_PP_TUPLE_EAT_2)(244, s) MITK_PP_IF(p(244, s), MITK_PP_FOR_244, MITK_PP_TUPLE_EAT_4)(o(244, s), p, o, m) +# define MITK_PP_FOR_244(s, p, o, m) MITK_PP_IF(p(245, s), m, MITK_PP_TUPLE_EAT_2)(245, s) MITK_PP_IF(p(245, s), MITK_PP_FOR_245, MITK_PP_TUPLE_EAT_4)(o(245, s), p, o, m) +# define MITK_PP_FOR_245(s, p, o, m) MITK_PP_IF(p(246, s), m, MITK_PP_TUPLE_EAT_2)(246, s) MITK_PP_IF(p(246, s), MITK_PP_FOR_246, MITK_PP_TUPLE_EAT_4)(o(246, s), p, o, m) +# define MITK_PP_FOR_246(s, p, o, m) MITK_PP_IF(p(247, s), m, MITK_PP_TUPLE_EAT_2)(247, s) MITK_PP_IF(p(247, s), MITK_PP_FOR_247, MITK_PP_TUPLE_EAT_4)(o(247, s), p, o, m) +# define MITK_PP_FOR_247(s, p, o, m) MITK_PP_IF(p(248, s), m, MITK_PP_TUPLE_EAT_2)(248, s) MITK_PP_IF(p(248, s), MITK_PP_FOR_248, MITK_PP_TUPLE_EAT_4)(o(248, s), p, o, m) +# define MITK_PP_FOR_248(s, p, o, m) MITK_PP_IF(p(249, s), m, MITK_PP_TUPLE_EAT_2)(249, s) MITK_PP_IF(p(249, s), MITK_PP_FOR_249, MITK_PP_TUPLE_EAT_4)(o(249, s), p, o, m) +# define MITK_PP_FOR_249(s, p, o, m) MITK_PP_IF(p(250, s), m, MITK_PP_TUPLE_EAT_2)(250, s) MITK_PP_IF(p(250, s), MITK_PP_FOR_250, MITK_PP_TUPLE_EAT_4)(o(250, s), p, o, m) +# define MITK_PP_FOR_250(s, p, o, m) MITK_PP_IF(p(251, s), m, MITK_PP_TUPLE_EAT_2)(251, s) MITK_PP_IF(p(251, s), MITK_PP_FOR_251, MITK_PP_TUPLE_EAT_4)(o(251, s), p, o, m) +# define MITK_PP_FOR_251(s, p, o, m) MITK_PP_IF(p(252, s), m, MITK_PP_TUPLE_EAT_2)(252, s) MITK_PP_IF(p(252, s), MITK_PP_FOR_252, MITK_PP_TUPLE_EAT_4)(o(252, s), p, o, m) +# define MITK_PP_FOR_252(s, p, o, m) MITK_PP_IF(p(253, s), m, MITK_PP_TUPLE_EAT_2)(253, s) MITK_PP_IF(p(253, s), MITK_PP_FOR_253, MITK_PP_TUPLE_EAT_4)(o(253, s), p, o, m) +# define MITK_PP_FOR_253(s, p, o, m) MITK_PP_IF(p(254, s), m, MITK_PP_TUPLE_EAT_2)(254, s) MITK_PP_IF(p(254, s), MITK_PP_FOR_254, MITK_PP_TUPLE_EAT_4)(o(254, s), p, o, m) +# define MITK_PP_FOR_254(s, p, o, m) MITK_PP_IF(p(255, s), m, MITK_PP_TUPLE_EAT_2)(255, s) MITK_PP_IF(p(255, s), MITK_PP_FOR_255, MITK_PP_TUPLE_EAT_4)(o(255, s), p, o, m) +# define MITK_PP_FOR_255(s, p, o, m) MITK_PP_IF(p(256, s), m, MITK_PP_TUPLE_EAT_2)(256, s) MITK_PP_IF(p(256, s), MITK_PP_FOR_256, MITK_PP_TUPLE_EAT_4)(o(256, s), p, o, m) +# define MITK_PP_FOR_256(s, p, o, m) MITK_PP_IF(p(257, s), m, MITK_PP_TUPLE_EAT_2)(257, s) MITK_PP_IF(p(257, s), MITK_PP_FOR_257, MITK_PP_TUPLE_EAT_4)(o(257, s), p, o, m) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPRepetitionFor.h b/Core/Code/Algorithms/mitkPPRepetitionFor.h new file mode 100644 index 0000000000..e2668b5943 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPRepetitionFor.h @@ -0,0 +1,306 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_REPETITION_FOR_HPP +# define MITK_PREPROCESSOR_REPETITION_FOR_HPP +# +# include "mitkPPCat.h" +# include "mitkPPDebugError.h" +# include "mitkPPDetailAutoRec.h" +# +# /* MITK_PP_FOR */ +# +# if 0 +# define MITK_PP_FOR(state, pred, op, macro) +# endif +# +# define MITK_PP_FOR MITK_PP_CAT(MITK_PP_FOR_, MITK_PP_AUTO_REC(MITK_PP_FOR_P, 256)) +# +# define MITK_PP_FOR_P(n) MITK_PP_CAT(MITK_PP_FOR_CHECK_, MITK_PP_FOR_ ## n(1, MITK_PP_FOR_SR_P, MITK_PP_FOR_SR_O, MITK_PP_FOR_SR_M)) +# +# define MITK_PP_FOR_SR_P(r, s) s +# define MITK_PP_FOR_SR_O(r, s) 0 +# define MITK_PP_FOR_SR_M(r, s) MITK_PP_NIL +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# include "mitkPPRepetitionDetailEDGFor.h" +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# include "mitkPPRepetitionDetailMSVCFor.h" +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_DMC() +# include "mitkPPRepetitionDetailDMCFor.h" +# else +# include "mitkPPRepetitionDetailFor.h" +# endif +# +# define MITK_PP_FOR_257(s, p, o, m) MITK_PP_ERROR(0x0002) +# +# define MITK_PP_FOR_CHECK_MITK_PP_NIL 1 +# +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_1(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_2(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_3(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_4(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_5(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_6(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_7(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_8(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_9(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_10(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_11(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_12(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_13(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_14(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_15(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_16(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_17(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_18(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_19(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_20(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_21(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_22(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_23(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_24(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_25(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_26(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_27(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_28(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_29(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_30(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_31(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_32(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_33(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_34(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_35(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_36(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_37(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_38(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_39(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_40(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_41(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_42(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_43(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_44(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_45(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_46(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_47(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_48(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_49(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_50(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_51(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_52(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_53(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_54(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_55(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_56(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_57(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_58(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_59(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_60(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_61(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_62(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_63(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_64(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_65(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_66(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_67(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_68(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_69(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_70(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_71(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_72(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_73(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_74(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_75(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_76(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_77(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_78(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_79(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_80(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_81(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_82(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_83(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_84(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_85(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_86(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_87(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_88(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_89(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_90(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_91(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_92(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_93(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_94(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_95(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_96(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_97(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_98(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_99(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_100(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_101(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_102(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_103(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_104(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_105(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_106(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_107(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_108(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_109(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_110(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_111(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_112(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_113(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_114(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_115(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_116(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_117(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_118(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_119(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_120(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_121(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_122(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_123(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_124(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_125(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_126(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_127(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_128(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_129(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_130(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_131(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_132(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_133(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_134(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_135(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_136(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_137(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_138(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_139(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_140(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_141(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_142(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_143(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_144(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_145(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_146(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_147(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_148(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_149(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_150(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_151(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_152(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_153(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_154(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_155(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_156(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_157(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_158(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_159(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_160(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_161(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_162(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_163(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_164(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_165(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_166(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_167(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_168(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_169(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_170(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_171(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_172(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_173(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_174(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_175(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_176(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_177(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_178(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_179(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_180(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_181(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_182(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_183(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_184(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_185(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_186(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_187(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_188(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_189(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_190(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_191(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_192(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_193(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_194(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_195(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_196(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_197(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_198(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_199(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_200(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_201(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_202(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_203(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_204(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_205(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_206(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_207(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_208(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_209(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_210(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_211(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_212(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_213(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_214(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_215(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_216(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_217(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_218(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_219(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_220(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_221(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_222(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_223(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_224(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_225(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_226(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_227(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_228(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_229(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_230(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_231(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_232(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_233(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_234(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_235(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_236(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_237(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_238(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_239(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_240(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_241(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_242(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_243(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_244(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_245(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_246(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_247(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_248(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_249(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_250(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_251(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_252(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_253(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_254(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_255(s, p, o, m) 0 +# define MITK_PP_FOR_CHECK_MITK_PP_FOR_256(s, p, o, m) 0 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeq.h b/Core/Code/Algorithms/mitkPPSeq.h new file mode 100644 index 0000000000..f6f390cd74 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeq.h @@ -0,0 +1,44 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_SEQ_HPP +# define MITK_PREPROCESSOR_SEQ_SEQ_HPP +# +# include "mitkPPConfig.h" +# include "mitkPPSeqElem.h" +# +# /* MITK_PP_SEQ_HEAD */ +# +# define MITK_PP_SEQ_HEAD(seq) MITK_PP_SEQ_ELEM(0, seq) +# +# /* MITK_PP_SEQ_TAIL */ +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_TAIL(seq) MITK_PP_SEQ_TAIL_1((seq)) +# define MITK_PP_SEQ_TAIL_1(par) MITK_PP_SEQ_TAIL_2 ## par +# define MITK_PP_SEQ_TAIL_2(seq) MITK_PP_SEQ_TAIL_I ## seq +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_SEQ_TAIL(seq) MITK_PP_SEQ_TAIL_ID(MITK_PP_SEQ_TAIL_I seq) +# define MITK_PP_SEQ_TAIL_ID(id) id +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_TAIL(seq) MITK_PP_SEQ_TAIL_D(seq) +# define MITK_PP_SEQ_TAIL_D(seq) MITK_PP_SEQ_TAIL_I seq +# else +# define MITK_PP_SEQ_TAIL(seq) MITK_PP_SEQ_TAIL_I seq +# endif +# +# define MITK_PP_SEQ_TAIL_I(x) +# +# /* MITK_PP_SEQ_NIL */ +# +# define MITK_PP_SEQ_NIL(x) (x) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqElem.h b/Core/Code/Algorithms/mitkPPSeqElem.h new file mode 100644 index 0000000000..5877c80868 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqElem.h @@ -0,0 +1,304 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_ELEM_HPP +# define MITK_PREPROCESSOR_SEQ_ELEM_HPP +# +# include "mitkPPCat.h" +# include "mitkPPConfig.h" +# include "mitkPPFacilitiesEmpty.h" +# +# /* MITK_PP_SEQ_ELEM */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_ELEM(i, seq) MITK_PP_SEQ_ELEM_I(i, seq) +# else +# define MITK_PP_SEQ_ELEM(i, seq) MITK_PP_SEQ_ELEM_I((i, seq)) +# endif +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_SEQ_ELEM_I(i, seq) MITK_PP_SEQ_ELEM_II((MITK_PP_SEQ_ELEM_ ## i seq)) +# define MITK_PP_SEQ_ELEM_II(res) MITK_PP_SEQ_ELEM_IV(MITK_PP_SEQ_ELEM_III res) +# define MITK_PP_SEQ_ELEM_III(x, _) x MITK_PP_EMPTY() +# define MITK_PP_SEQ_ELEM_IV(x) x +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_ELEM_I(par) MITK_PP_SEQ_ELEM_II ## par +# define MITK_PP_SEQ_ELEM_II(i, seq) MITK_PP_SEQ_ELEM_III(MITK_PP_SEQ_ELEM_ ## i ## seq) +# define MITK_PP_SEQ_ELEM_III(im) MITK_PP_SEQ_ELEM_IV(im) +# define MITK_PP_SEQ_ELEM_IV(x, _) x +# else +# if defined(__IBMC__) || defined(__IBMCPP__) +# define MITK_PP_SEQ_ELEM_I(i, seq) MITK_PP_SEQ_ELEM_II(MITK_PP_CAT(MITK_PP_SEQ_ELEM_ ## i, seq)) +# else +# define MITK_PP_SEQ_ELEM_I(i, seq) MITK_PP_SEQ_ELEM_II(MITK_PP_SEQ_ELEM_ ## i seq) +# endif +# define MITK_PP_SEQ_ELEM_II(im) MITK_PP_SEQ_ELEM_III(im) +# define MITK_PP_SEQ_ELEM_III(x, _) x +# endif +# +# define MITK_PP_SEQ_ELEM_0(x) x, MITK_PP_NIL +# define MITK_PP_SEQ_ELEM_1(_) MITK_PP_SEQ_ELEM_0 +# define MITK_PP_SEQ_ELEM_2(_) MITK_PP_SEQ_ELEM_1 +# define MITK_PP_SEQ_ELEM_3(_) MITK_PP_SEQ_ELEM_2 +# define MITK_PP_SEQ_ELEM_4(_) MITK_PP_SEQ_ELEM_3 +# define MITK_PP_SEQ_ELEM_5(_) MITK_PP_SEQ_ELEM_4 +# define MITK_PP_SEQ_ELEM_6(_) MITK_PP_SEQ_ELEM_5 +# define MITK_PP_SEQ_ELEM_7(_) MITK_PP_SEQ_ELEM_6 +# define MITK_PP_SEQ_ELEM_8(_) MITK_PP_SEQ_ELEM_7 +# define MITK_PP_SEQ_ELEM_9(_) MITK_PP_SEQ_ELEM_8 +# define MITK_PP_SEQ_ELEM_10(_) MITK_PP_SEQ_ELEM_9 +# define MITK_PP_SEQ_ELEM_11(_) MITK_PP_SEQ_ELEM_10 +# define MITK_PP_SEQ_ELEM_12(_) MITK_PP_SEQ_ELEM_11 +# define MITK_PP_SEQ_ELEM_13(_) MITK_PP_SEQ_ELEM_12 +# define MITK_PP_SEQ_ELEM_14(_) MITK_PP_SEQ_ELEM_13 +# define MITK_PP_SEQ_ELEM_15(_) MITK_PP_SEQ_ELEM_14 +# define MITK_PP_SEQ_ELEM_16(_) MITK_PP_SEQ_ELEM_15 +# define MITK_PP_SEQ_ELEM_17(_) MITK_PP_SEQ_ELEM_16 +# define MITK_PP_SEQ_ELEM_18(_) MITK_PP_SEQ_ELEM_17 +# define MITK_PP_SEQ_ELEM_19(_) MITK_PP_SEQ_ELEM_18 +# define MITK_PP_SEQ_ELEM_20(_) MITK_PP_SEQ_ELEM_19 +# define MITK_PP_SEQ_ELEM_21(_) MITK_PP_SEQ_ELEM_20 +# define MITK_PP_SEQ_ELEM_22(_) MITK_PP_SEQ_ELEM_21 +# define MITK_PP_SEQ_ELEM_23(_) MITK_PP_SEQ_ELEM_22 +# define MITK_PP_SEQ_ELEM_24(_) MITK_PP_SEQ_ELEM_23 +# define MITK_PP_SEQ_ELEM_25(_) MITK_PP_SEQ_ELEM_24 +# define MITK_PP_SEQ_ELEM_26(_) MITK_PP_SEQ_ELEM_25 +# define MITK_PP_SEQ_ELEM_27(_) MITK_PP_SEQ_ELEM_26 +# define MITK_PP_SEQ_ELEM_28(_) MITK_PP_SEQ_ELEM_27 +# define MITK_PP_SEQ_ELEM_29(_) MITK_PP_SEQ_ELEM_28 +# define MITK_PP_SEQ_ELEM_30(_) MITK_PP_SEQ_ELEM_29 +# define MITK_PP_SEQ_ELEM_31(_) MITK_PP_SEQ_ELEM_30 +# define MITK_PP_SEQ_ELEM_32(_) MITK_PP_SEQ_ELEM_31 +# define MITK_PP_SEQ_ELEM_33(_) MITK_PP_SEQ_ELEM_32 +# define MITK_PP_SEQ_ELEM_34(_) MITK_PP_SEQ_ELEM_33 +# define MITK_PP_SEQ_ELEM_35(_) MITK_PP_SEQ_ELEM_34 +# define MITK_PP_SEQ_ELEM_36(_) MITK_PP_SEQ_ELEM_35 +# define MITK_PP_SEQ_ELEM_37(_) MITK_PP_SEQ_ELEM_36 +# define MITK_PP_SEQ_ELEM_38(_) MITK_PP_SEQ_ELEM_37 +# define MITK_PP_SEQ_ELEM_39(_) MITK_PP_SEQ_ELEM_38 +# define MITK_PP_SEQ_ELEM_40(_) MITK_PP_SEQ_ELEM_39 +# define MITK_PP_SEQ_ELEM_41(_) MITK_PP_SEQ_ELEM_40 +# define MITK_PP_SEQ_ELEM_42(_) MITK_PP_SEQ_ELEM_41 +# define MITK_PP_SEQ_ELEM_43(_) MITK_PP_SEQ_ELEM_42 +# define MITK_PP_SEQ_ELEM_44(_) MITK_PP_SEQ_ELEM_43 +# define MITK_PP_SEQ_ELEM_45(_) MITK_PP_SEQ_ELEM_44 +# define MITK_PP_SEQ_ELEM_46(_) MITK_PP_SEQ_ELEM_45 +# define MITK_PP_SEQ_ELEM_47(_) MITK_PP_SEQ_ELEM_46 +# define MITK_PP_SEQ_ELEM_48(_) MITK_PP_SEQ_ELEM_47 +# define MITK_PP_SEQ_ELEM_49(_) MITK_PP_SEQ_ELEM_48 +# define MITK_PP_SEQ_ELEM_50(_) MITK_PP_SEQ_ELEM_49 +# define MITK_PP_SEQ_ELEM_51(_) MITK_PP_SEQ_ELEM_50 +# define MITK_PP_SEQ_ELEM_52(_) MITK_PP_SEQ_ELEM_51 +# define MITK_PP_SEQ_ELEM_53(_) MITK_PP_SEQ_ELEM_52 +# define MITK_PP_SEQ_ELEM_54(_) MITK_PP_SEQ_ELEM_53 +# define MITK_PP_SEQ_ELEM_55(_) MITK_PP_SEQ_ELEM_54 +# define MITK_PP_SEQ_ELEM_56(_) MITK_PP_SEQ_ELEM_55 +# define MITK_PP_SEQ_ELEM_57(_) MITK_PP_SEQ_ELEM_56 +# define MITK_PP_SEQ_ELEM_58(_) MITK_PP_SEQ_ELEM_57 +# define MITK_PP_SEQ_ELEM_59(_) MITK_PP_SEQ_ELEM_58 +# define MITK_PP_SEQ_ELEM_60(_) MITK_PP_SEQ_ELEM_59 +# define MITK_PP_SEQ_ELEM_61(_) MITK_PP_SEQ_ELEM_60 +# define MITK_PP_SEQ_ELEM_62(_) MITK_PP_SEQ_ELEM_61 +# define MITK_PP_SEQ_ELEM_63(_) MITK_PP_SEQ_ELEM_62 +# define MITK_PP_SEQ_ELEM_64(_) MITK_PP_SEQ_ELEM_63 +# define MITK_PP_SEQ_ELEM_65(_) MITK_PP_SEQ_ELEM_64 +# define MITK_PP_SEQ_ELEM_66(_) MITK_PP_SEQ_ELEM_65 +# define MITK_PP_SEQ_ELEM_67(_) MITK_PP_SEQ_ELEM_66 +# define MITK_PP_SEQ_ELEM_68(_) MITK_PP_SEQ_ELEM_67 +# define MITK_PP_SEQ_ELEM_69(_) MITK_PP_SEQ_ELEM_68 +# define MITK_PP_SEQ_ELEM_70(_) MITK_PP_SEQ_ELEM_69 +# define MITK_PP_SEQ_ELEM_71(_) MITK_PP_SEQ_ELEM_70 +# define MITK_PP_SEQ_ELEM_72(_) MITK_PP_SEQ_ELEM_71 +# define MITK_PP_SEQ_ELEM_73(_) MITK_PP_SEQ_ELEM_72 +# define MITK_PP_SEQ_ELEM_74(_) MITK_PP_SEQ_ELEM_73 +# define MITK_PP_SEQ_ELEM_75(_) MITK_PP_SEQ_ELEM_74 +# define MITK_PP_SEQ_ELEM_76(_) MITK_PP_SEQ_ELEM_75 +# define MITK_PP_SEQ_ELEM_77(_) MITK_PP_SEQ_ELEM_76 +# define MITK_PP_SEQ_ELEM_78(_) MITK_PP_SEQ_ELEM_77 +# define MITK_PP_SEQ_ELEM_79(_) MITK_PP_SEQ_ELEM_78 +# define MITK_PP_SEQ_ELEM_80(_) MITK_PP_SEQ_ELEM_79 +# define MITK_PP_SEQ_ELEM_81(_) MITK_PP_SEQ_ELEM_80 +# define MITK_PP_SEQ_ELEM_82(_) MITK_PP_SEQ_ELEM_81 +# define MITK_PP_SEQ_ELEM_83(_) MITK_PP_SEQ_ELEM_82 +# define MITK_PP_SEQ_ELEM_84(_) MITK_PP_SEQ_ELEM_83 +# define MITK_PP_SEQ_ELEM_85(_) MITK_PP_SEQ_ELEM_84 +# define MITK_PP_SEQ_ELEM_86(_) MITK_PP_SEQ_ELEM_85 +# define MITK_PP_SEQ_ELEM_87(_) MITK_PP_SEQ_ELEM_86 +# define MITK_PP_SEQ_ELEM_88(_) MITK_PP_SEQ_ELEM_87 +# define MITK_PP_SEQ_ELEM_89(_) MITK_PP_SEQ_ELEM_88 +# define MITK_PP_SEQ_ELEM_90(_) MITK_PP_SEQ_ELEM_89 +# define MITK_PP_SEQ_ELEM_91(_) MITK_PP_SEQ_ELEM_90 +# define MITK_PP_SEQ_ELEM_92(_) MITK_PP_SEQ_ELEM_91 +# define MITK_PP_SEQ_ELEM_93(_) MITK_PP_SEQ_ELEM_92 +# define MITK_PP_SEQ_ELEM_94(_) MITK_PP_SEQ_ELEM_93 +# define MITK_PP_SEQ_ELEM_95(_) MITK_PP_SEQ_ELEM_94 +# define MITK_PP_SEQ_ELEM_96(_) MITK_PP_SEQ_ELEM_95 +# define MITK_PP_SEQ_ELEM_97(_) MITK_PP_SEQ_ELEM_96 +# define MITK_PP_SEQ_ELEM_98(_) MITK_PP_SEQ_ELEM_97 +# define MITK_PP_SEQ_ELEM_99(_) MITK_PP_SEQ_ELEM_98 +# define MITK_PP_SEQ_ELEM_100(_) MITK_PP_SEQ_ELEM_99 +# define MITK_PP_SEQ_ELEM_101(_) MITK_PP_SEQ_ELEM_100 +# define MITK_PP_SEQ_ELEM_102(_) MITK_PP_SEQ_ELEM_101 +# define MITK_PP_SEQ_ELEM_103(_) MITK_PP_SEQ_ELEM_102 +# define MITK_PP_SEQ_ELEM_104(_) MITK_PP_SEQ_ELEM_103 +# define MITK_PP_SEQ_ELEM_105(_) MITK_PP_SEQ_ELEM_104 +# define MITK_PP_SEQ_ELEM_106(_) MITK_PP_SEQ_ELEM_105 +# define MITK_PP_SEQ_ELEM_107(_) MITK_PP_SEQ_ELEM_106 +# define MITK_PP_SEQ_ELEM_108(_) MITK_PP_SEQ_ELEM_107 +# define MITK_PP_SEQ_ELEM_109(_) MITK_PP_SEQ_ELEM_108 +# define MITK_PP_SEQ_ELEM_110(_) MITK_PP_SEQ_ELEM_109 +# define MITK_PP_SEQ_ELEM_111(_) MITK_PP_SEQ_ELEM_110 +# define MITK_PP_SEQ_ELEM_112(_) MITK_PP_SEQ_ELEM_111 +# define MITK_PP_SEQ_ELEM_113(_) MITK_PP_SEQ_ELEM_112 +# define MITK_PP_SEQ_ELEM_114(_) MITK_PP_SEQ_ELEM_113 +# define MITK_PP_SEQ_ELEM_115(_) MITK_PP_SEQ_ELEM_114 +# define MITK_PP_SEQ_ELEM_116(_) MITK_PP_SEQ_ELEM_115 +# define MITK_PP_SEQ_ELEM_117(_) MITK_PP_SEQ_ELEM_116 +# define MITK_PP_SEQ_ELEM_118(_) MITK_PP_SEQ_ELEM_117 +# define MITK_PP_SEQ_ELEM_119(_) MITK_PP_SEQ_ELEM_118 +# define MITK_PP_SEQ_ELEM_120(_) MITK_PP_SEQ_ELEM_119 +# define MITK_PP_SEQ_ELEM_121(_) MITK_PP_SEQ_ELEM_120 +# define MITK_PP_SEQ_ELEM_122(_) MITK_PP_SEQ_ELEM_121 +# define MITK_PP_SEQ_ELEM_123(_) MITK_PP_SEQ_ELEM_122 +# define MITK_PP_SEQ_ELEM_124(_) MITK_PP_SEQ_ELEM_123 +# define MITK_PP_SEQ_ELEM_125(_) MITK_PP_SEQ_ELEM_124 +# define MITK_PP_SEQ_ELEM_126(_) MITK_PP_SEQ_ELEM_125 +# define MITK_PP_SEQ_ELEM_127(_) MITK_PP_SEQ_ELEM_126 +# define MITK_PP_SEQ_ELEM_128(_) MITK_PP_SEQ_ELEM_127 +# define MITK_PP_SEQ_ELEM_129(_) MITK_PP_SEQ_ELEM_128 +# define MITK_PP_SEQ_ELEM_130(_) MITK_PP_SEQ_ELEM_129 +# define MITK_PP_SEQ_ELEM_131(_) MITK_PP_SEQ_ELEM_130 +# define MITK_PP_SEQ_ELEM_132(_) MITK_PP_SEQ_ELEM_131 +# define MITK_PP_SEQ_ELEM_133(_) MITK_PP_SEQ_ELEM_132 +# define MITK_PP_SEQ_ELEM_134(_) MITK_PP_SEQ_ELEM_133 +# define MITK_PP_SEQ_ELEM_135(_) MITK_PP_SEQ_ELEM_134 +# define MITK_PP_SEQ_ELEM_136(_) MITK_PP_SEQ_ELEM_135 +# define MITK_PP_SEQ_ELEM_137(_) MITK_PP_SEQ_ELEM_136 +# define MITK_PP_SEQ_ELEM_138(_) MITK_PP_SEQ_ELEM_137 +# define MITK_PP_SEQ_ELEM_139(_) MITK_PP_SEQ_ELEM_138 +# define MITK_PP_SEQ_ELEM_140(_) MITK_PP_SEQ_ELEM_139 +# define MITK_PP_SEQ_ELEM_141(_) MITK_PP_SEQ_ELEM_140 +# define MITK_PP_SEQ_ELEM_142(_) MITK_PP_SEQ_ELEM_141 +# define MITK_PP_SEQ_ELEM_143(_) MITK_PP_SEQ_ELEM_142 +# define MITK_PP_SEQ_ELEM_144(_) MITK_PP_SEQ_ELEM_143 +# define MITK_PP_SEQ_ELEM_145(_) MITK_PP_SEQ_ELEM_144 +# define MITK_PP_SEQ_ELEM_146(_) MITK_PP_SEQ_ELEM_145 +# define MITK_PP_SEQ_ELEM_147(_) MITK_PP_SEQ_ELEM_146 +# define MITK_PP_SEQ_ELEM_148(_) MITK_PP_SEQ_ELEM_147 +# define MITK_PP_SEQ_ELEM_149(_) MITK_PP_SEQ_ELEM_148 +# define MITK_PP_SEQ_ELEM_150(_) MITK_PP_SEQ_ELEM_149 +# define MITK_PP_SEQ_ELEM_151(_) MITK_PP_SEQ_ELEM_150 +# define MITK_PP_SEQ_ELEM_152(_) MITK_PP_SEQ_ELEM_151 +# define MITK_PP_SEQ_ELEM_153(_) MITK_PP_SEQ_ELEM_152 +# define MITK_PP_SEQ_ELEM_154(_) MITK_PP_SEQ_ELEM_153 +# define MITK_PP_SEQ_ELEM_155(_) MITK_PP_SEQ_ELEM_154 +# define MITK_PP_SEQ_ELEM_156(_) MITK_PP_SEQ_ELEM_155 +# define MITK_PP_SEQ_ELEM_157(_) MITK_PP_SEQ_ELEM_156 +# define MITK_PP_SEQ_ELEM_158(_) MITK_PP_SEQ_ELEM_157 +# define MITK_PP_SEQ_ELEM_159(_) MITK_PP_SEQ_ELEM_158 +# define MITK_PP_SEQ_ELEM_160(_) MITK_PP_SEQ_ELEM_159 +# define MITK_PP_SEQ_ELEM_161(_) MITK_PP_SEQ_ELEM_160 +# define MITK_PP_SEQ_ELEM_162(_) MITK_PP_SEQ_ELEM_161 +# define MITK_PP_SEQ_ELEM_163(_) MITK_PP_SEQ_ELEM_162 +# define MITK_PP_SEQ_ELEM_164(_) MITK_PP_SEQ_ELEM_163 +# define MITK_PP_SEQ_ELEM_165(_) MITK_PP_SEQ_ELEM_164 +# define MITK_PP_SEQ_ELEM_166(_) MITK_PP_SEQ_ELEM_165 +# define MITK_PP_SEQ_ELEM_167(_) MITK_PP_SEQ_ELEM_166 +# define MITK_PP_SEQ_ELEM_168(_) MITK_PP_SEQ_ELEM_167 +# define MITK_PP_SEQ_ELEM_169(_) MITK_PP_SEQ_ELEM_168 +# define MITK_PP_SEQ_ELEM_170(_) MITK_PP_SEQ_ELEM_169 +# define MITK_PP_SEQ_ELEM_171(_) MITK_PP_SEQ_ELEM_170 +# define MITK_PP_SEQ_ELEM_172(_) MITK_PP_SEQ_ELEM_171 +# define MITK_PP_SEQ_ELEM_173(_) MITK_PP_SEQ_ELEM_172 +# define MITK_PP_SEQ_ELEM_174(_) MITK_PP_SEQ_ELEM_173 +# define MITK_PP_SEQ_ELEM_175(_) MITK_PP_SEQ_ELEM_174 +# define MITK_PP_SEQ_ELEM_176(_) MITK_PP_SEQ_ELEM_175 +# define MITK_PP_SEQ_ELEM_177(_) MITK_PP_SEQ_ELEM_176 +# define MITK_PP_SEQ_ELEM_178(_) MITK_PP_SEQ_ELEM_177 +# define MITK_PP_SEQ_ELEM_179(_) MITK_PP_SEQ_ELEM_178 +# define MITK_PP_SEQ_ELEM_180(_) MITK_PP_SEQ_ELEM_179 +# define MITK_PP_SEQ_ELEM_181(_) MITK_PP_SEQ_ELEM_180 +# define MITK_PP_SEQ_ELEM_182(_) MITK_PP_SEQ_ELEM_181 +# define MITK_PP_SEQ_ELEM_183(_) MITK_PP_SEQ_ELEM_182 +# define MITK_PP_SEQ_ELEM_184(_) MITK_PP_SEQ_ELEM_183 +# define MITK_PP_SEQ_ELEM_185(_) MITK_PP_SEQ_ELEM_184 +# define MITK_PP_SEQ_ELEM_186(_) MITK_PP_SEQ_ELEM_185 +# define MITK_PP_SEQ_ELEM_187(_) MITK_PP_SEQ_ELEM_186 +# define MITK_PP_SEQ_ELEM_188(_) MITK_PP_SEQ_ELEM_187 +# define MITK_PP_SEQ_ELEM_189(_) MITK_PP_SEQ_ELEM_188 +# define MITK_PP_SEQ_ELEM_190(_) MITK_PP_SEQ_ELEM_189 +# define MITK_PP_SEQ_ELEM_191(_) MITK_PP_SEQ_ELEM_190 +# define MITK_PP_SEQ_ELEM_192(_) MITK_PP_SEQ_ELEM_191 +# define MITK_PP_SEQ_ELEM_193(_) MITK_PP_SEQ_ELEM_192 +# define MITK_PP_SEQ_ELEM_194(_) MITK_PP_SEQ_ELEM_193 +# define MITK_PP_SEQ_ELEM_195(_) MITK_PP_SEQ_ELEM_194 +# define MITK_PP_SEQ_ELEM_196(_) MITK_PP_SEQ_ELEM_195 +# define MITK_PP_SEQ_ELEM_197(_) MITK_PP_SEQ_ELEM_196 +# define MITK_PP_SEQ_ELEM_198(_) MITK_PP_SEQ_ELEM_197 +# define MITK_PP_SEQ_ELEM_199(_) MITK_PP_SEQ_ELEM_198 +# define MITK_PP_SEQ_ELEM_200(_) MITK_PP_SEQ_ELEM_199 +# define MITK_PP_SEQ_ELEM_201(_) MITK_PP_SEQ_ELEM_200 +# define MITK_PP_SEQ_ELEM_202(_) MITK_PP_SEQ_ELEM_201 +# define MITK_PP_SEQ_ELEM_203(_) MITK_PP_SEQ_ELEM_202 +# define MITK_PP_SEQ_ELEM_204(_) MITK_PP_SEQ_ELEM_203 +# define MITK_PP_SEQ_ELEM_205(_) MITK_PP_SEQ_ELEM_204 +# define MITK_PP_SEQ_ELEM_206(_) MITK_PP_SEQ_ELEM_205 +# define MITK_PP_SEQ_ELEM_207(_) MITK_PP_SEQ_ELEM_206 +# define MITK_PP_SEQ_ELEM_208(_) MITK_PP_SEQ_ELEM_207 +# define MITK_PP_SEQ_ELEM_209(_) MITK_PP_SEQ_ELEM_208 +# define MITK_PP_SEQ_ELEM_210(_) MITK_PP_SEQ_ELEM_209 +# define MITK_PP_SEQ_ELEM_211(_) MITK_PP_SEQ_ELEM_210 +# define MITK_PP_SEQ_ELEM_212(_) MITK_PP_SEQ_ELEM_211 +# define MITK_PP_SEQ_ELEM_213(_) MITK_PP_SEQ_ELEM_212 +# define MITK_PP_SEQ_ELEM_214(_) MITK_PP_SEQ_ELEM_213 +# define MITK_PP_SEQ_ELEM_215(_) MITK_PP_SEQ_ELEM_214 +# define MITK_PP_SEQ_ELEM_216(_) MITK_PP_SEQ_ELEM_215 +# define MITK_PP_SEQ_ELEM_217(_) MITK_PP_SEQ_ELEM_216 +# define MITK_PP_SEQ_ELEM_218(_) MITK_PP_SEQ_ELEM_217 +# define MITK_PP_SEQ_ELEM_219(_) MITK_PP_SEQ_ELEM_218 +# define MITK_PP_SEQ_ELEM_220(_) MITK_PP_SEQ_ELEM_219 +# define MITK_PP_SEQ_ELEM_221(_) MITK_PP_SEQ_ELEM_220 +# define MITK_PP_SEQ_ELEM_222(_) MITK_PP_SEQ_ELEM_221 +# define MITK_PP_SEQ_ELEM_223(_) MITK_PP_SEQ_ELEM_222 +# define MITK_PP_SEQ_ELEM_224(_) MITK_PP_SEQ_ELEM_223 +# define MITK_PP_SEQ_ELEM_225(_) MITK_PP_SEQ_ELEM_224 +# define MITK_PP_SEQ_ELEM_226(_) MITK_PP_SEQ_ELEM_225 +# define MITK_PP_SEQ_ELEM_227(_) MITK_PP_SEQ_ELEM_226 +# define MITK_PP_SEQ_ELEM_228(_) MITK_PP_SEQ_ELEM_227 +# define MITK_PP_SEQ_ELEM_229(_) MITK_PP_SEQ_ELEM_228 +# define MITK_PP_SEQ_ELEM_230(_) MITK_PP_SEQ_ELEM_229 +# define MITK_PP_SEQ_ELEM_231(_) MITK_PP_SEQ_ELEM_230 +# define MITK_PP_SEQ_ELEM_232(_) MITK_PP_SEQ_ELEM_231 +# define MITK_PP_SEQ_ELEM_233(_) MITK_PP_SEQ_ELEM_232 +# define MITK_PP_SEQ_ELEM_234(_) MITK_PP_SEQ_ELEM_233 +# define MITK_PP_SEQ_ELEM_235(_) MITK_PP_SEQ_ELEM_234 +# define MITK_PP_SEQ_ELEM_236(_) MITK_PP_SEQ_ELEM_235 +# define MITK_PP_SEQ_ELEM_237(_) MITK_PP_SEQ_ELEM_236 +# define MITK_PP_SEQ_ELEM_238(_) MITK_PP_SEQ_ELEM_237 +# define MITK_PP_SEQ_ELEM_239(_) MITK_PP_SEQ_ELEM_238 +# define MITK_PP_SEQ_ELEM_240(_) MITK_PP_SEQ_ELEM_239 +# define MITK_PP_SEQ_ELEM_241(_) MITK_PP_SEQ_ELEM_240 +# define MITK_PP_SEQ_ELEM_242(_) MITK_PP_SEQ_ELEM_241 +# define MITK_PP_SEQ_ELEM_243(_) MITK_PP_SEQ_ELEM_242 +# define MITK_PP_SEQ_ELEM_244(_) MITK_PP_SEQ_ELEM_243 +# define MITK_PP_SEQ_ELEM_245(_) MITK_PP_SEQ_ELEM_244 +# define MITK_PP_SEQ_ELEM_246(_) MITK_PP_SEQ_ELEM_245 +# define MITK_PP_SEQ_ELEM_247(_) MITK_PP_SEQ_ELEM_246 +# define MITK_PP_SEQ_ELEM_248(_) MITK_PP_SEQ_ELEM_247 +# define MITK_PP_SEQ_ELEM_249(_) MITK_PP_SEQ_ELEM_248 +# define MITK_PP_SEQ_ELEM_250(_) MITK_PP_SEQ_ELEM_249 +# define MITK_PP_SEQ_ELEM_251(_) MITK_PP_SEQ_ELEM_250 +# define MITK_PP_SEQ_ELEM_252(_) MITK_PP_SEQ_ELEM_251 +# define MITK_PP_SEQ_ELEM_253(_) MITK_PP_SEQ_ELEM_252 +# define MITK_PP_SEQ_ELEM_254(_) MITK_PP_SEQ_ELEM_253 +# define MITK_PP_SEQ_ELEM_255(_) MITK_PP_SEQ_ELEM_254 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqEnum.h b/Core/Code/Algorithms/mitkPPSeqEnum.h new file mode 100644 index 0000000000..f9cfc97796 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqEnum.h @@ -0,0 +1,288 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_ENUM_HPP +# define MITK_PREPROCESSOR_SEQ_ENUM_HPP +# +# include "mitkPPCat.h" +# include "mitkPPConfig.h" +# include "mitkPPSeqSize.h" +# +# /* MITK_PP_SEQ_ENUM */ +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_ENUM(seq) MITK_PP_SEQ_ENUM_I(seq) +# define MITK_PP_SEQ_ENUM_I(seq) MITK_PP_CAT(MITK_PP_SEQ_ENUM_, MITK_PP_SEQ_SIZE(seq)) seq +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_ENUM(seq) MITK_PP_SEQ_ENUM_I(MITK_PP_SEQ_SIZE(seq), seq) +# define MITK_PP_SEQ_ENUM_I(size, seq) MITK_PP_CAT(MITK_PP_SEQ_ENUM_, size) seq +# else +# define MITK_PP_SEQ_ENUM(seq) MITK_PP_CAT(MITK_PP_SEQ_ENUM_, MITK_PP_SEQ_SIZE(seq)) seq +# endif +# +# define MITK_PP_SEQ_ENUM_1(x) x +# define MITK_PP_SEQ_ENUM_2(x) x, MITK_PP_SEQ_ENUM_1 +# define MITK_PP_SEQ_ENUM_3(x) x, MITK_PP_SEQ_ENUM_2 +# define MITK_PP_SEQ_ENUM_4(x) x, MITK_PP_SEQ_ENUM_3 +# define MITK_PP_SEQ_ENUM_5(x) x, MITK_PP_SEQ_ENUM_4 +# define MITK_PP_SEQ_ENUM_6(x) x, MITK_PP_SEQ_ENUM_5 +# define MITK_PP_SEQ_ENUM_7(x) x, MITK_PP_SEQ_ENUM_6 +# define MITK_PP_SEQ_ENUM_8(x) x, MITK_PP_SEQ_ENUM_7 +# define MITK_PP_SEQ_ENUM_9(x) x, MITK_PP_SEQ_ENUM_8 +# define MITK_PP_SEQ_ENUM_10(x) x, MITK_PP_SEQ_ENUM_9 +# define MITK_PP_SEQ_ENUM_11(x) x, MITK_PP_SEQ_ENUM_10 +# define MITK_PP_SEQ_ENUM_12(x) x, MITK_PP_SEQ_ENUM_11 +# define MITK_PP_SEQ_ENUM_13(x) x, MITK_PP_SEQ_ENUM_12 +# define MITK_PP_SEQ_ENUM_14(x) x, MITK_PP_SEQ_ENUM_13 +# define MITK_PP_SEQ_ENUM_15(x) x, MITK_PP_SEQ_ENUM_14 +# define MITK_PP_SEQ_ENUM_16(x) x, MITK_PP_SEQ_ENUM_15 +# define MITK_PP_SEQ_ENUM_17(x) x, MITK_PP_SEQ_ENUM_16 +# define MITK_PP_SEQ_ENUM_18(x) x, MITK_PP_SEQ_ENUM_17 +# define MITK_PP_SEQ_ENUM_19(x) x, MITK_PP_SEQ_ENUM_18 +# define MITK_PP_SEQ_ENUM_20(x) x, MITK_PP_SEQ_ENUM_19 +# define MITK_PP_SEQ_ENUM_21(x) x, MITK_PP_SEQ_ENUM_20 +# define MITK_PP_SEQ_ENUM_22(x) x, MITK_PP_SEQ_ENUM_21 +# define MITK_PP_SEQ_ENUM_23(x) x, MITK_PP_SEQ_ENUM_22 +# define MITK_PP_SEQ_ENUM_24(x) x, MITK_PP_SEQ_ENUM_23 +# define MITK_PP_SEQ_ENUM_25(x) x, MITK_PP_SEQ_ENUM_24 +# define MITK_PP_SEQ_ENUM_26(x) x, MITK_PP_SEQ_ENUM_25 +# define MITK_PP_SEQ_ENUM_27(x) x, MITK_PP_SEQ_ENUM_26 +# define MITK_PP_SEQ_ENUM_28(x) x, MITK_PP_SEQ_ENUM_27 +# define MITK_PP_SEQ_ENUM_29(x) x, MITK_PP_SEQ_ENUM_28 +# define MITK_PP_SEQ_ENUM_30(x) x, MITK_PP_SEQ_ENUM_29 +# define MITK_PP_SEQ_ENUM_31(x) x, MITK_PP_SEQ_ENUM_30 +# define MITK_PP_SEQ_ENUM_32(x) x, MITK_PP_SEQ_ENUM_31 +# define MITK_PP_SEQ_ENUM_33(x) x, MITK_PP_SEQ_ENUM_32 +# define MITK_PP_SEQ_ENUM_34(x) x, MITK_PP_SEQ_ENUM_33 +# define MITK_PP_SEQ_ENUM_35(x) x, MITK_PP_SEQ_ENUM_34 +# define MITK_PP_SEQ_ENUM_36(x) x, MITK_PP_SEQ_ENUM_35 +# define MITK_PP_SEQ_ENUM_37(x) x, MITK_PP_SEQ_ENUM_36 +# define MITK_PP_SEQ_ENUM_38(x) x, MITK_PP_SEQ_ENUM_37 +# define MITK_PP_SEQ_ENUM_39(x) x, MITK_PP_SEQ_ENUM_38 +# define MITK_PP_SEQ_ENUM_40(x) x, MITK_PP_SEQ_ENUM_39 +# define MITK_PP_SEQ_ENUM_41(x) x, MITK_PP_SEQ_ENUM_40 +# define MITK_PP_SEQ_ENUM_42(x) x, MITK_PP_SEQ_ENUM_41 +# define MITK_PP_SEQ_ENUM_43(x) x, MITK_PP_SEQ_ENUM_42 +# define MITK_PP_SEQ_ENUM_44(x) x, MITK_PP_SEQ_ENUM_43 +# define MITK_PP_SEQ_ENUM_45(x) x, MITK_PP_SEQ_ENUM_44 +# define MITK_PP_SEQ_ENUM_46(x) x, MITK_PP_SEQ_ENUM_45 +# define MITK_PP_SEQ_ENUM_47(x) x, MITK_PP_SEQ_ENUM_46 +# define MITK_PP_SEQ_ENUM_48(x) x, MITK_PP_SEQ_ENUM_47 +# define MITK_PP_SEQ_ENUM_49(x) x, MITK_PP_SEQ_ENUM_48 +# define MITK_PP_SEQ_ENUM_50(x) x, MITK_PP_SEQ_ENUM_49 +# define MITK_PP_SEQ_ENUM_51(x) x, MITK_PP_SEQ_ENUM_50 +# define MITK_PP_SEQ_ENUM_52(x) x, MITK_PP_SEQ_ENUM_51 +# define MITK_PP_SEQ_ENUM_53(x) x, MITK_PP_SEQ_ENUM_52 +# define MITK_PP_SEQ_ENUM_54(x) x, MITK_PP_SEQ_ENUM_53 +# define MITK_PP_SEQ_ENUM_55(x) x, MITK_PP_SEQ_ENUM_54 +# define MITK_PP_SEQ_ENUM_56(x) x, MITK_PP_SEQ_ENUM_55 +# define MITK_PP_SEQ_ENUM_57(x) x, MITK_PP_SEQ_ENUM_56 +# define MITK_PP_SEQ_ENUM_58(x) x, MITK_PP_SEQ_ENUM_57 +# define MITK_PP_SEQ_ENUM_59(x) x, MITK_PP_SEQ_ENUM_58 +# define MITK_PP_SEQ_ENUM_60(x) x, MITK_PP_SEQ_ENUM_59 +# define MITK_PP_SEQ_ENUM_61(x) x, MITK_PP_SEQ_ENUM_60 +# define MITK_PP_SEQ_ENUM_62(x) x, MITK_PP_SEQ_ENUM_61 +# define MITK_PP_SEQ_ENUM_63(x) x, MITK_PP_SEQ_ENUM_62 +# define MITK_PP_SEQ_ENUM_64(x) x, MITK_PP_SEQ_ENUM_63 +# define MITK_PP_SEQ_ENUM_65(x) x, MITK_PP_SEQ_ENUM_64 +# define MITK_PP_SEQ_ENUM_66(x) x, MITK_PP_SEQ_ENUM_65 +# define MITK_PP_SEQ_ENUM_67(x) x, MITK_PP_SEQ_ENUM_66 +# define MITK_PP_SEQ_ENUM_68(x) x, MITK_PP_SEQ_ENUM_67 +# define MITK_PP_SEQ_ENUM_69(x) x, MITK_PP_SEQ_ENUM_68 +# define MITK_PP_SEQ_ENUM_70(x) x, MITK_PP_SEQ_ENUM_69 +# define MITK_PP_SEQ_ENUM_71(x) x, MITK_PP_SEQ_ENUM_70 +# define MITK_PP_SEQ_ENUM_72(x) x, MITK_PP_SEQ_ENUM_71 +# define MITK_PP_SEQ_ENUM_73(x) x, MITK_PP_SEQ_ENUM_72 +# define MITK_PP_SEQ_ENUM_74(x) x, MITK_PP_SEQ_ENUM_73 +# define MITK_PP_SEQ_ENUM_75(x) x, MITK_PP_SEQ_ENUM_74 +# define MITK_PP_SEQ_ENUM_76(x) x, MITK_PP_SEQ_ENUM_75 +# define MITK_PP_SEQ_ENUM_77(x) x, MITK_PP_SEQ_ENUM_76 +# define MITK_PP_SEQ_ENUM_78(x) x, MITK_PP_SEQ_ENUM_77 +# define MITK_PP_SEQ_ENUM_79(x) x, MITK_PP_SEQ_ENUM_78 +# define MITK_PP_SEQ_ENUM_80(x) x, MITK_PP_SEQ_ENUM_79 +# define MITK_PP_SEQ_ENUM_81(x) x, MITK_PP_SEQ_ENUM_80 +# define MITK_PP_SEQ_ENUM_82(x) x, MITK_PP_SEQ_ENUM_81 +# define MITK_PP_SEQ_ENUM_83(x) x, MITK_PP_SEQ_ENUM_82 +# define MITK_PP_SEQ_ENUM_84(x) x, MITK_PP_SEQ_ENUM_83 +# define MITK_PP_SEQ_ENUM_85(x) x, MITK_PP_SEQ_ENUM_84 +# define MITK_PP_SEQ_ENUM_86(x) x, MITK_PP_SEQ_ENUM_85 +# define MITK_PP_SEQ_ENUM_87(x) x, MITK_PP_SEQ_ENUM_86 +# define MITK_PP_SEQ_ENUM_88(x) x, MITK_PP_SEQ_ENUM_87 +# define MITK_PP_SEQ_ENUM_89(x) x, MITK_PP_SEQ_ENUM_88 +# define MITK_PP_SEQ_ENUM_90(x) x, MITK_PP_SEQ_ENUM_89 +# define MITK_PP_SEQ_ENUM_91(x) x, MITK_PP_SEQ_ENUM_90 +# define MITK_PP_SEQ_ENUM_92(x) x, MITK_PP_SEQ_ENUM_91 +# define MITK_PP_SEQ_ENUM_93(x) x, MITK_PP_SEQ_ENUM_92 +# define MITK_PP_SEQ_ENUM_94(x) x, MITK_PP_SEQ_ENUM_93 +# define MITK_PP_SEQ_ENUM_95(x) x, MITK_PP_SEQ_ENUM_94 +# define MITK_PP_SEQ_ENUM_96(x) x, MITK_PP_SEQ_ENUM_95 +# define MITK_PP_SEQ_ENUM_97(x) x, MITK_PP_SEQ_ENUM_96 +# define MITK_PP_SEQ_ENUM_98(x) x, MITK_PP_SEQ_ENUM_97 +# define MITK_PP_SEQ_ENUM_99(x) x, MITK_PP_SEQ_ENUM_98 +# define MITK_PP_SEQ_ENUM_100(x) x, MITK_PP_SEQ_ENUM_99 +# define MITK_PP_SEQ_ENUM_101(x) x, MITK_PP_SEQ_ENUM_100 +# define MITK_PP_SEQ_ENUM_102(x) x, MITK_PP_SEQ_ENUM_101 +# define MITK_PP_SEQ_ENUM_103(x) x, MITK_PP_SEQ_ENUM_102 +# define MITK_PP_SEQ_ENUM_104(x) x, MITK_PP_SEQ_ENUM_103 +# define MITK_PP_SEQ_ENUM_105(x) x, MITK_PP_SEQ_ENUM_104 +# define MITK_PP_SEQ_ENUM_106(x) x, MITK_PP_SEQ_ENUM_105 +# define MITK_PP_SEQ_ENUM_107(x) x, MITK_PP_SEQ_ENUM_106 +# define MITK_PP_SEQ_ENUM_108(x) x, MITK_PP_SEQ_ENUM_107 +# define MITK_PP_SEQ_ENUM_109(x) x, MITK_PP_SEQ_ENUM_108 +# define MITK_PP_SEQ_ENUM_110(x) x, MITK_PP_SEQ_ENUM_109 +# define MITK_PP_SEQ_ENUM_111(x) x, MITK_PP_SEQ_ENUM_110 +# define MITK_PP_SEQ_ENUM_112(x) x, MITK_PP_SEQ_ENUM_111 +# define MITK_PP_SEQ_ENUM_113(x) x, MITK_PP_SEQ_ENUM_112 +# define MITK_PP_SEQ_ENUM_114(x) x, MITK_PP_SEQ_ENUM_113 +# define MITK_PP_SEQ_ENUM_115(x) x, MITK_PP_SEQ_ENUM_114 +# define MITK_PP_SEQ_ENUM_116(x) x, MITK_PP_SEQ_ENUM_115 +# define MITK_PP_SEQ_ENUM_117(x) x, MITK_PP_SEQ_ENUM_116 +# define MITK_PP_SEQ_ENUM_118(x) x, MITK_PP_SEQ_ENUM_117 +# define MITK_PP_SEQ_ENUM_119(x) x, MITK_PP_SEQ_ENUM_118 +# define MITK_PP_SEQ_ENUM_120(x) x, MITK_PP_SEQ_ENUM_119 +# define MITK_PP_SEQ_ENUM_121(x) x, MITK_PP_SEQ_ENUM_120 +# define MITK_PP_SEQ_ENUM_122(x) x, MITK_PP_SEQ_ENUM_121 +# define MITK_PP_SEQ_ENUM_123(x) x, MITK_PP_SEQ_ENUM_122 +# define MITK_PP_SEQ_ENUM_124(x) x, MITK_PP_SEQ_ENUM_123 +# define MITK_PP_SEQ_ENUM_125(x) x, MITK_PP_SEQ_ENUM_124 +# define MITK_PP_SEQ_ENUM_126(x) x, MITK_PP_SEQ_ENUM_125 +# define MITK_PP_SEQ_ENUM_127(x) x, MITK_PP_SEQ_ENUM_126 +# define MITK_PP_SEQ_ENUM_128(x) x, MITK_PP_SEQ_ENUM_127 +# define MITK_PP_SEQ_ENUM_129(x) x, MITK_PP_SEQ_ENUM_128 +# define MITK_PP_SEQ_ENUM_130(x) x, MITK_PP_SEQ_ENUM_129 +# define MITK_PP_SEQ_ENUM_131(x) x, MITK_PP_SEQ_ENUM_130 +# define MITK_PP_SEQ_ENUM_132(x) x, MITK_PP_SEQ_ENUM_131 +# define MITK_PP_SEQ_ENUM_133(x) x, MITK_PP_SEQ_ENUM_132 +# define MITK_PP_SEQ_ENUM_134(x) x, MITK_PP_SEQ_ENUM_133 +# define MITK_PP_SEQ_ENUM_135(x) x, MITK_PP_SEQ_ENUM_134 +# define MITK_PP_SEQ_ENUM_136(x) x, MITK_PP_SEQ_ENUM_135 +# define MITK_PP_SEQ_ENUM_137(x) x, MITK_PP_SEQ_ENUM_136 +# define MITK_PP_SEQ_ENUM_138(x) x, MITK_PP_SEQ_ENUM_137 +# define MITK_PP_SEQ_ENUM_139(x) x, MITK_PP_SEQ_ENUM_138 +# define MITK_PP_SEQ_ENUM_140(x) x, MITK_PP_SEQ_ENUM_139 +# define MITK_PP_SEQ_ENUM_141(x) x, MITK_PP_SEQ_ENUM_140 +# define MITK_PP_SEQ_ENUM_142(x) x, MITK_PP_SEQ_ENUM_141 +# define MITK_PP_SEQ_ENUM_143(x) x, MITK_PP_SEQ_ENUM_142 +# define MITK_PP_SEQ_ENUM_144(x) x, MITK_PP_SEQ_ENUM_143 +# define MITK_PP_SEQ_ENUM_145(x) x, MITK_PP_SEQ_ENUM_144 +# define MITK_PP_SEQ_ENUM_146(x) x, MITK_PP_SEQ_ENUM_145 +# define MITK_PP_SEQ_ENUM_147(x) x, MITK_PP_SEQ_ENUM_146 +# define MITK_PP_SEQ_ENUM_148(x) x, MITK_PP_SEQ_ENUM_147 +# define MITK_PP_SEQ_ENUM_149(x) x, MITK_PP_SEQ_ENUM_148 +# define MITK_PP_SEQ_ENUM_150(x) x, MITK_PP_SEQ_ENUM_149 +# define MITK_PP_SEQ_ENUM_151(x) x, MITK_PP_SEQ_ENUM_150 +# define MITK_PP_SEQ_ENUM_152(x) x, MITK_PP_SEQ_ENUM_151 +# define MITK_PP_SEQ_ENUM_153(x) x, MITK_PP_SEQ_ENUM_152 +# define MITK_PP_SEQ_ENUM_154(x) x, MITK_PP_SEQ_ENUM_153 +# define MITK_PP_SEQ_ENUM_155(x) x, MITK_PP_SEQ_ENUM_154 +# define MITK_PP_SEQ_ENUM_156(x) x, MITK_PP_SEQ_ENUM_155 +# define MITK_PP_SEQ_ENUM_157(x) x, MITK_PP_SEQ_ENUM_156 +# define MITK_PP_SEQ_ENUM_158(x) x, MITK_PP_SEQ_ENUM_157 +# define MITK_PP_SEQ_ENUM_159(x) x, MITK_PP_SEQ_ENUM_158 +# define MITK_PP_SEQ_ENUM_160(x) x, MITK_PP_SEQ_ENUM_159 +# define MITK_PP_SEQ_ENUM_161(x) x, MITK_PP_SEQ_ENUM_160 +# define MITK_PP_SEQ_ENUM_162(x) x, MITK_PP_SEQ_ENUM_161 +# define MITK_PP_SEQ_ENUM_163(x) x, MITK_PP_SEQ_ENUM_162 +# define MITK_PP_SEQ_ENUM_164(x) x, MITK_PP_SEQ_ENUM_163 +# define MITK_PP_SEQ_ENUM_165(x) x, MITK_PP_SEQ_ENUM_164 +# define MITK_PP_SEQ_ENUM_166(x) x, MITK_PP_SEQ_ENUM_165 +# define MITK_PP_SEQ_ENUM_167(x) x, MITK_PP_SEQ_ENUM_166 +# define MITK_PP_SEQ_ENUM_168(x) x, MITK_PP_SEQ_ENUM_167 +# define MITK_PP_SEQ_ENUM_169(x) x, MITK_PP_SEQ_ENUM_168 +# define MITK_PP_SEQ_ENUM_170(x) x, MITK_PP_SEQ_ENUM_169 +# define MITK_PP_SEQ_ENUM_171(x) x, MITK_PP_SEQ_ENUM_170 +# define MITK_PP_SEQ_ENUM_172(x) x, MITK_PP_SEQ_ENUM_171 +# define MITK_PP_SEQ_ENUM_173(x) x, MITK_PP_SEQ_ENUM_172 +# define MITK_PP_SEQ_ENUM_174(x) x, MITK_PP_SEQ_ENUM_173 +# define MITK_PP_SEQ_ENUM_175(x) x, MITK_PP_SEQ_ENUM_174 +# define MITK_PP_SEQ_ENUM_176(x) x, MITK_PP_SEQ_ENUM_175 +# define MITK_PP_SEQ_ENUM_177(x) x, MITK_PP_SEQ_ENUM_176 +# define MITK_PP_SEQ_ENUM_178(x) x, MITK_PP_SEQ_ENUM_177 +# define MITK_PP_SEQ_ENUM_179(x) x, MITK_PP_SEQ_ENUM_178 +# define MITK_PP_SEQ_ENUM_180(x) x, MITK_PP_SEQ_ENUM_179 +# define MITK_PP_SEQ_ENUM_181(x) x, MITK_PP_SEQ_ENUM_180 +# define MITK_PP_SEQ_ENUM_182(x) x, MITK_PP_SEQ_ENUM_181 +# define MITK_PP_SEQ_ENUM_183(x) x, MITK_PP_SEQ_ENUM_182 +# define MITK_PP_SEQ_ENUM_184(x) x, MITK_PP_SEQ_ENUM_183 +# define MITK_PP_SEQ_ENUM_185(x) x, MITK_PP_SEQ_ENUM_184 +# define MITK_PP_SEQ_ENUM_186(x) x, MITK_PP_SEQ_ENUM_185 +# define MITK_PP_SEQ_ENUM_187(x) x, MITK_PP_SEQ_ENUM_186 +# define MITK_PP_SEQ_ENUM_188(x) x, MITK_PP_SEQ_ENUM_187 +# define MITK_PP_SEQ_ENUM_189(x) x, MITK_PP_SEQ_ENUM_188 +# define MITK_PP_SEQ_ENUM_190(x) x, MITK_PP_SEQ_ENUM_189 +# define MITK_PP_SEQ_ENUM_191(x) x, MITK_PP_SEQ_ENUM_190 +# define MITK_PP_SEQ_ENUM_192(x) x, MITK_PP_SEQ_ENUM_191 +# define MITK_PP_SEQ_ENUM_193(x) x, MITK_PP_SEQ_ENUM_192 +# define MITK_PP_SEQ_ENUM_194(x) x, MITK_PP_SEQ_ENUM_193 +# define MITK_PP_SEQ_ENUM_195(x) x, MITK_PP_SEQ_ENUM_194 +# define MITK_PP_SEQ_ENUM_196(x) x, MITK_PP_SEQ_ENUM_195 +# define MITK_PP_SEQ_ENUM_197(x) x, MITK_PP_SEQ_ENUM_196 +# define MITK_PP_SEQ_ENUM_198(x) x, MITK_PP_SEQ_ENUM_197 +# define MITK_PP_SEQ_ENUM_199(x) x, MITK_PP_SEQ_ENUM_198 +# define MITK_PP_SEQ_ENUM_200(x) x, MITK_PP_SEQ_ENUM_199 +# define MITK_PP_SEQ_ENUM_201(x) x, MITK_PP_SEQ_ENUM_200 +# define MITK_PP_SEQ_ENUM_202(x) x, MITK_PP_SEQ_ENUM_201 +# define MITK_PP_SEQ_ENUM_203(x) x, MITK_PP_SEQ_ENUM_202 +# define MITK_PP_SEQ_ENUM_204(x) x, MITK_PP_SEQ_ENUM_203 +# define MITK_PP_SEQ_ENUM_205(x) x, MITK_PP_SEQ_ENUM_204 +# define MITK_PP_SEQ_ENUM_206(x) x, MITK_PP_SEQ_ENUM_205 +# define MITK_PP_SEQ_ENUM_207(x) x, MITK_PP_SEQ_ENUM_206 +# define MITK_PP_SEQ_ENUM_208(x) x, MITK_PP_SEQ_ENUM_207 +# define MITK_PP_SEQ_ENUM_209(x) x, MITK_PP_SEQ_ENUM_208 +# define MITK_PP_SEQ_ENUM_210(x) x, MITK_PP_SEQ_ENUM_209 +# define MITK_PP_SEQ_ENUM_211(x) x, MITK_PP_SEQ_ENUM_210 +# define MITK_PP_SEQ_ENUM_212(x) x, MITK_PP_SEQ_ENUM_211 +# define MITK_PP_SEQ_ENUM_213(x) x, MITK_PP_SEQ_ENUM_212 +# define MITK_PP_SEQ_ENUM_214(x) x, MITK_PP_SEQ_ENUM_213 +# define MITK_PP_SEQ_ENUM_215(x) x, MITK_PP_SEQ_ENUM_214 +# define MITK_PP_SEQ_ENUM_216(x) x, MITK_PP_SEQ_ENUM_215 +# define MITK_PP_SEQ_ENUM_217(x) x, MITK_PP_SEQ_ENUM_216 +# define MITK_PP_SEQ_ENUM_218(x) x, MITK_PP_SEQ_ENUM_217 +# define MITK_PP_SEQ_ENUM_219(x) x, MITK_PP_SEQ_ENUM_218 +# define MITK_PP_SEQ_ENUM_220(x) x, MITK_PP_SEQ_ENUM_219 +# define MITK_PP_SEQ_ENUM_221(x) x, MITK_PP_SEQ_ENUM_220 +# define MITK_PP_SEQ_ENUM_222(x) x, MITK_PP_SEQ_ENUM_221 +# define MITK_PP_SEQ_ENUM_223(x) x, MITK_PP_SEQ_ENUM_222 +# define MITK_PP_SEQ_ENUM_224(x) x, MITK_PP_SEQ_ENUM_223 +# define MITK_PP_SEQ_ENUM_225(x) x, MITK_PP_SEQ_ENUM_224 +# define MITK_PP_SEQ_ENUM_226(x) x, MITK_PP_SEQ_ENUM_225 +# define MITK_PP_SEQ_ENUM_227(x) x, MITK_PP_SEQ_ENUM_226 +# define MITK_PP_SEQ_ENUM_228(x) x, MITK_PP_SEQ_ENUM_227 +# define MITK_PP_SEQ_ENUM_229(x) x, MITK_PP_SEQ_ENUM_228 +# define MITK_PP_SEQ_ENUM_230(x) x, MITK_PP_SEQ_ENUM_229 +# define MITK_PP_SEQ_ENUM_231(x) x, MITK_PP_SEQ_ENUM_230 +# define MITK_PP_SEQ_ENUM_232(x) x, MITK_PP_SEQ_ENUM_231 +# define MITK_PP_SEQ_ENUM_233(x) x, MITK_PP_SEQ_ENUM_232 +# define MITK_PP_SEQ_ENUM_234(x) x, MITK_PP_SEQ_ENUM_233 +# define MITK_PP_SEQ_ENUM_235(x) x, MITK_PP_SEQ_ENUM_234 +# define MITK_PP_SEQ_ENUM_236(x) x, MITK_PP_SEQ_ENUM_235 +# define MITK_PP_SEQ_ENUM_237(x) x, MITK_PP_SEQ_ENUM_236 +# define MITK_PP_SEQ_ENUM_238(x) x, MITK_PP_SEQ_ENUM_237 +# define MITK_PP_SEQ_ENUM_239(x) x, MITK_PP_SEQ_ENUM_238 +# define MITK_PP_SEQ_ENUM_240(x) x, MITK_PP_SEQ_ENUM_239 +# define MITK_PP_SEQ_ENUM_241(x) x, MITK_PP_SEQ_ENUM_240 +# define MITK_PP_SEQ_ENUM_242(x) x, MITK_PP_SEQ_ENUM_241 +# define MITK_PP_SEQ_ENUM_243(x) x, MITK_PP_SEQ_ENUM_242 +# define MITK_PP_SEQ_ENUM_244(x) x, MITK_PP_SEQ_ENUM_243 +# define MITK_PP_SEQ_ENUM_245(x) x, MITK_PP_SEQ_ENUM_244 +# define MITK_PP_SEQ_ENUM_246(x) x, MITK_PP_SEQ_ENUM_245 +# define MITK_PP_SEQ_ENUM_247(x) x, MITK_PP_SEQ_ENUM_246 +# define MITK_PP_SEQ_ENUM_248(x) x, MITK_PP_SEQ_ENUM_247 +# define MITK_PP_SEQ_ENUM_249(x) x, MITK_PP_SEQ_ENUM_248 +# define MITK_PP_SEQ_ENUM_250(x) x, MITK_PP_SEQ_ENUM_249 +# define MITK_PP_SEQ_ENUM_251(x) x, MITK_PP_SEQ_ENUM_250 +# define MITK_PP_SEQ_ENUM_252(x) x, MITK_PP_SEQ_ENUM_251 +# define MITK_PP_SEQ_ENUM_253(x) x, MITK_PP_SEQ_ENUM_252 +# define MITK_PP_SEQ_ENUM_254(x) x, MITK_PP_SEQ_ENUM_253 +# define MITK_PP_SEQ_ENUM_255(x) x, MITK_PP_SEQ_ENUM_254 +# define MITK_PP_SEQ_ENUM_256(x) x, MITK_PP_SEQ_ENUM_255 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqForEach.h b/Core/Code/Algorithms/mitkPPSeqForEach.h new file mode 100644 index 0000000000..21b9b19aae --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqForEach.h @@ -0,0 +1,60 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_FOR_EACH_HPP +# define MITK_PREPROCESSOR_SEQ_FOR_EACH_HPP +# +# include "mitkPPArithmeticDec.h" +# include "mitkPPConfig.h" +# include "mitkPPRepetitionFor.h" +# include "mitkPPSeq.h" +# include "mitkPPSeqSize.h" +# include "mitkPPTupleElem.h" +# include "mitkPPTupleRem.h" +# +# /* MITK_PP_SEQ_FOR_EACH */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_FOR_EACH(macro, data, seq) MITK_PP_FOR((macro, data, seq (nil)), MITK_PP_SEQ_FOR_EACH_P, MITK_PP_SEQ_FOR_EACH_O, MITK_PP_SEQ_FOR_EACH_M) +# else +# define MITK_PP_SEQ_FOR_EACH(macro, data, seq) MITK_PP_SEQ_FOR_EACH_D(macro, data, seq) +# define MITK_PP_SEQ_FOR_EACH_D(macro, data, seq) MITK_PP_FOR((macro, data, seq (nil)), MITK_PP_SEQ_FOR_EACH_P, MITK_PP_SEQ_FOR_EACH_O, MITK_PP_SEQ_FOR_EACH_M) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_P(r, x) MITK_PP_DEC(MITK_PP_SEQ_SIZE(MITK_PP_TUPLE_ELEM(3, 2, x))) +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_STRICT() +# define MITK_PP_SEQ_FOR_EACH_O(r, x) MITK_PP_SEQ_FOR_EACH_O_I x +# else +# define MITK_PP_SEQ_FOR_EACH_O(r, x) MITK_PP_SEQ_FOR_EACH_O_I(MITK_PP_TUPLE_ELEM(3, 0, x), MITK_PP_TUPLE_ELEM(3, 1, x), MITK_PP_TUPLE_ELEM(3, 2, x)) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, MITK_PP_SEQ_TAIL(seq)) +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_STRICT() +# define MITK_PP_SEQ_FOR_EACH_M(r, x) MITK_PP_SEQ_FOR_EACH_M_IM(r, MITK_PP_TUPLE_REM_3 x) +# define MITK_PP_SEQ_FOR_EACH_M_IM(r, im) MITK_PP_SEQ_FOR_EACH_M_I(r, im) +# else +# define MITK_PP_SEQ_FOR_EACH_M(r, x) MITK_PP_SEQ_FOR_EACH_M_I(r, MITK_PP_TUPLE_ELEM(3, 0, x), MITK_PP_TUPLE_ELEM(3, 1, x), MITK_PP_TUPLE_ELEM(3, 2, x)) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, MITK_PP_SEQ_HEAD(seq)) +# +# /* MITK_PP_SEQ_FOR_EACH_R */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_FOR_EACH_R(r, macro, data, seq) MITK_PP_FOR_ ## r((macro, data, seq (nil)), MITK_PP_SEQ_FOR_EACH_P, MITK_PP_SEQ_FOR_EACH_O, MITK_PP_SEQ_FOR_EACH_M) +# else +# define MITK_PP_SEQ_FOR_EACH_R(r, macro, data, seq) MITK_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) +# define MITK_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) MITK_PP_FOR_ ## r((macro, data, seq (nil)), MITK_PP_SEQ_FOR_EACH_P, MITK_PP_SEQ_FOR_EACH_O, MITK_PP_SEQ_FOR_EACH_M) +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqForEachProduct.h b/Core/Code/Algorithms/mitkPPSeqForEachProduct.h new file mode 100644 index 0000000000..29eebaca94 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqForEachProduct.h @@ -0,0 +1,126 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_FOR_EACH_PRODUCT_HPP +# define MITK_PREPROCESSOR_SEQ_FOR_EACH_PRODUCT_HPP +# +# include "mitkPPArithmeticDec.h" +# include "mitkPPConfig.h" +# include "mitkPPControlIf.h" +# include "mitkPPRepetitionFor.h" +# include "mitkPPSeq.h" +# include "mitkPPSeqSize.h" +# include "mitkPPTupleElem.h" +# include "mitkPPTupleRem.h" +# +# /* MITK_PP_SEQ_FOR_EACH_PRODUCT */ +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT(macro, sets) MITK_PP_SEQ_FOR_EACH_PRODUCT_E(MITK_PP_FOR, macro, sets) +# +# /* MITK_PP_SEQ_FOR_EACH_PRODUCT_R */ +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_R(r, macro, sets) MITK_PP_SEQ_FOR_EACH_PRODUCT_E(MITK_PP_FOR_ ## r, macro, sets) +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_E(impl, macro, sets) impl((MITK_PP_SEQ_HEAD(sets)(nil), MITK_PP_SEQ_TAIL(sets)(nil), (nil), macro), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_0) +# else +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_E(impl, macro, sets) MITK_PP_SEQ_FOR_EACH_PRODUCT_E_I(impl, macro, sets) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_E_I(impl, macro, sets) impl((MITK_PP_SEQ_HEAD(sets)(nil), MITK_PP_SEQ_TAIL(sets)(nil), (nil), macro), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_0) +# endif +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_STRICT() +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_P(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_P_I data +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_P_I(cset, rset, res, macro) MITK_PP_DEC(MITK_PP_SEQ_SIZE(cset)) +# else +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_P(r, data) MITK_PP_DEC(MITK_PP_SEQ_SIZE(MITK_PP_TUPLE_ELEM(4, 0, data))) +# endif +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_O(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_O_I data +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_O_I(cset, rset, res, macro) (MITK_PP_SEQ_TAIL(cset), rset, res, macro) +# else +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_O(r, data) (MITK_PP_SEQ_TAIL(MITK_PP_TUPLE_ELEM(4, 0, data)), MITK_PP_TUPLE_ELEM(4, 1, data), MITK_PP_TUPLE_ELEM(4, 2, data), MITK_PP_TUPLE_ELEM(4, 3, data)) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, i) MITK_PP_IF(MITK_PP_DEC(MITK_PP_SEQ_SIZE(MITK_PP_TUPLE_ELEM(4, 1, data))), MITK_PP_SEQ_FOR_EACH_PRODUCT_N_ ## i, MITK_PP_SEQ_FOR_EACH_PRODUCT_I) +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_I(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, MITK_PP_TUPLE_ELEM(4, 0, data), MITK_PP_TUPLE_ELEM(4, 1, data), MITK_PP_TUPLE_ELEM(4, 2, data), MITK_PP_TUPLE_ELEM(4, 3, data)) +# else +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_I(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_I_IM(r, MITK_PP_TUPLE_REM_4 data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_I_IM(r, im) MITK_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, im) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, cset, rset, res, macro) macro(r, MITK_PP_SEQ_TAIL(res (MITK_PP_SEQ_HEAD(cset)))) +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data) MITK_PP_SEQ_FOR_EACH_PRODUCT_H_I data +# else +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data) MITK_PP_SEQ_FOR_EACH_PRODUCT_H_I(MITK_PP_TUPLE_ELEM(4, 0, data), MITK_PP_TUPLE_ELEM(4, 1, data), MITK_PP_TUPLE_ELEM(4, 2, data), MITK_PP_TUPLE_ELEM(4, 3, data)) +# endif +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_H_I(cset, rset, res, macro) (MITK_PP_SEQ_HEAD(rset)(nil), MITK_PP_SEQ_TAIL(rset), res (MITK_PP_SEQ_HEAD(cset)), macro) +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_0(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 0)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_1(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 1)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_2(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 2)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_3(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 3)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_4(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 4)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_5(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 5)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_6(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 6)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_7(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 7)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_8(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 8)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_9(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 9)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_10(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 10)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_11(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 11)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_12(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 12)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_13(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 13)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_14(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 14)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_15(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 15)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_16(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 16)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_17(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 17)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_18(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 18)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_19(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 19)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_20(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 20)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_21(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 21)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_22(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 22)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_23(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 23)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_24(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 24)(r, data) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_M_25(r, data) MITK_PP_SEQ_FOR_EACH_PRODUCT_C(data, 25)(r, data) +# +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_0(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_1) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_1(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_2) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_2(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_3) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_3(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_4) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_4(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_5) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_5(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_6) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_6(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_7) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_7(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_8) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_8(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_9) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_9(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_10) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_10(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_11) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_11(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_12) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_12(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_13) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_13(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_14) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_14(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_15) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_15(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_16) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_16(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_17) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_17(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_18) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_18(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_19) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_19(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_20) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_20(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_21) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_21(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_22) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_22(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_23) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_23(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_24) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_24(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_25) +# define MITK_PP_SEQ_FOR_EACH_PRODUCT_N_25(r, data) MITK_PP_FOR_ ## r(MITK_PP_SEQ_FOR_EACH_PRODUCT_H(data), MITK_PP_SEQ_FOR_EACH_PRODUCT_P, MITK_PP_SEQ_FOR_EACH_PRODUCT_O, MITK_PP_SEQ_FOR_EACH_PRODUCT_M_26) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqSize.h b/Core/Code/Algorithms/mitkPPSeqSize.h new file mode 100644 index 0000000000..1941d5b57f --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqSize.h @@ -0,0 +1,548 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_SIZE_HPP +# define MITK_PREPROCESSOR_SEQ_SIZE_HPP +# +# include "mitkPPCat.h" +# include "mitkPPConfig.h" +# include "mitkPPTupleEat.h" +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_SEQ_SIZE(seq) MITK_PP_SEQ_SIZE_I((seq)) +# define MITK_PP_SEQ_SIZE_I(par) MITK_PP_SEQ_SIZE_II ## par +# define MITK_PP_SEQ_SIZE_II(seq) MITK_PP_CAT(MITK_PP_SEQ_SIZE_, MITK_PP_SEQ_SIZE_0 ## seq) +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() || MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_SEQ_SIZE(seq) MITK_PP_SEQ_SIZE_I(seq) +# define MITK_PP_SEQ_SIZE_I(seq) MITK_PP_CAT(MITK_PP_SEQ_SIZE_, MITK_PP_SEQ_SIZE_0 seq) +# elif defined(__IBMC__) || defined(__IBMCPP__) +# define MITK_PP_SEQ_SIZE(seq) MITK_PP_CAT(MITK_PP_SEQ_SIZE_, MITK_PP_CAT(MITK_PP_SEQ_SIZE_0, seq)) +# else +# define MITK_PP_SEQ_SIZE(seq) MITK_PP_CAT(MITK_PP_SEQ_SIZE_, MITK_PP_SEQ_SIZE_0 seq) +# endif +# +# define MITK_PP_SEQ_SIZE_0(_) MITK_PP_SEQ_SIZE_1 +# define MITK_PP_SEQ_SIZE_1(_) MITK_PP_SEQ_SIZE_2 +# define MITK_PP_SEQ_SIZE_2(_) MITK_PP_SEQ_SIZE_3 +# define MITK_PP_SEQ_SIZE_3(_) MITK_PP_SEQ_SIZE_4 +# define MITK_PP_SEQ_SIZE_4(_) MITK_PP_SEQ_SIZE_5 +# define MITK_PP_SEQ_SIZE_5(_) MITK_PP_SEQ_SIZE_6 +# define MITK_PP_SEQ_SIZE_6(_) MITK_PP_SEQ_SIZE_7 +# define MITK_PP_SEQ_SIZE_7(_) MITK_PP_SEQ_SIZE_8 +# define MITK_PP_SEQ_SIZE_8(_) MITK_PP_SEQ_SIZE_9 +# define MITK_PP_SEQ_SIZE_9(_) MITK_PP_SEQ_SIZE_10 +# define MITK_PP_SEQ_SIZE_10(_) MITK_PP_SEQ_SIZE_11 +# define MITK_PP_SEQ_SIZE_11(_) MITK_PP_SEQ_SIZE_12 +# define MITK_PP_SEQ_SIZE_12(_) MITK_PP_SEQ_SIZE_13 +# define MITK_PP_SEQ_SIZE_13(_) MITK_PP_SEQ_SIZE_14 +# define MITK_PP_SEQ_SIZE_14(_) MITK_PP_SEQ_SIZE_15 +# define MITK_PP_SEQ_SIZE_15(_) MITK_PP_SEQ_SIZE_16 +# define MITK_PP_SEQ_SIZE_16(_) MITK_PP_SEQ_SIZE_17 +# define MITK_PP_SEQ_SIZE_17(_) MITK_PP_SEQ_SIZE_18 +# define MITK_PP_SEQ_SIZE_18(_) MITK_PP_SEQ_SIZE_19 +# define MITK_PP_SEQ_SIZE_19(_) MITK_PP_SEQ_SIZE_20 +# define MITK_PP_SEQ_SIZE_20(_) MITK_PP_SEQ_SIZE_21 +# define MITK_PP_SEQ_SIZE_21(_) MITK_PP_SEQ_SIZE_22 +# define MITK_PP_SEQ_SIZE_22(_) MITK_PP_SEQ_SIZE_23 +# define MITK_PP_SEQ_SIZE_23(_) MITK_PP_SEQ_SIZE_24 +# define MITK_PP_SEQ_SIZE_24(_) MITK_PP_SEQ_SIZE_25 +# define MITK_PP_SEQ_SIZE_25(_) MITK_PP_SEQ_SIZE_26 +# define MITK_PP_SEQ_SIZE_26(_) MITK_PP_SEQ_SIZE_27 +# define MITK_PP_SEQ_SIZE_27(_) MITK_PP_SEQ_SIZE_28 +# define MITK_PP_SEQ_SIZE_28(_) MITK_PP_SEQ_SIZE_29 +# define MITK_PP_SEQ_SIZE_29(_) MITK_PP_SEQ_SIZE_30 +# define MITK_PP_SEQ_SIZE_30(_) MITK_PP_SEQ_SIZE_31 +# define MITK_PP_SEQ_SIZE_31(_) MITK_PP_SEQ_SIZE_32 +# define MITK_PP_SEQ_SIZE_32(_) MITK_PP_SEQ_SIZE_33 +# define MITK_PP_SEQ_SIZE_33(_) MITK_PP_SEQ_SIZE_34 +# define MITK_PP_SEQ_SIZE_34(_) MITK_PP_SEQ_SIZE_35 +# define MITK_PP_SEQ_SIZE_35(_) MITK_PP_SEQ_SIZE_36 +# define MITK_PP_SEQ_SIZE_36(_) MITK_PP_SEQ_SIZE_37 +# define MITK_PP_SEQ_SIZE_37(_) MITK_PP_SEQ_SIZE_38 +# define MITK_PP_SEQ_SIZE_38(_) MITK_PP_SEQ_SIZE_39 +# define MITK_PP_SEQ_SIZE_39(_) MITK_PP_SEQ_SIZE_40 +# define MITK_PP_SEQ_SIZE_40(_) MITK_PP_SEQ_SIZE_41 +# define MITK_PP_SEQ_SIZE_41(_) MITK_PP_SEQ_SIZE_42 +# define MITK_PP_SEQ_SIZE_42(_) MITK_PP_SEQ_SIZE_43 +# define MITK_PP_SEQ_SIZE_43(_) MITK_PP_SEQ_SIZE_44 +# define MITK_PP_SEQ_SIZE_44(_) MITK_PP_SEQ_SIZE_45 +# define MITK_PP_SEQ_SIZE_45(_) MITK_PP_SEQ_SIZE_46 +# define MITK_PP_SEQ_SIZE_46(_) MITK_PP_SEQ_SIZE_47 +# define MITK_PP_SEQ_SIZE_47(_) MITK_PP_SEQ_SIZE_48 +# define MITK_PP_SEQ_SIZE_48(_) MITK_PP_SEQ_SIZE_49 +# define MITK_PP_SEQ_SIZE_49(_) MITK_PP_SEQ_SIZE_50 +# define MITK_PP_SEQ_SIZE_50(_) MITK_PP_SEQ_SIZE_51 +# define MITK_PP_SEQ_SIZE_51(_) MITK_PP_SEQ_SIZE_52 +# define MITK_PP_SEQ_SIZE_52(_) MITK_PP_SEQ_SIZE_53 +# define MITK_PP_SEQ_SIZE_53(_) MITK_PP_SEQ_SIZE_54 +# define MITK_PP_SEQ_SIZE_54(_) MITK_PP_SEQ_SIZE_55 +# define MITK_PP_SEQ_SIZE_55(_) MITK_PP_SEQ_SIZE_56 +# define MITK_PP_SEQ_SIZE_56(_) MITK_PP_SEQ_SIZE_57 +# define MITK_PP_SEQ_SIZE_57(_) MITK_PP_SEQ_SIZE_58 +# define MITK_PP_SEQ_SIZE_58(_) MITK_PP_SEQ_SIZE_59 +# define MITK_PP_SEQ_SIZE_59(_) MITK_PP_SEQ_SIZE_60 +# define MITK_PP_SEQ_SIZE_60(_) MITK_PP_SEQ_SIZE_61 +# define MITK_PP_SEQ_SIZE_61(_) MITK_PP_SEQ_SIZE_62 +# define MITK_PP_SEQ_SIZE_62(_) MITK_PP_SEQ_SIZE_63 +# define MITK_PP_SEQ_SIZE_63(_) MITK_PP_SEQ_SIZE_64 +# define MITK_PP_SEQ_SIZE_64(_) MITK_PP_SEQ_SIZE_65 +# define MITK_PP_SEQ_SIZE_65(_) MITK_PP_SEQ_SIZE_66 +# define MITK_PP_SEQ_SIZE_66(_) MITK_PP_SEQ_SIZE_67 +# define MITK_PP_SEQ_SIZE_67(_) MITK_PP_SEQ_SIZE_68 +# define MITK_PP_SEQ_SIZE_68(_) MITK_PP_SEQ_SIZE_69 +# define MITK_PP_SEQ_SIZE_69(_) MITK_PP_SEQ_SIZE_70 +# define MITK_PP_SEQ_SIZE_70(_) MITK_PP_SEQ_SIZE_71 +# define MITK_PP_SEQ_SIZE_71(_) MITK_PP_SEQ_SIZE_72 +# define MITK_PP_SEQ_SIZE_72(_) MITK_PP_SEQ_SIZE_73 +# define MITK_PP_SEQ_SIZE_73(_) MITK_PP_SEQ_SIZE_74 +# define MITK_PP_SEQ_SIZE_74(_) MITK_PP_SEQ_SIZE_75 +# define MITK_PP_SEQ_SIZE_75(_) MITK_PP_SEQ_SIZE_76 +# define MITK_PP_SEQ_SIZE_76(_) MITK_PP_SEQ_SIZE_77 +# define MITK_PP_SEQ_SIZE_77(_) MITK_PP_SEQ_SIZE_78 +# define MITK_PP_SEQ_SIZE_78(_) MITK_PP_SEQ_SIZE_79 +# define MITK_PP_SEQ_SIZE_79(_) MITK_PP_SEQ_SIZE_80 +# define MITK_PP_SEQ_SIZE_80(_) MITK_PP_SEQ_SIZE_81 +# define MITK_PP_SEQ_SIZE_81(_) MITK_PP_SEQ_SIZE_82 +# define MITK_PP_SEQ_SIZE_82(_) MITK_PP_SEQ_SIZE_83 +# define MITK_PP_SEQ_SIZE_83(_) MITK_PP_SEQ_SIZE_84 +# define MITK_PP_SEQ_SIZE_84(_) MITK_PP_SEQ_SIZE_85 +# define MITK_PP_SEQ_SIZE_85(_) MITK_PP_SEQ_SIZE_86 +# define MITK_PP_SEQ_SIZE_86(_) MITK_PP_SEQ_SIZE_87 +# define MITK_PP_SEQ_SIZE_87(_) MITK_PP_SEQ_SIZE_88 +# define MITK_PP_SEQ_SIZE_88(_) MITK_PP_SEQ_SIZE_89 +# define MITK_PP_SEQ_SIZE_89(_) MITK_PP_SEQ_SIZE_90 +# define MITK_PP_SEQ_SIZE_90(_) MITK_PP_SEQ_SIZE_91 +# define MITK_PP_SEQ_SIZE_91(_) MITK_PP_SEQ_SIZE_92 +# define MITK_PP_SEQ_SIZE_92(_) MITK_PP_SEQ_SIZE_93 +# define MITK_PP_SEQ_SIZE_93(_) MITK_PP_SEQ_SIZE_94 +# define MITK_PP_SEQ_SIZE_94(_) MITK_PP_SEQ_SIZE_95 +# define MITK_PP_SEQ_SIZE_95(_) MITK_PP_SEQ_SIZE_96 +# define MITK_PP_SEQ_SIZE_96(_) MITK_PP_SEQ_SIZE_97 +# define MITK_PP_SEQ_SIZE_97(_) MITK_PP_SEQ_SIZE_98 +# define MITK_PP_SEQ_SIZE_98(_) MITK_PP_SEQ_SIZE_99 +# define MITK_PP_SEQ_SIZE_99(_) MITK_PP_SEQ_SIZE_100 +# define MITK_PP_SEQ_SIZE_100(_) MITK_PP_SEQ_SIZE_101 +# define MITK_PP_SEQ_SIZE_101(_) MITK_PP_SEQ_SIZE_102 +# define MITK_PP_SEQ_SIZE_102(_) MITK_PP_SEQ_SIZE_103 +# define MITK_PP_SEQ_SIZE_103(_) MITK_PP_SEQ_SIZE_104 +# define MITK_PP_SEQ_SIZE_104(_) MITK_PP_SEQ_SIZE_105 +# define MITK_PP_SEQ_SIZE_105(_) MITK_PP_SEQ_SIZE_106 +# define MITK_PP_SEQ_SIZE_106(_) MITK_PP_SEQ_SIZE_107 +# define MITK_PP_SEQ_SIZE_107(_) MITK_PP_SEQ_SIZE_108 +# define MITK_PP_SEQ_SIZE_108(_) MITK_PP_SEQ_SIZE_109 +# define MITK_PP_SEQ_SIZE_109(_) MITK_PP_SEQ_SIZE_110 +# define MITK_PP_SEQ_SIZE_110(_) MITK_PP_SEQ_SIZE_111 +# define MITK_PP_SEQ_SIZE_111(_) MITK_PP_SEQ_SIZE_112 +# define MITK_PP_SEQ_SIZE_112(_) MITK_PP_SEQ_SIZE_113 +# define MITK_PP_SEQ_SIZE_113(_) MITK_PP_SEQ_SIZE_114 +# define MITK_PP_SEQ_SIZE_114(_) MITK_PP_SEQ_SIZE_115 +# define MITK_PP_SEQ_SIZE_115(_) MITK_PP_SEQ_SIZE_116 +# define MITK_PP_SEQ_SIZE_116(_) MITK_PP_SEQ_SIZE_117 +# define MITK_PP_SEQ_SIZE_117(_) MITK_PP_SEQ_SIZE_118 +# define MITK_PP_SEQ_SIZE_118(_) MITK_PP_SEQ_SIZE_119 +# define MITK_PP_SEQ_SIZE_119(_) MITK_PP_SEQ_SIZE_120 +# define MITK_PP_SEQ_SIZE_120(_) MITK_PP_SEQ_SIZE_121 +# define MITK_PP_SEQ_SIZE_121(_) MITK_PP_SEQ_SIZE_122 +# define MITK_PP_SEQ_SIZE_122(_) MITK_PP_SEQ_SIZE_123 +# define MITK_PP_SEQ_SIZE_123(_) MITK_PP_SEQ_SIZE_124 +# define MITK_PP_SEQ_SIZE_124(_) MITK_PP_SEQ_SIZE_125 +# define MITK_PP_SEQ_SIZE_125(_) MITK_PP_SEQ_SIZE_126 +# define MITK_PP_SEQ_SIZE_126(_) MITK_PP_SEQ_SIZE_127 +# define MITK_PP_SEQ_SIZE_127(_) MITK_PP_SEQ_SIZE_128 +# define MITK_PP_SEQ_SIZE_128(_) MITK_PP_SEQ_SIZE_129 +# define MITK_PP_SEQ_SIZE_129(_) MITK_PP_SEQ_SIZE_130 +# define MITK_PP_SEQ_SIZE_130(_) MITK_PP_SEQ_SIZE_131 +# define MITK_PP_SEQ_SIZE_131(_) MITK_PP_SEQ_SIZE_132 +# define MITK_PP_SEQ_SIZE_132(_) MITK_PP_SEQ_SIZE_133 +# define MITK_PP_SEQ_SIZE_133(_) MITK_PP_SEQ_SIZE_134 +# define MITK_PP_SEQ_SIZE_134(_) MITK_PP_SEQ_SIZE_135 +# define MITK_PP_SEQ_SIZE_135(_) MITK_PP_SEQ_SIZE_136 +# define MITK_PP_SEQ_SIZE_136(_) MITK_PP_SEQ_SIZE_137 +# define MITK_PP_SEQ_SIZE_137(_) MITK_PP_SEQ_SIZE_138 +# define MITK_PP_SEQ_SIZE_138(_) MITK_PP_SEQ_SIZE_139 +# define MITK_PP_SEQ_SIZE_139(_) MITK_PP_SEQ_SIZE_140 +# define MITK_PP_SEQ_SIZE_140(_) MITK_PP_SEQ_SIZE_141 +# define MITK_PP_SEQ_SIZE_141(_) MITK_PP_SEQ_SIZE_142 +# define MITK_PP_SEQ_SIZE_142(_) MITK_PP_SEQ_SIZE_143 +# define MITK_PP_SEQ_SIZE_143(_) MITK_PP_SEQ_SIZE_144 +# define MITK_PP_SEQ_SIZE_144(_) MITK_PP_SEQ_SIZE_145 +# define MITK_PP_SEQ_SIZE_145(_) MITK_PP_SEQ_SIZE_146 +# define MITK_PP_SEQ_SIZE_146(_) MITK_PP_SEQ_SIZE_147 +# define MITK_PP_SEQ_SIZE_147(_) MITK_PP_SEQ_SIZE_148 +# define MITK_PP_SEQ_SIZE_148(_) MITK_PP_SEQ_SIZE_149 +# define MITK_PP_SEQ_SIZE_149(_) MITK_PP_SEQ_SIZE_150 +# define MITK_PP_SEQ_SIZE_150(_) MITK_PP_SEQ_SIZE_151 +# define MITK_PP_SEQ_SIZE_151(_) MITK_PP_SEQ_SIZE_152 +# define MITK_PP_SEQ_SIZE_152(_) MITK_PP_SEQ_SIZE_153 +# define MITK_PP_SEQ_SIZE_153(_) MITK_PP_SEQ_SIZE_154 +# define MITK_PP_SEQ_SIZE_154(_) MITK_PP_SEQ_SIZE_155 +# define MITK_PP_SEQ_SIZE_155(_) MITK_PP_SEQ_SIZE_156 +# define MITK_PP_SEQ_SIZE_156(_) MITK_PP_SEQ_SIZE_157 +# define MITK_PP_SEQ_SIZE_157(_) MITK_PP_SEQ_SIZE_158 +# define MITK_PP_SEQ_SIZE_158(_) MITK_PP_SEQ_SIZE_159 +# define MITK_PP_SEQ_SIZE_159(_) MITK_PP_SEQ_SIZE_160 +# define MITK_PP_SEQ_SIZE_160(_) MITK_PP_SEQ_SIZE_161 +# define MITK_PP_SEQ_SIZE_161(_) MITK_PP_SEQ_SIZE_162 +# define MITK_PP_SEQ_SIZE_162(_) MITK_PP_SEQ_SIZE_163 +# define MITK_PP_SEQ_SIZE_163(_) MITK_PP_SEQ_SIZE_164 +# define MITK_PP_SEQ_SIZE_164(_) MITK_PP_SEQ_SIZE_165 +# define MITK_PP_SEQ_SIZE_165(_) MITK_PP_SEQ_SIZE_166 +# define MITK_PP_SEQ_SIZE_166(_) MITK_PP_SEQ_SIZE_167 +# define MITK_PP_SEQ_SIZE_167(_) MITK_PP_SEQ_SIZE_168 +# define MITK_PP_SEQ_SIZE_168(_) MITK_PP_SEQ_SIZE_169 +# define MITK_PP_SEQ_SIZE_169(_) MITK_PP_SEQ_SIZE_170 +# define MITK_PP_SEQ_SIZE_170(_) MITK_PP_SEQ_SIZE_171 +# define MITK_PP_SEQ_SIZE_171(_) MITK_PP_SEQ_SIZE_172 +# define MITK_PP_SEQ_SIZE_172(_) MITK_PP_SEQ_SIZE_173 +# define MITK_PP_SEQ_SIZE_173(_) MITK_PP_SEQ_SIZE_174 +# define MITK_PP_SEQ_SIZE_174(_) MITK_PP_SEQ_SIZE_175 +# define MITK_PP_SEQ_SIZE_175(_) MITK_PP_SEQ_SIZE_176 +# define MITK_PP_SEQ_SIZE_176(_) MITK_PP_SEQ_SIZE_177 +# define MITK_PP_SEQ_SIZE_177(_) MITK_PP_SEQ_SIZE_178 +# define MITK_PP_SEQ_SIZE_178(_) MITK_PP_SEQ_SIZE_179 +# define MITK_PP_SEQ_SIZE_179(_) MITK_PP_SEQ_SIZE_180 +# define MITK_PP_SEQ_SIZE_180(_) MITK_PP_SEQ_SIZE_181 +# define MITK_PP_SEQ_SIZE_181(_) MITK_PP_SEQ_SIZE_182 +# define MITK_PP_SEQ_SIZE_182(_) MITK_PP_SEQ_SIZE_183 +# define MITK_PP_SEQ_SIZE_183(_) MITK_PP_SEQ_SIZE_184 +# define MITK_PP_SEQ_SIZE_184(_) MITK_PP_SEQ_SIZE_185 +# define MITK_PP_SEQ_SIZE_185(_) MITK_PP_SEQ_SIZE_186 +# define MITK_PP_SEQ_SIZE_186(_) MITK_PP_SEQ_SIZE_187 +# define MITK_PP_SEQ_SIZE_187(_) MITK_PP_SEQ_SIZE_188 +# define MITK_PP_SEQ_SIZE_188(_) MITK_PP_SEQ_SIZE_189 +# define MITK_PP_SEQ_SIZE_189(_) MITK_PP_SEQ_SIZE_190 +# define MITK_PP_SEQ_SIZE_190(_) MITK_PP_SEQ_SIZE_191 +# define MITK_PP_SEQ_SIZE_191(_) MITK_PP_SEQ_SIZE_192 +# define MITK_PP_SEQ_SIZE_192(_) MITK_PP_SEQ_SIZE_193 +# define MITK_PP_SEQ_SIZE_193(_) MITK_PP_SEQ_SIZE_194 +# define MITK_PP_SEQ_SIZE_194(_) MITK_PP_SEQ_SIZE_195 +# define MITK_PP_SEQ_SIZE_195(_) MITK_PP_SEQ_SIZE_196 +# define MITK_PP_SEQ_SIZE_196(_) MITK_PP_SEQ_SIZE_197 +# define MITK_PP_SEQ_SIZE_197(_) MITK_PP_SEQ_SIZE_198 +# define MITK_PP_SEQ_SIZE_198(_) MITK_PP_SEQ_SIZE_199 +# define MITK_PP_SEQ_SIZE_199(_) MITK_PP_SEQ_SIZE_200 +# define MITK_PP_SEQ_SIZE_200(_) MITK_PP_SEQ_SIZE_201 +# define MITK_PP_SEQ_SIZE_201(_) MITK_PP_SEQ_SIZE_202 +# define MITK_PP_SEQ_SIZE_202(_) MITK_PP_SEQ_SIZE_203 +# define MITK_PP_SEQ_SIZE_203(_) MITK_PP_SEQ_SIZE_204 +# define MITK_PP_SEQ_SIZE_204(_) MITK_PP_SEQ_SIZE_205 +# define MITK_PP_SEQ_SIZE_205(_) MITK_PP_SEQ_SIZE_206 +# define MITK_PP_SEQ_SIZE_206(_) MITK_PP_SEQ_SIZE_207 +# define MITK_PP_SEQ_SIZE_207(_) MITK_PP_SEQ_SIZE_208 +# define MITK_PP_SEQ_SIZE_208(_) MITK_PP_SEQ_SIZE_209 +# define MITK_PP_SEQ_SIZE_209(_) MITK_PP_SEQ_SIZE_210 +# define MITK_PP_SEQ_SIZE_210(_) MITK_PP_SEQ_SIZE_211 +# define MITK_PP_SEQ_SIZE_211(_) MITK_PP_SEQ_SIZE_212 +# define MITK_PP_SEQ_SIZE_212(_) MITK_PP_SEQ_SIZE_213 +# define MITK_PP_SEQ_SIZE_213(_) MITK_PP_SEQ_SIZE_214 +# define MITK_PP_SEQ_SIZE_214(_) MITK_PP_SEQ_SIZE_215 +# define MITK_PP_SEQ_SIZE_215(_) MITK_PP_SEQ_SIZE_216 +# define MITK_PP_SEQ_SIZE_216(_) MITK_PP_SEQ_SIZE_217 +# define MITK_PP_SEQ_SIZE_217(_) MITK_PP_SEQ_SIZE_218 +# define MITK_PP_SEQ_SIZE_218(_) MITK_PP_SEQ_SIZE_219 +# define MITK_PP_SEQ_SIZE_219(_) MITK_PP_SEQ_SIZE_220 +# define MITK_PP_SEQ_SIZE_220(_) MITK_PP_SEQ_SIZE_221 +# define MITK_PP_SEQ_SIZE_221(_) MITK_PP_SEQ_SIZE_222 +# define MITK_PP_SEQ_SIZE_222(_) MITK_PP_SEQ_SIZE_223 +# define MITK_PP_SEQ_SIZE_223(_) MITK_PP_SEQ_SIZE_224 +# define MITK_PP_SEQ_SIZE_224(_) MITK_PP_SEQ_SIZE_225 +# define MITK_PP_SEQ_SIZE_225(_) MITK_PP_SEQ_SIZE_226 +# define MITK_PP_SEQ_SIZE_226(_) MITK_PP_SEQ_SIZE_227 +# define MITK_PP_SEQ_SIZE_227(_) MITK_PP_SEQ_SIZE_228 +# define MITK_PP_SEQ_SIZE_228(_) MITK_PP_SEQ_SIZE_229 +# define MITK_PP_SEQ_SIZE_229(_) MITK_PP_SEQ_SIZE_230 +# define MITK_PP_SEQ_SIZE_230(_) MITK_PP_SEQ_SIZE_231 +# define MITK_PP_SEQ_SIZE_231(_) MITK_PP_SEQ_SIZE_232 +# define MITK_PP_SEQ_SIZE_232(_) MITK_PP_SEQ_SIZE_233 +# define MITK_PP_SEQ_SIZE_233(_) MITK_PP_SEQ_SIZE_234 +# define MITK_PP_SEQ_SIZE_234(_) MITK_PP_SEQ_SIZE_235 +# define MITK_PP_SEQ_SIZE_235(_) MITK_PP_SEQ_SIZE_236 +# define MITK_PP_SEQ_SIZE_236(_) MITK_PP_SEQ_SIZE_237 +# define MITK_PP_SEQ_SIZE_237(_) MITK_PP_SEQ_SIZE_238 +# define MITK_PP_SEQ_SIZE_238(_) MITK_PP_SEQ_SIZE_239 +# define MITK_PP_SEQ_SIZE_239(_) MITK_PP_SEQ_SIZE_240 +# define MITK_PP_SEQ_SIZE_240(_) MITK_PP_SEQ_SIZE_241 +# define MITK_PP_SEQ_SIZE_241(_) MITK_PP_SEQ_SIZE_242 +# define MITK_PP_SEQ_SIZE_242(_) MITK_PP_SEQ_SIZE_243 +# define MITK_PP_SEQ_SIZE_243(_) MITK_PP_SEQ_SIZE_244 +# define MITK_PP_SEQ_SIZE_244(_) MITK_PP_SEQ_SIZE_245 +# define MITK_PP_SEQ_SIZE_245(_) MITK_PP_SEQ_SIZE_246 +# define MITK_PP_SEQ_SIZE_246(_) MITK_PP_SEQ_SIZE_247 +# define MITK_PP_SEQ_SIZE_247(_) MITK_PP_SEQ_SIZE_248 +# define MITK_PP_SEQ_SIZE_248(_) MITK_PP_SEQ_SIZE_249 +# define MITK_PP_SEQ_SIZE_249(_) MITK_PP_SEQ_SIZE_250 +# define MITK_PP_SEQ_SIZE_250(_) MITK_PP_SEQ_SIZE_251 +# define MITK_PP_SEQ_SIZE_251(_) MITK_PP_SEQ_SIZE_252 +# define MITK_PP_SEQ_SIZE_252(_) MITK_PP_SEQ_SIZE_253 +# define MITK_PP_SEQ_SIZE_253(_) MITK_PP_SEQ_SIZE_254 +# define MITK_PP_SEQ_SIZE_254(_) MITK_PP_SEQ_SIZE_255 +# define MITK_PP_SEQ_SIZE_255(_) MITK_PP_SEQ_SIZE_256 +# define MITK_PP_SEQ_SIZE_256(_) MITK_PP_SEQ_SIZE_257 +# +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_0 0 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_1 1 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_2 2 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_3 3 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_4 4 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_5 5 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_6 6 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_7 7 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_8 8 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_9 9 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_10 10 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_11 11 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_12 12 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_13 13 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_14 14 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_15 15 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_16 16 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_17 17 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_18 18 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_19 19 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_20 20 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_21 21 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_22 22 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_23 23 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_24 24 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_25 25 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_26 26 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_27 27 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_28 28 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_29 29 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_30 30 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_31 31 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_32 32 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_33 33 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_34 34 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_35 35 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_36 36 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_37 37 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_38 38 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_39 39 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_40 40 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_41 41 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_42 42 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_43 43 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_44 44 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_45 45 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_46 46 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_47 47 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_48 48 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_49 49 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_50 50 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_51 51 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_52 52 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_53 53 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_54 54 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_55 55 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_56 56 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_57 57 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_58 58 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_59 59 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_60 60 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_61 61 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_62 62 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_63 63 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_64 64 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_65 65 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_66 66 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_67 67 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_68 68 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_69 69 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_70 70 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_71 71 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_72 72 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_73 73 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_74 74 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_75 75 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_76 76 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_77 77 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_78 78 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_79 79 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_80 80 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_81 81 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_82 82 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_83 83 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_84 84 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_85 85 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_86 86 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_87 87 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_88 88 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_89 89 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_90 90 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_91 91 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_92 92 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_93 93 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_94 94 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_95 95 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_96 96 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_97 97 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_98 98 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_99 99 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_100 100 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_101 101 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_102 102 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_103 103 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_104 104 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_105 105 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_106 106 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_107 107 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_108 108 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_109 109 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_110 110 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_111 111 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_112 112 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_113 113 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_114 114 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_115 115 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_116 116 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_117 117 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_118 118 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_119 119 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_120 120 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_121 121 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_122 122 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_123 123 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_124 124 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_125 125 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_126 126 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_127 127 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_128 128 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_129 129 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_130 130 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_131 131 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_132 132 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_133 133 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_134 134 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_135 135 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_136 136 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_137 137 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_138 138 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_139 139 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_140 140 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_141 141 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_142 142 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_143 143 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_144 144 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_145 145 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_146 146 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_147 147 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_148 148 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_149 149 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_150 150 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_151 151 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_152 152 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_153 153 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_154 154 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_155 155 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_156 156 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_157 157 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_158 158 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_159 159 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_160 160 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_161 161 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_162 162 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_163 163 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_164 164 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_165 165 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_166 166 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_167 167 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_168 168 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_169 169 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_170 170 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_171 171 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_172 172 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_173 173 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_174 174 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_175 175 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_176 176 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_177 177 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_178 178 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_179 179 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_180 180 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_181 181 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_182 182 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_183 183 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_184 184 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_185 185 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_186 186 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_187 187 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_188 188 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_189 189 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_190 190 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_191 191 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_192 192 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_193 193 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_194 194 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_195 195 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_196 196 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_197 197 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_198 198 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_199 199 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_200 200 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_201 201 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_202 202 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_203 203 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_204 204 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_205 205 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_206 206 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_207 207 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_208 208 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_209 209 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_210 210 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_211 211 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_212 212 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_213 213 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_214 214 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_215 215 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_216 216 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_217 217 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_218 218 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_219 219 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_220 220 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_221 221 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_222 222 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_223 223 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_224 224 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_225 225 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_226 226 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_227 227 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_228 228 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_229 229 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_230 230 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_231 231 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_232 232 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_233 233 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_234 234 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_235 235 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_236 236 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_237 237 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_238 238 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_239 239 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_240 240 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_241 241 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_242 242 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_243 243 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_244 244 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_245 245 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_246 246 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_247 247 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_248 248 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_249 249 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_250 250 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_251 251 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_252 252 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_253 253 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_254 254 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_255 255 +# define MITK_PP_SEQ_SIZE_MITK_PP_SEQ_SIZE_256 256 +# +# endif diff --git a/Core/Code/Algorithms/mitkPPSeqToTuple.h b/Core/Code/Algorithms/mitkPPSeqToTuple.h new file mode 100644 index 0000000000..b1fdd59083 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPSeqToTuple.h @@ -0,0 +1,27 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_SEQ_TO_TUPLE_HPP +# define MITK_PREPROCESSOR_SEQ_TO_TUPLE_HPP +# +# include "mitkPPConfig.h" +# include "mitkPPSeqEnum.h" +# +# /* MITK_PP_SEQ_TO_TUPLE */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_SEQ_TO_TUPLE(seq) (MITK_PP_SEQ_ENUM(seq)) +# else +# define MITK_PP_SEQ_TO_TUPLE(seq) MITK_PP_SEQ_TO_TUPLE_I(seq) +# define MITK_PP_SEQ_TO_TUPLE_I(seq) (MITK_PP_SEQ_ENUM(seq)) +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPPStringize.h b/Core/Code/Algorithms/mitkPPStringize.h new file mode 100644 index 0000000000..90c98c0341 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPStringize.h @@ -0,0 +1,33 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_STRINGIZE_HPP +# define MITK_PREPROCESSOR_STRINGIZE_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_STRINGIZE */ +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_STRINGIZE(text) MITK_PP_STRINGIZE_A((text)) +# define MITK_PP_STRINGIZE_A(arg) MITK_PP_STRINGIZE_I arg +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_STRINGIZE(text) MITK_PP_STRINGIZE_OO((text)) +# define MITK_PP_STRINGIZE_OO(par) MITK_PP_STRINGIZE_I ## par +# else +# define MITK_PP_STRINGIZE(text) MITK_PP_STRINGIZE_I(text) +# endif +# +# define MITK_PP_STRINGIZE_I(text) #text +# +# endif diff --git a/Core/Code/Algorithms/mitkPPTupleEat.h b/Core/Code/Algorithms/mitkPPTupleEat.h new file mode 100644 index 0000000000..b33f4fb520 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPTupleEat.h @@ -0,0 +1,57 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_TUPLE_EAT_HPP +# define MITK_PREPROCESSOR_TUPLE_EAT_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_TUPLE_EAT */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_TUPLE_EAT(size) MITK_PP_TUPLE_EAT_I(size) +# else +# define MITK_PP_TUPLE_EAT(size) MITK_PP_TUPLE_EAT_OO((size)) +# define MITK_PP_TUPLE_EAT_OO(par) MITK_PP_TUPLE_EAT_I ## par +# endif +# +# define MITK_PP_TUPLE_EAT_I(size) MITK_PP_TUPLE_EAT_ ## size +# +# define MITK_PP_TUPLE_EAT_0() +# define MITK_PP_TUPLE_EAT_1(a) +# define MITK_PP_TUPLE_EAT_2(a, b) +# define MITK_PP_TUPLE_EAT_3(a, b, c) +# define MITK_PP_TUPLE_EAT_4(a, b, c, d) +# define MITK_PP_TUPLE_EAT_5(a, b, c, d, e) +# define MITK_PP_TUPLE_EAT_6(a, b, c, d, e, f) +# define MITK_PP_TUPLE_EAT_7(a, b, c, d, e, f, g) +# define MITK_PP_TUPLE_EAT_8(a, b, c, d, e, f, g, h) +# define MITK_PP_TUPLE_EAT_9(a, b, c, d, e, f, g, h, i) +# define MITK_PP_TUPLE_EAT_10(a, b, c, d, e, f, g, h, i, j) +# define MITK_PP_TUPLE_EAT_11(a, b, c, d, e, f, g, h, i, j, k) +# define MITK_PP_TUPLE_EAT_12(a, b, c, d, e, f, g, h, i, j, k, l) +# define MITK_PP_TUPLE_EAT_13(a, b, c, d, e, f, g, h, i, j, k, l, m) +# define MITK_PP_TUPLE_EAT_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n) +# define MITK_PP_TUPLE_EAT_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +# define MITK_PP_TUPLE_EAT_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) +# define MITK_PP_TUPLE_EAT_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) +# define MITK_PP_TUPLE_EAT_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) +# define MITK_PP_TUPLE_EAT_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) +# define MITK_PP_TUPLE_EAT_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) +# define MITK_PP_TUPLE_EAT_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) +# define MITK_PP_TUPLE_EAT_22(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) +# define MITK_PP_TUPLE_EAT_23(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) +# define MITK_PP_TUPLE_EAT_24(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) +# define MITK_PP_TUPLE_EAT_25(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) +# +# endif diff --git a/Core/Code/Algorithms/mitkPPTupleElem.h b/Core/Code/Algorithms/mitkPPTupleElem.h new file mode 100644 index 0000000000..5fcc60aee7 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPTupleElem.h @@ -0,0 +1,385 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_TUPLE_ELEM_HPP +# define MITK_PREPROCESSOR_TUPLE_ELEM_HPP +# +# include "mitkPPConfig.h" +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_TUPLE_ELEM(size, index, tuple) MITK_PP_TUPLE_ELEM_I(size, index, tuple) +# else +# define MITK_PP_TUPLE_ELEM(size, index, tuple) MITK_PP_TUPLE_ELEM_OO((size, index, tuple)) +# define MITK_PP_TUPLE_ELEM_OO(par) MITK_PP_TUPLE_ELEM_I ## par +# endif +# +# if MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_TUPLE_ELEM_I(s, i, t) MITK_PP_TUPLE_ELEM_ ## s ## _ ## i ## t +# elif MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MSVC() +# define MITK_PP_TUPLE_ELEM_I(s, i, t) MITK_PP_TUPLE_ELEM_II(MITK_PP_TUPLE_ELEM_ ## s ## _ ## i t) +# define MITK_PP_TUPLE_ELEM_II(res) res +# else +# define MITK_PP_TUPLE_ELEM_I(s, i, t) MITK_PP_TUPLE_ELEM_ ## s ## _ ## i t +# endif +# +# define MITK_PP_TUPLE_ELEM_1_0(a) a +# +# define MITK_PP_TUPLE_ELEM_2_0(a, b) a +# define MITK_PP_TUPLE_ELEM_2_1(a, b) b +# +# define MITK_PP_TUPLE_ELEM_3_0(a, b, c) a +# define MITK_PP_TUPLE_ELEM_3_1(a, b, c) b +# define MITK_PP_TUPLE_ELEM_3_2(a, b, c) c +# +# define MITK_PP_TUPLE_ELEM_4_0(a, b, c, d) a +# define MITK_PP_TUPLE_ELEM_4_1(a, b, c, d) b +# define MITK_PP_TUPLE_ELEM_4_2(a, b, c, d) c +# define MITK_PP_TUPLE_ELEM_4_3(a, b, c, d) d +# +# define MITK_PP_TUPLE_ELEM_5_0(a, b, c, d, e) a +# define MITK_PP_TUPLE_ELEM_5_1(a, b, c, d, e) b +# define MITK_PP_TUPLE_ELEM_5_2(a, b, c, d, e) c +# define MITK_PP_TUPLE_ELEM_5_3(a, b, c, d, e) d +# define MITK_PP_TUPLE_ELEM_5_4(a, b, c, d, e) e +# +# define MITK_PP_TUPLE_ELEM_6_0(a, b, c, d, e, f) a +# define MITK_PP_TUPLE_ELEM_6_1(a, b, c, d, e, f) b +# define MITK_PP_TUPLE_ELEM_6_2(a, b, c, d, e, f) c +# define MITK_PP_TUPLE_ELEM_6_3(a, b, c, d, e, f) d +# define MITK_PP_TUPLE_ELEM_6_4(a, b, c, d, e, f) e +# define MITK_PP_TUPLE_ELEM_6_5(a, b, c, d, e, f) f +# +# define MITK_PP_TUPLE_ELEM_7_0(a, b, c, d, e, f, g) a +# define MITK_PP_TUPLE_ELEM_7_1(a, b, c, d, e, f, g) b +# define MITK_PP_TUPLE_ELEM_7_2(a, b, c, d, e, f, g) c +# define MITK_PP_TUPLE_ELEM_7_3(a, b, c, d, e, f, g) d +# define MITK_PP_TUPLE_ELEM_7_4(a, b, c, d, e, f, g) e +# define MITK_PP_TUPLE_ELEM_7_5(a, b, c, d, e, f, g) f +# define MITK_PP_TUPLE_ELEM_7_6(a, b, c, d, e, f, g) g +# +# define MITK_PP_TUPLE_ELEM_8_0(a, b, c, d, e, f, g, h) a +# define MITK_PP_TUPLE_ELEM_8_1(a, b, c, d, e, f, g, h) b +# define MITK_PP_TUPLE_ELEM_8_2(a, b, c, d, e, f, g, h) c +# define MITK_PP_TUPLE_ELEM_8_3(a, b, c, d, e, f, g, h) d +# define MITK_PP_TUPLE_ELEM_8_4(a, b, c, d, e, f, g, h) e +# define MITK_PP_TUPLE_ELEM_8_5(a, b, c, d, e, f, g, h) f +# define MITK_PP_TUPLE_ELEM_8_6(a, b, c, d, e, f, g, h) g +# define MITK_PP_TUPLE_ELEM_8_7(a, b, c, d, e, f, g, h) h +# +# define MITK_PP_TUPLE_ELEM_9_0(a, b, c, d, e, f, g, h, i) a +# define MITK_PP_TUPLE_ELEM_9_1(a, b, c, d, e, f, g, h, i) b +# define MITK_PP_TUPLE_ELEM_9_2(a, b, c, d, e, f, g, h, i) c +# define MITK_PP_TUPLE_ELEM_9_3(a, b, c, d, e, f, g, h, i) d +# define MITK_PP_TUPLE_ELEM_9_4(a, b, c, d, e, f, g, h, i) e +# define MITK_PP_TUPLE_ELEM_9_5(a, b, c, d, e, f, g, h, i) f +# define MITK_PP_TUPLE_ELEM_9_6(a, b, c, d, e, f, g, h, i) g +# define MITK_PP_TUPLE_ELEM_9_7(a, b, c, d, e, f, g, h, i) h +# define MITK_PP_TUPLE_ELEM_9_8(a, b, c, d, e, f, g, h, i) i +# +# define MITK_PP_TUPLE_ELEM_10_0(a, b, c, d, e, f, g, h, i, j) a +# define MITK_PP_TUPLE_ELEM_10_1(a, b, c, d, e, f, g, h, i, j) b +# define MITK_PP_TUPLE_ELEM_10_2(a, b, c, d, e, f, g, h, i, j) c +# define MITK_PP_TUPLE_ELEM_10_3(a, b, c, d, e, f, g, h, i, j) d +# define MITK_PP_TUPLE_ELEM_10_4(a, b, c, d, e, f, g, h, i, j) e +# define MITK_PP_TUPLE_ELEM_10_5(a, b, c, d, e, f, g, h, i, j) f +# define MITK_PP_TUPLE_ELEM_10_6(a, b, c, d, e, f, g, h, i, j) g +# define MITK_PP_TUPLE_ELEM_10_7(a, b, c, d, e, f, g, h, i, j) h +# define MITK_PP_TUPLE_ELEM_10_8(a, b, c, d, e, f, g, h, i, j) i +# define MITK_PP_TUPLE_ELEM_10_9(a, b, c, d, e, f, g, h, i, j) j +# +# define MITK_PP_TUPLE_ELEM_11_0(a, b, c, d, e, f, g, h, i, j, k) a +# define MITK_PP_TUPLE_ELEM_11_1(a, b, c, d, e, f, g, h, i, j, k) b +# define MITK_PP_TUPLE_ELEM_11_2(a, b, c, d, e, f, g, h, i, j, k) c +# define MITK_PP_TUPLE_ELEM_11_3(a, b, c, d, e, f, g, h, i, j, k) d +# define MITK_PP_TUPLE_ELEM_11_4(a, b, c, d, e, f, g, h, i, j, k) e +# define MITK_PP_TUPLE_ELEM_11_5(a, b, c, d, e, f, g, h, i, j, k) f +# define MITK_PP_TUPLE_ELEM_11_6(a, b, c, d, e, f, g, h, i, j, k) g +# define MITK_PP_TUPLE_ELEM_11_7(a, b, c, d, e, f, g, h, i, j, k) h +# define MITK_PP_TUPLE_ELEM_11_8(a, b, c, d, e, f, g, h, i, j, k) i +# define MITK_PP_TUPLE_ELEM_11_9(a, b, c, d, e, f, g, h, i, j, k) j +# define MITK_PP_TUPLE_ELEM_11_10(a, b, c, d, e, f, g, h, i, j, k) k +# +# define MITK_PP_TUPLE_ELEM_12_0(a, b, c, d, e, f, g, h, i, j, k, l) a +# define MITK_PP_TUPLE_ELEM_12_1(a, b, c, d, e, f, g, h, i, j, k, l) b +# define MITK_PP_TUPLE_ELEM_12_2(a, b, c, d, e, f, g, h, i, j, k, l) c +# define MITK_PP_TUPLE_ELEM_12_3(a, b, c, d, e, f, g, h, i, j, k, l) d +# define MITK_PP_TUPLE_ELEM_12_4(a, b, c, d, e, f, g, h, i, j, k, l) e +# define MITK_PP_TUPLE_ELEM_12_5(a, b, c, d, e, f, g, h, i, j, k, l) f +# define MITK_PP_TUPLE_ELEM_12_6(a, b, c, d, e, f, g, h, i, j, k, l) g +# define MITK_PP_TUPLE_ELEM_12_7(a, b, c, d, e, f, g, h, i, j, k, l) h +# define MITK_PP_TUPLE_ELEM_12_8(a, b, c, d, e, f, g, h, i, j, k, l) i +# define MITK_PP_TUPLE_ELEM_12_9(a, b, c, d, e, f, g, h, i, j, k, l) j +# define MITK_PP_TUPLE_ELEM_12_10(a, b, c, d, e, f, g, h, i, j, k, l) k +# define MITK_PP_TUPLE_ELEM_12_11(a, b, c, d, e, f, g, h, i, j, k, l) l +# +# define MITK_PP_TUPLE_ELEM_13_0(a, b, c, d, e, f, g, h, i, j, k, l, m) a +# define MITK_PP_TUPLE_ELEM_13_1(a, b, c, d, e, f, g, h, i, j, k, l, m) b +# define MITK_PP_TUPLE_ELEM_13_2(a, b, c, d, e, f, g, h, i, j, k, l, m) c +# define MITK_PP_TUPLE_ELEM_13_3(a, b, c, d, e, f, g, h, i, j, k, l, m) d +# define MITK_PP_TUPLE_ELEM_13_4(a, b, c, d, e, f, g, h, i, j, k, l, m) e +# define MITK_PP_TUPLE_ELEM_13_5(a, b, c, d, e, f, g, h, i, j, k, l, m) f +# define MITK_PP_TUPLE_ELEM_13_6(a, b, c, d, e, f, g, h, i, j, k, l, m) g +# define MITK_PP_TUPLE_ELEM_13_7(a, b, c, d, e, f, g, h, i, j, k, l, m) h +# define MITK_PP_TUPLE_ELEM_13_8(a, b, c, d, e, f, g, h, i, j, k, l, m) i +# define MITK_PP_TUPLE_ELEM_13_9(a, b, c, d, e, f, g, h, i, j, k, l, m) j +# define MITK_PP_TUPLE_ELEM_13_10(a, b, c, d, e, f, g, h, i, j, k, l, m) k +# define MITK_PP_TUPLE_ELEM_13_11(a, b, c, d, e, f, g, h, i, j, k, l, m) l +# define MITK_PP_TUPLE_ELEM_13_12(a, b, c, d, e, f, g, h, i, j, k, l, m) m +# +# define MITK_PP_TUPLE_ELEM_14_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n) a +# define MITK_PP_TUPLE_ELEM_14_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n) b +# define MITK_PP_TUPLE_ELEM_14_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n) c +# define MITK_PP_TUPLE_ELEM_14_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n) d +# define MITK_PP_TUPLE_ELEM_14_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n) e +# define MITK_PP_TUPLE_ELEM_14_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n) f +# define MITK_PP_TUPLE_ELEM_14_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n) g +# define MITK_PP_TUPLE_ELEM_14_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n) h +# define MITK_PP_TUPLE_ELEM_14_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n) i +# define MITK_PP_TUPLE_ELEM_14_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n) j +# define MITK_PP_TUPLE_ELEM_14_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n) k +# define MITK_PP_TUPLE_ELEM_14_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n) l +# define MITK_PP_TUPLE_ELEM_14_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n) m +# define MITK_PP_TUPLE_ELEM_14_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n) n +# +# define MITK_PP_TUPLE_ELEM_15_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) a +# define MITK_PP_TUPLE_ELEM_15_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) b +# define MITK_PP_TUPLE_ELEM_15_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) c +# define MITK_PP_TUPLE_ELEM_15_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) d +# define MITK_PP_TUPLE_ELEM_15_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) e +# define MITK_PP_TUPLE_ELEM_15_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) f +# define MITK_PP_TUPLE_ELEM_15_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) g +# define MITK_PP_TUPLE_ELEM_15_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) h +# define MITK_PP_TUPLE_ELEM_15_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) i +# define MITK_PP_TUPLE_ELEM_15_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) j +# define MITK_PP_TUPLE_ELEM_15_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) k +# define MITK_PP_TUPLE_ELEM_15_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) l +# define MITK_PP_TUPLE_ELEM_15_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) m +# define MITK_PP_TUPLE_ELEM_15_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) n +# define MITK_PP_TUPLE_ELEM_15_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) o +# +# define MITK_PP_TUPLE_ELEM_16_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) a +# define MITK_PP_TUPLE_ELEM_16_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) b +# define MITK_PP_TUPLE_ELEM_16_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) c +# define MITK_PP_TUPLE_ELEM_16_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) d +# define MITK_PP_TUPLE_ELEM_16_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) e +# define MITK_PP_TUPLE_ELEM_16_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) f +# define MITK_PP_TUPLE_ELEM_16_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) g +# define MITK_PP_TUPLE_ELEM_16_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) h +# define MITK_PP_TUPLE_ELEM_16_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) i +# define MITK_PP_TUPLE_ELEM_16_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) j +# define MITK_PP_TUPLE_ELEM_16_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) k +# define MITK_PP_TUPLE_ELEM_16_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) l +# define MITK_PP_TUPLE_ELEM_16_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) m +# define MITK_PP_TUPLE_ELEM_16_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) n +# define MITK_PP_TUPLE_ELEM_16_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) o +# define MITK_PP_TUPLE_ELEM_16_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) p +# +# define MITK_PP_TUPLE_ELEM_17_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) a +# define MITK_PP_TUPLE_ELEM_17_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) b +# define MITK_PP_TUPLE_ELEM_17_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) c +# define MITK_PP_TUPLE_ELEM_17_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) d +# define MITK_PP_TUPLE_ELEM_17_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) e +# define MITK_PP_TUPLE_ELEM_17_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) f +# define MITK_PP_TUPLE_ELEM_17_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) g +# define MITK_PP_TUPLE_ELEM_17_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) h +# define MITK_PP_TUPLE_ELEM_17_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) i +# define MITK_PP_TUPLE_ELEM_17_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) j +# define MITK_PP_TUPLE_ELEM_17_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) k +# define MITK_PP_TUPLE_ELEM_17_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) l +# define MITK_PP_TUPLE_ELEM_17_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) m +# define MITK_PP_TUPLE_ELEM_17_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) n +# define MITK_PP_TUPLE_ELEM_17_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) o +# define MITK_PP_TUPLE_ELEM_17_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) p +# define MITK_PP_TUPLE_ELEM_17_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) q +# +# define MITK_PP_TUPLE_ELEM_18_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) a +# define MITK_PP_TUPLE_ELEM_18_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) b +# define MITK_PP_TUPLE_ELEM_18_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) c +# define MITK_PP_TUPLE_ELEM_18_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) d +# define MITK_PP_TUPLE_ELEM_18_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) e +# define MITK_PP_TUPLE_ELEM_18_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) f +# define MITK_PP_TUPLE_ELEM_18_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) g +# define MITK_PP_TUPLE_ELEM_18_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) h +# define MITK_PP_TUPLE_ELEM_18_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) i +# define MITK_PP_TUPLE_ELEM_18_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) j +# define MITK_PP_TUPLE_ELEM_18_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) k +# define MITK_PP_TUPLE_ELEM_18_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) l +# define MITK_PP_TUPLE_ELEM_18_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) m +# define MITK_PP_TUPLE_ELEM_18_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) n +# define MITK_PP_TUPLE_ELEM_18_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) o +# define MITK_PP_TUPLE_ELEM_18_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) p +# define MITK_PP_TUPLE_ELEM_18_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) q +# define MITK_PP_TUPLE_ELEM_18_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) r +# +# define MITK_PP_TUPLE_ELEM_19_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) a +# define MITK_PP_TUPLE_ELEM_19_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) b +# define MITK_PP_TUPLE_ELEM_19_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) c +# define MITK_PP_TUPLE_ELEM_19_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) d +# define MITK_PP_TUPLE_ELEM_19_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) e +# define MITK_PP_TUPLE_ELEM_19_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) f +# define MITK_PP_TUPLE_ELEM_19_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) g +# define MITK_PP_TUPLE_ELEM_19_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) h +# define MITK_PP_TUPLE_ELEM_19_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) i +# define MITK_PP_TUPLE_ELEM_19_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) j +# define MITK_PP_TUPLE_ELEM_19_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) k +# define MITK_PP_TUPLE_ELEM_19_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) l +# define MITK_PP_TUPLE_ELEM_19_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) m +# define MITK_PP_TUPLE_ELEM_19_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) n +# define MITK_PP_TUPLE_ELEM_19_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) o +# define MITK_PP_TUPLE_ELEM_19_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) p +# define MITK_PP_TUPLE_ELEM_19_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) q +# define MITK_PP_TUPLE_ELEM_19_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) r +# define MITK_PP_TUPLE_ELEM_19_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) s +# +# define MITK_PP_TUPLE_ELEM_20_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) a +# define MITK_PP_TUPLE_ELEM_20_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) b +# define MITK_PP_TUPLE_ELEM_20_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) c +# define MITK_PP_TUPLE_ELEM_20_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) d +# define MITK_PP_TUPLE_ELEM_20_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) e +# define MITK_PP_TUPLE_ELEM_20_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) f +# define MITK_PP_TUPLE_ELEM_20_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) g +# define MITK_PP_TUPLE_ELEM_20_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) h +# define MITK_PP_TUPLE_ELEM_20_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) i +# define MITK_PP_TUPLE_ELEM_20_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) j +# define MITK_PP_TUPLE_ELEM_20_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) k +# define MITK_PP_TUPLE_ELEM_20_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) l +# define MITK_PP_TUPLE_ELEM_20_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) m +# define MITK_PP_TUPLE_ELEM_20_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) n +# define MITK_PP_TUPLE_ELEM_20_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) o +# define MITK_PP_TUPLE_ELEM_20_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) p +# define MITK_PP_TUPLE_ELEM_20_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) q +# define MITK_PP_TUPLE_ELEM_20_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) r +# define MITK_PP_TUPLE_ELEM_20_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) s +# define MITK_PP_TUPLE_ELEM_20_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) t +# +# define MITK_PP_TUPLE_ELEM_21_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) a +# define MITK_PP_TUPLE_ELEM_21_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) b +# define MITK_PP_TUPLE_ELEM_21_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) c +# define MITK_PP_TUPLE_ELEM_21_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) d +# define MITK_PP_TUPLE_ELEM_21_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) e +# define MITK_PP_TUPLE_ELEM_21_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) f +# define MITK_PP_TUPLE_ELEM_21_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) g +# define MITK_PP_TUPLE_ELEM_21_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) h +# define MITK_PP_TUPLE_ELEM_21_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) i +# define MITK_PP_TUPLE_ELEM_21_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) j +# define MITK_PP_TUPLE_ELEM_21_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) k +# define MITK_PP_TUPLE_ELEM_21_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) l +# define MITK_PP_TUPLE_ELEM_21_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) m +# define MITK_PP_TUPLE_ELEM_21_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) n +# define MITK_PP_TUPLE_ELEM_21_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) o +# define MITK_PP_TUPLE_ELEM_21_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) p +# define MITK_PP_TUPLE_ELEM_21_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) q +# define MITK_PP_TUPLE_ELEM_21_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) r +# define MITK_PP_TUPLE_ELEM_21_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) s +# define MITK_PP_TUPLE_ELEM_21_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) t +# define MITK_PP_TUPLE_ELEM_21_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) u +# +# define MITK_PP_TUPLE_ELEM_22_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) a +# define MITK_PP_TUPLE_ELEM_22_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) b +# define MITK_PP_TUPLE_ELEM_22_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) c +# define MITK_PP_TUPLE_ELEM_22_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) d +# define MITK_PP_TUPLE_ELEM_22_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) e +# define MITK_PP_TUPLE_ELEM_22_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) f +# define MITK_PP_TUPLE_ELEM_22_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) g +# define MITK_PP_TUPLE_ELEM_22_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) h +# define MITK_PP_TUPLE_ELEM_22_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) i +# define MITK_PP_TUPLE_ELEM_22_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) j +# define MITK_PP_TUPLE_ELEM_22_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) k +# define MITK_PP_TUPLE_ELEM_22_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) l +# define MITK_PP_TUPLE_ELEM_22_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) m +# define MITK_PP_TUPLE_ELEM_22_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) n +# define MITK_PP_TUPLE_ELEM_22_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) o +# define MITK_PP_TUPLE_ELEM_22_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) p +# define MITK_PP_TUPLE_ELEM_22_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) q +# define MITK_PP_TUPLE_ELEM_22_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) r +# define MITK_PP_TUPLE_ELEM_22_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) s +# define MITK_PP_TUPLE_ELEM_22_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) t +# define MITK_PP_TUPLE_ELEM_22_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) u +# define MITK_PP_TUPLE_ELEM_22_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) v +# +# define MITK_PP_TUPLE_ELEM_23_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) a +# define MITK_PP_TUPLE_ELEM_23_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) b +# define MITK_PP_TUPLE_ELEM_23_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) c +# define MITK_PP_TUPLE_ELEM_23_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) d +# define MITK_PP_TUPLE_ELEM_23_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) e +# define MITK_PP_TUPLE_ELEM_23_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) f +# define MITK_PP_TUPLE_ELEM_23_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) g +# define MITK_PP_TUPLE_ELEM_23_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) h +# define MITK_PP_TUPLE_ELEM_23_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) i +# define MITK_PP_TUPLE_ELEM_23_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) j +# define MITK_PP_TUPLE_ELEM_23_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) k +# define MITK_PP_TUPLE_ELEM_23_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) l +# define MITK_PP_TUPLE_ELEM_23_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) m +# define MITK_PP_TUPLE_ELEM_23_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) n +# define MITK_PP_TUPLE_ELEM_23_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) o +# define MITK_PP_TUPLE_ELEM_23_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) p +# define MITK_PP_TUPLE_ELEM_23_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) q +# define MITK_PP_TUPLE_ELEM_23_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) r +# define MITK_PP_TUPLE_ELEM_23_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) s +# define MITK_PP_TUPLE_ELEM_23_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) t +# define MITK_PP_TUPLE_ELEM_23_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) u +# define MITK_PP_TUPLE_ELEM_23_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) v +# define MITK_PP_TUPLE_ELEM_23_22(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) w +# +# define MITK_PP_TUPLE_ELEM_24_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) a +# define MITK_PP_TUPLE_ELEM_24_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) b +# define MITK_PP_TUPLE_ELEM_24_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) c +# define MITK_PP_TUPLE_ELEM_24_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) d +# define MITK_PP_TUPLE_ELEM_24_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) e +# define MITK_PP_TUPLE_ELEM_24_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) f +# define MITK_PP_TUPLE_ELEM_24_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) g +# define MITK_PP_TUPLE_ELEM_24_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) h +# define MITK_PP_TUPLE_ELEM_24_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) i +# define MITK_PP_TUPLE_ELEM_24_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) j +# define MITK_PP_TUPLE_ELEM_24_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) k +# define MITK_PP_TUPLE_ELEM_24_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) l +# define MITK_PP_TUPLE_ELEM_24_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) m +# define MITK_PP_TUPLE_ELEM_24_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) n +# define MITK_PP_TUPLE_ELEM_24_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) o +# define MITK_PP_TUPLE_ELEM_24_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) p +# define MITK_PP_TUPLE_ELEM_24_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) q +# define MITK_PP_TUPLE_ELEM_24_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) r +# define MITK_PP_TUPLE_ELEM_24_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) s +# define MITK_PP_TUPLE_ELEM_24_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) t +# define MITK_PP_TUPLE_ELEM_24_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) u +# define MITK_PP_TUPLE_ELEM_24_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) v +# define MITK_PP_TUPLE_ELEM_24_22(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) w +# define MITK_PP_TUPLE_ELEM_24_23(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) x +# +# define MITK_PP_TUPLE_ELEM_25_0(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) a +# define MITK_PP_TUPLE_ELEM_25_1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) b +# define MITK_PP_TUPLE_ELEM_25_2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) c +# define MITK_PP_TUPLE_ELEM_25_3(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) d +# define MITK_PP_TUPLE_ELEM_25_4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) e +# define MITK_PP_TUPLE_ELEM_25_5(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) f +# define MITK_PP_TUPLE_ELEM_25_6(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) g +# define MITK_PP_TUPLE_ELEM_25_7(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) h +# define MITK_PP_TUPLE_ELEM_25_8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) i +# define MITK_PP_TUPLE_ELEM_25_9(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) j +# define MITK_PP_TUPLE_ELEM_25_10(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) k +# define MITK_PP_TUPLE_ELEM_25_11(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) l +# define MITK_PP_TUPLE_ELEM_25_12(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) m +# define MITK_PP_TUPLE_ELEM_25_13(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) n +# define MITK_PP_TUPLE_ELEM_25_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) o +# define MITK_PP_TUPLE_ELEM_25_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) p +# define MITK_PP_TUPLE_ELEM_25_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) q +# define MITK_PP_TUPLE_ELEM_25_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) r +# define MITK_PP_TUPLE_ELEM_25_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) s +# define MITK_PP_TUPLE_ELEM_25_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) t +# define MITK_PP_TUPLE_ELEM_25_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) u +# define MITK_PP_TUPLE_ELEM_25_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) v +# define MITK_PP_TUPLE_ELEM_25_22(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) w +# define MITK_PP_TUPLE_ELEM_25_23(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) x +# define MITK_PP_TUPLE_ELEM_25_24(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) y +# +# endif diff --git a/Core/Code/Algorithms/mitkPPTupleRem.h b/Core/Code/Algorithms/mitkPPTupleRem.h new file mode 100644 index 0000000000..f9ededef69 --- /dev/null +++ b/Core/Code/Algorithms/mitkPPTupleRem.h @@ -0,0 +1,72 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under the Boost Software License, Version 1.0. (See +# * accompanying file LICENSE_1_0.txt or copy at +# * http://www.boost.org/LICENSE_1_0.txt) +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef MITK_PREPROCESSOR_TUPLE_REM_HPP +# define MITK_PREPROCESSOR_TUPLE_REM_HPP +# +# include "mitkPPConfig.h" +# +# /* MITK_PP_TUPLE_REM */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_TUPLE_REM(size) MITK_PP_TUPLE_REM_I(size) +# else +# define MITK_PP_TUPLE_REM(size) MITK_PP_TUPLE_REM_OO((size)) +# define MITK_PP_TUPLE_REM_OO(par) MITK_PP_TUPLE_REM_I ## par +# endif +# +# define MITK_PP_TUPLE_REM_I(size) MITK_PP_TUPLE_REM_ ## size +# +# define MITK_PP_TUPLE_REM_0() +# define MITK_PP_TUPLE_REM_1(a) a +# define MITK_PP_TUPLE_REM_2(a, b) a, b +# define MITK_PP_TUPLE_REM_3(a, b, c) a, b, c +# define MITK_PP_TUPLE_REM_4(a, b, c, d) a, b, c, d +# define MITK_PP_TUPLE_REM_5(a, b, c, d, e) a, b, c, d, e +# define MITK_PP_TUPLE_REM_6(a, b, c, d, e, f) a, b, c, d, e, f +# define MITK_PP_TUPLE_REM_7(a, b, c, d, e, f, g) a, b, c, d, e, f, g +# define MITK_PP_TUPLE_REM_8(a, b, c, d, e, f, g, h) a, b, c, d, e, f, g, h +# define MITK_PP_TUPLE_REM_9(a, b, c, d, e, f, g, h, i) a, b, c, d, e, f, g, h, i +# define MITK_PP_TUPLE_REM_10(a, b, c, d, e, f, g, h, i, j) a, b, c, d, e, f, g, h, i, j +# define MITK_PP_TUPLE_REM_11(a, b, c, d, e, f, g, h, i, j, k) a, b, c, d, e, f, g, h, i, j, k +# define MITK_PP_TUPLE_REM_12(a, b, c, d, e, f, g, h, i, j, k, l) a, b, c, d, e, f, g, h, i, j, k, l +# define MITK_PP_TUPLE_REM_13(a, b, c, d, e, f, g, h, i, j, k, l, m) a, b, c, d, e, f, g, h, i, j, k, l, m +# define MITK_PP_TUPLE_REM_14(a, b, c, d, e, f, g, h, i, j, k, l, m, n) a, b, c, d, e, f, g, h, i, j, k, l, m, n +# define MITK_PP_TUPLE_REM_15(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o +# define MITK_PP_TUPLE_REM_16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p +# define MITK_PP_TUPLE_REM_17(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q +# define MITK_PP_TUPLE_REM_18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r +# define MITK_PP_TUPLE_REM_19(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s +# define MITK_PP_TUPLE_REM_20(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t +# define MITK_PP_TUPLE_REM_21(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u +# define MITK_PP_TUPLE_REM_22(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v +# define MITK_PP_TUPLE_REM_23(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w +# define MITK_PP_TUPLE_REM_24(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x +# define MITK_PP_TUPLE_REM_25(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y +# +# /* MITK_PP_TUPLE_REM_CTOR */ +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_EDG() +# define MITK_PP_TUPLE_REM_CTOR(size, tuple) MITK_PP_TUPLE_REM_CTOR_I(MITK_PP_TUPLE_REM(size), tuple) +# else +# define MITK_PP_TUPLE_REM_CTOR(size, tuple) MITK_PP_TUPLE_REM_CTOR_D(size, tuple) +# define MITK_PP_TUPLE_REM_CTOR_D(size, tuple) MITK_PP_TUPLE_REM_CTOR_I(MITK_PP_TUPLE_REM(size), tuple) +# endif +# +# if ~MITK_PP_CONFIG_FLAGS() & MITK_PP_CONFIG_MWCC() +# define MITK_PP_TUPLE_REM_CTOR_I(ext, tuple) ext tuple +# else +# define MITK_PP_TUPLE_REM_CTOR_I(ext, tuple) MITK_PP_TUPLE_REM_CTOR_OO((ext, tuple)) +# define MITK_PP_TUPLE_REM_CTOR_OO(par) MITK_PP_TUPLE_REM_CTOR_II ## par +# define MITK_PP_TUPLE_REM_CTOR_II(ext, tuple) ext ## tuple +# endif +# +# endif diff --git a/Core/Code/Algorithms/mitkPixelTypeList.h b/Core/Code/Algorithms/mitkPixelTypeList.h new file mode 100644 index 0000000000..2c33db0c32 --- /dev/null +++ b/Core/Code/Algorithms/mitkPixelTypeList.h @@ -0,0 +1,194 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include + +namespace mitk { + +struct EmptyType {}; + +template< + typename T0=EmptyType, + typename T1=EmptyType, + typename T2=EmptyType, + typename T3=EmptyType, + typename T4=EmptyType, + typename T5=EmptyType, + typename T6=EmptyType, + typename T7=EmptyType, + typename T8=EmptyType, + typename T9=EmptyType +> struct PixelTypeList; + +template< + typename T0, + typename T1, + typename T2, + typename T3, + typename T4, + typename T5, + typename T6, + typename T7, + typename T8, + typename T9 +> struct PixelTypeList +{ + typedef T0 head; + typedef PixelTypeList tail; + enum + { + length = tail::length+1 + }; +}; + +template<> +struct PixelTypeList +{ + enum + { + length = 0 + }; +}; + +template +struct PixelTypeLength +{ + enum + { + value = TypeList::length + }; +}; + +template< + typename TypeList, + int Index, //requested element index + int Step = 0, //current recusion step + bool Stop=(Index==Step), //stop recusion flag + bool OutOfRange = PixelTypeLength::value==0 //out of range flag +> struct GetPixelType +{ + typedef typename GetPixelType::type type; +}; + +//"out of range" specialization +template< + typename TypeList, + int Index, + int Step, + bool Stop +> +struct GetPixelType +{ + //if OutOfRange is 'true' the 'type' is undefined + //so we'll get a compile-time error +}; + +//"element found" specialization +template< + typename TypeList, + int Index, + int Step, + bool OutOfRange +> +struct GetPixelType +{ + //the index is equal to the recursion step + //so the result type is the head of the Typlist and stop! + typedef typename TypeList::head type; +}; + +//////////////////////////////////////////////////////////// +// run-time type switch +template< + typename TypeList, + int Index = 0, + bool Stop=(Index==PixelTypeLength::value) +> struct PixelTypeSwitch; + +template +struct PixelTypeSwitch +{ + template + bool operator() (int i, F& f) + { + if( i == Index) + { + return f.operator()::type>(); + } + else + { + PixelTypeSwitch next; + return next(i, f); + } + } +}; + +template +struct PixelTypeSwitch +{ + template + bool operator() (int, F&) + { + throw std::out_of_range("Index out of range"); + } +}; + +template +struct AccessItkImageFunctor +{ + typedef void (*CallBack)(T1,T2,T3); + + AccessItkImageFunctor(X* cl, CallBack callBack, const mitk::Image* mitkImage, T1 t1 = T1(), T2 t2 = T2(), T3 t3 = T3()) + : cl(cl), callBack(callBack), mitkImage(mitkImage), pixelType(mitkImage->GetPixelType()), + t1(t1), t2(t2), t3(t3) + { + + } + + template + bool operator() () + { + if (pixelType != typeid(PixelType)) return false; + if (mitkImage->GetDimension() != VDimension) return false; + + const_cast(mitkImage)->Update(); + + typedef itk::Image ImageType; + typedef mitk::ImageToItk ImageToItkType; + itk::SmartPointer imagetoitk = ImageToItkType::New(); + imagetoitk->SetInput(mitkImage); + imagetoitk->Update(); + cl->*callBack(imagetoitk->GetOutput(), t1, t2, t3); + return true; + } + +private: + + X* cl; + CallBack callBack; + + const mitk::Image* mitkImage; + const mitk::PixelType& pixelType; + T1 t1; + T2 t2; + T3 t3; +}; + + +} // namespace mitk + diff --git a/Core/Code/Algorithms/mitkRGBToRGBACastImageFilter.cpp b/Core/Code/Algorithms/mitkRGBToRGBACastImageFilter.cpp index 9f39a83f51..0da6869236 100644 --- a/Core/Code/Algorithms/mitkRGBToRGBACastImageFilter.cpp +++ b/Core/Code/Algorithms/mitkRGBToRGBACastImageFilter.cpp @@ -1,223 +1,223 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-04-23 13:50:34 +0200 (Do, 23 Apr 2009) $ Version: $Revision: 16947 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkRGBToRGBACastImageFilter.h" #include "mitkImageTimeSelector.h" #include "mitkProperties.h" #include "mitkImageAccessByItk.h" #include "mitkImageToItk.h" #include #include #include #include mitk::RGBToRGBACastImageFilter::RGBToRGBACastImageFilter() { this->SetNumberOfInputs(1); this->SetNumberOfRequiredInputs(1); m_InputTimeSelector = mitk::ImageTimeSelector::New(); m_OutputTimeSelector = mitk::ImageTimeSelector::New(); } mitk::RGBToRGBACastImageFilter::~RGBToRGBACastImageFilter() { } bool mitk::RGBToRGBACastImageFilter::IsRGBImage( const mitk::Image *image ) { const mitk::PixelType &inputPixelType = image->GetPixelType(); if ( (inputPixelType == typeid( UCRGBPixelType) ) || (inputPixelType == typeid( USRGBPixelType) ) || (inputPixelType == typeid( FloatRGBPixelType) ) || (inputPixelType == typeid( DoubleRGBPixelType) ) ) { return true; } return false; } void mitk::RGBToRGBACastImageFilter::GenerateInputRequestedRegion() { Superclass::GenerateInputRequestedRegion(); mitk::Image* output = this->GetOutput(); mitk::Image* input = const_cast< mitk::Image * > ( this->GetInput() ); if ( !output->IsInitialized() ) { return; } input->SetRequestedRegionToLargestPossibleRegion(); //GenerateTimeInInputRegion(output, input); } void mitk::RGBToRGBACastImageFilter::GenerateOutputInformation() { mitk::Image::ConstPointer input = this->GetInput(); mitk::Image::Pointer output = this->GetOutput(); if ((output->IsInitialized()) && (this->GetMTime() <= m_TimeOfHeaderInitialization.GetMTime())) return; itkDebugMacro(<<"GenerateOutputInformation()"); // Initialize RGBA output with same pixel type as input image const mitk::PixelType &inputPixelType = input->GetPixelType(); if ( inputPixelType == typeid( UCRGBPixelType ) ) { mitk::PixelType outputPixelType( typeid( unsigned char ), 4, itk::ImageIOBase::RGBA ); output->Initialize( outputPixelType, *input->GetTimeSlicedGeometry() ); } else if ( inputPixelType == typeid( USRGBPixelType ) ) { mitk::PixelType outputPixelType( typeid( unsigned short ), 4, itk::ImageIOBase::RGBA ); output->Initialize( outputPixelType, *input->GetTimeSlicedGeometry() ); } else if ( inputPixelType == typeid( FloatRGBPixelType ) ) { mitk::PixelType outputPixelType( typeid( float ), 4, itk::ImageIOBase::RGBA ); output->Initialize( outputPixelType, *input->GetTimeSlicedGeometry() ); } else if ( inputPixelType == typeid( DoubleRGBPixelType ) ) { mitk::PixelType outputPixelType( typeid( double ), 4, itk::ImageIOBase::RGBA ); output->Initialize( outputPixelType, *input->GetTimeSlicedGeometry() ); } output->SetPropertyList(input->GetPropertyList()->Clone()); m_TimeOfHeaderInitialization.Modified(); } void mitk::RGBToRGBACastImageFilter::GenerateData() { mitk::Image::ConstPointer input = this->GetInput(); mitk::Image::Pointer output = this->GetOutput(); if( !output->IsInitialized() ) { return; } m_InputTimeSelector->SetInput(input); m_OutputTimeSelector->SetInput(this->GetOutput()); mitk::Image::RegionType outputRegion = output->GetRequestedRegion(); const mitk::TimeSlicedGeometry *outputTimeGeometry = output->GetTimeSlicedGeometry(); const mitk::TimeSlicedGeometry *inputTimeGeometry = input->GetTimeSlicedGeometry(); ScalarType timeInMS; int timestep=0; int tstart=outputRegion.GetIndex(3); int tmax=tstart+outputRegion.GetSize(3); int t; for(t=tstart;tTimeStepToMS( t ); timestep = inputTimeGeometry->MSToTimeStep( timeInMS ); m_InputTimeSelector->SetTimeNr(timestep); m_InputTimeSelector->UpdateLargestPossibleRegion(); m_OutputTimeSelector->SetTimeNr(t); m_OutputTimeSelector->UpdateLargestPossibleRegion(); mitk::Image *image = m_InputTimeSelector->GetOutput(); const mitk::PixelType &pixelType = image->GetPixelType(); // Check if the pixel type is supported if ( pixelType == typeid( UCRGBPixelType ) ) { - AccessFixedPixelTypeByItk_2( image, InternalCast, UCRGBPixelType, this, 255 ); + AccessFixedPixelTypeByItk_2( image, InternalCast, (UCRGBPixelType), this, 255 ); } else if ( pixelType == typeid( USRGBPixelType ) ) { - AccessFixedPixelTypeByItk_2( image, InternalCast, USRGBPixelType, this, 65535 ); + AccessFixedPixelTypeByItk_2( image, InternalCast, (USRGBPixelType), this, 65535 ); } else if ( pixelType == typeid( FloatRGBPixelType ) ) { - AccessFixedPixelTypeByItk_2( image, InternalCast, FloatRGBPixelType, this, 1.0 ); + AccessFixedPixelTypeByItk_2( image, InternalCast, (FloatRGBPixelType), this, 1.0 ); } else if ( pixelType == typeid( DoubleRGBPixelType ) ) { - AccessFixedPixelTypeByItk_2( image, InternalCast, DoubleRGBPixelType, this, 1.0 ); + AccessFixedPixelTypeByItk_2( image, InternalCast, (DoubleRGBPixelType), this, 1.0 ); } else { // Otherwise, write warning and graft input to output // ...TBD... } } m_TimeOfHeaderInitialization.Modified(); } template < typename TPixel, unsigned int VImageDimension > void mitk::RGBToRGBACastImageFilter::InternalCast( itk::Image< TPixel, VImageDimension > *inputItkImage, mitk::RGBToRGBACastImageFilter *addComponentFilter, typename TPixel::ComponentType defaultAlpha ) { typedef TPixel InputPixelType; typedef itk::RGBAPixel< typename TPixel::ComponentType > OutputPixelType; typedef itk::Image< InputPixelType, VImageDimension > InputImageType; typedef itk::Image< OutputPixelType, VImageDimension > OutputImageType; typedef itk::ImageRegionConstIterator< InputImageType > InputImageIteratorType; typedef itk::ImageRegionIteratorWithIndex< OutputImageType > OutputImageIteratorType; typename mitk::ImageToItk< OutputImageType >::Pointer outputimagetoitk = mitk::ImageToItk< OutputImageType >::New(); outputimagetoitk->SetInput(addComponentFilter->m_OutputTimeSelector->GetOutput()); outputimagetoitk->Update(); typename OutputImageType::Pointer outputItkImage = outputimagetoitk->GetOutput(); // create the iterators typename InputImageType::RegionType inputRegionOfInterest = inputItkImage->GetLargestPossibleRegion(); InputImageIteratorType inputIt( inputItkImage, inputRegionOfInterest ); OutputImageIteratorType outputIt( outputItkImage, inputRegionOfInterest ); for ( inputIt.GoToBegin(), outputIt.GoToBegin(); !inputIt.IsAtEnd(); ++inputIt, ++outputIt ) { typename InputPixelType::Iterator pixelInputIt = inputIt.Get().Begin(); typename OutputPixelType::Iterator pixelOutputIt = outputIt.Get().Begin(); *pixelOutputIt++ = *pixelInputIt++; *pixelOutputIt++ = *pixelInputIt++; *pixelOutputIt++ = *pixelInputIt++; *pixelOutputIt = defaultAlpha; } } diff --git a/Core/Code/IO/mitkItkPictureWrite.cpp b/Core/Code/IO/mitkItkPictureWrite.cpp index 0913526280..d8fa5aa18b 100644 --- a/Core/Code/IO/mitkItkPictureWrite.cpp +++ b/Core/Code/IO/mitkItkPictureWrite.cpp @@ -1,125 +1,128 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkItkPictureWrite.h" -#include "mitkImageAccessByItk.h" +#include #include #include #include template < typename TPixel, unsigned int VImageDimension > void _mitkItkPictureWrite(itk::Image< TPixel, VImageDimension >* itkImage, const std::string& fileName) { typedef itk::Image< TPixel, VImageDimension > TImageType; typedef itk::Image OutputImage3DType; typedef itk::Image OutputImage2DType; typename itk::RescaleIntensityImageFilter::Pointer rescaler = itk::RescaleIntensityImageFilter::New(); rescaler->SetInput(itkImage); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); itk::NumericSeriesFileNames::Pointer numericFileNameWriter = itk::NumericSeriesFileNames::New(); itk::ImageSeriesWriter::Pointer writer = itk::ImageSeriesWriter::New(); int numberOfSlices = itkImage->GetLargestPossibleRegion().GetSize()[2]; std::string finalFileName = fileName; std::string::size_type pos = fileName.find_last_of(".",fileName.length()-1); if(pos==std::string::npos) finalFileName.append(".%d.png"); else finalFileName.insert(pos,".%d"); numericFileNameWriter->SetEndIndex(numberOfSlices); numericFileNameWriter->SetSeriesFormat(finalFileName.c_str()); numericFileNameWriter->Modified(); writer->SetInput( rescaler->GetOutput() ); writer->SetFileNames(numericFileNameWriter->GetFileNames()); writer->Update(); } -InstantiateAccessFunction_1(_mitkItkPictureWrite, const std::string&); +#define InstantiateAccessFunction__mitkItkPictureWrite(pixelType, dim) \ + template MITK_CORE_EXPORT void _mitkItkPictureWrite(itk::Image*, const std::string&); + +InstantiateAccessFunction(_mitkItkPictureWrite) // typedef itk::Image, 2> itkImageRGBUC2; // template <> void _mitkItkImageWrite, 2>(itkImageRGBUC2* itkImage, const std::string& fileName) // { // typedef itkImageRGBUC2 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; // // typedef itk::Image, 3> itkImageRGBUC3; // template <> void _mitkItkImageWrite, 3>(itkImageRGBUC3* itkImage, const std::string& fileName) // { // typedef itkImageRGBUC3 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; // // typedef itk::Image, 3> itkImageDTIF3; // template <> void _mitkItkImageWrite, 3>(itkImageDTIF3* itkImage, const std::string& fileName) // { // typedef itkImageDTIF3 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; // // typedef itk::Image, 3> itkImageDTID3; // template <> void _mitkItkImageWrite, 3>(itkImageDTID3* itkImage, const std::string& fileName) // { // typedef itkImageDTID3 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; // // typedef itk::Image, 2> itkImageDTIF2; // template <> void _mitkItkImageWrite, 2>(itkImageDTIF2* itkImage, const std::string& fileName) // { // typedef itkImageDTIF2 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; // // typedef itk::Image, 2> itkImageDTID2; // template <> void _mitkItkImageWrite, 2>(itkImageDTID2* itkImage, const std::string& fileName) // { // typedef itkImageDTID2 TImageType; // // itk::ImageFileWriter::Pointer writer = itk::ImageFileWriter::New(); // writer->SetInput( itkImage ); // writer->SetFileName( fileName.c_str() ); // writer->Update(); // }; diff --git a/Core/Code/Testing/files.cmake b/Core/Code/Testing/files.cmake index 0fae44fb29..bceafab826 100644 --- a/Core/Code/Testing/files.cmake +++ b/Core/Code/Testing/files.cmake @@ -1,92 +1,94 @@ # tests with no extra command line parameter SET(MODULE_TESTS + mitkAccessByItkTest.cpp mitkCoreObjectFactoryTest.cpp mitkPointSetWriterTest.cpp mitkMaterialTest.cpp mitkActionTest.cpp mitkEnumerationPropertyTest.cpp mitkEventTest.cpp mitkFocusManagerTest.cpp mitkGenericPropertyTest.cpp mitkGeometry3DTest.cpp mitkGeometryDataToSurfaceFilterTest.cpp mitkGlobalInteractionTest.cpp mitkImageDataItemTest.cpp #mitkImageMapper2DTest.cpp mitkImageGeneratorTest.cpp mitkBaseDataTest.cpp #mitkImageToItkTest.cpp + mitkInstantiateAccessFunctionTest.cpp mitkInteractorTest.cpp mitkITKThreadingTest.cpp # mitkLevelWindowManagerTest.cpp mitkLevelWindowTest.cpp mitkMessageTest.cpp #mitkPipelineSmartPointerCorrectnessTest.cpp mitkPixelTypeTest.cpp mitkPlaneGeometryTest.cpp mitkPointSetFileIOTest.cpp mitkPointSetTest.cpp mitkPointSetInteractorTest.cpp mitkPropertyListTest.cpp #mitkRegistrationBaseTest.cpp #mitkSegmentationInterpolationTest.cpp mitkSlicedGeometry3DTest.cpp mitkSliceNavigationControllerTest.cpp mitkStateMachineTest.cpp mitkStateTest.cpp mitkSurfaceTest.cpp mitkSurfaceToSurfaceFilterTest.cpp mitkTimeSlicedGeometryTest.cpp mitkTransitionTest.cpp mitkUndoControllerTest.cpp mitkVtkWidgetRenderingTest.cpp mitkVerboseLimitedLinearUndoTest.cpp mitkWeakPointerTest.cpp mitkTransferFunctionTest.cpp #mitkAbstractTransformGeometryTest.cpp #mitkPicFileIOTest.cpp mitkStepperTest.cpp itkTotalVariationDenoisingImageFilterTest.cpp mitkRenderingManagerTest.cpp vtkMitkThickSlicesFilterTest.cpp mitkNodePredicateSourceTest.cpp mitkVectorTest.cpp ) # test with image filename as an extra command line parameter SET(MODULE_IMAGE_TESTS mitkSurfaceVtkWriterTest.cpp mitkPicFileWriterTest.cpp #mitkImageSliceSelectorTest.cpp mitkImageTimeSelectorTest.cpp mitkPicFileReaderTest.cpp # mitkVtkPropRendererTest.cpp mitkDataNodeFactoryTest.cpp #mitkSTLFileReaderTest.cpp ) # list of images for which the tests are run SET(MODULE_TESTIMAGES US4DCyl.pic.gz Pic3D.pic.gz Pic2DplusT.pic.gz BallBinary30x30x30.pic.gz binary.stl ball.stl ) SET(MODULE_CUSTOM_TESTS #mitkLabeledImageToSurfaceFilterTest.cpp #mitkExternalToolsTest.cpp mitkDataStorageTest.cpp mitkDataNodeTest.cpp mitkDicomSeriesReaderTest.cpp mitkDICOMLocaleTest.cpp mitkEventMapperTest.cpp mitkNodeDependentPointSetInteractorTest.cpp mitkStateMachineFactoryTest.cpp mitkPointSetLocaleTest.cpp mitkImageTest.cpp mitkImageWriterTest.cpp ) diff --git a/Core/Code/Testing/mitkAccessByItkTest.cpp b/Core/Code/Testing/mitkAccessByItkTest.cpp new file mode 100644 index 0000000000..b2a823cf2f --- /dev/null +++ b/Core/Code/Testing/mitkAccessByItkTest.cpp @@ -0,0 +1,240 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision: 17495 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include + +#include "mitkTestingMacros.h" + +#include +#include + +#define TestImageType(type, dim) \ + MITK_TEST_CONDITION(typeid(type) == typeid(TPixel) && dim == VDimension, "Checking for correct type itk::Image<" #type "," #dim ">") + +class AccessByItkTest +{ +public: + + typedef AccessByItkTest Self; + + typedef itk::Image IntImage2D; + typedef itk::Image IntImage3D; + typedef itk::Image FloatImage2D; + typedef itk::Image FloatImage3D; + + enum EImageType { + Unknown = 0, + Int2D, + Int3D, + Float2D, + Float3D + }; + + void testAccessByItk() + { + mitk::Image::Pointer mitkIntImage2D = createMitkImage(); + mitk::Image::ConstPointer mitkIntImage3D(createMitkImage()); + mitk::Image::ConstPointer mitkFloatImage2D(createMitkImage()); + mitk::Image::Pointer mitkFloatImage3D = createMitkImage(); + + AccessByItk(mitkIntImage2D, AccessItkImage); + AccessByItk(mitkIntImage3D, AccessItkImage); + AccessByItk(mitkFloatImage2D, AccessItkImage); + AccessByItk(mitkFloatImage3D, AccessItkImage); + + AccessByItk_n(mitkIntImage2D, AccessItkImage, (Int2D, 2)); + AccessByItk_n(mitkIntImage3D, AccessItkImage, (Int3D, 2)); + AccessByItk_n(mitkFloatImage2D, AccessItkImage, (Float2D, 2)); + AccessByItk_n(mitkFloatImage3D, AccessItkImage, (Float3D, 2)); + } + + void testAccessFixedDimensionByItk() + { + mitk::Image::Pointer mitkIntImage2D = createMitkImage(); + mitk::Image::ConstPointer mitkIntImage3D(createMitkImage()); + mitk::Image::ConstPointer mitkFloatImage2D(createMitkImage()); + mitk::Image::Pointer mitkFloatImage3D = createMitkImage(); + + AccessFixedDimensionByItk(mitkIntImage2D, AccessItkImage, 2); + AccessFixedDimensionByItk(mitkIntImage3D, AccessItkImage, 3); + AccessFixedDimensionByItk(mitkFloatImage2D, AccessItkImage, 2); + AccessFixedDimensionByItk(mitkFloatImage3D, AccessItkImage, 3); + + AccessFixedDimensionByItk_n(mitkIntImage2D, AccessItkImage, 2, (Int2D, 2)); + AccessFixedDimensionByItk_n(mitkIntImage3D, AccessItkImage, 3, (Int3D, 2)); + AccessFixedDimensionByItk_n(mitkFloatImage2D, AccessItkImage, 2, (Float2D, 2)); + AccessFixedDimensionByItk_n(mitkFloatImage3D, AccessItkImage, 3, (Float3D, 2)); + + // Test for wrong dimension + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedDimensionByItk(mitkFloatImage3D, AccessItkImage, 2); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedDimensionByItk_n(mitkFloatImage3D, AccessItkImage, 2, (Float3D, 2)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + } + + void testAccessFixedPixelTypeByItk() + { + mitk::Image::Pointer mitkIntImage2D = createMitkImage(); + mitk::Image::ConstPointer mitkIntImage3D(createMitkImage()); + mitk::Image::ConstPointer mitkFloatImage2D(createMitkImage()); + mitk::Image::Pointer mitkFloatImage3D = createMitkImage(); + + AccessFixedPixelTypeByItk(mitkIntImage2D, AccessItkImage, (int)(float)); + AccessFixedPixelTypeByItk(mitkIntImage3D, AccessItkImage, (int)(float)); + AccessFixedPixelTypeByItk(mitkFloatImage2D, AccessItkImage, (int)(float)); + AccessFixedPixelTypeByItk(mitkFloatImage3D, AccessItkImage, (int)(float)); + + AccessFixedPixelTypeByItk_n(mitkIntImage2D, AccessItkImage, (int)(float), (Int2D, 2)); + AccessFixedPixelTypeByItk_n(mitkIntImage3D, AccessItkImage, (int)(float), (Int3D, 2)); + AccessFixedPixelTypeByItk_n(mitkFloatImage2D, AccessItkImage, (int)(float), (Float2D, 2)); + AccessFixedPixelTypeByItk_n(mitkFloatImage3D, AccessItkImage, (int)(float), (Float3D, 2)); + + // Test for wrong pixel type + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedPixelTypeByItk(mitkFloatImage3D, AccessItkImage, (int)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedPixelTypeByItk_n(mitkFloatImage3D, AccessItkImage, (int), (Float3D, 2)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + } + + void testAccessFixedTypeByItk() + { + mitk::Image::Pointer mitkIntImage2D = createMitkImage(); + mitk::Image::ConstPointer mitkIntImage3D(createMitkImage()); + mitk::Image::ConstPointer mitkFloatImage2D(createMitkImage()); + mitk::Image::Pointer mitkFloatImage3D = createMitkImage(); + + AccessFixedTypeByItk(mitkIntImage2D, AccessItkImage, (int)(float), (2)(3)); + AccessFixedTypeByItk(mitkIntImage3D, AccessItkImage, (int)(float), (2)(3)); + AccessFixedTypeByItk(mitkFloatImage2D, AccessItkImage, (int)(float), (2)(3)); + AccessFixedTypeByItk(mitkFloatImage3D, AccessItkImage, (int)(float), (2)(3)); + + AccessFixedTypeByItk_n(mitkIntImage2D, AccessItkImage, (int)(float), (2)(3), (Int2D, 2)); + AccessFixedTypeByItk_n(mitkIntImage3D, AccessItkImage, (int)(float), (2)(3), (Int3D, 2)); + AccessFixedTypeByItk_n(mitkFloatImage2D, AccessItkImage, (int)(float), (2)(3), (Float2D, 2)); + AccessFixedTypeByItk_n(mitkFloatImage3D, AccessItkImage, (int)(float), (2)(3), (Float3D, 2)); + + // Test for wrong dimension + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedTypeByItk(mitkFloatImage3D, AccessItkImage, (float), (2)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedTypeByItk_n(mitkFloatImage3D, AccessItkImage, (float), (2), (Float3D, 2)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + // Test for wrong pixel type + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedTypeByItk(mitkFloatImage3D, AccessItkImage, (int), (3)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + + MITK_TEST_FOR_EXCEPTION_BEGIN(const mitk::AccessByItkException&) + AccessFixedTypeByItk_n(mitkFloatImage3D, AccessItkImage, (int), (3), (Float3D, 2)); + MITK_TEST_FOR_EXCEPTION_END(const mitk::AccessByItkException&) + } + + void testAccessTwoImagesFixedDimensionByItk() + { + mitk::Image::Pointer mitkIntImage2D = createMitkImage(); + mitk::Image::ConstPointer mitkFloatImage2D(createMitkImage()); + + AccessTwoImagesFixedDimensionByItk(mitkIntImage2D, mitkFloatImage2D, AccessTwoItkImages, 2); + } + + template + void AccessItkImage(itk::Image*, + EImageType param1 = Unknown, int param2 = 0, int param3 = 0) + { + switch (param1) + { + case Int2D: TestImageType(int , 2) break; + case Int3D: TestImageType(int, 3) break; + case Float2D: TestImageType(float, 2) break; + case Float3D: TestImageType(float, 3) break; + default: break; + } + + if (param2) + { + MITK_TEST_CONDITION(param2 == 2, "Checking for correct second parameter") + } + if (param3) + { + MITK_TEST_CONDITION(param3 == 3, "Checking for correct third parameter") + } + } + +private: + + template + void AccessTwoItkImages(itk::Image* itkImage1, itk::Image* itkImage2) + { + if (!(typeid(int) == typeid(TPixel1) && typeid(float) == typeid(TPixel2) && + VDimension1 == 2 && VDimension2 == 2)) + { + throw std::runtime_error("Image type mismatch"); + } + } + + template + mitk::Image::Pointer createMitkImage() + { + typename ImageType::Pointer itkImage = ImageType::New(); + typename ImageType::IndexType start; + start.Fill(0); + typename ImageType::SizeType size; + size.Fill(3); + typename ImageType::RegionType region; + region.SetSize(size); + region.SetIndex(start); + itkImage->SetRegions(region); + itkImage->Allocate(); + return mitk::GrabItkImageMemory(itkImage); + } +}; + +int mitkAccessByItkTest(int /*argc*/, char* /*argv*/[]) +{ + + MITK_TEST_BEGIN("AccessByItk") + + AccessByItkTest accessTest; + + MITK_TEST_OUTPUT(<< "Testing AccessByItk macro") + accessTest.testAccessByItk(); + + MITK_TEST_OUTPUT(<< "Testing AccessFixedDimensionByItk macro") + accessTest.testAccessFixedDimensionByItk(); + + MITK_TEST_OUTPUT(<< "Testing AccessFixedTypeByItk macro") + accessTest.testAccessFixedTypeByItk(); + + MITK_TEST_OUTPUT(<< "Testing AccessFixedPixelTypeByItk macro") + accessTest.testAccessFixedPixelTypeByItk(); + + MITK_TEST_OUTPUT(<< "Testing AccessTwoImagesFixedDimensionByItk macro") + accessTest.testAccessTwoImagesFixedDimensionByItk(); + + MITK_TEST_END() + +} diff --git a/Core/Code/Testing/mitkImageToItkTest.cpp b/Core/Code/Testing/mitkImageToItkTest.cpp index 5ac76c1c02..df403c3a1b 100644 --- a/Core/Code/Testing/mitkImageToItkTest.cpp +++ b/Core/Code/Testing/mitkImageToItkTest.cpp @@ -1,272 +1,271 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkImage.h" -#include "mitkImageAccessByItk.h" #include "mitkITKImageImport.h" #include "mitkReferenceCountWatcher.h" #include "itkDiffusionTensor3D.h" #include "itkConfidenceDiffusionTensor3D.h" #include #include int compareGeometries(mitk::Geometry3D* geometry1, mitk::Geometry3D* geometry2) { std::cout << "Testing transfer of GetGeometry()->GetOrigin(): " << std::flush; if(mitk::Equal(geometry1->GetOrigin(), geometry2->GetOrigin()) == false) { std::cout<<"[FAILED]"<GetSpacing(): " << std::flush; if(mitk::Equal(geometry1->GetSpacing(), geometry2->GetSpacing()) == false) { std::cout<<"[FAILED]"<GetAxisVector(" << i << "): " << std::flush; if(mitk::Equal(geometry1->GetAxisVector(i), geometry2->GetAxisVector(i)) == false) { std::cout<<"[FAILED]"< int testBackCasting(mitk::Image* imgMem, typename ImageType::Pointer & itkImage, bool disconnectAfterImport) { int result; if(itkImage.IsNull()) { std::cout<<"[FAILED]"<GetBufferPointer(); if(p==NULL) { std::cout<<"[FAILED]"<GetGeometry(), mitkImage->GetGeometry()); if(result != EXIT_SUCCESS) return result; std::cout << "Testing whether data after mitk::CastToMitkImage is available: " << std::flush; if(mitkImage->IsChannelSet()==false) { std::cout<<"[FAILED]"<DisconnectPipeline(); std::cout<<"[PASSED]"<GetGeometry(), mitkImage->GetGeometry()); if(result != EXIT_SUCCESS) return result; std::cout << "Testing whether data after mitk::ImportItkImage is available: " << std::flush; if(mitkImage->IsChannelSet()==false) { std::cout<<"[FAILED]"< int testImageToItkAndBack(mitk::Image* imgMem) { int result; int *p = (int*)imgMem->GetData(); if(p==NULL) { std::cout<<"[FAILED]"< ImageType; typename mitk::ImageToItk::Pointer toItkFilter = mitk::ImageToItk::New(); toItkFilter->SetInput(imgMem); toItkFilter->Update(); typename ImageType::Pointer itkImage = toItkFilter->GetOutput(); result = testBackCasting(imgMem, itkImage, false); if(result != EXIT_SUCCESS) return result; std::cout << "Testing mitk::ImageToItk (with subsequent DisconnectPipeline, see below): " << std::flush; result = testBackCasting(imgMem, itkImage, true); if(result != EXIT_SUCCESS) return result; return EXIT_SUCCESS; } int mitkImageToItkTest(int /*argc*/, char* /*argv*/[]) { int result; //Create Image out of nowhere mitk::Image::Pointer imgMem; mitk::PixelType pt(typeid(int)); std::cout << "Testing creation of Image: "; imgMem=mitk::Image::New(); if(imgMem.IsNull()) { std::cout<<"[FAILED]"<InitializeStandardPlane(100, 100, right, bottom, &spacing); planegeometry->SetOrigin(origin); std::cout << "done" << std::endl; std::cout << "Testing Initialize(const mitk::PixelType& type, int sDim, const mitk::PlaneGeometry& geometry) and GetData(): "; imgMem->Initialize(mitk::PixelType(typeid(int)), 40, *planegeometry); //XXXXXXXXXXXXXXXXXXXXXCHANGE! result = testImageToItkAndBack<3>(imgMem); if(result != EXIT_SUCCESS) return result; std::cout << "Testing mitk::CastToItkImage with casting (mitk int to itk float): " << std::flush; typedef itk::Image ImageType; ImageType::Pointer itkImage; mitk::CastToItkImage( imgMem, itkImage ); result = testBackCasting(imgMem, itkImage, false); if(result != EXIT_SUCCESS) return result; result = testBackCasting(imgMem, itkImage, true); if(result != EXIT_SUCCESS) return result; std::cout << "Testing Initialize(const mitk::PixelType& type, int sDim, const mitk::PlaneGeometry& geometry) and GetData(): "; imgMem->Initialize(mitk::PixelType(typeid(int)), 40, *planegeometry, false, 1, 6); result = testImageToItkAndBack<4>(imgMem); if(result != EXIT_SUCCESS) return result; std::cout << "Testing mitk::CastToItkImage again (mitk float to itk float): " << std::flush; imgMem->Initialize(mitk::PixelType(typeid(float)), 40, *planegeometry); mitk::CastToItkImage( imgMem, itkImage ); std::cout<<"[PASSED]"<GetChannelData().GetPointer(); std::cout << "Testing destruction of original mitk::Image: " << std::flush; imgMem = NULL; std::cout<<"[PASSED]"<GetReferenceCount()-1 != 1) // 1 count by imageDataItem itself { std::cout<< imageDataItem->GetReferenceCount()-1 << " != 1. [FAILED]" << std::endl; return EXIT_FAILURE; } std::cout<<"[PASSED]"<GetReferenceCount()-1 != 0) // 1 count by imageDataItem itself { std::cout<< imageDataItem->GetReferenceCount()-1 << " != 0. [FAILED]" << std::endl; return EXIT_FAILURE; } std::cout<<"[PASSED]"<,3>::Pointer diffImage; imgMem->Initialize(mitk::PixelType(typeid(itk::DiffusionTensor3D)), 40, *planegeometry); mitk::CastToItkImage( imgMem, diffImage ); imgMem->InitializeByItk(diffImage.GetPointer()); std::cout<<"[PASSED]"<,3>::Pointer diffImage2; imgMem->Initialize(mitk::PixelType(typeid(itk::DiffusionTensor3D)), 40, *planegeometry); mitk::CastToItkImage( imgMem, diffImage2 ); imgMem->InitializeByItk(diffImage2.GetPointer()); std::cout<<"[PASSED]"<,3>::Pointer confDiffImage; imgMem->Initialize(mitk::PixelType(typeid(itk::ConfidenceDiffusionTensor3D)), 40, *planegeometry); mitk::CastToItkImage( imgMem, confDiffImage ); imgMem->InitializeByItk(confDiffImage.GetPointer()); std::cout<<"[PASSED]"<,3>::Pointer confDiffImage2; imgMem->Initialize(mitk::PixelType(typeid(itk::ConfidenceDiffusionTensor3D)), 40, *planegeometry); mitk::CastToItkImage( imgMem, confDiffImage2 ); imgMem->InitializeByItk(confDiffImage2.GetPointer()); std::cout<<"[PASSED]"< + +// This is a "compile test", meaning that this file calls all InstantiateAccessFunction macros +// and must successfully compile. +class InstantiateAccessFunctionTest +{ +public: + + template + void AccessItkImage(itk::Image*, int) + { } + +}; + +#define InstantiateAccessFunction_AccessItkImage(Pixel, Dim) \ + template void InstantiateAccessFunctionTest::AccessItkImage(itk::Image*, int); + +InstantiateAccessFunctionForFixedPixelType(AccessItkImage, (float)(double)) +InstantiateAccessFunctionForIntegralPixelTypes(AccessItkImage) + +int mitkInstantiateAccessFunctionTest(int /*argc*/, char* /*argv*/[]) +{ + + MITK_TEST_BEGIN("InstantiateAccessFunction") + + MITK_TEST_OUTPUT(<< "Successfully compiled") + + MITK_TEST_END() + +} diff --git a/Core/Code/files.cmake b/Core/Code/files.cmake index 99a9f7f4e8..f4a7a6bf40 100644 --- a/Core/Code/files.cmake +++ b/Core/Code/files.cmake @@ -1,226 +1,275 @@ SET(H_FILES + Algorithms/itkImportMitkImageContainer.h + Algorithms/itkImportMitkImageContainer.txx Algorithms/itkLocalVariationImageFilter.h + Algorithms/itkLocalVariationImageFilter.txx + Algorithms/itkMITKScalarImageToHistogramGenerator.h + Algorithms/itkMITKScalarImageToHistogramGenerator.txx Algorithms/itkTotalVariationDenoisingImageFilter.h + Algorithms/itkTotalVariationDenoisingImageFilter.txx Algorithms/itkTotalVariationSingleIterationImageFilter.h + Algorithms/itkTotalVariationSingleIterationImageFilter.txx + + Algorithms/mitkImageAccessByItk.h + Algorithms/mitkImageCast.h + Algorithms/mitkImageToItk.h + Algorithms/mitkImageToItk.txx + Algorithms/mitkInstantiateAccessFunctions.h + Algorithms/mitkITKImageImport.h + Algorithms/mitkITKImageImport.txx + Algorithms/mitkPixelTypeList.h + + # Preprocessor macros taken from Boost + Algorithms/mitkPPArithmeticDec.h + Algorithms/mitkPPArgCount.h + Algorithms/mitkPPCat.h + Algorithms/mitkPPConfig.h + Algorithms/mitkPPControlExprIIf.h + Algorithms/mitkPPControlIf.h + Algorithms/mitkPPControlIIf.h + Algorithms/mitkPPDebugError.h + Algorithms/mitkPPDetailAutoRec.h + Algorithms/mitkPPDetailDMCAutoRec.h + Algorithms/mitkPPExpand.h + Algorithms/mitkPPFacilitiesEmpty.h + Algorithms/mitkPPFacilitiesExpand.h + Algorithms/mitkPPLogicalBool.h + Algorithms/mitkPPRepetitionDetailDMCFor.h + Algorithms/mitkPPRepetitionDetailEDGFor.h + Algorithms/mitkPPRepetitionDetailFor.h + Algorithms/mitkPPRepetitionDetailMSVCFor.h + Algorithms/mitkPPRepetitionFor.h + Algorithms/mitkPPSeqElem.h + Algorithms/mitkPPSeqForEach.h + Algorithms/mitkPPSeqForEachProduct.h + Algorithms/mitkPPSeq.h + Algorithms/mitkPPSeqEnum.h + Algorithms/mitkPPSeqSize.h + Algorithms/mitkPPSeqToTuple.h + Algorithms/mitkPPStringize.h + Algorithms/mitkPPTupleEat.h + Algorithms/mitkPPTupleElem.h + Algorithms/mitkPPTupleRem.h + DataManagement/mitkCommon.h Interactions/mitkEventMapperAddOn.h ) SET(CPP_FILES Algorithms/mitkBaseDataSource.cpp Algorithms/mitkBaseProcess.cpp Algorithms/mitkCoreObjectFactoryBase.cpp Algorithms/mitkCoreObjectFactory.cpp Algorithms/mitkDataNodeFactory.cpp Algorithms/mitkDataNodeSource.cpp Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp Algorithms/mitkHistogramGenerator.cpp Algorithms/mitkImageCaster.cpp Algorithms/mitkImageCastPart1.cpp Algorithms/mitkImageCastPart2.cpp Algorithms/mitkImageCastPart3.cpp Algorithms/mitkImageCastPart4.cpp Algorithms/mitkImageChannelSelector.cpp Algorithms/mitkImageSliceSelector.cpp Algorithms/mitkImageSource.cpp Algorithms/mitkImageTimeSelector.cpp Algorithms/mitkImageToImageFilter.cpp Algorithms/mitkPointSetSource.cpp Algorithms/mitkPointSetToPointSetFilter.cpp Algorithms/mitkRGBToRGBACastImageFilter.cpp Algorithms/mitkSubImageSelector.cpp Algorithms/mitkSurfaceSource.cpp Algorithms/mitkSurfaceToSurfaceFilter.cpp Algorithms/mitkUIDGenerator.cpp Algorithms/mitkVolumeCalculator.cpp Controllers/mitkBaseController.cpp Controllers/mitkCallbackFromGUIThread.cpp Controllers/mitkCameraController.cpp Controllers/mitkCameraRotationController.cpp Controllers/mitkFocusManager.cpp Controllers/mitkLimitedLinearUndo.cpp Controllers/mitkOperationEvent.cpp Controllers/mitkProgressBar.cpp Controllers/mitkRenderingManager.cpp Controllers/mitkSliceNavigationController.cpp Controllers/mitkSlicesCoordinator.cpp Controllers/mitkSlicesRotator.cpp Controllers/mitkSlicesSwiveller.cpp Controllers/mitkStatusBar.cpp Controllers/mitkStepper.cpp Controllers/mitkTestManager.cpp Controllers/mitkUndoController.cpp Controllers/mitkVerboseLimitedLinearUndo.cpp Controllers/mitkVtkInteractorCameraController.cpp Controllers/mitkVtkLayerController.cpp DataManagement/mitkAbstractTransformGeometry.cpp DataManagement/mitkAnnotationProperty.cpp DataManagement/mitkApplicationCursor.cpp DataManagement/mitkBaseData.cpp DataManagement/mitkBaseProperty.cpp DataManagement/mitkClippingProperty.cpp DataManagement/mitkColorProperty.cpp DataManagement/mitkDataStorage.cpp #DataManagement/mitkDataTree.cpp DataManagement/mitkDataNode.cpp #DataManagement/mitkDataTreeStorage.cpp DataManagement/mitkDisplayGeometry.cpp DataManagement/mitkEnumerationProperty.cpp DataManagement/mitkGeometry2D.cpp DataManagement/mitkGeometry2DData.cpp DataManagement/mitkGeometry3D.cpp DataManagement/mitkGeometryData.cpp DataManagement/mitkGroupTagProperty.cpp DataManagement/mitkImage.cpp DataManagement/mitkImageDataItem.cpp DataManagement/mitkLandmarkBasedCurvedGeometry.cpp DataManagement/mitkLandmarkProjectorBasedCurvedGeometry.cpp DataManagement/mitkLandmarkProjector.cpp DataManagement/mitkLevelWindow.cpp DataManagement/mitkLevelWindowManager.cpp DataManagement/mitkLevelWindowPreset.cpp DataManagement/mitkLevelWindowProperty.cpp DataManagement/mitkLookupTable.cpp DataManagement/mitkLookupTables.cpp # specializations of GenericLookupTable DataManagement/mitkMemoryUtilities.cpp DataManagement/mitkModalityProperty.cpp DataManagement/mitkModeOperation.cpp DataManagement/mitkNodePredicateAnd.cpp DataManagement/mitkNodePredicateBase.cpp DataManagement/mitkNodePredicateCompositeBase.cpp DataManagement/mitkNodePredicateData.cpp DataManagement/mitkNodePredicateDataType.cpp DataManagement/mitkNodePredicateDimension.cpp DataManagement/mitkNodePredicateFirstLevel.cpp DataManagement/mitkNodePredicateNot.cpp DataManagement/mitkNodePredicateOr.cpp DataManagement/mitkNodePredicateProperty.cpp DataManagement/mitkNodePredicateSource.cpp DataManagement/mitkPlaneOrientationProperty.cpp DataManagement/mitkPlaneGeometry.cpp DataManagement/mitkPlaneOperation.cpp DataManagement/mitkPointOperation.cpp DataManagement/mitkPointSet.cpp DataManagement/mitkProperties.cpp DataManagement/mitkPropertyList.cpp DataManagement/mitkRotationOperation.cpp DataManagement/mitkSlicedData.cpp DataManagement/mitkSlicedGeometry3D.cpp DataManagement/mitkSmartPointerProperty.cpp DataManagement/mitkStandaloneDataStorage.cpp DataManagement/mitkStateTransitionOperation.cpp DataManagement/mitkStringProperty.cpp DataManagement/mitkSurface.cpp DataManagement/mitkSurfaceOperation.cpp DataManagement/mitkThinPlateSplineCurvedGeometry.cpp DataManagement/mitkTimeSlicedGeometry.cpp DataManagement/mitkTransferFunction.cpp DataManagement/mitkTransferFunctionInitializer.cpp DataManagement/mitkVector.cpp DataManagement/mitkVtkInterpolationProperty.cpp DataManagement/mitkVtkRepresentationProperty.cpp DataManagement/mitkVtkResliceInterpolationProperty.cpp DataManagement/mitkVtkScalarModeProperty.cpp DataManagement/mitkVtkVolumeRenderingProperty.cpp DataManagement/mitkWeakPointerProperty.cpp DataManagement/mitkShaderProperty.cpp DataManagement/mitkResliceMethodProperty.cpp DataManagement/mitkMaterial.cpp Interactions/mitkAction.cpp Interactions/mitkAffineInteractor.cpp Interactions/mitkCoordinateSupplier.cpp Interactions/mitkDisplayCoordinateOperation.cpp Interactions/mitkDisplayInteractor.cpp Interactions/mitkDisplayPositionEvent.cpp Interactions/mitkDisplayVectorInteractor.cpp Interactions/mitkDisplayVectorInteractorLevelWindow.cpp Interactions/mitkDisplayVectorInteractorScroll.cpp Interactions/mitkEvent.cpp Interactions/mitkEventDescription.cpp Interactions/mitkEventMapper.cpp Interactions/mitkGlobalInteraction.cpp Interactions/mitkInteractor.cpp Interactions/mitkMouseMovePointSetInteractor.cpp Interactions/mitkMoveSurfaceInteractor.cpp Interactions/mitkNodeDepententPointSetInteractor.cpp Interactions/mitkPointSetInteractor.cpp Interactions/mitkPositionEvent.cpp Interactions/mitkPositionTracker.cpp Interactions/mitkState.cpp Interactions/mitkStateEvent.cpp Interactions/mitkStateMachine.cpp Interactions/mitkStateMachineFactory.cpp Interactions/mitkTransition.cpp Interactions/mitkWheelEvent.cpp Interactions/mitkKeyEvent.cpp Interactions/mitkVtkEventAdapter.cpp IO/mitkBaseDataIOFactory.cpp IO/mitkDicomSeriesReader.cpp IO/mitkFileReader.cpp IO/mitkFileSeriesReader.cpp IO/mitkFileWriter.cpp IO/mitkIpPicGet.c IO/mitkImageGenerator.cpp IO/mitkImageWriter.cpp IO/mitkImageWriterFactory.cpp IO/mitkItkImageFileIOFactory.cpp IO/mitkItkImageFileReader.cpp IO/mitkItkPictureWrite.cpp IO/mitkLookupTableProperty.cpp IO/mitkOperation.cpp IO/mitkPicFileIOFactory.cpp IO/mitkPicFileReader.cpp IO/mitkPicFileWriter.cpp IO/mitkPicHelper.cpp IO/mitkPicVolumeTimeSeriesIOFactory.cpp IO/mitkPicVolumeTimeSeriesReader.cpp IO/mitkPixelType.cpp IO/mitkPointSetIOFactory.cpp IO/mitkPointSetReader.cpp IO/mitkPointSetWriter.cpp IO/mitkPointSetWriterFactory.cpp IO/mitkRawImageFileReader.cpp IO/mitkStandardFileLocations.cpp IO/mitkSTLFileIOFactory.cpp IO/mitkSTLFileReader.cpp IO/mitkSurfaceVtkWriter.cpp IO/mitkSurfaceVtkWriterFactory.cpp IO/mitkVtiFileIOFactory.cpp IO/mitkVtiFileReader.cpp IO/mitkVtkImageIOFactory.cpp IO/mitkVtkImageReader.cpp IO/mitkVtkSurfaceIOFactory.cpp IO/mitkVtkSurfaceReader.cpp IO/vtkPointSetXMLParser.cpp IO/mitkLog.cpp Rendering/mitkBaseRenderer.cpp Rendering/mitkVtkMapper2D.cpp Rendering/mitkVtkMapper3D.cpp Rendering/mitkRenderWindowFrame.cpp Rendering/mitkGeometry2DDataMapper2D.cpp Rendering/mitkGeometry2DDataVtkMapper3D.cpp Rendering/mitkGLMapper2D.cpp Rendering/mitkGradientBackground.cpp Rendering/mitkManufacturerLogo.cpp Rendering/mitkMapper2D.cpp Rendering/mitkMapper3D.cpp Rendering/mitkMapper.cpp Rendering/mitkPointSetGLMapper2D.cpp Rendering/mitkPointSetVtkMapper3D.cpp Rendering/mitkPolyDataGLMapper2D.cpp Rendering/mitkSurfaceGLMapper2D.cpp Rendering/mitkSurfaceVtkMapper3D.cpp Rendering/mitkVolumeDataVtkMapper3D.cpp Rendering/mitkVtkPropRenderer.cpp Rendering/mitkVtkWidgetRendering.cpp Rendering/vtkMitkRectangleProp.cpp Rendering/vtkMitkRenderProp.cpp Rendering/mitkVtkEventProvider.cpp Rendering/mitkRenderWindow.cpp Rendering/mitkRenderWindowBase.cpp Rendering/mitkShaderRepository.cpp Rendering/mitkImageMapperGL2D.cpp Rendering/vtkMitkThickSlicesFilter.cpp ) diff --git a/Documentation/Doxygen/Modules/ModuleAdaptors.dox b/Documentation/Doxygen/Modules/ModuleAdaptors.dox index 9cfb28d368..b720121389 100644 --- a/Documentation/Doxygen/Modules/ModuleAdaptors.dox +++ b/Documentation/Doxygen/Modules/ModuleAdaptors.dox @@ -1,102 +1,142 @@ namespace mitk { /** \defgroup Adaptor Adaptor Classes \ingroup ProcessAdaptor \brief This subcategory includes adaptor classes for the integration of algorithms from other toolkits, especially ITK. -The task of most of the classes in this category is to deal with the conversion between the (templated) itk::Image and the (not-templated) mitk::Image. +The task of most of the classes in this category is to deal with the conversion between +the (templated) itk::Image and the (not-templated) mitk::Image. Methods for conversion are provided for both directions: \li \ref MitkToItk \li \ref ItkToMitk Care has to be taken regarding the involved coordinate systems, see \ref ItkToMitkCoordinateSystems. For limitations on ITK-type conversion see the section \ref Limitations. -VTK-based access to MITK images is straightforward: simply ask your mitk::Image for a \a vtkImageData by calling Image:GetVtkImageData. -Similarily, to get a \a vtkPolyData from the MITK class for storing surfaces, mitk::Surface, call Surface::GetVtkPolyData. +VTK-based access to MITK images is straightforward: simply ask your mitk::Image for a +\a vtkImageData by calling Image:GetVtkImageData. Similarily, to get a \a vtkPolyData +from the MITK class for storing surfaces, mitk::Surface, call Surface::GetVtkPolyData. \section MitkToItk MITK to ITK adaptors -Pixel type and dimension of MITK images can be specified at run time whereas ITK images are templated over the pixel type and the dimension, thus in ITK both need to be specified at compile time. +Pixel type and dimension of MITK images can be specified at run time whereas ITK images +are templated over the pixel type and the dimension, thus in ITK both need to be specified +at compile time. There two different situations, which are covered in the following sub-sections: -\li Either you know the pixel type/dimension the ITK image should have at compile time for some reason (e.g., you always create MITK images of a specific pixel type/dimension) -\li or the pixel type/dimension of an MITK image is really unkown and the ITK image should have the same (unkown) type. +\li Either you know the pixel type/dimension the ITK image should have at compile time for + some reason (e.g., you always create MITK images of a specific pixel type/dimension) +\li or the pixel type/dimension of an MITK image is really unkown and the ITK image should + have the same (unkown) type. \subsection MitkToFixedItk Converting MITK images to ITK images with known type If you know the type (pixel type and dimension) of the MITK image you have two options: -\li mitk::ImageToItk: is a process class that takes an mitk::Image as input and produces an itk::Image of the given type \a TOutputImage as output (to be access using \a GetOutput()). In case the MITK image does not have the same type as \a TOutputImage an exception will be thrown. -\li mitk::CastToItkImage: this function has two parameters, the mitk::Image (input) and a smartpointer to an itk::Image (output, does not need to be initialized). In case the MITK image does not have the same type as the ITK image it will be casted (if possible; done via itk::CastImageFilter). - -Thus, mitk::CastToItkImage is the more powerful variant: here it is sufficient that you know what you want to have (the ITK data type), to which the MITK image will be casted, if needed. +\li mitk::ImageToItk: is a process class that takes an mitk::Image as input + and produces an itk::Image of the given type \a TOutputImage as output (to be accessed + using \a GetOutput()). In case the MITK image does not have the same type as + \a TOutputImage an exception will be thrown. +\li mitk::CastToItkImage: this function has two parameters, the mitk::Image (input) and a + smartpointer to an itk::Image (output, does not need to be initialized). In case the + MITK image does not have the same type as the ITK image it will be casted + (if possible; done via itk::CastImageFilter). + +Thus, mitk::CastToItkImage is the more powerful variant: here it is sufficient that you know +what you want to have (the ITK data type), to which the MITK image will be casted, if needed. \subsection MitkToUnkownItk Accessing an MITK image as an ITK image (type unkown) -If you do not know the pixel type/dimension of an MITK image in advance and the ITK image should have the same (unkown) type, e.g., to run a filter on the MITK image data, we cannot really convert to one ITK image. This is simply, because we cannot instantiate an itk::Image object with unkown pixel type/dimension. +If you do not know the pixel type/dimension of an MITK image in advance and the ITK image should +have the same (unkown) type, e.g., to run a filter on the MITK image data, we cannot really convert +to one ITK image. This is simply, because we cannot instantiate an itk::Image object with unkown +pixel type/dimension. Nevertheless, MITK provides a way to access an MITK image as if it was an ITK image of unkown type. To do so, first define an access method, which is templated as an ITK image is: \code -template +template MyAccessMethod(itk::Image* itkImage) { ... } \endcode -If you don't understand this template syntax, we need to refer you to an C++ text book. Understanding template syntax is crucial to successfully using ITK. +If you don't understand this template syntax, we need to refer you to an C++ text book. Understanding +template syntax is crucial to successfully using ITK. -To call this templated method with an (untemplated) mitk::Image, you can use the AccessByItk macro (or one of its variants) from mitkImageAccessByItk.h. This macro checks for -the actual image type of the mitk::Image and does any neccessary conversions. This works for all typical pixel types and for dimension 2 and 3. +To call this templated method with an (untemplated) mitk::Image, you can use the #AccessByItk macro +(or one of its variants) from mitkImageAccessByItk.h. This macro checks for the actual image type of +the mitk::Image and does any neccessary conversions. This works for all configured pixel types (default +is char, unsigned char, short, unsigned short, int, unsigned int, float, and double) and dimensions +(default is 2 and 3). You can change the considered default pixel types and dimensions by modifying +the CMake variables MITK_ACCESSBYITK_*. \code AccessByItk(mitkImage, MyAccessMethod) \endcode An example is given in \ref Step6Page. -The AccessBy... macros create quite a lot of code: the user defined access method has to be compiled for all typical pixel types \em times the two supported dimensions (2 and 3). Therefore, depending on the complexity of the access method, some compilers may run into problems with memory. -One workaround is to use explicit instantiation and distribute it on multiple files. The macros InstantiateAccessFunction... are for this purpose. -An example is again given in \ref Step6Page. -Another workaround is to reduce the created code by fixing either the type (AccessFixedTypeByItk) or dimension (AccessFixedDimensionByItk). +The AccessBy... macros create quite a lot of code: the user defined access method has to be compiled for +all considered pixel types \em times the supported dimensions (default is 2 and 3). Therefore, depending +on the complexity of the access method, some compilers may run into problems with memory. +One workaround is to use explicit instantiation and distribute it on multiple files. The macro +#InstantiateAccessFunction and its variants are for this purpose. An example is again given in \ref Step6Page. +Another workaround is to reduce the created code by fixing either the type (#AccessFixedTypeByItk) or +dimension (#AccessFixedDimensionByItk). -There are variants for additional parameters for AccessByItk... and InstantiateAccessFunction..., e.g., AccessFixedTypeByItk_2 allows to pass two additional parameters to the access-function. +There is one variant of AccessByItk... for passing additional parameters +to the access-function, called #AccessFixedTypeByItk_n. \link mitkImage.h \endlink \link mitkImageCast.h \endlink \link mitkImageToItk.h \endlink \link mitkITKImageImport.h \endlink \section ItkToMitk ITK to MITK adaptors Converting ITK images to MITK is easier than the other way round. Basically, you have three options: -\li mitk::ITKImageImport: is a process class that takes an itk::Image of the given type \a TOutputImage as input and produces an mitk::Image as output (to be access using \a GetOutput()). The image data contained in the itk::Image is referenced, not copied. -\li mitk::ImportItkImage: this function takes the itk::Image as input and returns an mitk::Image. Internally, it uses the class just described. So again, the image data contained in the itk::Image is referenced, not copied. -\li mitk::CastToMitkImage: this function has two parameters, the itk::Image (input) and a smartpointer to an mitk::Image (output, does not need to be initialized). In contrast to the other described methods, this functions copies the image data! +\li mitk::ITKImageImport: is a process class that takes an itk::Image of the given type + \a TOutputImage as input and produces an mitk::Image as output (to be accessed using \a GetOutput()). + The image data contained in the itk::Image is referenced, not copied. +\li mitk::ImportItkImage: this function takes the itk::Image as input and returns an mitk::Image. Internally, + it uses the class just described. So again, the image data contained in the itk::Image is referenced, not + copied. +\li mitk::CastToMitkImage: this function has two parameters, the itk::Image (input) and a smartpointer to an + mitk::Image (output, does not need to be initialized). In contrast to the other described methods, + this function copies the image data! \section ItkToMitkCoordinateSystems ITK image vs MITK coordinate systems -Converting coordinates from the ITK physical coordinate system (which does not support rotated images) to the MITK world coordinate system should be performed via the Geometry3D of the Image, see mitk::Geometry3D::WorldToItkPhysicalPoint. +Converting coordinates from the ITK physical coordinate system (which does not support rotated images) to the +MITK world coordinate system should be performed via the Geometry3D of the Image, +see mitk::Geometry3D::WorldToItkPhysicalPoint. \section Limitations Limitations -The \ref MitkToItk for unspecified types have to do type multiplexing at compile time. This is done for a limited number of pixel types (\a char, \a short, \a int, \a long, \a double, \a float, and the \a unsigned variants of the integer data types) and for dimensions 2 and 3. +The \ref MitkToItk for unspecified types have to do type multiplexing at compile time. This is done for a +limited number of pixel types and dimensions, defined during the CMake configuration process. -Especially, color image types are not multiplexed. This is because many algorithms do not support color images (e.g. with data type itk::RGBPixel) because they do not have a scalar data type. If your algorithm do support color and you want to multiplex over all scalar as well as the color data type, try the following: +Especially, color image types are not multiplexed. This is because many algorithms do not support color images +(e.g. with data type itk::RGBPixel) because they do not have a scalar data type. If your algorithm do support +color and you want to multiplex over all scalar as well as the color data type, try the following: \code - if (myMitkImageThatMaybeColor->GetPixelType()==typeid(itk::RGBPixel)) - { - AccessFixedPixelTypeByItk(myMitkImageThatMaybeColor, myAlgorithmFunction, itk::RGBPixel); - } - else - { - AccessByItk(myMitkImageThatMaybeColor, myAlgorithmFunction); - } +try +{ + AccessFixedPixelTypeByItk(myMitkImageThatMaybeColor, // The MITK image which may be a color image + myAlgorithmFunction, // The template method being able to handle color + MITK_ACCESSBYITK_PIXEL_TYPES_SEQ // The default pixel type sequence + (itk::RGBPixel) // The additional type sequence + ) +} +catch(const mitk::AccessByItkException& e) +{ + // add error handling here +} \endcode */ -} \ No newline at end of file +} diff --git a/Modules/DeformableRegistration/mitkBSplineRegistration.cpp b/Modules/DeformableRegistration/mitkBSplineRegistration.cpp index 5b3761e1cd..7fef213719 100644 --- a/Modules/DeformableRegistration/mitkBSplineRegistration.cpp +++ b/Modules/DeformableRegistration/mitkBSplineRegistration.cpp @@ -1,369 +1,371 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-05 19:02:32 +0200 (Tue, 05 May 2009) $ Version: $Revision: 17105 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#include + #include "itkImageFileWriter.h" #include "itkWarpImageFilter.h" #include "itkImageRegionIterator.h" #include "mitkBSplineRegistration.h" #include "itkBSplineDeformableTransform.h" //#include "itkLBFGSOptimizer.h" #include "itkMeanSquaresImageToImageMetric.h" #include "itkMattesMutualInformationImageToImageMetric.h" #include "itkResampleImageFilter.h" #include "itkImageRegistrationMethod.h" #include "itkBSplineDeformableTransformInitializer.h" #include "mitkOptimizerFactory.h" #include "mitkMetricFactory.h" #include #include namespace mitk { BSplineRegistration::BSplineRegistration(): m_Iterations(50), m_ResultName("deformedImage.mhd"), m_SaveResult(true), m_SaveDeformationField(false), m_UpdateInputImage(false), m_MatchHistograms(true), m_Metric(0) { m_Observer = mitk::RigidRegistrationObserver::New(); } BSplineRegistration::~BSplineRegistration() { } void BSplineRegistration::SetNumberOfIterations(int iterations) { m_Iterations = iterations; } void BSplineRegistration::SetSaveResult(bool saveResult) { m_SaveResult = saveResult; } void BSplineRegistration::SetResultFileName(const char* resultName) { m_ResultName = resultName; } template < typename TPixel, unsigned int VImageDimension > void BSplineRegistration::GenerateData2( itk::Image* itkImage1) { std::cout << "start bspline registration" << std::endl; // Typedefs typedef typename itk::Image< TPixel, VImageDimension > InternalImageType; typedef typename itk::Vector< float, VImageDimension > VectorPixelType; typedef typename itk::Image< VectorPixelType, VImageDimension > DeformationFieldType; typedef itk::BSplineDeformableTransform< double, VImageDimension, 3 > TransformType; typedef typename TransformType::ParametersType ParametersType; //typedef itk::LBFGSOptimizer OptimizerType; typedef itk::SingleValuedNonLinearOptimizer OptimizerType; //typedef itk::SingleValuedCostFunction MetricType; typedef itk::MattesMutualInformationImageToImageMetric< InternalImageType, InternalImageType > MetricType; typedef itk::MeanSquaresImageToImageMetric< InternalImageType, InternalImageType > MetricTypeMS; typedef itk::LinearInterpolateImageFunction< InternalImageType, double > InterpolatorType; typedef itk::ImageRegistrationMethod< InternalImageType, InternalImageType > RegistrationType; typedef typename itk::WarpImageFilter< InternalImageType, InternalImageType, DeformationFieldType > WarperType; typedef typename TransformType::SpacingType SpacingType; typedef typename TransformType::OriginType OriginType; typedef itk::ResampleImageFilter< InternalImageType, InternalImageType > ResampleFilterType; typedef itk::Image< TPixel, VImageDimension > OutputImageType; // Sample new image with the same image type as the fixed image typedef itk::CastImageFilter< InternalImageType, InternalImageType > CastFilterType; typedef itk::Vector< float, VImageDimension > VectorType; typedef itk::Image< VectorType, VImageDimension > DeformationFieldType; typedef itk::BSplineDeformableTransformInitializer < TransformType, InternalImageType > InitializerType; typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); typename RegistrationType::Pointer registration = RegistrationType::New(); typename InitializerType::Pointer initializer = InitializerType::New(); typename TransformType::Pointer transform = TransformType::New(); if(m_Metric==0 || m_Metric==1) { typename MetricType::Pointer metric = MetricType::New(); metric->SetNumberOfHistogramBins( 32); metric->SetNumberOfSpatialSamples(90000); registration->SetMetric( metric ); } else{ typename MetricTypeMS::Pointer metric = MetricTypeMS::New(); registration->SetMetric( metric ); } typename OptimizerFactory::Pointer optFac = OptimizerFactory::New(); optFac->SetOptimizerParameters(m_OptimizerParameters); optFac->SetNumberOfTransformParameters(transform->GetNumberOfParameters()); OptimizerType::Pointer optimizer = optFac->GetOptimizer(); optimizer->AddObserver(itk::AnyEvent(), m_Observer); //typedef mitk::MetricFactory MetricFactoryType; //typename MetricFactoryType::Pointer metricFac = MetricFactoryType::New(); //metricFac->SetMetricParameters(m_MetricParameters); ////MetricType::Pointer metric = metricFac->GetMetric(); typename InternalImageType::Pointer fixedImage = InternalImageType::New(); mitk::CastToItkImage(m_ReferenceImage, fixedImage); typename InternalImageType::Pointer movingImage = itkImage1; typename InternalImageType::RegionType fixedRegion = fixedImage->GetBufferedRegion(); typename InternalImageType::RegionType movingRegion = movingImage->GetBufferedRegion(); if(m_MatchHistograms) { typedef itk::RescaleIntensityImageFilter FilterType; typedef itk::HistogramMatchingImageFilter HEFilterType; typename FilterType::Pointer inputRescaleFilter = FilterType::New(); typename FilterType::Pointer referenceRescaleFilter = FilterType::New(); referenceRescaleFilter->SetInput(fixedImage); inputRescaleFilter->SetInput(movingImage); TPixel desiredMinimum = 0; TPixel desiredMaximum = 255; referenceRescaleFilter->SetOutputMinimum( desiredMinimum ); referenceRescaleFilter->SetOutputMaximum( desiredMaximum ); referenceRescaleFilter->UpdateLargestPossibleRegion(); inputRescaleFilter->SetOutputMinimum( desiredMinimum ); inputRescaleFilter->SetOutputMaximum( desiredMaximum ); inputRescaleFilter->UpdateLargestPossibleRegion(); // Histogram match the images typename HEFilterType::Pointer intensityEqualizeFilter = HEFilterType::New(); intensityEqualizeFilter->SetReferenceImage( inputRescaleFilter->GetOutput() ); intensityEqualizeFilter->SetInput( referenceRescaleFilter->GetOutput() ); intensityEqualizeFilter->SetNumberOfHistogramLevels( 64 ); intensityEqualizeFilter->SetNumberOfMatchPoints( 12 ); intensityEqualizeFilter->ThresholdAtMeanIntensityOn(); intensityEqualizeFilter->Update(); //fixedImage = referenceRescaleFilter->GetOutput(); //movingImage = IntensityEqualizeFilter->GetOutput(); fixedImage = intensityEqualizeFilter->GetOutput(); movingImage = inputRescaleFilter->GetOutput(); } // registration->SetOptimizer( optimizer ); registration->SetInterpolator( interpolator ); registration->SetFixedImage( fixedImage ); registration->SetMovingImage( movingImage ); registration->SetFixedImageRegion(fixedRegion ); initializer->SetTransform(transform); initializer->SetImage(fixedImage); initializer->SetNumberOfGridNodesInsideTheImage( m_NumberOfGridPoints ); initializer->InitializeTransform(); registration->SetTransform( transform ); const unsigned int numberOfParameters = transform->GetNumberOfParameters(); typename itk::BSplineDeformableTransform< double, VImageDimension, 3 >::ParametersType parameters; parameters.set_size(numberOfParameters); parameters.Fill( 0.0 ); transform->SetParameters( parameters ); // We now pass the parameters of the current transform as the initial // parameters to be used when the registration process starts. registration->SetInitialTransformParameters( transform->GetParameters() ); std::cout << "Intial Parameters = " << std::endl; std::cout << transform->GetParameters() << std::endl; std::cout << std::endl << "Starting Registration" << std::endl; try { double tstart(clock()); registration->StartRegistration(); double time = clock() - tstart; time = time / CLOCKS_PER_SEC; MITK_INFO << "Registration time: " << time; } catch( itk::ExceptionObject & err ) { std::cerr << "ExceptionObject caught !" << std::endl; std::cerr << err << std::endl; } typename OptimizerType::ParametersType finalParameters = registration->GetLastTransformParameters(); std::cout << "Last Transform Parameters" << std::endl; std::cout << finalParameters << std::endl; transform->SetParameters( finalParameters ); /* ResampleFilterType::Pointer resampler = ResampleFilterType::New(); resampler->SetTransform( transform ); resampler->SetInput( movingImage ); resampler->SetSize( fixedImage->GetLargestPossibleRegion().GetSize() ); resampler->SetOutputOrigin( fixedImage->GetOrigin() ); resampler->SetOutputSpacing( fixedImage->GetSpacing() ); resampler->SetOutputDirection( fixedImage->GetDirection() ); resampler->SetDefaultPixelValue( 100 ); resampler->SetInterpolator( interpolator); resampler->Update();*/ // Generate deformation field typename DeformationFieldType::Pointer field = DeformationFieldType::New(); field->SetRegions( movingRegion ); field->SetOrigin( movingImage->GetOrigin() ); field->SetSpacing( movingImage->GetSpacing() ); field->SetDirection( movingImage->GetDirection() ); field->Allocate(); typedef itk::ImageRegionIterator< DeformationFieldType > FieldIterator; FieldIterator fi( field, movingRegion ); fi.GoToBegin(); typename TransformType::InputPointType fixedPoint; typename TransformType::OutputPointType movingPoint; typename DeformationFieldType::IndexType index; VectorType displacement; while( ! fi.IsAtEnd() ) { index = fi.GetIndex(); field->TransformIndexToPhysicalPoint( index, fixedPoint ); movingPoint = transform->TransformPoint( fixedPoint ); displacement = movingPoint - fixedPoint; fi.Set( displacement ); ++fi; } // Use the deformation field to warp the moving image typename WarperType::Pointer warper = WarperType::New(); warper->SetInput( movingImage ); warper->SetInterpolator( interpolator ); warper->SetOutputSpacing( movingImage->GetSpacing() ); warper->SetOutputOrigin( movingImage->GetOrigin() ); warper->SetOutputDirection( movingImage->GetDirection() ); warper->SetDeformationField( field ); warper->Update(); typename InternalImageType::Pointer result = warper->GetOutput(); if(m_UpdateInputImage) { Image::Pointer outputImage = this->GetOutput(); mitk::CastToMitkImage( result, outputImage ); } // Save the deformationfield resulting from the registration if(m_SaveDeformationField) { typedef itk::ImageFileWriter< DeformationFieldType > FieldWriterType; typename FieldWriterType::Pointer fieldWriter = FieldWriterType::New(); fieldWriter->SetInput( field ); fieldWriter->SetFileName( m_DeformationFileName ); try { fieldWriter->Update(); } catch( itk::ExceptionObject & excp ) { std::cerr << "Exception thrown " << std::endl; std::cerr << excp << std::endl; //return EXIT_FAILURE; } } } } // end namespace diff --git a/Modules/DeformableRegistration/mitkDemonsRegistration.cpp b/Modules/DeformableRegistration/mitkDemonsRegistration.cpp index fbee3cbcea..0ac8e1312f 100644 --- a/Modules/DeformableRegistration/mitkDemonsRegistration.cpp +++ b/Modules/DeformableRegistration/mitkDemonsRegistration.cpp @@ -1,265 +1,267 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#include + #include "itkImageFileWriter.h" #include "itkWarpImageFilter.h" #include "itkImageRegionIterator.h" #include "mitkDemonsRegistration.h" namespace mitk { DemonsRegistration::DemonsRegistration(): m_Iterations(50), m_StandardDeviation(1.0), m_FieldName("newField.mhd"), m_ResultName("deformedImage.mhd"), m_SaveField(true), m_SaveResult(true), m_DeformationField(NULL) { } DemonsRegistration::~DemonsRegistration() { } void DemonsRegistration::SetNumberOfIterations(int iterations) { m_Iterations = iterations; } void DemonsRegistration::SetStandardDeviation(float deviation) { m_StandardDeviation = deviation; } void DemonsRegistration::SetSaveDeformationField(bool saveField) { m_SaveField = saveField; } void DemonsRegistration::SetDeformationFieldFileName(const char* fieldName) { m_FieldName = fieldName; } void DemonsRegistration::SetSaveResult(bool saveResult) { m_SaveResult = saveResult; } void DemonsRegistration::SetResultFileName(const char* resultName) { m_ResultName = resultName; } itk::Image,3>::Pointer DemonsRegistration::GetDeformationField() { return m_DeformationField; } template < typename TPixel, unsigned int VImageDimension > void DemonsRegistration::GenerateData2( itk::Image* itkImage1) { typedef typename itk::Image< TPixel, VImageDimension > FixedImageType; typedef typename itk::Image< TPixel, VImageDimension > MovingImageType; typedef float InternalPixelType; typedef typename itk::Image< InternalPixelType, VImageDimension > InternalImageType; typedef typename itk::CastImageFilter< FixedImageType, InternalImageType > FixedImageCasterType; typedef typename itk::CastImageFilter< MovingImageType, InternalImageType > MovingImageCasterType; typedef typename itk::Image< InternalPixelType, VImageDimension > InternalImageType; typedef typename itk::Vector< float, VImageDimension > VectorPixelType; typedef typename itk::Image< VectorPixelType, VImageDimension > DeformationFieldType; typedef typename itk::DemonsRegistrationFilter< InternalImageType, InternalImageType, DeformationFieldType> RegistrationFilterType; typedef typename itk::WarpImageFilter< MovingImageType, MovingImageType, DeformationFieldType > WarperType; typedef typename itk::LinearInterpolateImageFunction< MovingImageType, double > InterpolatorType; typedef TPixel OutputPixelType; typedef typename itk::Image< OutputPixelType, VImageDimension > OutputImageType; typedef typename itk::CastImageFilter< MovingImageType, OutputImageType > CastFilterType; typedef typename itk::ImageFileWriter< OutputImageType > WriterType; typedef typename itk::ImageFileWriter< DeformationFieldType > FieldWriterType; typename FixedImageType::Pointer fixedImage = FixedImageType::New(); mitk::CastToItkImage(m_ReferenceImage, fixedImage); typename MovingImageType::Pointer movingImage = itkImage1; if (fixedImage.IsNotNull() && movingImage.IsNotNull()) { typename RegistrationFilterType::Pointer filter = RegistrationFilterType::New(); this->AddStepsToDo(4); typename itk::ReceptorMemberCommand::Pointer command = itk::ReceptorMemberCommand::New(); command->SetCallbackFunction(this, &DemonsRegistration::SetProgress); filter->AddObserver( itk::IterationEvent(), command ); typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New(); fixedImageCaster->SetInput(fixedImage); filter->SetFixedImage( fixedImageCaster->GetOutput() ); typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New(); movingImageCaster->SetInput(movingImage); filter->SetMovingImage(movingImageCaster->GetOutput()); filter->SetNumberOfIterations( m_Iterations ); filter->SetStandardDeviations( m_StandardDeviation ); filter->Update(); typename WarperType::Pointer warper = WarperType::New(); typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); warper->SetInput( movingImage ); warper->SetInterpolator( interpolator ); warper->SetOutputSpacing( fixedImage->GetSpacing() ); warper->SetOutputOrigin( fixedImage->GetOrigin() ); warper->SetOutputDirection( fixedImage->GetDirection()); warper->SetDeformationField( filter->GetOutput() ); warper->Update(); Image::Pointer outputImage = this->GetOutput(); mitk::CastToMitkImage( warper->GetOutput(), outputImage ); typename WriterType::Pointer writer = WriterType::New(); typename CastFilterType::Pointer caster = CastFilterType::New(); writer->SetFileName( m_ResultName ); caster->SetInput( warper->GetOutput() ); writer->SetInput( caster->GetOutput() ); if(m_SaveResult) { writer->Update(); } if (VImageDimension == 2) { typedef DeformationFieldType VectorImage2DType; typedef typename DeformationFieldType::PixelType Vector2DType; typename VectorImage2DType::ConstPointer vectorImage2D = filter->GetOutput(); typename VectorImage2DType::RegionType region2D = vectorImage2D->GetBufferedRegion(); typename VectorImage2DType::IndexType index2D = region2D.GetIndex(); typename VectorImage2DType::SizeType size2D = region2D.GetSize(); typedef typename itk::Vector< float, 3 > Vector3DType; typedef typename itk::Image< Vector3DType, 3 > VectorImage3DType; typedef typename itk::ImageFileWriter< VectorImage3DType > WriterType; typename WriterType::Pointer writer3D = WriterType::New(); typename VectorImage3DType::Pointer vectorImage3D = VectorImage3DType::New(); typename VectorImage3DType::RegionType region3D; typename VectorImage3DType::IndexType index3D; typename VectorImage3DType::SizeType size3D; index3D[0] = index2D[0]; index3D[1] = index2D[1]; index3D[2] = 0; size3D[0] = size2D[0]; size3D[1] = size2D[1]; size3D[2] = 1; region3D.SetSize( size3D ); region3D.SetIndex( index3D ); typename VectorImage2DType::SpacingType spacing2D = vectorImage2D->GetSpacing(); typename VectorImage3DType::SpacingType spacing3D; spacing3D[0] = spacing2D[0]; spacing3D[1] = spacing2D[1]; spacing3D[2] = 1.0; vectorImage3D->SetSpacing( spacing3D ); vectorImage3D->SetRegions( region3D ); vectorImage3D->Allocate(); typedef typename itk::ImageRegionConstIterator< VectorImage2DType > Iterator2DType; typedef typename itk::ImageRegionIterator< VectorImage3DType > Iterator3DType; Iterator2DType it2( vectorImage2D, region2D ); Iterator3DType it3( vectorImage3D, region3D ); it2.GoToBegin(); it3.GoToBegin(); Vector2DType vector2D; Vector3DType vector3D; vector3D[2] = 0; // set Z component to zero. while( !it2.IsAtEnd() ) { vector2D = it2.Get(); vector3D[0] = vector2D[0]; vector3D[1] = vector2D[1]; it3.Set( vector3D ); ++it2; ++it3; } writer3D->SetInput( vectorImage3D ); m_DeformationField = vectorImage3D; writer3D->SetFileName( m_FieldName ); try { if(m_SaveField) { writer3D->Update(); } } catch( itk::ExceptionObject & excp ) { MITK_ERROR << excp << std::endl; } } else { typename FieldWriterType::Pointer fieldwriter = FieldWriterType::New(); fieldwriter->SetFileName(m_FieldName); fieldwriter->SetInput( filter->GetOutput() ); m_DeformationField = (itk::Image,3> *)(filter->GetOutput()); if(m_SaveField) { fieldwriter->Update(); } } this->SetRemainingProgress(4); } } } // end namespace diff --git a/Modules/DeformableRegistration/mitkHistogramMatching.cpp b/Modules/DeformableRegistration/mitkHistogramMatching.cpp index 81f976981c..81ab99d1b0 100644 --- a/Modules/DeformableRegistration/mitkHistogramMatching.cpp +++ b/Modules/DeformableRegistration/mitkHistogramMatching.cpp @@ -1,84 +1,86 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkHistogramMatching.h" +#include + namespace mitk { HistogramMatching::HistogramMatching() { m_ThresholdAtMeanIntensity = true; m_NumberOfHistogramLevels = 1024; m_NumberOfMatchPoints = 7; } HistogramMatching::~HistogramMatching() { } void HistogramMatching::SetNumberOfHistogramLevels(int histogrammLevels) { m_NumberOfHistogramLevels = histogrammLevels; } void HistogramMatching::SetNumberOfMatchPoints(int matchPoints) { m_NumberOfMatchPoints = matchPoints; } void HistogramMatching::SetThresholdAtMeanIntensity(bool on) { m_ThresholdAtMeanIntensity = on; } template < typename TPixel, unsigned int VImageDimension > void HistogramMatching::GenerateData2( itk::Image* itkImage1) { typedef typename itk::Image< TPixel, VImageDimension > FixedImageType; typedef typename itk::Image< TPixel, VImageDimension > MovingImageType; typedef float InternalPixelType; typedef typename itk::Image< InternalPixelType, VImageDimension > InternalImageType; typedef typename itk::CastImageFilter< FixedImageType, InternalImageType > FixedImageCasterType; typedef typename itk::CastImageFilter< MovingImageType, InternalImageType > MovingImageCasterType; typedef typename itk::HistogramMatchingImageFilter< InternalImageType, InternalImageType > MatchingFilterType; typename FixedImageType::Pointer fixedImage = FixedImageType::New(); mitk::CastToItkImage(m_ReferenceImage, fixedImage); typename MovingImageType::Pointer movingImage = itkImage1; if (fixedImage.IsNotNull() && movingImage.IsNotNull()) { typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New(); fixedImageCaster->SetInput(fixedImage); typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New(); movingImageCaster->SetInput(movingImage); typename MatchingFilterType::Pointer matcher = MatchingFilterType::New(); matcher->SetInput( movingImageCaster->GetOutput() ); matcher->SetReferenceImage( fixedImageCaster->GetOutput() ); matcher->SetNumberOfHistogramLevels( m_NumberOfHistogramLevels ); matcher->SetNumberOfMatchPoints( m_NumberOfMatchPoints ); matcher->SetThresholdAtMeanIntensity(m_ThresholdAtMeanIntensity); matcher->Update(); Image::Pointer outputImage = this->GetOutput(); mitk::CastToMitkImage( matcher->GetOutput(), outputImage ); } } } // end namespace diff --git a/Modules/DeformableRegistration/mitkSymmetricForcesDemonsRegistration.cpp b/Modules/DeformableRegistration/mitkSymmetricForcesDemonsRegistration.cpp index 017134af20..e1a4f01523 100644 --- a/Modules/DeformableRegistration/mitkSymmetricForcesDemonsRegistration.cpp +++ b/Modules/DeformableRegistration/mitkSymmetricForcesDemonsRegistration.cpp @@ -1,265 +1,267 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#include + #include "itkImageFileWriter.h" #include "itkWarpImageFilter.h" #include "itkInverseDeformationFieldImageFilter.h" #include "mitkSymmetricForcesDemonsRegistration.h" namespace mitk { SymmetricForcesDemonsRegistration::SymmetricForcesDemonsRegistration(): m_Iterations(50), m_StandardDeviation(1.0), m_FieldName("newField.mhd"), m_ResultName("deformedImage.mhd"), m_SaveField(true), m_SaveResult(true), m_DeformationField(NULL) { } SymmetricForcesDemonsRegistration::~SymmetricForcesDemonsRegistration() { } void SymmetricForcesDemonsRegistration::SetNumberOfIterations(int iterations) { m_Iterations = iterations; } void SymmetricForcesDemonsRegistration::SetStandardDeviation(float deviation) { m_StandardDeviation = deviation; } void SymmetricForcesDemonsRegistration::SetSaveDeformationField(bool saveField) { m_SaveField = saveField; } void SymmetricForcesDemonsRegistration::SetDeformationFieldFileName(const char* fieldName) { m_FieldName = fieldName; } void SymmetricForcesDemonsRegistration::SetSaveResult(bool saveResult) { m_SaveResult = saveResult; } void SymmetricForcesDemonsRegistration::SetResultFileName(const char* resultName) { m_ResultName = resultName; } itk::Image,3>::Pointer SymmetricForcesDemonsRegistration::GetDeformationField() { return m_DeformationField; } template < typename TPixel, unsigned int VImageDimension > void SymmetricForcesDemonsRegistration::GenerateData2( itk::Image* itkImage1) { typedef typename itk::Image< TPixel, VImageDimension > FixedImageType; typedef typename itk::Image< TPixel, VImageDimension > MovingImageType; typedef float InternalPixelType; typedef typename itk::Image< InternalPixelType, VImageDimension > InternalImageType; typedef typename itk::CastImageFilter< FixedImageType, InternalImageType > FixedImageCasterType; typedef typename itk::CastImageFilter< MovingImageType, InternalImageType > MovingImageCasterType; typedef typename itk::Vector< float, VImageDimension > VectorPixelType; typedef typename itk::Image< VectorPixelType, VImageDimension > DeformationFieldType; typedef typename itk::SymmetricForcesDemonsRegistrationFilter< InternalImageType, InternalImageType, DeformationFieldType> RegistrationFilterType; typedef typename itk::WarpImageFilter< MovingImageType, MovingImageType, DeformationFieldType > WarperType; typedef typename itk::LinearInterpolateImageFunction< MovingImageType, double > InterpolatorType; typedef TPixel OutputPixelType; typedef typename itk::Image< OutputPixelType, VImageDimension > OutputImageType; typedef typename itk::CastImageFilter< MovingImageType, OutputImageType > CastFilterType; typedef typename itk::ImageFileWriter< OutputImageType > WriterType; typedef typename itk::ImageFileWriter< DeformationFieldType > FieldWriterType; typedef typename itk::InverseDeformationFieldImageFilter InverseFilterType; typename FixedImageType::Pointer fixedImage = FixedImageType::New(); mitk::CastToItkImage(m_ReferenceImage, fixedImage); typename MovingImageType::Pointer movingImage = itkImage1; if (fixedImage.IsNotNull() && movingImage.IsNotNull()) { typename RegistrationFilterType::Pointer filter = RegistrationFilterType::New(); this->AddStepsToDo(4); itk::ReceptorMemberCommand::Pointer command = itk::ReceptorMemberCommand::New(); command->SetCallbackFunction(this, &SymmetricForcesDemonsRegistration::SetProgress); filter->AddObserver( itk::IterationEvent(), command ); typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New(); fixedImageCaster->SetInput(fixedImage); filter->SetFixedImage( fixedImageCaster->GetOutput() ); typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New(); movingImageCaster->SetInput(movingImage); filter->SetMovingImage(movingImageCaster->GetOutput()); filter->SetNumberOfIterations( m_Iterations ); filter->SetStandardDeviations( m_StandardDeviation ); filter->Update(); typename WarperType::Pointer warper = WarperType::New(); typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); warper->SetInput( movingImage ); warper->SetInterpolator( interpolator ); warper->SetOutputSpacing( fixedImage->GetSpacing() ); warper->SetOutputOrigin( fixedImage->GetOrigin() ); warper->SetDeformationField( filter->GetOutput() ); warper->Update(); typename WriterType::Pointer writer = WriterType::New(); typename CastFilterType::Pointer caster = CastFilterType::New(); writer->SetFileName( m_ResultName ); caster->SetInput( warper->GetOutput() ); writer->SetInput( caster->GetOutput() ); if(m_SaveResult) { writer->Update(); } Image::Pointer outputImage = this->GetOutput(); mitk::CastToMitkImage( warper->GetOutput(), outputImage ); if (VImageDimension == 2) { typedef DeformationFieldType VectorImage2DType; typedef typename DeformationFieldType::PixelType Vector2DType; typename VectorImage2DType::ConstPointer vectorImage2D = filter->GetOutput(); typename VectorImage2DType::RegionType region2D = vectorImage2D->GetBufferedRegion(); typename VectorImage2DType::IndexType index2D = region2D.GetIndex(); typename VectorImage2DType::SizeType size2D = region2D.GetSize(); typedef typename itk::Vector< float, 3 > Vector3DType; typedef typename itk::Image< Vector3DType, 3 > VectorImage3DType; typedef typename itk::ImageFileWriter< VectorImage3DType > WriterType; WriterType::Pointer writer3D = WriterType::New(); VectorImage3DType::Pointer vectorImage3D = VectorImage3DType::New(); VectorImage3DType::RegionType region3D; VectorImage3DType::IndexType index3D; VectorImage3DType::SizeType size3D; index3D[0] = index2D[0]; index3D[1] = index2D[1]; index3D[2] = 0; size3D[0] = size2D[0]; size3D[1] = size2D[1]; size3D[2] = 1; region3D.SetSize( size3D ); region3D.SetIndex( index3D ); typename VectorImage2DType::SpacingType spacing2D = vectorImage2D->GetSpacing(); VectorImage3DType::SpacingType spacing3D; spacing3D[0] = spacing2D[0]; spacing3D[1] = spacing2D[1]; spacing3D[2] = 1.0; vectorImage3D->SetSpacing( spacing3D ); vectorImage3D->SetRegions( region3D ); vectorImage3D->Allocate(); typedef typename itk::ImageRegionConstIterator< VectorImage2DType > Iterator2DType; typedef typename itk::ImageRegionIterator< VectorImage3DType > Iterator3DType; Iterator2DType it2( vectorImage2D, region2D ); Iterator3DType it3( vectorImage3D, region3D ); it2.GoToBegin(); it3.GoToBegin(); Vector2DType vector2D; Vector3DType vector3D; vector3D[2] = 0; // set Z component to zero. while( !it2.IsAtEnd() ) { vector2D = it2.Get(); vector3D[0] = vector2D[0]; vector3D[1] = vector2D[1]; it3.Set( vector3D ); ++it2; ++it3; } writer3D->SetInput( vectorImage3D ); m_DeformationField = vectorImage3D; writer3D->SetFileName( m_FieldName ); try { if(m_SaveField) { writer3D->Update(); } } catch( itk::ExceptionObject & excp ) { MITK_ERROR << excp << std::endl; } } else { typename FieldWriterType::Pointer fieldwriter = FieldWriterType::New(); fieldwriter->SetFileName( m_FieldName ); fieldwriter->SetInput( filter->GetOutput() ); //m_DeformationField = filter->GetOutput(); m_DeformationField = (itk::Image,3> *)(filter->GetOutput()); //see BUG #3732 if(m_SaveField) { fieldwriter->Update(); } } this->SetRemainingProgress(4); } } } // end namespace diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp b/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp index 60d96532e3..ae034449f0 100644 --- a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp +++ b/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp @@ -1,106 +1,107 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2008-12-10 18:05:13 +0100 (Mi, 10 Dez 2008) $ Version: $Revision: 15922 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkNrrdTensorImageWriter.h" #include "itkMetaDataDictionary.h" #include "itkMetaDataObject.h" #include "itkNrrdImageIO.h" #include "itkImageFileWriter.h" +#include "itkDiffusionTensor3D.h" #include "mitkImageCast.h" mitk::NrrdTensorImageWriter::NrrdTensorImageWriter() : m_FileName(""), m_FilePrefix(""), m_FilePattern(""), m_Success(false) { this->SetNumberOfRequiredInputs( 1 ); } mitk::NrrdTensorImageWriter::~NrrdTensorImageWriter() {} void mitk::NrrdTensorImageWriter::GenerateData() { m_Success = false; InputType* input = this->GetInput(); if (input == NULL) { itkWarningMacro(<<"Sorry, input to NrrdTensorImageWriter is NULL!"); return; } if ( m_FileName == "" ) { itkWarningMacro( << "Sorry, filename has not been set!" ); return ; } itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); io->SetFileType( itk::ImageIOBase::Binary ); io->UseCompressionOn(); typedef itk::Image,3> ImageType; typedef itk::ImageFileWriter WriterType; WriterType::Pointer nrrdWriter = WriterType::New(); ImageType::Pointer outimage = ImageType::New(); CastToItkImage(input, outimage); nrrdWriter->SetInput( outimage ); nrrdWriter->SetImageIO(io); nrrdWriter->SetFileName(m_FileName); nrrdWriter->UseCompressionOn(); try { nrrdWriter->Update(); } catch (itk::ExceptionObject e) { std::cout << e << std::endl; } m_Success = true; } void mitk::NrrdTensorImageWriter::SetInput( InputType* diffVolumes ) { this->ProcessObject::SetNthInput( 0, diffVolumes ); } mitk::TensorImage* mitk::NrrdTensorImageWriter::GetInput() { if ( this->GetNumberOfInputs() < 1 ) { return NULL; } else { return dynamic_cast ( this->ProcessObject::GetInput( 0 ) ); } } std::vector mitk::NrrdTensorImageWriter::GetPossibleFileExtensions() { std::vector possibleFileExtensions; possibleFileExtensions.push_back(".dti"); possibleFileExtensions.push_back(".hdti"); return possibleFileExtensions; } diff --git a/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h b/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h index 4762e50a45..b462288c43 100644 --- a/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h +++ b/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h @@ -1,161 +1,163 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkCompareImageSliceTestHelperhincluded #define mitkCompareImageSliceTestHelperhincluded #include "mitkImageCast.h" +#include #include #include // copied from mitk/Core/Algorithms/mitkOverwriteSliceImageFilter.cpp // basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h #define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \ if ( typeId == typeid(pixeltype) ) \ { \ typedef itk::Image ImageType; \ typedef mitk::ImageToItk ImageToItkType; \ itk::SmartPointer imagetoitk = ImageToItkType::New(); \ imagetoitk->SetInput(mitkImage); \ imagetoitk->Update(); \ itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \ } #define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \ { \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, double, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, float, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, char, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension, itkimage2) \ } class CompareImageSliceTestHelper { private: /* variables to be used by CompareSlice only */ static unsigned int m_Dimension0; static unsigned int m_Dimension1; static unsigned int m_SliceDimension; static unsigned int m_SliceIndex; static bool m_ComparisonResult; static mitk::Image* m_SliceImage; public: template static void ItkImageCompare( itk::Image* inputImage, itk::Image* outputImage ) { m_ComparisonResult = false; typedef itk::Image SliceImageType; typedef itk::Image VolumeImageType; typedef itk::ImageSliceConstIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< SliceImageType > InputSliceIteratorType; typename VolumeImageType::RegionType sliceInVolumeRegion; sliceInVolumeRegion = outputImage->GetLargestPossibleRegion(); sliceInVolumeRegion.SetSize( m_SliceDimension, 1 ); // just one slice sliceInVolumeRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // exactly this slice, please OutputSliceIteratorType outputIterator( outputImage, sliceInVolumeRegion ); outputIterator.SetFirstDirection(m_Dimension0); outputIterator.SetSecondDirection(m_Dimension1); InputSliceIteratorType inputIterator( inputImage, inputImage->GetLargestPossibleRegion() ); // iterate over output slice (and over input slice simultaneously) outputIterator.GoToBegin(); inputIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { while ( !outputIterator.IsAtEndOfSlice() ) { while ( !outputIterator.IsAtEndOfLine() ) { m_ComparisonResult = outputIterator.Get() == (TPixel2) inputIterator.Get(); if (!m_ComparisonResult) return; // return on first mismatch ++outputIterator; ++inputIterator; } outputIterator.NextLine(); } outputIterator.NextSlice(); } } template static void ItkImageSwitch( itk::Image* itkImage ) { const std::type_info& typeId=*(m_SliceImage->GetPixelType().GetTypeId()); - myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage ); + AccessFixedDimensionByItk_1( m_SliceImage, ItkImageCompare, 2, itkImage ) + //myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage ); } static bool CompareSlice( mitk::Image* image, unsigned int sliceDimension, unsigned int sliceIndex, mitk::Image* slice ) { if ( !image || ! slice ) return false; switch (sliceDimension) { default: case 2: m_Dimension0 = 0; m_Dimension1 = 1; break; case 1: m_Dimension0 = 0; m_Dimension1 = 2; break; case 0: m_Dimension0 = 1; m_Dimension1 = 2; break; } if ( slice->GetDimension() != 2 || image->GetDimension() != 3 || slice->GetDimension(0) != image->GetDimension(m_Dimension0) || slice->GetDimension(1) != image->GetDimension(m_Dimension1) ) { std::cerr << "Slice and image dimensions differ. Sorry, cannot work like this." << std::endl; return false; } // this will do a long long if/else to find out both pixel typesA m_SliceImage = slice; m_SliceIndex = sliceIndex; m_SliceDimension = sliceDimension; m_ComparisonResult = false; AccessFixedDimensionByItk( image, ItkImageSwitch, 3 ); return m_ComparisonResult; } }; // end class #endif diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.cpp b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.cpp index bc71cc4e55..fa65f08e95 100644 --- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.cpp +++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.cpp @@ -1,294 +1,296 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-12-02 14:54:03 +0100 (Do, 2 Dec 2010) $ Version: $Revision: 21147 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkExtractDirectedPlaneImageFilterNew.h" #include "mitkImageCast.h" #include "mitkImageTimeSelector.h" #include "itkImageRegionIterator.h" +#include + mitk::ExtractDirectedPlaneImageFilterNew::ExtractDirectedPlaneImageFilterNew() :m_CurrentWorldGeometry2D(NULL) { } mitk::ExtractDirectedPlaneImageFilterNew::~ExtractDirectedPlaneImageFilterNew() { } void mitk::ExtractDirectedPlaneImageFilterNew::GenerateData(){ mitk::Image::ConstPointer inputImage = ImageToImageFilter::GetInput(0); if ( !inputImage ) { MITK_ERROR << "mitk::ExtractDirectedPlaneImageFilterNew: No input available. Please set the input!" << std::endl; itkExceptionMacro("mitk::ExtractDirectedPlaneImageFilterNew: No input available. Please set the input!"); return; } m_ImageGeometry = inputImage->GetGeometry(); //If no timestep is set, the lowest given will be selected const mitk::TimeSlicedGeometry* inputTimeGeometry = this->GetInput()->GetTimeSlicedGeometry(); if ( !m_ActualInputTimestep ) { ScalarType time = m_CurrentWorldGeometry2D->GetTimeBounds()[0]; if ( time > ScalarTypeNumericTraits::NonpositiveMin() ) { m_ActualInputTimestep = inputTimeGeometry->MSToTimeStep( time ); } } if ( inputImage->GetDimension() > 4 || inputImage->GetDimension() < 2) { MITK_ERROR << "mitk::ExtractDirectedPlaneImageFilterNew:GenerateData works only with 3D and 3D+t images, sorry." << std::endl; itkExceptionMacro("mitk::ExtractDirectedPlaneImageFilterNew works only with 3D and 3D+t images, sorry."); return; } else if ( inputImage->GetDimension() == 4 ) { mitk::ImageTimeSelector::Pointer timeselector = mitk::ImageTimeSelector::New(); timeselector->SetInput( inputImage ); timeselector->SetTimeNr( m_ActualInputTimestep ); timeselector->UpdateLargestPossibleRegion(); inputImage = timeselector->GetOutput(); } else if ( inputImage->GetDimension() == 2) { mitk::Image::Pointer resultImage = ImageToImageFilter::GetOutput(); resultImage = const_cast( inputImage.GetPointer() ); ImageToImageFilter::SetNthOutput( 0, resultImage); return; } if ( !m_CurrentWorldGeometry2D ) { MITK_ERROR<< "mitk::ExtractDirectedPlaneImageFilterNew::GenerateData has no CurrentWorldGeometry2D set" << std::endl; return; } AccessFixedDimensionByItk( inputImage, ItkSliceExtraction, 3 ); }//Generate Data void mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation () { Superclass::GenerateOutputInformation(); } /* * The desired slice is extracted by filling the image`s corresponding pixel values in an empty 2 dimensional itk::Image * Therefor the itk image`s extent in pixel (in each direction) is doubled and its spacing (also in each direction) is divided by two * (similar to the shannon theorem). */ template void mitk::ExtractDirectedPlaneImageFilterNew::ItkSliceExtraction (itk::Image* inputImage) { typedef itk::Image InputImageType; typedef itk::Image SliceImageType; typedef itk::ImageRegionConstIterator< SliceImageType > SliceIterator; //Creating an itk::Image that represents the sampled slice typename SliceImageType::Pointer resultSlice = SliceImageType::New(); typename SliceImageType::IndexType start; start[0] = 0; start[1] = 0; Point3D origin = m_CurrentWorldGeometry2D->GetOrigin(); Vector3D right = m_CurrentWorldGeometry2D->GetAxisVector(0); Vector3D bottom = m_CurrentWorldGeometry2D->GetAxisVector(1); //Calculation the sample-spacing, i.e the half of the smallest spacing existing in the original image Vector3D newPixelSpacing = m_ImageGeometry->GetSpacing(); float minSpacing = newPixelSpacing[0]; for (unsigned int i = 1; i < newPixelSpacing.Size(); i++) { if (newPixelSpacing[i] < minSpacing ) { minSpacing = newPixelSpacing[i]; } } newPixelSpacing[0] = 0.5*minSpacing; newPixelSpacing[1] = 0.5*minSpacing; newPixelSpacing[2] = 0.5*minSpacing; float pixelSpacing[2]; pixelSpacing[0] = newPixelSpacing[0]; pixelSpacing[1] = newPixelSpacing[1]; //Calculating the size of the sampled slice typename SliceImageType::SizeType size; Vector2D extentInMM; extentInMM[0] = m_CurrentWorldGeometry2D->GetExtentInMM(0); extentInMM[1] = m_CurrentWorldGeometry2D->GetExtentInMM(1); //The maximum extent is the lenght of the diagonal of the considered plane double maxExtent = sqrt(extentInMM[0]*extentInMM[0]+extentInMM[1]*extentInMM[1]); unsigned int xTranlation = (maxExtent-extentInMM[0]); unsigned int yTranlation = (maxExtent-extentInMM[1]); size[0] = (maxExtent+xTranlation)/newPixelSpacing[0]; size[1] = (maxExtent+yTranlation)/newPixelSpacing[1]; //Creating an ImageRegion Object typename SliceImageType::RegionType region; region.SetSize( size ); region.SetIndex( start ); //Defining the image`s extent and origin by passing the region to it and allocating memory for it resultSlice->SetRegions( region ); resultSlice->SetSpacing( pixelSpacing ); resultSlice->Allocate(); /* * Here we create an new geometry so that the transformations are calculated correctly (our resulting slice has a different bounding box and spacing) * The original current worldgeometry must be cloned because we have to keep the directions of the axis vector which represents the rotation */ right.Normalize(); bottom.Normalize(); //Here we translate the origin to adapt the new geometry to the previous calculated extent origin[0] -= xTranlation*right[0]+yTranlation*bottom[0]; origin[1] -= xTranlation*right[1]+yTranlation*bottom[1]; origin[2] -= xTranlation*right[2]+yTranlation*bottom[2]; //Putting it together for the new geometry mitk::Geometry3D::Pointer newSliceGeometryTest = dynamic_cast(m_CurrentWorldGeometry2D->Clone().GetPointer()); newSliceGeometryTest->ChangeImageGeometryConsideringOriginOffset(true); //Workaround because of BUG (#6505) newSliceGeometryTest->GetIndexToWorldTransform()->SetMatrix(m_CurrentWorldGeometry2D->GetIndexToWorldTransform()->GetMatrix()); //Workaround end newSliceGeometryTest->SetOrigin(origin); ScalarType bounds[6]={0, size[0], 0, size[1], 0, 1}; newSliceGeometryTest->SetBounds(bounds); newSliceGeometryTest->SetSpacing(newPixelSpacing); newSliceGeometryTest->Modified(); //Workaround because of BUG (#6505) itk::MatrixOffsetTransformBase::MatrixType tempTransform = newSliceGeometryTest->GetIndexToWorldTransform()->GetMatrix(); //Workaround end /* * Now we iterate over the recently created slice. * For each slice - pixel we check whether there is an according * pixel in the input - image which can be set in the slice. * In this way a slice is sampled out of the input - image regrading to the given PlaneGeometry */ Point3D currentSliceIndexPointIn2D; Point3D currentImageWorldPointIn3D; typename InputImageType::IndexType inputIndex; SliceIterator sliceIterator ( resultSlice, resultSlice->GetLargestPossibleRegion() ); sliceIterator.GoToBegin(); while ( !sliceIterator.IsAtEnd() ) { /* * Here we add 0.5 to to assure that the indices are correctly transformed. * (Because of the 0.5er Bug) */ currentSliceIndexPointIn2D[0] = sliceIterator.GetIndex()[0]+0.5; currentSliceIndexPointIn2D[1] = sliceIterator.GetIndex()[1]+0.5; currentSliceIndexPointIn2D[2] = 0; newSliceGeometryTest->IndexToWorld( currentSliceIndexPointIn2D, currentImageWorldPointIn3D ); m_ImageGeometry->WorldToIndex( currentImageWorldPointIn3D, inputIndex); if ( m_ImageGeometry->IsIndexInside( inputIndex )) { resultSlice->SetPixel( sliceIterator.GetIndex(), inputImage->GetPixel(inputIndex) ); } else { resultSlice->SetPixel( sliceIterator.GetIndex(), 0); } ++sliceIterator; } Image::Pointer resultImage = ImageToImageFilter::GetOutput(); GrabItkImageMemory(resultSlice, resultImage, NULL, false); resultImage->SetClonedGeometry(newSliceGeometryTest); //Workaround because of BUG (#6505) resultImage->GetGeometry()->GetIndexToWorldTransform()->SetMatrix(tempTransform); //Workaround end } ///**TEST** May ba a little bit more efficient but doesn`t already work/ //right.Normalize(); //bottom.Normalize(); //Point3D currentImagePointIn3D = origin /*+ bottom*newPixelSpacing*/; //unsigned int columns ( 0 ); /**ENDE**/ /****TEST***/ //SliceImageType::IndexType index = sliceIterator.GetIndex(); //if ( columns == (extentInPixel[0]) ) //{ //If we are at the end of a row, then we have to go to the beginning of the next row //currentImagePointIn3D = origin; //currentImagePointIn3D += newPixelSpacing[1]*bottom*index[1]; //columns = 0; //m_ImageGeometry->WorldToIndex(currentImagePointIn3D, inputIndex); //} //else //{ //// //if ( columns != 0 ) //{ //currentImagePointIn3D += newPixelSpacing[0]*right; //} //m_ImageGeometry->WorldToIndex(currentImagePointIn3D, inputIndex); //} //if ( m_ImageGeometry->IsIndexInside( inputIndex )) //{ //resultSlice->SetPixel( sliceIterator.GetIndex(), inputImage->GetPixel(inputIndex) ); //} //else if (currentImagePointIn3D == origin) //{ //Point3D temp; //temp[0] = bottom[0]*newPixelSpacing[0]*0.5; //temp[1] = bottom[1]*newPixelSpacing[1]*0.5; //temp[2] = bottom[2]*newPixelSpacing[2]*0.5; //origin[0] += temp[0]; //origin[1] += temp[1]; //origin[2] += temp[2]; //currentImagePointIn3D = origin; //m_ImageGeometry->WorldToIndex(currentImagePointIn3D, inputIndex); //if ( m_ImageGeometry->IsIndexInside( inputIndex )) //{ //resultSlice->SetPixel( sliceIterator.GetIndex(), inputImage->GetPixel(inputIndex) ); //} //} /****TEST ENDE****/ diff --git a/Modules/ImageExtraction/mitkExtractImageFilter.cpp b/Modules/ImageExtraction/mitkExtractImageFilter.cpp index 0957ed70fd..94047a738e 100644 --- a/Modules/ImageExtraction/mitkExtractImageFilter.cpp +++ b/Modules/ImageExtraction/mitkExtractImageFilter.cpp @@ -1,252 +1,254 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkExtractImageFilter.h" #include "mitkImageCast.h" #include "mitkPlaneGeometry.h" #include "mitkITKImageImport.h" #include "mitkImageTimeSelector.h" +#include + #include mitk::ExtractImageFilter::ExtractImageFilter() :m_SliceIndex(0), m_SliceDimension(0), m_TimeStep(0) { } mitk::ExtractImageFilter::~ExtractImageFilter() { } void mitk::ExtractImageFilter::GenerateData() { Image::ConstPointer input = ImageToImageFilter::GetInput(0); if ( (input->GetDimension() > 4) || (input->GetDimension() < 2) ) { MITK_ERROR << "mitk::ExtractImageFilter:GenerateData works only with 3D and 3D+t images, sorry." << std::endl; itkExceptionMacro("mitk::ExtractImageFilter works only with 3D and 3D+t images, sorry."); return; } else if (input->GetDimension() == 4) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( input ); timeSelector->SetTimeNr( m_TimeStep ); timeSelector->UpdateLargestPossibleRegion(); input = timeSelector->GetOutput(); } else if (input->GetDimension() == 2) { Image::Pointer resultImage = ImageToImageFilter::GetOutput(); resultImage = const_cast(input.GetPointer()); ImageToImageFilter::SetNthOutput( 0, resultImage ); return; } if ( m_SliceDimension >= input->GetDimension() ) { MITK_ERROR << "mitk::ExtractImageFilter:GenerateData m_SliceDimension == " << m_SliceDimension << " makes no sense with an " << input->GetDimension() << "D image." << std::endl; itkExceptionMacro("This is not a sensible value for m_SliceDimension."); return; } AccessFixedDimensionByItk( input, ItkImageProcessing, 3 ); // set a nice geometry for display and point transformations Geometry3D* inputImageGeometry = ImageToImageFilter::GetInput(0)->GetGeometry(); if (!inputImageGeometry) { MITK_ERROR << "In ExtractImageFilter::ItkImageProcessing: Input image has no geometry!" << std::endl; return; } PlaneGeometry::PlaneOrientation orientation = PlaneGeometry::Transversal; switch ( m_SliceDimension ) { default: case 2: orientation = PlaneGeometry::Transversal; break; case 1: orientation = PlaneGeometry::Frontal; break; case 0: orientation = PlaneGeometry::Sagittal; break; } PlaneGeometry::Pointer planeGeometry = PlaneGeometry::New(); planeGeometry->InitializeStandardPlane( inputImageGeometry, orientation, (ScalarType)m_SliceIndex, true, false ); Image::Pointer resultImage = ImageToImageFilter::GetOutput(); planeGeometry->ChangeImageGeometryConsideringOriginOffset(true); resultImage->SetGeometry( planeGeometry ); } template void mitk::ExtractImageFilter::ItkImageProcessing( itk::Image* itkImage ) { // use the itk::ExtractImageFilter to get a 2D image typedef itk::Image< TPixel, VImageDimension > ImageType3D; typedef itk::Image< TPixel, VImageDimension-1 > ImageType2D; typename ImageType3D::RegionType inSliceRegion = itkImage->GetLargestPossibleRegion(); inSliceRegion.SetSize( m_SliceDimension, 0 ); typedef itk::ExtractImageFilter ExtractImageFilterType; typename ExtractImageFilterType::Pointer sliceExtractor = ExtractImageFilterType::New(); sliceExtractor->SetInput( itkImage ); inSliceRegion.SetIndex( m_SliceDimension, m_SliceIndex ); sliceExtractor->SetExtractionRegion( inSliceRegion ); // calculate the output sliceExtractor->UpdateLargestPossibleRegion(); typename ImageType2D::Pointer slice = sliceExtractor->GetOutput(); // possible bug in itk::ExtractImageFilter: or in CastToItkImage ? // direction maxtrix is wrong/broken/not working with mitk::Image::InitializeByItkImage // solution here: we overwrite it with an unity matrix // correct image direction only if ITK version < 3.10 #if (ITK_VERSION_MAJOR == 3 && ITK_VERSION_MINOR < 10) || ITK_VERSION_MAJOR < 3 typename ImageType2D::DirectionType imageDirection; imageDirection.SetIdentity(); slice->SetDirection(imageDirection); #endif // re-import to MITK Image::Pointer resultImage = ImageToImageFilter::GetOutput(); GrabItkImageMemory(slice, resultImage, NULL, false); } /* * What is the input requested region that is required to produce the output * requested region? By default, the largest possible region is always * required but this is overridden in many subclasses. For instance, for an * image processing filter where an output pixel is a simple function of an * input pixel, the input requested region will be set to the output * requested region. For an image processing filter where an output pixel is * a function of the pixels in a neighborhood of an input pixel, then the * input requested region will need to be larger than the output requested * region (to avoid introducing artificial boundary conditions). This * function should never request an input region that is outside the the * input largest possible region (i.e. implementations of this method should * crop the input requested region at the boundaries of the input largest * possible region). */ void mitk::ExtractImageFilter::GenerateInputRequestedRegion() { Superclass::GenerateInputRequestedRegion(); ImageToImageFilter::InputImagePointer input = const_cast< ImageToImageFilter::InputImageType* > ( this->GetInput() ); Image::Pointer output = this->GetOutput(); if (input->GetDimension() == 2) { input->SetRequestedRegionToLargestPossibleRegion(); return; } Image::RegionType requestedRegion; requestedRegion = output->GetRequestedRegion(); requestedRegion.SetIndex(0, 0); requestedRegion.SetIndex(1, 0); requestedRegion.SetIndex(2, 0); requestedRegion.SetSize(0, input->GetDimension(0)); requestedRegion.SetSize(1, input->GetDimension(1)); requestedRegion.SetSize(2, input->GetDimension(2)); requestedRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // only one slice needed requestedRegion.SetSize( m_SliceDimension, 1 ); input->SetRequestedRegion( &requestedRegion ); } /* * Generate the information decribing the output data. The default * implementation of this method will copy information from the input to the * output. A filter may override this method if its output will have different * information than its input. For instance, a filter that shrinks an image will * need to provide an implementation for this method that changes the spacing of * the pixels. Such filters should call their superclass' implementation of this * method prior to changing the information values they need (i.e. * GenerateOutputInformation() should call * Superclass::GenerateOutputInformation() prior to changing the information. */ void mitk::ExtractImageFilter::GenerateOutputInformation() { Image::Pointer output = this->GetOutput(); Image::ConstPointer input = this->GetInput(); if (input.IsNull()) return; if ( m_SliceDimension >= input->GetDimension() && input->GetDimension() != 2 ) { MITK_ERROR << "mitk::ExtractImageFilter:GenerateOutputInformation m_SliceDimension == " << m_SliceDimension << " makes no sense with an " << input->GetDimension() << "D image." << std::endl; itkExceptionMacro("This is not a sensible value for m_SliceDimension."); return; } unsigned int sliceDimension( m_SliceDimension ); if ( input->GetDimension() == 2) { sliceDimension = 2; } unsigned int tmpDimensions[2]; switch ( sliceDimension ) { default: case 2: // orientation = PlaneGeometry::Transversal; tmpDimensions[0] = input->GetDimension(0); tmpDimensions[1] = input->GetDimension(1); break; case 1: // orientation = PlaneGeometry::Frontal; tmpDimensions[0] = input->GetDimension(0); tmpDimensions[1] = input->GetDimension(2); break; case 0: // orientation = PlaneGeometry::Sagittal; tmpDimensions[0] = input->GetDimension(1); tmpDimensions[1] = input->GetDimension(2); break; } output->Initialize(input->GetPixelType(), 2, tmpDimensions, 1 /*input->GetNumberOfChannels()*/); // initialize the spacing of the output /* Vector3D spacing = input->GetSlicedGeometry()->GetSpacing(); if(input->GetDimension()>=2) spacing[2]=spacing[1]; else spacing[2] = 1.0; output->GetSlicedGeometry()->SetSpacing(spacing); */ output->SetPropertyList(input->GetPropertyList()->Clone()); } diff --git a/Modules/ImageStatistics/mitkImageStatisticsCalculator.cpp b/Modules/ImageStatistics/mitkImageStatisticsCalculator.cpp index f036529b8b..24941ef244 100644 --- a/Modules/ImageStatistics/mitkImageStatisticsCalculator.cpp +++ b/Modules/ImageStatistics/mitkImageStatisticsCalculator.cpp @@ -1,1035 +1,1036 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ Version: $Revision: 17179 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkImageStatisticsCalculator.h" #include "mitkImageAccessByItk.h" +#include "mitkImageCast.h" #include "mitkExtractImageFilter.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if ( ( VTK_MAJOR_VERSION <= 5 ) && ( VTK_MINOR_VERSION<=8) ) #include "mitkvtkLassoStencilSource.h" #else #include "vtkLassoStencilSource.h" #endif #include #include namespace mitk { ImageStatisticsCalculator::ImageStatisticsCalculator() : m_MaskingMode( MASKING_MODE_NONE ), m_MaskingModeChanged( false ), m_DoIgnorePixelValue(false), m_IgnorePixelValue(0.0), m_IgnorePixelValueChanged(false) { m_EmptyHistogram = HistogramType::New(); HistogramType::SizeType histogramSize; histogramSize.Fill( 256 ); m_EmptyHistogram->Initialize( histogramSize ); m_EmptyStatistics.Reset(); } ImageStatisticsCalculator::~ImageStatisticsCalculator() { } void ImageStatisticsCalculator::SetImage( const mitk::Image *image ) { if ( m_Image != image ) { m_Image = image; this->Modified(); unsigned int numberOfTimeSteps = image->GetTimeSteps(); // Initialize vectors to time-size of this image m_ImageHistogramVector.resize( numberOfTimeSteps ); m_MaskedImageHistogramVector.resize( numberOfTimeSteps ); m_PlanarFigureHistogramVector.resize( numberOfTimeSteps ); m_ImageStatisticsVector.resize( numberOfTimeSteps ); m_MaskedImageStatisticsVector.resize( numberOfTimeSteps ); m_PlanarFigureStatisticsVector.resize( numberOfTimeSteps ); m_ImageStatisticsTimeStampVector.resize( numberOfTimeSteps ); m_MaskedImageStatisticsTimeStampVector.resize( numberOfTimeSteps ); m_PlanarFigureStatisticsTimeStampVector.resize( numberOfTimeSteps ); m_ImageStatisticsCalculationTriggerVector.resize( numberOfTimeSteps ); m_MaskedImageStatisticsCalculationTriggerVector.resize( numberOfTimeSteps ); m_PlanarFigureStatisticsCalculationTriggerVector.resize( numberOfTimeSteps ); for ( unsigned int t = 0; t < image->GetTimeSteps(); ++t ) { m_ImageStatisticsTimeStampVector[t].Modified(); m_ImageStatisticsCalculationTriggerVector[t] = true; } } } void ImageStatisticsCalculator::SetImageMask( const mitk::Image *imageMask ) { if ( m_Image.IsNull() ) { itkExceptionMacro( << "Image needs to be set first!" ); } if ( m_Image->GetTimeSteps() != imageMask->GetTimeSteps() ) { itkExceptionMacro( << "Image and image mask need to have equal number of time steps!" ); } if ( m_ImageMask != imageMask ) { m_ImageMask = imageMask; this->Modified(); for ( unsigned int t = 0; t < m_Image->GetTimeSteps(); ++t ) { m_MaskedImageStatisticsTimeStampVector[t].Modified(); m_MaskedImageStatisticsCalculationTriggerVector[t] = true; } } } void ImageStatisticsCalculator::SetPlanarFigure( mitk::PlanarFigure *planarFigure ) { if ( m_Image.IsNull() ) { itkExceptionMacro( << "Image needs to be set first!" ); } if ( m_PlanarFigure != planarFigure ) { m_PlanarFigure = planarFigure; this->Modified(); for ( unsigned int t = 0; t < m_Image->GetTimeSteps(); ++t ) { m_PlanarFigureStatisticsTimeStampVector[t].Modified(); m_PlanarFigureStatisticsCalculationTriggerVector[t] = true; } } } void ImageStatisticsCalculator::SetMaskingMode( unsigned int mode ) { if ( m_MaskingMode != mode ) { m_MaskingMode = mode; m_MaskingModeChanged = true; this->Modified(); } } void ImageStatisticsCalculator::SetMaskingModeToNone() { if ( m_MaskingMode != MASKING_MODE_NONE ) { m_MaskingMode = MASKING_MODE_NONE; m_MaskingModeChanged = true; this->Modified(); } } void ImageStatisticsCalculator::SetMaskingModeToImage() { if ( m_MaskingMode != MASKING_MODE_IMAGE ) { m_MaskingMode = MASKING_MODE_IMAGE; m_MaskingModeChanged = true; this->Modified(); } } void ImageStatisticsCalculator::SetMaskingModeToPlanarFigure() { if ( m_MaskingMode != MASKING_MODE_PLANARFIGURE ) { m_MaskingMode = MASKING_MODE_PLANARFIGURE; m_MaskingModeChanged = true; this->Modified(); } } void ImageStatisticsCalculator::SetIgnorePixelValue(double value) { if ( m_IgnorePixelValue != value ) { m_IgnorePixelValue = value; if(m_DoIgnorePixelValue) { m_IgnorePixelValueChanged = true; } this->Modified(); } } double ImageStatisticsCalculator::GetIgnorePixelValue() { return m_IgnorePixelValue; } void ImageStatisticsCalculator::SetDoIgnorePixelValue(bool value) { if ( m_DoIgnorePixelValue != value ) { m_DoIgnorePixelValue = value; m_IgnorePixelValueChanged = true; this->Modified(); } } bool ImageStatisticsCalculator::GetDoIgnorePixelValue() { return m_DoIgnorePixelValue; } bool ImageStatisticsCalculator::ComputeStatistics( unsigned int timeStep ) { if ( m_Image.IsNull() ) { itkExceptionMacro( << "Image not set!" ); } if ( m_Image->GetReferenceCount() == 1 ) { // Image no longer valid; we are the only ones to still hold a reference on it return false; } if ( timeStep >= m_Image->GetTimeSteps() ) { throw std::runtime_error( "Error: invalid time step!" ); } // If a mask was set but we are the only ones to still hold a reference on // it, delete it. if ( m_ImageMask.IsNotNull() && (m_ImageMask->GetReferenceCount() == 1) ) { m_ImageMask = NULL; } // Check if statistics is already up-to-date unsigned long imageMTime = m_ImageStatisticsTimeStampVector[timeStep].GetMTime(); unsigned long maskedImageMTime = m_MaskedImageStatisticsTimeStampVector[timeStep].GetMTime(); unsigned long planarFigureMTime = m_PlanarFigureStatisticsTimeStampVector[timeStep].GetMTime(); bool imageStatisticsCalculationTrigger = m_ImageStatisticsCalculationTriggerVector[timeStep]; bool maskedImageStatisticsCalculationTrigger = m_MaskedImageStatisticsCalculationTriggerVector[timeStep]; bool planarFigureStatisticsCalculationTrigger = m_PlanarFigureStatisticsCalculationTriggerVector[timeStep]; if ( !m_IgnorePixelValueChanged && ((m_MaskingMode != MASKING_MODE_NONE) || (imageMTime > m_Image->GetMTime() && !imageStatisticsCalculationTrigger)) && ((m_MaskingMode != MASKING_MODE_IMAGE) || (maskedImageMTime > m_ImageMask->GetMTime() && !maskedImageStatisticsCalculationTrigger)) && ((m_MaskingMode != MASKING_MODE_PLANARFIGURE) || (planarFigureMTime > m_PlanarFigure->GetMTime() && !planarFigureStatisticsCalculationTrigger)) ) { // Statistics is up to date! if ( m_MaskingModeChanged ) { m_MaskingModeChanged = false; return true; } else { return false; } } // Reset state changed flag m_MaskingModeChanged = false; m_IgnorePixelValueChanged = false; // Depending on masking mode, extract and/or generate the required image // and mask data from the user input this->ExtractImageAndMask( timeStep ); Statistics *statistics; HistogramType::ConstPointer *histogram; switch ( m_MaskingMode ) { case MASKING_MODE_NONE: default: { if(!m_DoIgnorePixelValue) { statistics = &m_ImageStatisticsVector[timeStep]; histogram = &m_ImageHistogramVector[timeStep]; m_ImageStatisticsTimeStampVector[timeStep].Modified(); m_ImageStatisticsCalculationTriggerVector[timeStep] = false; } else { statistics = &m_MaskedImageStatisticsVector[timeStep]; histogram = &m_MaskedImageHistogramVector[timeStep]; m_MaskedImageStatisticsTimeStampVector[timeStep].Modified(); m_MaskedImageStatisticsCalculationTriggerVector[timeStep] = false; } break; } case MASKING_MODE_IMAGE: statistics = &m_MaskedImageStatisticsVector[timeStep]; histogram = &m_MaskedImageHistogramVector[timeStep]; m_MaskedImageStatisticsTimeStampVector[timeStep].Modified(); m_MaskedImageStatisticsCalculationTriggerVector[timeStep] = false; break; case MASKING_MODE_PLANARFIGURE: statistics = &m_PlanarFigureStatisticsVector[timeStep]; histogram = &m_PlanarFigureHistogramVector[timeStep]; m_PlanarFigureStatisticsTimeStampVector[timeStep].Modified(); m_PlanarFigureStatisticsCalculationTriggerVector[timeStep] = false; break; } // Calculate statistics and histogram(s) if ( m_InternalImage->GetDimension() == 3 ) { if ( m_MaskingMode == MASKING_MODE_NONE && !m_DoIgnorePixelValue ) { AccessFixedDimensionByItk_2( m_InternalImage, InternalCalculateStatisticsUnmasked, 3, *statistics, histogram ); } else { AccessFixedDimensionByItk_3( m_InternalImage, InternalCalculateStatisticsMasked, 3, m_InternalImageMask3D.GetPointer(), *statistics, histogram ); } } else if ( m_InternalImage->GetDimension() == 2 ) { if ( m_MaskingMode == MASKING_MODE_NONE && !m_DoIgnorePixelValue ) { AccessFixedDimensionByItk_2( m_InternalImage, InternalCalculateStatisticsUnmasked, 2, *statistics, histogram ); } else { AccessFixedDimensionByItk_3( m_InternalImage, InternalCalculateStatisticsMasked, 2, m_InternalImageMask2D.GetPointer(), *statistics, histogram ); } } else { MITK_ERROR << "ImageStatistics: Image dimension not supported!"; } // Release unused image smart pointers to free memory m_InternalImage = mitk::Image::ConstPointer(); m_InternalImageMask3D = MaskImage3DType::Pointer(); m_InternalImageMask2D = MaskImage2DType::Pointer(); return true; } const ImageStatisticsCalculator::HistogramType * ImageStatisticsCalculator::GetHistogram( unsigned int timeStep ) const { if ( m_Image.IsNull() || (timeStep >= m_Image->GetTimeSteps()) ) { return NULL; } switch ( m_MaskingMode ) { case MASKING_MODE_NONE: default: { if(m_DoIgnorePixelValue) return m_MaskedImageHistogramVector[timeStep]; return m_ImageHistogramVector[timeStep]; } case MASKING_MODE_IMAGE: return m_MaskedImageHistogramVector[timeStep]; case MASKING_MODE_PLANARFIGURE: return m_PlanarFigureHistogramVector[timeStep]; } } const ImageStatisticsCalculator::Statistics & ImageStatisticsCalculator::GetStatistics( unsigned int timeStep ) const { if ( m_Image.IsNull() || (timeStep >= m_Image->GetTimeSteps()) ) { return m_EmptyStatistics; } switch ( m_MaskingMode ) { case MASKING_MODE_NONE: default: { if(m_DoIgnorePixelValue) return m_MaskedImageStatisticsVector[timeStep]; return m_ImageStatisticsVector[timeStep]; } case MASKING_MODE_IMAGE: return m_MaskedImageStatisticsVector[timeStep]; case MASKING_MODE_PLANARFIGURE: return m_PlanarFigureStatisticsVector[timeStep]; } } void ImageStatisticsCalculator::ExtractImageAndMask( unsigned int timeStep ) { if ( m_Image.IsNull() ) { throw std::runtime_error( "Error: image empty!" ); } if ( timeStep >= m_Image->GetTimeSteps() ) { throw std::runtime_error( "Error: invalid time step!" ); } ImageTimeSelector::Pointer imageTimeSelector = ImageTimeSelector::New(); imageTimeSelector->SetInput( m_Image ); imageTimeSelector->SetTimeNr( timeStep ); imageTimeSelector->UpdateLargestPossibleRegion(); mitk::Image *timeSliceImage = imageTimeSelector->GetOutput(); switch ( m_MaskingMode ) { case MASKING_MODE_NONE: { m_InternalImage = timeSliceImage; m_InternalImageMask2D = NULL; m_InternalImageMask3D = NULL; if(m_DoIgnorePixelValue) { if( m_InternalImage->GetDimension() == 3 ) { CastToItkImage( timeSliceImage, m_InternalImageMask3D ); m_InternalImageMask3D->FillBuffer(1); } if( m_InternalImage->GetDimension() == 2 ) { CastToItkImage( timeSliceImage, m_InternalImageMask2D ); m_InternalImageMask2D->FillBuffer(1); } } break; } case MASKING_MODE_IMAGE: { if ( m_ImageMask.IsNotNull() && (m_ImageMask->GetReferenceCount() > 1) ) { if ( timeStep < m_ImageMask->GetTimeSteps() ) { ImageTimeSelector::Pointer maskedImageTimeSelector = ImageTimeSelector::New(); maskedImageTimeSelector->SetInput( m_ImageMask ); maskedImageTimeSelector->SetTimeNr( timeStep ); maskedImageTimeSelector->UpdateLargestPossibleRegion(); mitk::Image *timeSliceMaskedImage = maskedImageTimeSelector->GetOutput(); m_InternalImage = timeSliceImage; CastToItkImage( timeSliceMaskedImage, m_InternalImageMask3D ); } else { throw std::runtime_error( "Error: image mask has not enough time steps!" ); } } else { throw std::runtime_error( "Error: image mask empty!" ); } break; } case MASKING_MODE_PLANARFIGURE: { m_InternalImageMask2D = NULL; if ( m_PlanarFigure.IsNull() ) { throw std::runtime_error( "Error: planar figure empty!" ); } if ( !m_PlanarFigure->IsClosed() ) { throw std::runtime_error( "Masking not possible for non-closed figures" ); } const Geometry3D *imageGeometry = timeSliceImage->GetGeometry(); if ( imageGeometry == NULL ) { throw std::runtime_error( "Image geometry invalid!" ); } const Geometry2D *planarFigureGeometry2D = m_PlanarFigure->GetGeometry2D(); if ( planarFigureGeometry2D == NULL ) { throw std::runtime_error( "Planar-Figure not yet initialized!" ); } const PlaneGeometry *planarFigureGeometry = dynamic_cast< const PlaneGeometry * >( planarFigureGeometry2D ); if ( planarFigureGeometry == NULL ) { throw std::runtime_error( "Non-planar planar figures not supported!" ); } // Find principal direction of PlanarFigure in input image unsigned int axis; if ( !this->GetPrincipalAxis( imageGeometry, planarFigureGeometry->GetNormal(), axis ) ) { throw std::runtime_error( "Non-aligned planar figures not supported!" ); } // Find slice number corresponding to PlanarFigure in input image MaskImage3DType::IndexType index; imageGeometry->WorldToIndex( planarFigureGeometry->GetOrigin(), index ); unsigned int slice = index[axis]; // Extract slice with given position and direction from image ExtractImageFilter::Pointer imageExtractor = ExtractImageFilter::New(); imageExtractor->SetInput( timeSliceImage ); imageExtractor->SetSliceDimension( axis ); imageExtractor->SetSliceIndex( slice ); imageExtractor->Update(); m_InternalImage = imageExtractor->GetOutput(); // Compute mask from PlanarFigure AccessFixedDimensionByItk_1( m_InternalImage, InternalCalculateMaskFromPlanarFigure, 2, axis ); } } if(m_DoIgnorePixelValue) { if ( m_InternalImage->GetDimension() == 3 ) { AccessFixedDimensionByItk_1( m_InternalImage, InternalMaskIgnoredPixels, 3, m_InternalImageMask3D.GetPointer() ); } else if ( m_InternalImage->GetDimension() == 2 ) { AccessFixedDimensionByItk_1( m_InternalImage, InternalMaskIgnoredPixels, 2, m_InternalImageMask2D.GetPointer() ); } } } bool ImageStatisticsCalculator::GetPrincipalAxis( const Geometry3D *geometry, Vector3D vector, unsigned int &axis ) { vector.Normalize(); for ( unsigned int i = 0; i < 3; ++i ) { Vector3D axisVector = geometry->GetAxisVector( i ); axisVector.Normalize(); if ( fabs( fabs( axisVector * vector ) - 1.0) < mitk::eps ) { axis = i; return true; } } return false; } template < typename TPixel, unsigned int VImageDimension > void ImageStatisticsCalculator::InternalCalculateStatisticsUnmasked( const itk::Image< TPixel, VImageDimension > *image, Statistics &statistics, typename HistogramType::ConstPointer *histogram ) { typedef itk::Image< TPixel, VImageDimension > ImageType; typedef itk::Image< unsigned short, VImageDimension > MaskImageType; typedef typename ImageType::IndexType IndexType; typedef itk::Statistics::ScalarImageToHistogramGenerator< ImageType > HistogramGeneratorType; // Progress listening... typedef itk::SimpleMemberCommand< ImageStatisticsCalculator > ITKCommandType; ITKCommandType::Pointer progressListener; progressListener = ITKCommandType::New(); progressListener->SetCallbackFunction( this, &ImageStatisticsCalculator::UnmaskedStatisticsProgressUpdate ); // Issue 100 artificial progress events since ScalarIMageToHistogramGenerator // does not (yet?) support progress reporting this->InvokeEvent( itk::StartEvent() ); for ( unsigned int i = 0; i < 100; ++i ) { this->UnmaskedStatisticsProgressUpdate(); } // Calculate histogram typename HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput( image ); histogramGenerator->SetMarginalScale( 100 ); // Defines y-margin width of histogram histogramGenerator->SetNumberOfBins( 768 ); // CT range [-1024, +2048] --> bin size 4 values histogramGenerator->SetHistogramMin( -1024.0 ); histogramGenerator->SetHistogramMax( 2048.0 ); histogramGenerator->Compute(); *histogram = histogramGenerator->GetOutput(); // Calculate statistics (separate filter) typedef itk::StatisticsImageFilter< ImageType > StatisticsFilterType; typename StatisticsFilterType::Pointer statisticsFilter = StatisticsFilterType::New(); statisticsFilter->SetInput( image ); unsigned long observerTag = statisticsFilter->AddObserver( itk::ProgressEvent(), progressListener ); statisticsFilter->Update(); statisticsFilter->RemoveObserver( observerTag ); this->InvokeEvent( itk::EndEvent() ); statistics.N = image->GetBufferedRegion().GetNumberOfPixels(); statistics.Min = statisticsFilter->GetMinimum(); statistics.Max = statisticsFilter->GetMaximum(); statistics.Mean = statisticsFilter->GetMean(); statistics.Median = 0.0; statistics.Sigma = statisticsFilter->GetSigma(); statistics.RMS = sqrt( statistics.Mean * statistics.Mean + statistics.Sigma * statistics.Sigma ); } template < typename TPixel, unsigned int VImageDimension > void ImageStatisticsCalculator::InternalMaskIgnoredPixels( const itk::Image< TPixel, VImageDimension > *image, itk::Image< unsigned short, VImageDimension > *maskImage ) { typedef itk::Image< TPixel, VImageDimension > ImageType; typedef itk::Image< unsigned short, VImageDimension > MaskImageType; itk::ImageRegionIterator itmask(maskImage, maskImage->GetLargestPossibleRegion()); itk::ImageRegionConstIterator itimage(image, image->GetLargestPossibleRegion()); itmask = itmask.Begin(); itimage = itimage.Begin(); while( !itmask.IsAtEnd() ) { if(m_IgnorePixelValue == itimage.Get()) { itmask.Set(0); } ++itmask; ++itimage; } } template < typename TPixel, unsigned int VImageDimension > void ImageStatisticsCalculator::InternalCalculateStatisticsMasked( const itk::Image< TPixel, VImageDimension > *image, itk::Image< unsigned short, VImageDimension > *maskImage, Statistics &statistics, typename HistogramType::ConstPointer *histogram ) { typedef itk::Image< TPixel, VImageDimension > ImageType; typedef itk::Image< unsigned short, VImageDimension > MaskImageType; typedef typename ImageType::IndexType IndexType; typedef typename ImageType::PointType PointType; typedef typename ImageType::SpacingType SpacingType; typedef itk::LabelStatisticsImageFilter< ImageType, MaskImageType > LabelStatisticsFilterType; typedef itk::ChangeInformationImageFilter< MaskImageType > ChangeInformationFilterType; typedef itk::ExtractImageFilter< ImageType, ImageType > ExtractImageFilterType; // Make sure that mask is set if ( maskImage == NULL ) { itkExceptionMacro( << "Mask image needs to be set!" ); } // Make sure that spacing of mask and image are the same SpacingType imageSpacing = image->GetSpacing(); SpacingType maskSpacing = maskImage->GetSpacing(); PointType zeroPoint; zeroPoint.Fill( 0.0 ); if ( (zeroPoint + imageSpacing).SquaredEuclideanDistanceTo( (zeroPoint + maskSpacing) ) > mitk::eps ) { itkExceptionMacro( << "Mask needs to have same spacing as image! (Image spacing: " << imageSpacing << "; Mask spacing: " << maskSpacing << ")" ); } // Make sure that the voxels of mask and image are correctly "aligned", i.e., voxel boundaries are the same in both images PointType imageOrigin = image->GetOrigin(); PointType maskOrigin = maskImage->GetOrigin(); long offset[ImageType::ImageDimension]; for ( unsigned int i = 0; i < ImageType::ImageDimension; ++i ) { double indexCoordDistance = (maskOrigin[i] - imageOrigin[i]) / imageSpacing[i]; double misalignment = indexCoordDistance - floor( indexCoordDistance + 0.5 ); if ( fabs( misalignment ) > imageSpacing[i] / 20.0 ) { itkExceptionMacro( << "Pixels/voxels of mask and image are not sufficiently aligned! (Misalignment: " << misalignment << ")" ); } offset[i] = (int) indexCoordDistance + image->GetBufferedRegion().GetIndex()[i]; } // Adapt the origin and region (index/size) of the mask so that the origin of both are the same typename ChangeInformationFilterType::Pointer adaptMaskFilter; adaptMaskFilter = ChangeInformationFilterType::New(); adaptMaskFilter->ChangeOriginOn(); adaptMaskFilter->ChangeRegionOn(); adaptMaskFilter->SetInput( maskImage ); adaptMaskFilter->SetOutputOrigin( image->GetOrigin() ); adaptMaskFilter->SetOutputOffset( offset ); adaptMaskFilter->Update(); typename MaskImageType::Pointer adaptedMaskImage = adaptMaskFilter->GetOutput(); // Make sure that mask region is contained within image region if ( !image->GetLargestPossibleRegion().IsInside( adaptedMaskImage->GetLargestPossibleRegion() ) ) { itkExceptionMacro( << "Mask region needs to be inside of image region! (Image region: " << image->GetLargestPossibleRegion() << "; Mask region: " << adaptedMaskImage->GetLargestPossibleRegion() << ")" ); } // If mask region is smaller than image region, extract the sub-sampled region from the original image typename ImageType::SizeType imageSize = image->GetBufferedRegion().GetSize(); typename ImageType::SizeType maskSize = maskImage->GetBufferedRegion().GetSize(); bool maskSmallerImage = false; for ( unsigned int i = 0; i < ImageType::ImageDimension; ++i ) { if ( maskSize[i] < imageSize[i] ) { maskSmallerImage = true; } } typename ImageType::ConstPointer adaptedImage; if ( maskSmallerImage ) { typename ExtractImageFilterType::Pointer extractImageFilter = ExtractImageFilterType::New(); extractImageFilter->SetInput( image ); extractImageFilter->SetExtractionRegion( adaptedMaskImage->GetBufferedRegion() ); extractImageFilter->Update(); adaptedImage = extractImageFilter->GetOutput(); } else { adaptedImage = image; } // Initialize Filter typename LabelStatisticsFilterType::Pointer labelStatisticsFilter; labelStatisticsFilter = LabelStatisticsFilterType::New(); labelStatisticsFilter->SetInput( adaptedImage ); labelStatisticsFilter->SetLabelInput( adaptedMaskImage ); labelStatisticsFilter->UseHistogramsOn(); labelStatisticsFilter->SetHistogramParameters( 384, -1024.0, 2048.0); // Add progress listening typedef itk::SimpleMemberCommand< ImageStatisticsCalculator > ITKCommandType; ITKCommandType::Pointer progressListener; progressListener = ITKCommandType::New(); progressListener->SetCallbackFunction( this, &ImageStatisticsCalculator::MaskedStatisticsProgressUpdate ); unsigned long observerTag = labelStatisticsFilter->AddObserver( itk::ProgressEvent(), progressListener ); // Execute filter this->InvokeEvent( itk::StartEvent() ); // Make sure that only the mask region is considered (otherwise, if the mask region is smaller // than the image region, the Update() would result in an exception). labelStatisticsFilter->GetOutput()->SetRequestedRegion( adaptedMaskImage->GetLargestPossibleRegion() ); // Execute the filter labelStatisticsFilter->Update(); this->InvokeEvent( itk::EndEvent() ); labelStatisticsFilter->RemoveObserver( observerTag ); // Find label of mask (other than 0) bool maskNonEmpty = false; unsigned int i; for ( i = 1; i < 4096; ++i ) { if ( labelStatisticsFilter->HasLabel( i ) ) { maskNonEmpty = true; break; } } if ( maskNonEmpty ) { *histogram = labelStatisticsFilter->GetHistogram( i ); statistics.N = labelStatisticsFilter->GetCount( i ); statistics.Min = labelStatisticsFilter->GetMinimum( i ); statistics.Max = labelStatisticsFilter->GetMaximum( i ); statistics.Mean = labelStatisticsFilter->GetMean( i ); statistics.Median = labelStatisticsFilter->GetMedian( i ); statistics.Sigma = labelStatisticsFilter->GetSigma( i ); statistics.RMS = sqrt( statistics.Mean * statistics.Mean + statistics.Sigma * statistics.Sigma ); } else { *histogram = m_EmptyHistogram; statistics.Reset(); } } template < typename TPixel, unsigned int VImageDimension > void ImageStatisticsCalculator::InternalCalculateMaskFromPlanarFigure( const itk::Image< TPixel, VImageDimension > *image, unsigned int axis ) { typedef itk::Image< TPixel, VImageDimension > ImageType; typedef itk::CastImageFilter< ImageType, MaskImage2DType > CastFilterType; // Generate mask image as new image with same header as input image and // initialize with "1". typename CastFilterType::Pointer castFilter = CastFilterType::New(); castFilter->SetInput( image ); castFilter->Update(); castFilter->GetOutput()->FillBuffer( 1 ); // all PolylinePoints of the PlanarFigure are stored in a vtkPoints object. // These points are used by the vtkLassoStencilSource to create // a vtkImageStencil. const mitk::Geometry2D *planarFigureGeometry2D = m_PlanarFigure->GetGeometry2D(); const typename PlanarFigure::PolyLineType planarFigurePolyline = m_PlanarFigure->GetPolyLine( 0 ); const mitk::Geometry3D *imageGeometry3D = m_Image->GetGeometry( 0 ); // Determine x- and y-dimensions depending on principal axis int i0, i1; switch ( axis ) { case 0: i0 = 1; i1 = 2; break; case 1: i0 = 0; i1 = 2; break; case 2: default: i0 = 0; i1 = 1; break; } // store the polyline contour as vtkPoints object bool outOfBounds = false; vtkSmartPointer points = vtkPoints::New(); typename PlanarFigure::PolyLineType::const_iterator it; const Vector3D& imageSpacing3D = imageGeometry3D->GetSpacing(); for ( it = planarFigurePolyline.begin(); it != planarFigurePolyline.end(); ++it ) { Point3D point3D; // Convert 2D point back to the local index coordinates of the selected // image planarFigureGeometry2D->Map( it->Point, point3D ); // Polygons (partially) outside of the image bounds can not be processed // further due to a bug in vtkPolyDataToImageStencil if ( !imageGeometry3D->IsInside( point3D ) ) { outOfBounds = true; } imageGeometry3D->WorldToIndex( point3D, point3D ); points->InsertNextPoint( point3D[i0], point3D[i1], 0 ); } if ( outOfBounds ) { throw std::runtime_error( "Figure at least partially outside of image bounds!" ); } // create a vtkLassoStencilSource and set the points of the Polygon vtkSmartPointer lassoStencil = vtkLassoStencilSource::New(); lassoStencil->SetShapeToPolygon(); lassoStencil->SetPoints( points ); // Export from ITK to VTK (to use a VTK filter) typedef itk::VTKImageImport< MaskImage2DType > ImageImportType; typedef itk::VTKImageExport< MaskImage2DType > ImageExportType; typename ImageExportType::Pointer itkExporter = ImageExportType::New(); itkExporter->SetInput( castFilter->GetOutput() ); vtkSmartPointer vtkImporter = vtkImageImport::New(); this->ConnectPipelines( itkExporter, vtkImporter ); // Apply the generated image stencil to the input image vtkSmartPointer imageStencilFilter = vtkImageStencil::New(); imageStencilFilter->SetInputConnection( vtkImporter->GetOutputPort() ); imageStencilFilter->SetStencil( lassoStencil->GetOutput() ); imageStencilFilter->ReverseStencilOff(); imageStencilFilter->SetBackgroundValue( 0 ); imageStencilFilter->Update(); // Export from VTK back to ITK vtkSmartPointer vtkExporter = vtkImageExport::New(); vtkExporter->SetInputConnection( imageStencilFilter->GetOutputPort() ); vtkExporter->Update(); typename ImageImportType::Pointer itkImporter = ImageImportType::New(); this->ConnectPipelines( vtkExporter, itkImporter ); itkImporter->Update(); // Store mask m_InternalImageMask2D = itkImporter->GetOutput(); // Clean up VTK objects vtkImporter->Delete(); imageStencilFilter->Delete(); //vtkExporter->Delete(); // TODO: crashes when outcommented; memory leak?? } void ImageStatisticsCalculator::UnmaskedStatisticsProgressUpdate() { // Need to throw away every second progress event to reach a final count of // 100 since two consecutive filters are used in this case static int updateCounter = 0; if ( updateCounter++ % 2 == 0 ) { this->InvokeEvent( itk::ProgressEvent() ); } } void ImageStatisticsCalculator::MaskedStatisticsProgressUpdate() { this->InvokeEvent( itk::ProgressEvent() ); } } diff --git a/Modules/MitkExt/Algorithms/mitkBoundingObjectToSegmentationFilter.cpp b/Modules/MitkExt/Algorithms/mitkBoundingObjectToSegmentationFilter.cpp index 3c7b5dbe90..55411b9788 100644 --- a/Modules/MitkExt/Algorithms/mitkBoundingObjectToSegmentationFilter.cpp +++ b/Modules/MitkExt/Algorithms/mitkBoundingObjectToSegmentationFilter.cpp @@ -1,120 +1,122 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 27918 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkBoundingObjectToSegmentationFilter.h" #include "mitkImageCast.h" +#include + mitk::BoundingObjectToSegmentationFilter::BoundingObjectToSegmentationFilter() { this->SetNumberOfRequiredInputs(1); } mitk::BoundingObjectToSegmentationFilter::~BoundingObjectToSegmentationFilter() { } void mitk::BoundingObjectToSegmentationFilter::SetBoundingObject(mitk::BoundingObject::Pointer boundingObject) { mitk::BoundingObjectGroup* testgroup = dynamic_cast (boundingObject.GetPointer()); if (testgroup) m_boundingObjectGroup = testgroup; else { m_boundingObjectGroup = mitk::BoundingObjectGroup::New(); m_boundingObjectGroup->AddBoundingObject(boundingObject); } } void mitk::BoundingObjectToSegmentationFilter::GenerateData() { typedef itk::Image itkImageType; mitk::Image::Pointer outputImage = this->GetOutput(); mitk::Image::ConstPointer inputImage = this->GetInput(); outputImage->Initialize(inputImage); itkImageType::Pointer itkImage; CastToItkImage(outputImage, itkImage); itkImage->FillBuffer(0); for (unsigned int i=0; iGetCount(); i++) { //create region for boundingobject mitk::BoundingObject::Pointer boundingObject = m_boundingObjectGroup->GetBoundingObjects().at(i); mitk::Geometry3D::Pointer boGeometry = boundingObject->GetGeometry(); mitk::Geometry3D::Pointer inputImageGeometry = inputImage->GetSlicedGeometry(); mitk::BoundingBox::Pointer boToIm = boGeometry->CalculateBoundingBoxRelativeToTransform(inputImageGeometry->GetIndexToWorldTransform()); mitk::BoundingBox::ConstPointer imgBB = inputImageGeometry->GetBoundingBox(); mitk::BoundingBox::PointType minImg = imgBB->GetMinimum(); mitk::BoundingBox::PointType maxImg = imgBB->GetMaximum(); itkImageType::IndexType boIndex; itkImageType::SizeType boSize; mitk::BoundingBox::PointType min = boToIm->GetMinimum(); mitk::BoundingBox::PointType max = boToIm->GetMaximum(); //check if boundingbox is inside imageregion for (int i =0; i<3; i++) { if (min [i] < minImg[i]) min[i] = minImg[i]; if (max [i] < minImg[i]) max[i] = minImg[i]; if (max[i] > maxImg[i]) max[i] = maxImg[i]; if (min [i] > maxImg[i]) min[i] = maxImg[i]-1; } // add 0.5 (boGeometry is no image geometry) boIndex[0] = (mitk::SlicedData::IndexType::IndexValueType)(min[0] + 0.5); boIndex[1] = (mitk::SlicedData::IndexType::IndexValueType)(min[1] + 0.5); boIndex[2] = (mitk::SlicedData::IndexType::IndexValueType)(min[2] + 0.5); // add 1 because we need 0.5 for each index boSize[0] = (mitk::SlicedData::IndexType::IndexValueType) (max[0]-min[0]); boSize[1] = (mitk::SlicedData::IndexType::IndexValueType) (max[1]-min[1]); boSize[2] = (mitk::SlicedData::IndexType::IndexValueType) (max[2]-min[2]); itkImageType::RegionType region(boIndex, boSize); //create region iterator itk::ImageRegionIteratorWithIndex itBoundingObject = itk::ImageRegionIteratorWithIndex(itkImage, region ); itBoundingObject.GoToBegin(); while(!itBoundingObject.IsAtEnd()) { itkImageType::IndexType index = itBoundingObject.GetIndex(); mitk::Point3D p; p[0] = index[0]; p[1] = index[1]; p[2] = index[2]; inputImageGeometry->IndexToWorld(p,p); if (boundingObject->IsInside(p) && boundingObject->GetPositive()) itBoundingObject.Set(1); else if (boundingObject->IsInside(p) && !boundingObject->GetPositive()) itBoundingObject.Set(0); ++itBoundingObject; } } CastToMitkImage(itkImage, outputImage); -} \ No newline at end of file +} diff --git a/Modules/MitkExt/Algorithms/mitkCalculateSegmentationVolume.cpp b/Modules/MitkExt/Algorithms/mitkCalculateSegmentationVolume.cpp index a339453733..3301d2b6eb 100644 --- a/Modules/MitkExt/Algorithms/mitkCalculateSegmentationVolume.cpp +++ b/Modules/MitkExt/Algorithms/mitkCalculateSegmentationVolume.cpp @@ -1,123 +1,125 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#include + #include "mitkCalculateSegmentationVolume.h" #include "itkImageRegionConstIteratorWithIndex.h" #include namespace mitk { CalculateSegmentationVolume::CalculateSegmentationVolume() { } CalculateSegmentationVolume::~CalculateSegmentationVolume() { } template < typename TPixel, unsigned int VImageDimension > void CalculateSegmentationVolume::ItkImageProcessing( itk::Image< TPixel, VImageDimension >* itkImage, TPixel* itkNotUsed(dummy) ) { itk::ImageRegionConstIteratorWithIndex > iterBinaryImage( itkImage, itkImage->GetLargestPossibleRegion() ); typename itk::ImageRegionConstIteratorWithIndex >::IndexType currentIndex; typename itk::ImageRegionConstIteratorWithIndex >::IndexType minIndex; for (unsigned int i = 0; i < VImageDimension; ++i) minIndex[i] = std::numeric_limits::max(); typename itk::ImageRegionConstIteratorWithIndex >::IndexType maxIndex; for (unsigned int i = 0; i < VImageDimension; ++i) maxIndex[i] = std::numeric_limits::min(); m_CenterOfMass.Fill(0.0); m_Volume = 0; while (!iterBinaryImage.IsAtEnd()) { if ( iterBinaryImage.Get() > static_cast(0.0) ) { // update center of mass currentIndex = iterBinaryImage.GetIndex(); itk::Vector currentPoint; for (unsigned int i = 0; i < VImageDimension; ++i) currentPoint[i] = currentIndex[i]; m_CenterOfMass = (m_CenterOfMass * ( static_cast(m_Volume) / static_cast(m_Volume+1) ) ) // e.g. 3 points: old center * 2/3 + currentPoint * 1/3; + currentPoint / static_cast(m_Volume+1); // update number of voxels ++m_Volume; // update bounding box for (unsigned int i = 0; i < VImageDimension; ++i) { if (currentIndex[i] < minIndex[i]) minIndex[i] = currentIndex[i]; if (currentIndex[i] > maxIndex[i]) maxIndex[i] = currentIndex[i]; } } ++iterBinaryImage; } m_MinIndexOfBoundingBox[2] = 0.0; m_MaxIndexOfBoundingBox[2] = 0.0; for (unsigned int i = 0; i < VImageDimension; ++i) { m_MinIndexOfBoundingBox[i] = minIndex[i]; m_MaxIndexOfBoundingBox[i] = maxIndex[i]; } } bool CalculateSegmentationVolume::ReadyToRun() { Image::Pointer image; GetPointerParameter("Input", image); return image.IsNotNull() && GetGroupNode(); } bool CalculateSegmentationVolume::ThreadedUpdateFunction() { // get image Image::Pointer image; GetPointerParameter("Input", image); AccessFixedDimensionByItk( image.GetPointer(), ItkImageProcessing, 3 ); // some magic to call the correctly templated function (we only do 3D images here!) // consider single voxel volume Vector3D spacing = image->GetSlicedGeometry()->GetSpacing(); // spacing in mm float volumeML = (ScalarType) m_Volume * spacing[0] * spacing[1] * spacing[2] / 1000.0; // convert to ml DataNode* groupNode = GetGroupNode(); if (groupNode) { groupNode->SetProperty( "volume", FloatProperty::New(volumeML) ); groupNode->SetProperty( "centerOfMass", Vector3DProperty::New(m_CenterOfMass) ); groupNode->SetProperty( "boundingBoxMinimum", Vector3DProperty::New(m_MinIndexOfBoundingBox) ); groupNode->SetProperty( "boundingBoxMaximum", Vector3DProperty::New(m_MaxIndexOfBoundingBox) ); groupNode->SetProperty( "showVolume", BoolProperty::New(true) ); } return true; } } // namespace diff --git a/Modules/MitkExt/Algorithms/mitkContourUtils.cpp b/Modules/MitkExt/Algorithms/mitkContourUtils.cpp index c8cb136f73..483eba1f23 100644 --- a/Modules/MitkExt/Algorithms/mitkContourUtils.cpp +++ b/Modules/MitkExt/Algorithms/mitkContourUtils.cpp @@ -1,166 +1,171 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkContourUtils.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" +#include "mitkInstantiateAccessFunctions.h" #include "ipSegmentation.h" +#define InstantiateAccessFunction_ItkCopyFilledContourToSlice(pixelType, dim) \ + template void mitk::ContourUtils::ItkCopyFilledContourToSlice(itk::Image*, const mitk::Image*, int); + // explicitly instantiate the 2D version of this method -InstantiateAccessFunctionForFixedDimension_2( mitk::ContourUtils::ItkCopyFilledContourToSlice, 2, const mitk::Image*, int ); +InstantiateAccessFunctionForFixedDimension(ItkCopyFilledContourToSlice, 2); mitk::ContourUtils::ContourUtils() { } mitk::ContourUtils::~ContourUtils() { } mitk::Contour::Pointer mitk::ContourUtils::ProjectContourTo2DSlice(Image* slice, Contour* contourIn3D, bool itkNotUsed( correctionForIpSegmentation ), bool constrainToInside) { if ( !slice || !contourIn3D ) return NULL; Contour::Pointer projectedContour = Contour::New(); const Contour::PathType::VertexListType* pointsIn3D = contourIn3D->GetContourPath()->GetVertexList(); const Geometry3D* sliceGeometry = slice->GetGeometry(); for ( Contour::PathType::VertexListType::const_iterator iter = pointsIn3D->begin(); iter != pointsIn3D->end(); ++iter ) { Contour::PathType::VertexType currentPointIn3DITK = *iter; Point3D currentPointIn3D; for (int i = 0; i < 3; ++i) currentPointIn3D[i] = currentPointIn3DITK[i]; Point3D projectedPointIn2D; projectedPointIn2D.Fill(0.0); sliceGeometry->WorldToIndex( currentPointIn3D, projectedPointIn2D ); // MITK_INFO << "world point " << currentPointIn3D << " in index is " << projectedPointIn2D; if ( !sliceGeometry->IsIndexInside( projectedPointIn2D ) && constrainToInside ) { MITK_INFO << "**" << currentPointIn3D << " is " << projectedPointIn2D << " --> correct it (TODO)" << std::endl; } projectedContour->AddVertex( projectedPointIn2D ); } return projectedContour; } mitk::Contour::Pointer mitk::ContourUtils::BackProjectContourFrom2DSlice(const Geometry3D* sliceGeometry, Contour* contourIn2D, bool itkNotUsed( correctionForIpSegmentation ) ) { if ( !sliceGeometry || !contourIn2D ) return NULL; Contour::Pointer worldContour = Contour::New(); const Contour::PathType::VertexListType* pointsIn2D = contourIn2D->GetContourPath()->GetVertexList(); for ( Contour::PathType::VertexListType::const_iterator iter = pointsIn2D->begin(); iter != pointsIn2D->end(); ++iter ) { Contour::PathType::VertexType currentPointIn3DITK = *iter; Point3D currentPointIn2D; for (int i = 0; i < 3; ++i) currentPointIn2D[i] = currentPointIn3DITK[i]; Point3D worldPointIn3D; worldPointIn3D.Fill(0.0); sliceGeometry->IndexToWorld( currentPointIn2D, worldPointIn3D ); //MITK_INFO << "index " << currentPointIn2D << " world " << worldPointIn3D << std::endl; worldContour->AddVertex( worldPointIn3D ); } return worldContour; } void mitk::ContourUtils::FillContourInSlice( Contour* projectedContour, Image* sliceImage, int paintingPixelValue ) { // 1. Use ipSegmentation to draw a filled(!) contour into a new 8 bit 2D image, which will later be copied back to the slice. // We don't work on the "real" working data, because ipSegmentation would restrict us to 8 bit images // convert the projected contour into a ipSegmentation format mitkIpInt4_t* picContour = new mitkIpInt4_t[2 * projectedContour->GetNumberOfPoints()]; const Contour::PathType::VertexListType* pointsIn2D = projectedContour->GetContourPath()->GetVertexList(); unsigned int index(0); for ( Contour::PathType::VertexListType::const_iterator iter = pointsIn2D->begin(); iter != pointsIn2D->end(); ++iter, ++index ) { picContour[ 2 * index + 0 ] = static_cast( (*iter)[0] + 1.0 ); // +0.5 wahrscheinlich richtiger picContour[ 2 * index + 1 ] = static_cast( (*iter)[1] + 1.0 ); //MITK_INFO << "mitk 2d [" << (*iter)[0] << ", " << (*iter)[1] << "] pic [" << picContour[ 2*index+0] << ", " << picContour[ 2*index+1] << "]"; } assert( sliceImage->GetSliceData() ); mitkIpPicDescriptor* originalPicSlice = sliceImage->GetSliceData()->GetPicDescriptor(); mitkIpPicDescriptor* picSlice = ipMITKSegmentationNew( originalPicSlice ); ipMITKSegmentationClear( picSlice ); assert( originalPicSlice && picSlice ); // here comes the actual contour filling algorithm (from ipSegmentation/Graphics Gems) ipMITKSegmentationCombineRegion ( picSlice, picContour, projectedContour->GetNumberOfPoints(), NULL, IPSEGMENTATION_OR, 1); // set to 1 delete[] picContour; // 2. Copy the filled contour to the working data slice // copy all pixels that are non-zero to the original image (not caring for the actual type of the working image). perhaps make the replace value a parameter ( -> general painting tool ). // make the pic slice an mitk/itk image (as little ipPic code as possible), call a templated method with accessbyitk, iterate over the original and the modified slice Image::Pointer ipsegmentationModifiedSlice = Image::New(); ipsegmentationModifiedSlice->Initialize( picSlice ); ipsegmentationModifiedSlice->SetPicSlice( picSlice ); AccessFixedDimensionByItk_2( sliceImage, ItkCopyFilledContourToSlice, 2, ipsegmentationModifiedSlice, paintingPixelValue ); ipsegmentationModifiedSlice = NULL; // free MITK header information ipMITKSegmentationFree( picSlice ); // free actual memory } template void mitk::ContourUtils::ItkCopyFilledContourToSlice( itk::Image* originalSlice, const Image* filledContourSlice, int overwritevalue ) { typedef itk::Image SliceType; typename SliceType::Pointer filledContourSliceITK; CastToItkImage( filledContourSlice, filledContourSliceITK ); // now the original slice and the ipSegmentation-painted slice are in the same format, and we can just copy all pixels that are non-zero typedef itk::ImageRegionIterator< SliceType > OutputIteratorType; typedef itk::ImageRegionConstIterator< SliceType > InputIteratorType; InputIteratorType inputIterator( filledContourSliceITK, filledContourSliceITK->GetLargestPossibleRegion() ); OutputIteratorType outputIterator( originalSlice, originalSlice->GetLargestPossibleRegion() ); outputIterator.GoToBegin(); inputIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { if ( inputIterator.Get() != 0 ) { outputIterator.Set( overwritevalue ); } ++outputIterator; ++inputIterator; } } diff --git a/Modules/MitkExt/Algorithms/mitkCorrectorAlgorithm.cpp b/Modules/MitkExt/Algorithms/mitkCorrectorAlgorithm.cpp index 4561a458f8..afbf24fce1 100644 --- a/Modules/MitkExt/Algorithms/mitkCorrectorAlgorithm.cpp +++ b/Modules/MitkExt/Algorithms/mitkCorrectorAlgorithm.cpp @@ -1,507 +1,509 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkCorrectorAlgorithm.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" +#include "mitkImageDataItem.h" #include "mitkContourUtils.h" mitk::CorrectorAlgorithm::CorrectorAlgorithm() :ImageToImageFilter() { } mitk::CorrectorAlgorithm::~CorrectorAlgorithm() { } void mitk::CorrectorAlgorithm::GenerateData() { Image::Pointer inputImage = const_cast(ImageToImageFilter::GetInput(0)); if (inputImage.IsNull() || inputImage->GetDimension() != 2) { itkExceptionMacro("CorrectorAlgorithm needs a 2D image as input."); } if (m_Contour.IsNull()) { itkExceptionMacro("CorrectorAlgorithm needs a Contour object as input."); } // copy the input (since m_WorkingImage will be changed later) m_WorkingImage = Image::New(); m_WorkingImage->Initialize( inputImage ); m_WorkingImage->SetVolume( inputImage.GetPointer()->GetData() ); if (inputImage->GetTimeSlicedGeometry() ) { AffineGeometryFrame3D::Pointer originalGeometryAGF = inputImage->GetTimeSlicedGeometry()->Clone(); TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast( originalGeometryAGF.GetPointer() ); m_WorkingImage->SetGeometry( originalGeometry ); } else { itkExceptionMacro("Original image does not have a 'Time sliced geometry'! Cannot copy."); } // Convert to ipMITKSegmentationTYPE (because TobiasHeimannCorrectionAlgorithm relys on that data type) itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeImage; CastToItkImage( m_WorkingImage, correctPixelTypeImage ); assert (correctPixelTypeImage.IsNotNull() ); // possible bug in CastToItkImage ? // direction maxtrix is wrong/broken/not working after CastToItkImage, leading to a failed assertion in // mitk/Core/DataStructures/mitkSlicedGeometry3D.cpp, 479: // virtual void mitk::SlicedGeometry3D::SetSpacing(const mitk::Vector3D&): Assertion `aSpacing[0]>0 && aSpacing[1]>0 && aSpacing[2]>0' failed // solution here: we overwrite it with an unity matrix itk::Image< ipMITKSegmentationTYPE, 2 >::DirectionType imageDirection; imageDirection.SetIdentity(); correctPixelTypeImage->SetDirection(imageDirection); Image::Pointer temporarySlice = this->GetOutput(); // temporarySlice = ImportItkImage( correctPixelTypeImage ); CastToMitkImage( correctPixelTypeImage, temporarySlice ); TobiasHeimannCorrectionAlgorithm( temporarySlice->GetSliceData()->GetPicDescriptor() ); // temporarySlice is our return value (user can get it by calling GetOutput() ) CalculateDifferenceImage( temporarySlice, inputImage ); if ( m_DifferenceImage.IsNotNull() && inputImage->GetTimeSlicedGeometry() ) { AffineGeometryFrame3D::Pointer originalGeometryAGF = inputImage->GetTimeSlicedGeometry()->Clone(); TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast( originalGeometryAGF.GetPointer() ); m_DifferenceImage->SetGeometry( originalGeometry ); } else { itkExceptionMacro("Original image does not have a 'Time sliced geometry'! Cannot copy."); } } void mitk::CorrectorAlgorithm::TobiasHeimannCorrectionAlgorithm(mitkIpPicDescriptor* pic) { /*! Some documentation (not by the original author) TobiasHeimannCorrectionAlgorithm will be called, when the user has finished drawing a freehand line. There should be different results, depending on the line's properties: 1. Without any prior segmentation, the start point and the end point of the drawn line will be connected to a contour and the area enclosed by the contour will be marked as segmentation. 2. When the whole line is inside a segmentation, start and end point will be connected to a contour and the area of this contour will be subtracted from the segmentation. 3. When the line starts inside a segmentation and ends outside with only a single transition from segmentation to no-segmentation, nothing will happen. 4. When there are multiple transitions between inside-segmentation and outside-segmentation, the line will be divided in so called segments. Each segment is either fully inside or fully outside a segmentation. When it is inside a segmentation, its enclosed area will be subtracted from the segmentation. When the segment is outside a segmentation, its enclosed area it will be added to the segmentation. The algorithm is described in full length in Tobias Heimann's diploma thesis (MBI Technical Report 145, p. 37 - 40). */ int oaSize = 1000000; // if we need a fixed number, then let it be big int* _ofsArray = new int[ oaSize ]; for (int i=0; i segData; segData.reserve( 16 ); Contour* contour3D = const_cast(m_Contour.GetPointer()); ContourUtils::Pointer contourUtils = ContourUtils::New(); Contour::Pointer projectedContour = contourUtils->ProjectContourTo2DSlice( m_WorkingImage, contour3D, true, false ); if (projectedContour.IsNull()) { delete[] _ofsArray; return; } if (projectedContour->GetNumberOfPoints() < 2) { delete[] _ofsArray; return; } // convert the projected contour into a ipSegmentation format mitkIpInt4_t* _points = new mitkIpInt4_t[2 * projectedContour->GetNumberOfPoints()]; const Contour::PathType::VertexListType* pointsIn2D = projectedContour->GetContourPath()->GetVertexList(); unsigned int index(0); for ( Contour::PathType::VertexListType::const_iterator iter = pointsIn2D->begin(); iter != pointsIn2D->end(); ++iter, ++index ) { _points[ 2 * index + 0 ] = static_cast( (*iter)[0] + 0.5 ); _points[ 2 * index + 1 ] = static_cast( (*iter)[1] + 0.5 ); } // store ofsets of the drawn line in array int _ofsNum = 0; unsigned int num = projectedContour->GetNumberOfPoints(); int lastOfs = -1; for (unsigned int i=0; i=pic->n[0]) x = pic->n[0]-0.5; if (y<0) y=0.5; else if (y>=pic->n[1]) y = pic->n[1]-0.5; // ok, now store safe ofs int ofs = (int)(x) + pic->n[0]*((int)(y)); x += dx; y += dy; if (ofs != lastOfs) { _ofsArray[_ofsNum++] = ofs; lastOfs = ofs; } } } if (_ofsNum == 0) { // contour was completely outside the binary image delete[] _ofsArray; delete[] _points; return; } ipMITKSegmentationTYPE* picdata = static_cast(pic->data); // divide line in logical segments: int numSegments = 0; ipMITKSegmentationTYPE state = *(picdata + _ofsArray[0]); int ofsP = 1; int modifyStart, modifyEnd; // start of first and end of last segment bool nextSegment; segData.clear(); do { nextSegment = false; while (ofsP<_ofsNum && *(picdata + _ofsArray[ofsP])==state) ofsP++; if (ofsP<_ofsNum) { int lineStart = ofsP-1; if (numSegments==0) modifyStart = ofsP; state = *(picdata + _ofsArray[ofsP]); while (ofsP<_ofsNum && *(picdata + _ofsArray[ofsP])==state) ofsP++; if (ofsP<_ofsNum) { int lineEnd = ofsP; modifyEnd = lineEnd; nextSegment = true; // now we've got a valid segment from lineStart to lineEnd TSegData thisSegData; thisSegData.lineStart = lineStart; thisSegData.lineEnd = lineEnd; thisSegData.modified = modifySegment( lineStart, lineEnd, state, pic, _ofsArray ); segData.push_back( thisSegData ); numSegments++; } } } while (nextSegment); for (int segNr=0; segNr < numSegments; segNr++) { // draw line if modified: if ( segData[segNr].modified ) { for (int i=segData[segNr].lineStart+1; in[0]*pic->n[1]; for (oneContourOffset = 0; oneContourOffset < imageSize; oneContourOffset++) if ( ((ipMITKSegmentationTYPE*) pic->data)[oneContourOffset]> 0) break; float* contourPoints = ipMITKSegmentationGetContour8N( pic, oneContourOffset, numberOfContourPoints, newBufferSize ); // memory allocated with malloc if (contourPoints) { // copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; for (int index = 0; index < numberOfContourPoints; ++index) { newPoint[0] = contourPoints[ 2 * index + 0 ]; newPoint[1] = contourPoints[ 2 * index + 1]; newPoint[2] = 0; contourInImageIndexCoordinates->AddVertex( newPoint ); } free(contourPoints); ContourUtils::Pointer contourUtils = ContourUtils::New(); contourUtils->FillContourInSlice( contourInImageIndexCoordinates, m_WorkingImage ); } delete[] _ofsArray; delete[] _points; } bool mitk::CorrectorAlgorithm::modifySegment( int lineStart, int lineEnd, ipMITKSegmentationTYPE state, mitkIpPicDescriptor *pic, int* _ofsArray ) { // offsets for pixels right, top, left, bottom int nbDelta4[4]; nbDelta4[0]=1; nbDelta4[1]=pic->n[0]; nbDelta4[1]*=-1; // necessary because of unsigned declaration of pic->n nbDelta4[2]=-1; nbDelta4[3]=pic->n[0]; // offsets for pixels right, top-right, top, top-left left, bottom-left, bottom, bottom-right int nbDelta8[8]; nbDelta8[0] = 1; nbDelta8[1] = nbDelta4[1]+1; nbDelta8[2] = nbDelta4[1]; nbDelta8[3] = nbDelta4[1]-1; nbDelta8[4] = -1; nbDelta8[5] = nbDelta4[3]-1; nbDelta8[6] = nbDelta4[3]; nbDelta8[7] = nbDelta4[3]+1; ipMITKSegmentationTYPE* picdata = static_cast(pic->data); ipMITKSegmentationTYPE saveStart = *(picdata + _ofsArray[lineStart]); ipMITKSegmentationTYPE saveEnd = *(picdata + _ofsArray[lineEnd]); ipMITKSegmentationTYPE newState = ((!state)&1) + 2; // probably equal to: ipMITKSegmentationTYPE newState = 3 - state; // make two copies of pic: mitkIpPicDescriptor *seg1 = mitkIpPicClone( pic ); mitkIpPicDescriptor *seg2 = mitkIpPicClone( pic ); int i; // mark line in original for (i=lineStart; i<=lineEnd; i++) { *(picdata + _ofsArray[i]) = 3; } // mark the first side in copy 1: bool firstPix = true; bool modified; int line = pic->n[0]; // #pixels in line int maxOfs = (int)(line * pic->n[1]); // #pixels in slice for (i=lineStart+1; i= maxOfs // below last line ) continue; ipMITKSegmentationTYPE nbVal = *(picdata + nbOfs); ipMITKSegmentationTYPE destVal = *(((ipMITKSegmentationTYPE*)seg1->data) + nbOfs); if (nbVal!=3 && destVal!=newState) { // get only neigbhours that are not part of the line itself if (firstPix) { *(((ipMITKSegmentationTYPE*)seg1->data) + nbOfs) = newState; // this one is used to mark the side! firstPix = false; modified = true; } else { int tnb = 0; while ( tnb < 4 && ((nbOfs + nbDelta4[tnb]) >= 0) && ((nbOfs + nbDelta4[tnb]) < maxOfs) && *(((ipMITKSegmentationTYPE*)seg1->data) + nbOfs + nbDelta4[tnb]) != newState ) tnb++; if (tnb < 4 && ((nbOfs + nbDelta4[tnb]) >= 0) && ((nbOfs + nbDelta4[tnb]) < maxOfs) ) { *(((ipMITKSegmentationTYPE*)seg1->data) + nbOfs) = newState; // we've got a buddy close modified = true; } } } } } while (modified); } // mark the other side in copy 2: for (i=lineStart+1; i= maxOfs // below last line ) continue; ipMITKSegmentationTYPE lineVal = *(picdata + nbOfs); ipMITKSegmentationTYPE side1Val = *(((ipMITKSegmentationTYPE*)seg1->data) + nbOfs); if (lineVal != 3 && side1Val != newState) { *(((ipMITKSegmentationTYPE*)seg2->data) + nbOfs) = newState; } } } // take care of line ends for multiple segments: *(((ipMITKSegmentationTYPE*)seg1->data) + _ofsArray[lineStart]) = newState; *(((ipMITKSegmentationTYPE*)seg1->data) + _ofsArray[lineEnd]) = newState; *(((ipMITKSegmentationTYPE*)seg2->data) + _ofsArray[lineStart]) = newState; *(((ipMITKSegmentationTYPE*)seg2->data) + _ofsArray[lineEnd]) = newState; // replace regions: newState = (!state)&1; int sizeRegion1 = 0, sizeRegion2 = 0; for (i=lineStart+1; idata) + _ofsArray[i]) != newState) { sizeRegion1 += ipMITKSegmentationReplaceRegion4N( seg1, _ofsArray[i], newState ); } if (*(((ipMITKSegmentationTYPE*)seg2->data) + _ofsArray[i]) != newState) { sizeRegion2 += ipMITKSegmentationReplaceRegion4N( seg2, _ofsArray[i], newState ); } } // combine image: //printf( "Size Region1 = %8i Size Region2 = %8i\n", sizeRegion1, sizeRegion2 ); int sizeDif; ipMITKSegmentationTYPE *current, *segSrc; if (sizeRegion1 < sizeRegion2) { segSrc = (ipMITKSegmentationTYPE*)seg1->data; sizeDif = sizeRegion2 - sizeRegion1; } else { segSrc = (ipMITKSegmentationTYPE*)seg2->data; sizeDif = sizeRegion1 - sizeRegion2; } modified = false; if (sizeDif > 2*(lineEnd-lineStart)) { // decision is safe enough: ipMITKSegmentationTYPE *end = picdata + (pic->n[0]*pic->n[1]); for (current = picdata; current we calculate a diff image using ITK, switching for the correct type of originalImage */ m_DifferenceImage = NULL; Image::Pointer tmpPtr = originalImage; AccessFixedDimensionByItk_1( tmpPtr, ItkCalculateDifferenceImage, 2, modifiedImage ); } template void mitk::CorrectorAlgorithm::ItkCalculateDifferenceImage( itk::Image* originalImage, Image* modifiedMITKImage ) { typedef itk::Image ModifiedImageType; typedef itk::Image DiffImageType; typedef itk::ImageRegionConstIterator< itk::Image > OriginalSliceIteratorType; typedef itk::ImageRegionConstIterator< ModifiedImageType > ModifiedSliceIteratorType; typedef itk::ImageRegionIterator< DiffImageType > DiffSliceIteratorType; typename ModifiedImageType::Pointer modifiedImage; CastToItkImage( modifiedMITKImage, modifiedImage ); // create new image as a copy of the input // this new image is the output of this filter class typename DiffImageType::Pointer diffImage; m_DifferenceImage = Image::New(); PixelType pixelType( typeid(short signed int) ); m_DifferenceImage->Initialize( pixelType, 2, modifiedMITKImage->GetDimensions() ); CastToItkImage( m_DifferenceImage, diffImage ); // iterators over both input images (original and modified) and the output image (diff) ModifiedSliceIteratorType modifiedIterator( modifiedImage, diffImage->GetLargestPossibleRegion() ); OriginalSliceIteratorType originalIterator( originalImage, diffImage->GetLargestPossibleRegion() ); DiffSliceIteratorType diffIterator( diffImage, diffImage->GetLargestPossibleRegion() ); modifiedIterator.GoToBegin(); originalIterator.GoToBegin(); diffIterator.GoToBegin(); while ( !diffIterator.IsAtEnd() ) { short signed int difference = static_cast( static_cast(modifiedIterator.Get()) - static_cast(originalIterator.Get())); // not good for bigger values ?! diffIterator.Set( difference ); ++modifiedIterator; ++originalIterator; ++diffIterator; } } diff --git a/Modules/MitkExt/Algorithms/mitkDiffImageApplier.cpp b/Modules/MitkExt/Algorithms/mitkDiffImageApplier.cpp index 97336e3356..3a62b82191 100644 --- a/Modules/MitkExt/Algorithms/mitkDiffImageApplier.cpp +++ b/Modules/MitkExt/Algorithms/mitkDiffImageApplier.cpp @@ -1,328 +1,329 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkDiffImageApplier.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkApplyDiffImageOperation.h" #include "mitkRenderingManager.h" #include "mitkSegmentationInterpolationController.h" #include "mitkImageTimeSelector.h" #include #include mitk::DiffImageApplier::DiffImageApplier() { } mitk::DiffImageApplier::~DiffImageApplier() { } void mitk::DiffImageApplier::ExecuteOperation( Operation* operation ) { ApplyDiffImageOperation* imageOperation = dynamic_cast( operation ); if ( imageOperation // we actually have the kind of operation that we can handle && imageOperation->IsImageStillValid() ) // AND the image is not yet deleted { m_Image = imageOperation->GetImage(); Image::Pointer image3D = m_Image; // will be changed later in case of 3D+t m_SliceDifferenceImage = imageOperation->GetDiffImage(); m_TimeStep = imageOperation->GetTimeStep(); m_Factor = imageOperation->GetFactor(); if ( m_SliceDifferenceImage->GetDimension() == 2 ) { m_SliceIndex = imageOperation->GetSliceIndex(); m_SliceDimension = imageOperation->GetSliceDimension(); switch (m_SliceDimension) { default: case 2: m_Dimension0 = 0; m_Dimension1 = 1; break; case 1: m_Dimension0 = 0; m_Dimension1 = 2; break; case 0: m_Dimension0 = 1; m_Dimension1 = 2; break; } if ( m_SliceDifferenceImage->GetDimension() != 2 || (m_Image->GetDimension() < 3 || m_Image->GetDimension() > 4) || m_SliceDifferenceImage->GetDimension(0) != m_Image->GetDimension(m_Dimension0) || m_SliceDifferenceImage->GetDimension(1) != m_Image->GetDimension(m_Dimension1) || m_SliceIndex >= m_Image->GetDimension(m_SliceDimension) ) { itkExceptionMacro("Slice and image dimensions differ or slice index is too large. Sorry, cannot work like this."); return; } if ( m_Image->GetDimension() == 4 ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( m_Image ); timeSelector->SetTimeNr( m_TimeStep ); timeSelector->UpdateLargestPossibleRegion(); image3D = timeSelector->GetOutput(); } // this will do a long long if/else to find out both pixel types AccessFixedDimensionByItk( image3D, ItkImageSwitch2DDiff, 3 ); if ( m_Factor == 1 || m_Factor == -1 ) { if ( m_Factor == -1 ) { // multiply diff pixels by factor and then send this diff slice AccessFixedDimensionByItk( m_SliceDifferenceImage, ItkInvertPixelValues, 2 ); } // just send the diff to SegmentationInterpolationController SegmentationInterpolationController* interpolator = SegmentationInterpolationController::InterpolatorForImage( m_Image ); if (interpolator) { interpolator->BlockModified(true); interpolator->SetChangedSlice( m_SliceDifferenceImage, m_SliceDimension, m_SliceIndex, m_TimeStep ); } m_Image->Modified(); if (interpolator) { interpolator->BlockModified(false); } if ( m_Factor == -1 ) // return to normal values { AccessFixedDimensionByItk( m_SliceDifferenceImage, ItkInvertPixelValues, 2 ); } } else // no trivial case, too lazy to do something else { m_Image->Modified(); // check if interpolation is called. prefer to send diff directly } RenderingManager::GetInstance()->RequestUpdateAll(); } else if ( m_SliceDifferenceImage->GetDimension() == 3 ) { // ... if ( m_SliceDifferenceImage->GetDimension(0) != m_Image->GetDimension(0) || m_SliceDifferenceImage->GetDimension(1) != m_Image->GetDimension(1) || m_SliceDifferenceImage->GetDimension(2) != m_Image->GetDimension(2) || m_TimeStep >= m_Image->GetDimension(3) ) { itkExceptionMacro("Diff image size differs from original image size. Sorry, cannot work like this."); return; } if ( m_Image->GetDimension() == 4 ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( m_Image ); timeSelector->SetTimeNr( m_TimeStep ); timeSelector->UpdateLargestPossibleRegion(); image3D = timeSelector->GetOutput(); } // this will do a long long if/else to find out both pixel types AccessFixedDimensionByItk( image3D, ItkImageSwitch3DDiff, 3 ); if ( m_Factor == 1 || m_Factor == -1 ) { if ( m_Factor == -1 ) { // multiply diff pixels by factor and then send this diff slice AccessFixedDimensionByItk( m_SliceDifferenceImage, ItkInvertPixelValues, 3 ); } // just send the diff to SegmentationInterpolationController SegmentationInterpolationController* interpolator = SegmentationInterpolationController::InterpolatorForImage( m_Image ); if (interpolator) { interpolator->BlockModified(true); interpolator->SetChangedVolume( m_SliceDifferenceImage, m_TimeStep ); } m_Image->Modified(); if (interpolator) { interpolator->BlockModified(false); } if ( m_Factor == -1 ) // return to normal values { AccessFixedDimensionByItk( m_SliceDifferenceImage, ItkInvertPixelValues, 3 ); } } else // no trivial case, too lazy to do something else { m_Image->Modified(); // check if interpolation is called. prefer to send diff directly } RenderingManager::GetInstance()->RequestUpdateAll(); } else { itkExceptionMacro("Diff image must be 2D or 3D. Sorry, cannot work like this."); return; } } m_Image = NULL; m_SliceDifferenceImage = NULL; } mitk::DiffImageApplier* mitk::DiffImageApplier::GetInstanceForUndo() { static DiffImageApplier::Pointer s_Instance = DiffImageApplier::New(); return s_Instance; } // basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h #define myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \ if ( typeId == typeid(pixeltype) ) \ { \ typedef itk::Image ImageType; \ typedef mitk::ImageToItk ImageToItkType; \ itk::SmartPointer imagetoitk = ImageToItkType::New(); \ imagetoitk->SetInput(mitkImage); \ imagetoitk->Update(); \ itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \ } #define myMITKDiffImageApplierFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \ { \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, double, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, float, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, short, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, char, dimension, itkimage2) else \ myMITKDiffImageApplierFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension, itkimage2) \ } template void mitk::DiffImageApplier::ItkImageSwitch2DDiff( itk::Image* itkImage ) { const std::type_info& typeId=*(m_SliceDifferenceImage->GetPixelType().GetTypeId()); myMITKDiffImageApplierFilterAccessAllTypesByItk( m_SliceDifferenceImage, ItkImageProcessing2DDiff, 2, itkImage ); } template void mitk::DiffImageApplier::ItkImageSwitch3DDiff( itk::Image* itkImage ) { const std::type_info& typeId=*(m_SliceDifferenceImage->GetPixelType().GetTypeId()); myMITKDiffImageApplierFilterAccessAllTypesByItk( m_SliceDifferenceImage, ItkImageProcessing3DDiff, 3, itkImage ); } template void mitk::DiffImageApplier::ItkImageProcessing2DDiff( itk::Image* diffImage, itk::Image* outputImage ) { typedef itk::Image DiffImageType; typedef itk::Image VolumeImageType; typedef itk::ImageSliceIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< DiffImageType > DiffSliceIteratorType; typename VolumeImageType::RegionType sliceInVolumeRegion; sliceInVolumeRegion = outputImage->GetLargestPossibleRegion(); sliceInVolumeRegion.SetSize( m_SliceDimension, 1 ); // just one slice sliceInVolumeRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // exactly this slice, please OutputSliceIteratorType outputIterator( outputImage, sliceInVolumeRegion ); outputIterator.SetFirstDirection(m_Dimension0); outputIterator.SetSecondDirection(m_Dimension1); DiffSliceIteratorType diffIterator( diffImage, diffImage->GetLargestPossibleRegion() ); // iterate over output slice (and over input slice simultaneously) outputIterator.GoToBegin(); diffIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { while ( !outputIterator.IsAtEndOfSlice() ) { while ( !outputIterator.IsAtEndOfLine() ) { TPixel2 newValue = outputIterator.Get() + (TPixel2) ((double)diffIterator.Get() * m_Factor); outputIterator.Set( newValue ); ++outputIterator; ++diffIterator; } outputIterator.NextLine(); } outputIterator.NextSlice(); } } template void mitk::DiffImageApplier::ItkImageProcessing3DDiff( itk::Image* diffImage, itk::Image* outputImage ) { typedef itk::Image DiffImageType; typedef itk::Image VolumeImageType; typedef itk::ImageRegionIterator< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< DiffImageType > DiffSliceIteratorType; OutputSliceIteratorType outputIterator( outputImage, outputImage->GetLargestPossibleRegion() ); DiffSliceIteratorType diffIterator( diffImage, diffImage->GetLargestPossibleRegion() ); // iterate over output slice (and over input slice simultaneously) outputIterator.GoToBegin(); diffIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { TPixel2 newValue = outputIterator.Get() + (TPixel2) ((double)diffIterator.Get() * m_Factor); outputIterator.Set( newValue ); ++outputIterator; ++diffIterator; } } template void mitk::DiffImageApplier::ItkInvertPixelValues( itk::Image* itkImage ) { typedef itk::ImageRegionIterator< itk::Image > IteratorType; IteratorType iter( itkImage, itkImage->GetLargestPossibleRegion() ); iter.GoToBegin(); while ( !iter.IsAtEnd() ) { iter.Set( -( iter.Get() ) ); ++iter; } } diff --git a/Modules/MitkExt/Algorithms/mitkLabeledImageToSurfaceFilter.cpp b/Modules/MitkExt/Algorithms/mitkLabeledImageToSurfaceFilter.cpp index 9515bdc66d..d7d47e5bf0 100644 --- a/Modules/MitkExt/Algorithms/mitkLabeledImageToSurfaceFilter.cpp +++ b/Modules/MitkExt/Algorithms/mitkLabeledImageToSurfaceFilter.cpp @@ -1,388 +1,392 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include #include #include #include #include #include #include #if (VTK_MAJOR_VERSION < 5) #include #endif #include #include #include +#include #include #include mitk::LabeledImageToSurfaceFilter::LabeledImageToSurfaceFilter() : m_GaussianStandardDeviation(1.5), m_GenerateAllLabels(true), m_Label(1), m_BackgroundLabel(0) { } mitk::LabeledImageToSurfaceFilter::~LabeledImageToSurfaceFilter() { } void mitk::LabeledImageToSurfaceFilter::GenerateOutputInformation() { Superclass::GenerateOutputInformation(); // // check which labels are available in the image // m_AvailableLabels = this->GetAvailableLabels(); m_IdxToLabels.clear(); // // if we don't want to generate surfaces for all labels // we have to remove all labels except m_Label and m_BackgroundLabel // from the list of available labels // if ( ! m_GenerateAllLabels ) { LabelMapType tmp; LabelMapType::iterator it; it = m_AvailableLabels.find( m_Label ); if ( it != m_AvailableLabels.end() ) tmp[m_Label] = it->second; else tmp[m_Label] = 0; it = m_AvailableLabels.find( m_BackgroundLabel ); if ( it != m_AvailableLabels.end() ) tmp[m_BackgroundLabel] = it->second; else tmp[m_BackgroundLabel] = 0; m_AvailableLabels = tmp; } // // check for the number of labels: if the whole image is filled, no // background is available and thus the numberOfOutpus is equal to the // number of available labels in the image (which is a special case). // If we have background voxels, the number of outputs is one less than // then number of available labels. // unsigned int numberOfOutputs = 0; if ( m_AvailableLabels.find( m_BackgroundLabel ) == m_AvailableLabels.end() ) numberOfOutputs = m_AvailableLabels.size(); else numberOfOutputs = m_AvailableLabels.size() - 1; if ( numberOfOutputs == 0 ) { itkWarningMacro("Number of outputs == 0"); } // // determine the number of time steps of the input image // mitk::Image* image = ( mitk::Image* )GetInput(); unsigned int numberOfTimeSteps = image->GetTimeSlicedGeometry()->GetTimeSteps(); // // set the number of outputs to the number of labels used. // initialize the output surfaces accordingly (incl. time steps) // this->SetNumberOfOutputs( numberOfOutputs ); this->SetNumberOfRequiredOutputs( numberOfOutputs ); for ( unsigned int i = 0 ; i < numberOfOutputs; ++i ) { if ( ! this->GetOutput( i ) ) { mitk::Surface::Pointer output = static_cast( this->MakeOutput(0).GetPointer() ); assert ( output.IsNotNull() ); output->Expand( numberOfTimeSteps ); this->SetNthOutput( i, output.GetPointer() ); } } } void mitk::LabeledImageToSurfaceFilter::GenerateData() { mitk::Image* image = ( mitk::Image* )GetInput(); if ( image == NULL ) { itkWarningMacro("Image is NULL"); return; } mitk::Image::RegionType outputRegion = image->GetRequestedRegion(); m_IdxToLabels.clear(); if ( this->GetNumberOfOutputs() == 0 ) return; // // traverse the known labels and create surfaces for them. // unsigned int currentOutputIndex = 0; for ( LabelMapType::iterator it = m_AvailableLabels.begin() ; it != m_AvailableLabels.end() ; ++it ) { if ( it->first == m_BackgroundLabel ) continue; if ( ( it->second == 0 ) && m_GenerateAllLabels ) continue; assert ( currentOutputIndex < this->GetNumberOfOutputs() ); mitk::Surface::Pointer surface = this->GetOutput( currentOutputIndex ); assert( surface.IsNotNull() ); int tstart=outputRegion.GetIndex(3); int tmax=tstart+outputRegion.GetSize(3); //GetSize()==1 - will aber 0 haben, wenn nicht zeitaufgeloet int t; for( t=tstart; t < tmax; ++t) { vtkImageData *vtkimagedata = image->GetVtkImageData( t ); CreateSurface( t,vtkimagedata,surface.GetPointer(), it->first ); } m_IdxToLabels[ currentOutputIndex ] = it->first; currentOutputIndex++; } } void mitk::LabeledImageToSurfaceFilter::CreateSurface( int time, vtkImageData *vtkimage, mitk::Surface * surface, mitk::LabeledImageToSurfaceFilter::LabelType label ) { vtkImageChangeInformation *indexCoordinatesImageFilter = vtkImageChangeInformation::New(); indexCoordinatesImageFilter->SetInput(vtkimage); indexCoordinatesImageFilter->SetOutputOrigin(0.0,0.0,0.0); vtkImageThreshold* threshold = vtkImageThreshold::New(); threshold->SetInput( indexCoordinatesImageFilter->GetOutput() ); //indexCoordinatesImageFilter->Delete(); threshold->SetInValue( 100 ); threshold->SetOutValue( 0 ); threshold->ThresholdBetween( label, label ); threshold->SetOutputScalarTypeToUnsignedChar(); threshold->ReleaseDataFlagOn(); vtkImageGaussianSmooth *gaussian = vtkImageGaussianSmooth::New(); gaussian->SetInput( threshold->GetOutput() ); //threshold->Delete(); gaussian->SetDimensionality( 3 ); gaussian->SetRadiusFactor( 0.49 ); gaussian->SetStandardDeviation( GetGaussianStandardDeviation() ); gaussian->ReleaseDataFlagOn(); gaussian->UpdateInformation(); gaussian->Update(); //MarchingCube -->create Surface vtkMarchingCubes *skinExtractor = vtkMarchingCubes::New(); skinExtractor->ReleaseDataFlagOn(); skinExtractor->SetInput(gaussian->GetOutput());//RC++ indexCoordinatesImageFilter->Delete(); skinExtractor->SetValue(0, 50); vtkPolyData *polydata; polydata = skinExtractor->GetOutput(); polydata->Register(NULL);//RC++ skinExtractor->Delete(); if (m_Smooth) { vtkSmoothPolyDataFilter *smoother = vtkSmoothPolyDataFilter::New(); //read poly1 (poly1 can be the original polygon, or the decimated polygon) smoother->SetInput(polydata);//RC++ smoother->SetNumberOfIterations( m_SmoothIteration ); smoother->SetRelaxationFactor( m_SmoothRelaxation ); smoother->SetFeatureAngle( 60 ); smoother->FeatureEdgeSmoothingOff(); smoother->BoundarySmoothingOff(); smoother->SetConvergence( 0 ); polydata->Delete();//RC-- polydata = smoother->GetOutput(); polydata->Register(NULL);//RC++ smoother->Delete(); } // //#if (VTK_MAJOR_VERSION >= 5) // if (m_Decimate == Decimate ) // { // MITK_ERROR << "vtkDecimate not available for VTK 5.0 and above."; // MITK_ERROR << " Using vtkDecimatePro instead." << std::endl; // m_Decimate = DecimatePro; // } //#endif //decimate = to reduce number of polygons if(m_Decimate==DecimatePro) { vtkDecimatePro *decimate = vtkDecimatePro::New(); decimate->SplittingOff(); decimate->SetErrorIsAbsolute(5); decimate->SetFeatureAngle(30); decimate->PreserveTopologyOn(); decimate->BoundaryVertexDeletionOff(); decimate->SetDegree(10); //std-value is 25! decimate->SetInput(polydata);//RC++ decimate->SetTargetReduction(m_TargetReduction); decimate->SetMaximumError(0.002); polydata->Delete();//RC-- polydata = decimate->GetOutput(); polydata->Register(NULL);//RC++ decimate->Delete(); } #if (VTK_MAJOR_VERSION < 5) else if (m_Decimate==Decimate) { vtkDecimate *decimate = vtkDecimate::New(); decimate->SetInput( polydata ); decimate->PreserveTopologyOn(); decimate->BoundaryVertexDeletionOff(); decimate->SetTargetReduction( m_TargetReduction ); polydata->Delete();//RC-- polydata = decimate->GetOutput(); polydata->Register(NULL);//RC++ decimate->Delete(); } #endif polydata->Update(); polydata->SetSource(NULL); if(polydata->GetNumberOfPoints() > 0) { mitk::Vector3D spacing = GetInput()->GetGeometry(time)->GetSpacing(); vtkPoints * points = polydata->GetPoints(); vtkMatrix4x4 *vtkmatrix = vtkMatrix4x4::New(); GetInput()->GetGeometry(time)->GetVtkTransform()->GetMatrix(vtkmatrix); double (*matrix)[4] = vtkmatrix->Element; unsigned int i,j; for(i=0;i<3;++i) for(j=0;j<3;++j) matrix[i][j]/=spacing[j]; unsigned int n = points->GetNumberOfPoints(); vtkFloatingPointType point[3]; for (i = 0; i < n; i++) { points->GetPoint(i, point); mitkVtkLinearTransformPoint(matrix,point,point); points->SetPoint(i, point); } vtkmatrix->Delete(); } surface->SetVtkPolyData(polydata, time); polydata->UnRegister(NULL); gaussian->Delete(); threshold->Delete(); } template < typename TPixel, unsigned int VImageDimension > void GetAvailableLabelsInternal( itk::Image* image, mitk::LabeledImageToSurfaceFilter::LabelMapType& availableLabels ) { typedef itk::Image ImageType; typedef itk::ImageRegionIterator< ImageType > ImageRegionIteratorType; availableLabels.clear(); ImageRegionIteratorType it( image, image->GetLargestPossibleRegion() ); it.GoToBegin(); mitk::LabeledImageToSurfaceFilter::LabelMapType::iterator labelIt; while( ! it.IsAtEnd() ) { labelIt = availableLabels.find( ( mitk::LabeledImageToSurfaceFilter::LabelType ) ( it.Get() ) ); if ( labelIt == availableLabels.end() ) { availableLabels[ ( mitk::LabeledImageToSurfaceFilter::LabelType ) ( it.Get() ) ] = 1; } else { labelIt->second += 1; } ++it; } } -InstantiateAccessFunctionForFixedDimension_1(GetAvailableLabelsInternal, 3, mitk::LabeledImageToSurfaceFilter::LabelMapType&); +#define InstantiateAccessFunction_GetAvailableLabelsInternal(pixelType, dim) \ +template void GetAvailableLabelsInternal(itk::Image*, mitk::LabeledImageToSurfaceFilter::LabelMapType&); + +InstantiateAccessFunctionForFixedDimension(GetAvailableLabelsInternal, 3); mitk::LabeledImageToSurfaceFilter::LabelMapType mitk::LabeledImageToSurfaceFilter::GetAvailableLabels() { mitk::Image::Pointer image = ( mitk::Image* )GetInput(); LabelMapType availableLabels; AccessFixedDimensionByItk_1( image, GetAvailableLabelsInternal, 3, availableLabels ); return availableLabels; } void mitk::LabeledImageToSurfaceFilter::CreateSurface(int, vtkImageData*, mitk::Surface*, const ScalarType) { itkWarningMacro( "This function should never be called!" ); assert(false); } mitk::LabeledImageToSurfaceFilter::LabelType mitk::LabeledImageToSurfaceFilter::GetLabelForNthOutput( const unsigned int& idx ) { IdxToLabelMapType::iterator it = m_IdxToLabels.find( idx ); if ( it != m_IdxToLabels.end() ) { return it->second; } else { itkWarningMacro( "Unknown index encountered: " << idx << ". There are " << this->GetNumberOfOutputs() << " outputs available." ); return itk::NumericTraits::max(); } } mitk::ScalarType mitk::LabeledImageToSurfaceFilter::GetVolumeForNthOutput( const unsigned int& i ) { return GetVolumeForLabel( GetLabelForNthOutput( i ) ); } mitk::ScalarType mitk::LabeledImageToSurfaceFilter::GetVolumeForLabel( const mitk::LabeledImageToSurfaceFilter::LabelType& label ) { // get the image spacing mitk::Image* image = ( mitk::Image* )GetInput(); const float* spacing = image->GetSlicedGeometry()->GetFloatSpacing(); // get the number of voxels encountered for the given label, // calculate the volume and return it. LabelMapType::iterator it = m_AvailableLabels.find( label ); if ( it != m_AvailableLabels.end() ) { return static_cast(it->second) * ( spacing[0] * spacing[1] * spacing[2] / 1000.0f ); } else { itkWarningMacro( "Unknown label encountered: " << label ); return 0.0; } } diff --git a/Modules/MitkExt/Algorithms/mitkOverwriteDirectedPlaneImageFilter.cpp b/Modules/MitkExt/Algorithms/mitkOverwriteDirectedPlaneImageFilter.cpp index a04d8e822b..37b9c6bca3 100644 --- a/Modules/MitkExt/Algorithms/mitkOverwriteDirectedPlaneImageFilter.cpp +++ b/Modules/MitkExt/Algorithms/mitkOverwriteDirectedPlaneImageFilter.cpp @@ -1,490 +1,491 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-01-14 14:20:26 +0100 (Do, 14 Jan 2010) $ Version: $Revision: 21047 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkOverwriteDirectedPlaneImageFilter.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkSegmentationInterpolationController.h" #include "mitkApplyDiffImageOperation.h" #include "mitkOperationEvent.h" #include "mitkInteractionConst.h" #include "mitkUndoController.h" #include "mitkDiffImageApplier.h" #include "mitkImageTimeSelector.h" #include #include mitk::OverwriteDirectedPlaneImageFilter::OverwriteDirectedPlaneImageFilter() :m_PlaneGeometry(0), m_ImageGeometry3D(0), m_TimeStep(0), m_Dimension0(0), m_Dimension1(1), m_CreateUndoInformation(false) { } mitk::OverwriteDirectedPlaneImageFilter::~OverwriteDirectedPlaneImageFilter() { } void mitk::OverwriteDirectedPlaneImageFilter::GenerateData() { // // this is the place to implement the major part of undo functionality (bug #491) // here we have to create undo/do operations // // WHO is the operation actor? This object may not be destroyed ever (design of undo stack)! // -> some singleton method of this filter? // // neccessary additional objects: // - something that executes the operations // - the operation class (must hold a binary diff or something) // - observer commands to know when the image is deleted (no further action then, perhaps even remove the operations from the undo stack) // //Image::ConstPointer input = ImageToImageFilter::GetInput(0); Image::ConstPointer input3D = ImageToImageFilter::GetInput(0); //Image::ConstPointer slice = m_SliceImage; if ( input3D.IsNull() || m_SliceImage.IsNull() ) return; if ( input3D->GetDimension() == 4 ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( input3D ); timeSelector->SetTimeNr( m_TimeStep ); timeSelector->UpdateLargestPossibleRegion(); input3D = timeSelector->GetOutput(); } m_ImageGeometry3D = input3D->GetGeometry(); /* if ( m_SliceDifferenceImage.IsNull() || m_SliceDifferenceImage->GetDimension(0) != m_SliceImage->GetDimension(0) || m_SliceDifferenceImage->GetDimension(1) != m_SliceImage->GetDimension(1) ) { m_SliceDifferenceImage = mitk::Image::New(); mitk::PixelType pixelType( typeid(short signed int) ); m_SliceDifferenceImage->Initialize( pixelType, 2, m_SliceImage->GetDimensions() ); } */ //MITK_INFO << "Overwriting slice " << m_SliceIndex << " in dimension " << m_SliceDimension << " at time step " << m_TimeStep << std::endl; // this will do a long long if/else to find out both pixel types /*AccessFixedDimensionByItk( input3D, ItkImageSwitch, 3 );*/ AccessFixedDimensionByItk( input3D, ItkSliceOverwriting, 3 ); //SegmentationInterpolationController* interpolator = SegmentationInterpolationController::InterpolatorForImage( input3D ); //if (interpolator) //{ // interpolator->BlockModified(true); // //interpolator->SetChangedSlice( m_SliceDifferenceImage, m_SliceDimension, m_SliceIndex, m_TimeStep ); //} /* if ( m_CreateUndoInformation ) { // create do/undo operations (we don't execute the doOp here, because it has already been executed during calculation of the diff image ApplyDiffImageOperation* doOp = new ApplyDiffImageOperation( OpTEST, const_cast(input.GetPointer()), m_SliceDifferenceImage, m_TimeStep, m_SliceDimension, m_SliceIndex ); ApplyDiffImageOperation* undoOp = new ApplyDiffImageOperation( OpTEST, const_cast(input.GetPointer()), m_SliceDifferenceImage, m_TimeStep, m_SliceDimension, m_SliceIndex ); undoOp->SetFactor( -1.0 ); OperationEvent* undoStackItem = new OperationEvent( DiffImageApplier::GetInstanceForUndo(), doOp, undoOp, this->EventDescription(m_SliceDimension, m_SliceIndex, m_TimeStep) ); UndoController::GetCurrentUndoModel()->SetOperationEvent( undoStackItem ); } */ // this image is modified (good to know for the renderer) input3D->Modified(); /*if (interpolator) { interpolator->BlockModified(false); }*/ } template void mitk::OverwriteDirectedPlaneImageFilter::ItkSliceOverwriting( itk::Image* input3D ) { typedef itk::Image SliceImageType; typedef itk::Image VolumeImageType; typedef itk::ImageSliceIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< SliceImageType > SliceIteratorType; typename SliceImageType::Pointer sliceImage = SliceImageType::New(); CastToItkImage(m_SliceImage,sliceImage); SliceIteratorType sliceIterator( sliceImage, sliceImage->GetLargestPossibleRegion() ); sliceIterator.GoToBegin(); Point3D currentPointIn2D; Point3D worldPointIn3D; //Here we just iterate over the slice which must be written into the 3D volumen and set the corresponding pixel in our 3D volume while ( !sliceIterator.IsAtEnd() ) { currentPointIn2D[0] = sliceIterator.GetIndex()[0]+0.5; currentPointIn2D[1] = sliceIterator.GetIndex()[1]+0.5; currentPointIn2D[2] = 0; m_PlaneGeometry->IndexToWorld( currentPointIn2D, worldPointIn3D ); typename itk::Image::IndexType outputIndex; m_ImageGeometry3D->WorldToIndex( worldPointIn3D, outputIndex ); // Only access ITK image if it's inside if ( m_ImageGeometry3D->IsIndexInside( outputIndex ) ) { input3D->SetPixel( outputIndex, (TPixel)sliceIterator.Get() ); } ++sliceIterator; } } /****TEST***/ //Maybe a bit more efficient but doesn`t already work. See also ExtractCirectedPlaneImageFilter //typename itk::Image::IndexType outputIndex; //if ( columns == extent[0] ) //{ ////If we are at the end of a row, then we have to go to the beginning of the next row //currentImagePointIn3D = origin; //currentImagePointIn3D += spacing[1]*bottom*currentPointIn2D[1]; //columns = 0; //m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); //} //else //{ //if ( columns != 0 ) //{ //currentImagePointIn3D += spacing[0]*right; //} //m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); //} //if ( m_ImageGeometry3D->IsIndexInside( outputIndex )) //{ //outputImage->SetPixel( outputIndex, (TPixel2)inputIterator.Get() ); //} //else if (currentImagePointIn3D == origin) //{ //Point3D temp; //temp[0] = bottom[0]*spacing[0]*0.5; //temp[1] = bottom[1]*spacing[1]*0.5; //temp[2] = bottom[2]*spacing[2]*0.5; //origin[0] += temp[0]; //origin[1] += temp[1]; //origin[2] += temp[2]; //currentImagePointIn3D = origin; //m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); //if ( m_ImageGeometry3D->IsIndexInside( outputIndex )) //{ //outputImage->SetPixel( outputIndex, (TPixel2)inputIterator.Get() ); //} //} //columns++; /****TEST ENDE****/ //* // // Offset the world coordinate by one pixel to compensate for // // index/world origin differences. // Point3D offsetIndex; // offsetIndex.Fill( 1 ); // Point3D offsetWorld; // offsetWorld.Fill( 0 ); // m_PlaneGeometry->IndexToWorld( offsetIndex, offsetWorld ); // // remove origin shift // const Point3D origin = m_PlaneGeometry->GetOrigin(); // offsetWorld[0] -= origin[0]; // offsetWorld[1] -= origin[1]; // offsetWorld[2] -= origin[2]; // // offset world coordinate // worldPointIn3D[ 0 ] += offsetWorld[0]; // worldPointIn3D[ 1 ] += offsetWorld[1]; // worldPointIn3D[ 2 ] += offsetWorld[2]; //*/ // basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h /*#define myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \ // if ( typeId == typeid(pixeltype) ) \ //{ \ // typedef itk::Image ImageType; \ // typedef mitk::ImageToItk ImageToItkType; \ // itk::SmartPointer imagetoitk = ImageToItkType::New(); \ // imagetoitk->SetInput(mitkImage); \ // imagetoitk->Update(); \ // itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \ //} // //#define myMITKOverwriteDirectedPlaneImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \ //{ \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, double, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, float, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, short, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, char, dimension, itkimage2) else \ // myMITKOverwriteDirectedPlaneImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension, itkimage2) \ //}*/ // // //template //void mitk::OverwriteDirectedPlaneImageFilter::ItkImageSwitch( itk::Image* itkImage ) //{ // const std::type_info& typeId=*(m_SliceImage->GetPixelType().GetTypeId()); // // myMITKOverwriteDirectedPlaneImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageProcessing, 2, itkImage ); //} //template //void mitk::OverwriteDirectedPlaneImageFilter::ItkImageProcessing( itk::Image* inputImage, itk::Image* outputImage ) //{ // typedef itk::Image SliceImageType; // typedef itk::Image DiffImageType; // typedef itk::Image VolumeImageType; // // typedef itk::ImageSliceIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; // typedef itk::ImageRegionConstIterator< SliceImageType > InputSliceIteratorType; // //typedef itk::ImageRegionIterator< DiffImageType > DiffSliceIteratorType; // // InputSliceIteratorType inputIterator( inputImage, inputImage->GetLargestPossibleRegion() ); // // //typename DiffImageType::Pointer diffImage; // //CastToItkImage( m_SliceDifferenceImage, diffImage ); // //DiffSliceIteratorType diffIterator( diffImage, diffImage->GetLargestPossibleRegion() ); // // inputIterator.GoToBegin(); // //diffIterator.GoToBegin(); // // //TEST // Point3D origin = m_PlaneGeometry->GetOrigin(); // Vector3D right = m_PlaneGeometry->GetAxisVector(0); // Vector3D bottom = m_PlaneGeometry->GetAxisVector(1); // right.Normalize(); // bottom.Normalize(); // // Vector2D spacing = inputImage->GetSpacing(); // // Vector2D extentInMM; // extentInMM[0] = m_PlaneGeometry->GetExtentInMM(0); // extentInMM[1] = m_PlaneGeometry->GetExtentInMM(1); // // Vector2D extent; // extent[0] = m_PlaneGeometry->GetExtent(0); // extent[1] = m_PlaneGeometry->GetExtent(1); // //TEST ENDE // // Point3D currentPointIn2D, worldPointIn3D; // TPixel2 outputPixel = 0; // // int debugCounter( 0 ); // // std::ofstream geometryFile; // geometryFile.precision(30); // geometryFile.open("C:/Users/fetzer/Desktop/TEST/geometryFileOv.txt"); // // geometryFile<<"Offset: [ "<GetIndexToWorldTransform()->GetOffset()[0]<<", "<GetIndexToWorldTransform()->GetOffset()[1]<<", "<GetIndexToWorldTransform()->GetOffset()[2]<<" ]"<GetIndexToWorldTransform()->GetMatrix()<IndexToWorld( currentPointIn2D, worldPointIn3D ); // //typename itk::Image::IndexType outputIndex; // m_ImageGeometry3D->WorldToIndex( worldPointIn3D, outputIndex ); // // // Only access ITK image if it's inside // if ( m_ImageGeometry3D->IsIndexInside( outputIndex ) ) // { // //outputPixel = outputImage->GetPixel( outputIndex ); // outputImage->SetPixel( outputIndex, (TPixel2)inputIterator.Get() ); // /*if( inputIterator.Get() == mitk::paint::addPixelValue ) // { // outputImage->SetPixel( outputIndex, (TPixel2)( 1 ) ); // } // else if( inputIterator.Get() == mitk::paint::subPixelValue ) // { // outputImage->SetPixel( outputIndex, (TPixel2)( 0 ) ); // }*/ // } // ///****TEST***/ // ////typename itk::Image::IndexType outputIndex; // ////if ( columns == extent[0] ) ////{ //////If we are at the end of a row, then we have to go to the beginning of the next row ////currentImagePointIn3D = origin; ////currentImagePointIn3D += spacing[1]*bottom*currentPointIn2D[1]; //columns = 0; ////m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); ////} ////else ////{ ////if ( columns != 0 ) ////{ ////currentImagePointIn3D += spacing[0]*right; ////} ////m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); ////} // ////if ( m_ImageGeometry3D->IsIndexInside( outputIndex )) ////{ ////outputImage->SetPixel( outputIndex, (TPixel2)inputIterator.Get() ); ////} ////else if (currentImagePointIn3D == origin) ////{ ////Point3D temp; ////temp[0] = bottom[0]*spacing[0]*0.5; ////temp[1] = bottom[1]*spacing[1]*0.5; ////temp[2] = bottom[2]*spacing[2]*0.5; ////origin[0] += temp[0]; ////origin[1] += temp[1]; ////origin[2] += temp[2]; ////currentImagePointIn3D = origin; ////m_ImageGeometry3D->WorldToIndex(currentImagePointIn3D, outputIndex); ////if ( m_ImageGeometry3D->IsIndexInside( outputIndex )) ////{ ////outputImage->SetPixel( outputIndex, (TPixel2)inputIterator.Get() ); ////} ////} ////columns++; // ///****TEST ENDE****/ // ////* //// // Offset the world coordinate by one pixel to compensate for //// // index/world origin differences. //// Point3D offsetIndex; //// offsetIndex.Fill( 1 ); //// Point3D offsetWorld; //// offsetWorld.Fill( 0 ); //// m_PlaneGeometry->IndexToWorld( offsetIndex, offsetWorld ); //// // remove origin shift //// const Point3D origin = m_PlaneGeometry->GetOrigin(); //// offsetWorld[0] -= origin[0]; //// offsetWorld[1] -= origin[1]; //// offsetWorld[2] -= origin[2]; //// // offset world coordinate //// worldPointIn3D[ 0 ] += offsetWorld[0]; //// worldPointIn3D[ 1 ] += offsetWorld[1]; //// worldPointIn3D[ 2 ] += offsetWorld[2]; ////*/ // // Output index // // ////For the purpose of debug ////if( debugCounter%100 == 0) //////{ ////Point3D contIndex; ////m_ImageGeometry3D->WorldToIndex(worldPointIn3D,contIndex); ////overriderFile.precision(10); ////overriderFile<<"2D-Index: [ "<(inputIterator.Get() - outputPixel ) ); // oh oh, not good for bigger values // ++inputIterator; ////++debugCounter; // //++diffIterator; // } // /*overriderFile.close(); // overriderFileIndex.close();*/ // geometryFile.close(); // ///* // typename VolumeImageType::RegionType sliceInVolumeRegion; // // sliceInVolumeRegion = outputImage->GetLargestPossibleRegion(); // sliceInVolumeRegion.SetSize( m_SliceDimension, 1 ); // just one slice // sliceInVolumeRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // exactly this slice, please // // OutputSliceIteratorType outputIterator( outputImage, sliceInVolumeRegion ); // outputIterator.SetFirstDirection(m_Dimension0); // outputIterator.SetSecondDirection(m_Dimension1); // // // iterate over output slice (and over input slice simultaneously) // outputIterator.GoToBegin(); // while ( !outputIterator.IsAtEnd() ) // { // while ( !outputIterator.IsAtEndOfSlice() ) // { // while ( !outputIterator.IsAtEndOfLine() ) // { // diffIterator.Set( static_cast(inputIterator.Get() - outputIterator.Get()) ); // oh oh, not good for bigger values // outputIterator.Set( (TPixel2) inputIterator.Get() ); // ++outputIterator; // ++inputIterator; // ++diffIterator; // } // outputIterator.NextLine(); // } // outputIterator.NextSlice(); // } // */ //} /* std::string mitk::OverwriteDirectedPlaneImageFilter::EventDescription( unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep ) { std::stringstream s; s << "Changed slice ("; switch (sliceDimension) { default: case 2: s << "T"; break; case 1: s << "C"; break; case 0: s << "S"; break; } s << " " << sliceIndex << " " << timeStep << ")"; return s.str(); } */ - \ No newline at end of file + diff --git a/Modules/MitkExt/Algorithms/mitkOverwriteSliceImageFilter.cpp b/Modules/MitkExt/Algorithms/mitkOverwriteSliceImageFilter.cpp index 58bd05baae..76d8bb8455 100644 --- a/Modules/MitkExt/Algorithms/mitkOverwriteSliceImageFilter.cpp +++ b/Modules/MitkExt/Algorithms/mitkOverwriteSliceImageFilter.cpp @@ -1,246 +1,247 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkOverwriteSliceImageFilter.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkSegmentationInterpolationController.h" #include "mitkApplyDiffImageOperation.h" #include "mitkOperationEvent.h" #include "mitkInteractionConst.h" #include "mitkUndoController.h" #include "mitkDiffImageApplier.h" #include "mitkImageTimeSelector.h" #include #include mitk::OverwriteSliceImageFilter::OverwriteSliceImageFilter() :m_SliceIndex(0), m_SliceDimension(0), m_TimeStep(0), m_Dimension0(0), m_Dimension1(1), m_CreateUndoInformation(false) { } mitk::OverwriteSliceImageFilter::~OverwriteSliceImageFilter() { } void mitk::OverwriteSliceImageFilter::GenerateData() { // // this is the place to implement the major part of undo functionality (bug #491) // here we have to create undo/do operations // // WHO is the operation actor? This object may not be destroyed ever (design of undo stack)! // -> some singleton method of this filter? // // neccessary additional objects: // - something that executes the operations // - the operation class (must hold a binary diff or something) // - observer commands to know when the image is deleted (no further action then, perhaps even remove the operations from the undo stack) // Image::ConstPointer input = ImageToImageFilter::GetInput(0); Image::ConstPointer input3D = input; Image::ConstPointer slice = m_SliceImage; if ( input.IsNull() || slice.IsNull() ) return; switch (m_SliceDimension) { default: case 2: m_Dimension0 = 0; m_Dimension1 = 1; break; case 1: m_Dimension0 = 0; m_Dimension1 = 2; break; case 0: m_Dimension0 = 1; m_Dimension1 = 2; break; } if ( slice->GetDimension() < 2 || input->GetDimension() > 4 || slice->GetDimension(0) != input->GetDimension(m_Dimension0) || slice->GetDimension(1) != input->GetDimension(m_Dimension1) || m_SliceIndex >= input->GetDimension(m_SliceDimension) ) { itkExceptionMacro("Slice and image dimensions differ or slice index is too large. Sorry, cannot work like this."); return; } if ( input->GetDimension() == 4 ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( input ); timeSelector->SetTimeNr( m_TimeStep ); timeSelector->UpdateLargestPossibleRegion(); input3D = timeSelector->GetOutput(); } if ( m_SliceDifferenceImage.IsNull() || m_SliceDifferenceImage->GetDimension(0) != m_SliceImage->GetDimension(0) || m_SliceDifferenceImage->GetDimension(1) != m_SliceImage->GetDimension(1) ) { m_SliceDifferenceImage = mitk::Image::New(); mitk::PixelType pixelType( typeid(short signed int) ); m_SliceDifferenceImage->Initialize( pixelType, 2, m_SliceImage->GetDimensions() ); } //MITK_INFO << "Overwriting slice " << m_SliceIndex << " in dimension " << m_SliceDimension << " at time step " << m_TimeStep << std::endl; // this will do a long long if/else to find out both pixel types AccessFixedDimensionByItk( input3D, ItkImageSwitch, 3 ); SegmentationInterpolationController* interpolator = SegmentationInterpolationController::InterpolatorForImage( input ); if (interpolator) { interpolator->BlockModified(true); interpolator->SetChangedSlice( m_SliceDifferenceImage, m_SliceDimension, m_SliceIndex, m_TimeStep ); } if ( m_CreateUndoInformation ) { // create do/undo operations (we don't execute the doOp here, because it has already been executed during calculation of the diff image ApplyDiffImageOperation* doOp = new ApplyDiffImageOperation( OpTEST, const_cast(input.GetPointer()), m_SliceDifferenceImage, m_TimeStep, m_SliceDimension, m_SliceIndex ); ApplyDiffImageOperation* undoOp = new ApplyDiffImageOperation( OpTEST, const_cast(input.GetPointer()), m_SliceDifferenceImage, m_TimeStep, m_SliceDimension, m_SliceIndex ); undoOp->SetFactor( -1.0 ); OperationEvent* undoStackItem = new OperationEvent( DiffImageApplier::GetInstanceForUndo(), doOp, undoOp, this->EventDescription(m_SliceDimension, m_SliceIndex, m_TimeStep) ); UndoController::GetCurrentUndoModel()->SetOperationEvent( undoStackItem ); } // this image is modified (good to know for the renderer) input->Modified(); if (interpolator) { interpolator->BlockModified(false); } } // basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h #define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \ if ( typeId == typeid(pixeltype) ) \ { \ typedef itk::Image ImageType; \ typedef mitk::ImageToItk ImageToItkType; \ itk::SmartPointer imagetoitk = ImageToItkType::New(); \ imagetoitk->SetInput(mitkImage); \ imagetoitk->Update(); \ itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \ } #define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \ { \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, double, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, float, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, char, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension, itkimage2) \ } template void mitk::OverwriteSliceImageFilter::ItkImageSwitch( itk::Image* itkImage ) { const std::type_info& typeId=*(m_SliceImage->GetPixelType().GetTypeId()); myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageProcessing, 2, itkImage ); } template void mitk::OverwriteSliceImageFilter::ItkImageProcessing( itk::Image* inputImage, itk::Image* outputImage ) { typedef itk::Image SliceImageType; typedef itk::Image DiffImageType; typedef itk::Image VolumeImageType; typedef itk::ImageSliceIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< SliceImageType > InputSliceIteratorType; typedef itk::ImageRegionIterator< DiffImageType > DiffSliceIteratorType; typename VolumeImageType::RegionType sliceInVolumeRegion; sliceInVolumeRegion = outputImage->GetLargestPossibleRegion(); sliceInVolumeRegion.SetSize( m_SliceDimension, 1 ); // just one slice sliceInVolumeRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // exactly this slice, please OutputSliceIteratorType outputIterator( outputImage, sliceInVolumeRegion ); outputIterator.SetFirstDirection(m_Dimension0); outputIterator.SetSecondDirection(m_Dimension1); InputSliceIteratorType inputIterator( inputImage, inputImage->GetLargestPossibleRegion() ); typename DiffImageType::Pointer diffImage; CastToItkImage( m_SliceDifferenceImage, diffImage ); DiffSliceIteratorType diffIterator( diffImage, diffImage->GetLargestPossibleRegion() ); // iterate over output slice (and over input slice simultaneously) outputIterator.GoToBegin(); inputIterator.GoToBegin(); diffIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { while ( !outputIterator.IsAtEndOfSlice() ) { while ( !outputIterator.IsAtEndOfLine() ) { diffIterator.Set( static_cast(inputIterator.Get() - outputIterator.Get()) ); // oh oh, not good for bigger values outputIterator.Set( (TPixel2) inputIterator.Get() ); ++outputIterator; ++inputIterator; ++diffIterator; } outputIterator.NextLine(); } outputIterator.NextSlice(); } } std::string mitk::OverwriteSliceImageFilter::EventDescription( unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep ) { std::stringstream s; s << "Changed slice ("; switch (sliceDimension) { default: case 2: s << "T"; break; case 1: s << "C"; break; case 0: s << "S"; break; } s << " " << sliceIndex << " " << timeStep << ")"; return s.str(); } diff --git a/Modules/MitkExt/Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp b/Modules/MitkExt/Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp index 7e249bbf06..af7b540e61 100644 --- a/Modules/MitkExt/Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp +++ b/Modules/MitkExt/Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp @@ -1,72 +1,73 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkShapeBasedInterpolationAlgorithm.h" #include "mitkImageCast.h" +#include "mitkImageDataItem.h" #include "ipSegmentation.h" mitk::Image::Pointer mitk::ShapeBasedInterpolationAlgorithm::Interpolate( Image::ConstPointer lowerSlice, unsigned int lowerSliceIndex, Image::ConstPointer upperSlice, unsigned int upperSliceIndex, unsigned int requestedIndex, unsigned int /*sliceDimension*/, // commented variables are not used Image::Pointer resultImage, unsigned int /*timeStep*/, Image::ConstPointer /*referenceImage*/) { // convert these slices to the ipSegmentation data type (into an ITK image) itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeLowerITKSlice; CastToItkImage( lowerSlice, correctPixelTypeLowerITKSlice ); assert ( correctPixelTypeLowerITKSlice.IsNotNull() ); itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeUpperITKSlice; CastToItkImage( upperSlice, correctPixelTypeUpperITKSlice ); assert ( correctPixelTypeUpperITKSlice.IsNotNull() ); // correct direction info itk::Image< ipMITKSegmentationTYPE, 2 >::DirectionType imageDirection; imageDirection.SetIdentity(); correctPixelTypeLowerITKSlice->SetDirection(imageDirection); correctPixelTypeUpperITKSlice->SetDirection(imageDirection); // back-convert to MITK images to access a mitkIpPicDescriptor Image::Pointer correctPixelTypeLowerMITKSlice = Image::New(); CastToMitkImage( correctPixelTypeLowerITKSlice, correctPixelTypeLowerMITKSlice ); mitkIpPicDescriptor* lowerPICSlice = correctPixelTypeLowerMITKSlice->GetSliceData()->GetPicDescriptor(); Image::Pointer correctPixelTypeUpperMITKSlice = Image::New(); CastToMitkImage( correctPixelTypeUpperITKSlice, correctPixelTypeUpperMITKSlice ); mitkIpPicDescriptor* upperPICSlice = correctPixelTypeUpperMITKSlice->GetSliceData()->GetPicDescriptor(); // calculate where the current slice is in comparison to the lower and upper neighboring slices float ratio = (float)(requestedIndex - lowerSliceIndex) / (float)(upperSliceIndex - lowerSliceIndex); mitkIpPicDescriptor* ipPicResult = ipMITKSegmentationInterpolate( lowerPICSlice, upperPICSlice, ratio ); // magic if (!ipPicResult) return NULL; Geometry3D::Pointer originalGeometry = resultImage->GetGeometry(); resultImage->Initialize( ipPicResult ); resultImage->SetPicSlice( ipPicResult ); resultImage->SetGeometry( originalGeometry ); mitkIpPicFree( ipPicResult ); return resultImage; } diff --git a/Modules/MitkExt/Controllers/mitkSegmentationInterpolationController.cpp b/Modules/MitkExt/Controllers/mitkSegmentationInterpolationController.cpp index 19a773abe2..794a202c4a 100644 --- a/Modules/MitkExt/Controllers/mitkSegmentationInterpolationController.cpp +++ b/Modules/MitkExt/Controllers/mitkSegmentationInterpolationController.cpp @@ -1,485 +1,486 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkSegmentationInterpolationController.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkExtractImageFilter.h" #include "mitkImageTimeSelector.h" #include "mitkShapeBasedInterpolationAlgorithm.h" #include #include #include mitk::SegmentationInterpolationController::InterpolatorMapType mitk::SegmentationInterpolationController::s_InterpolatorForImage; // static member initialization mitk::SegmentationInterpolationController* mitk::SegmentationInterpolationController::InterpolatorForImage(const Image* image) { InterpolatorMapType::iterator iter = s_InterpolatorForImage.find( image ); if ( iter != s_InterpolatorForImage.end() ) { return iter->second; } else { return NULL; } } mitk::SegmentationInterpolationController::SegmentationInterpolationController() :m_BlockModified(false) { } mitk::SegmentationInterpolationController::~SegmentationInterpolationController() { // remove this from the list of interpolators for ( InterpolatorMapType::iterator iter = s_InterpolatorForImage.begin(); iter != s_InterpolatorForImage.end(); ++iter ) { if (iter->second == this) { s_InterpolatorForImage.erase( iter ); break; } } } void mitk::SegmentationInterpolationController::OnImageModified(const itk::EventObject&) { if (!m_BlockModified && m_Segmentation.IsNotNull() ) { SetSegmentationVolume( m_Segmentation ); } } void mitk::SegmentationInterpolationController::BlockModified(bool block) { m_BlockModified = block; } void mitk::SegmentationInterpolationController::SetSegmentationVolume( const Image* segmentation ) { // clear old information (remove all time steps m_SegmentationCountInSlice.clear(); // delete this from the list of interpolators InterpolatorMapType::iterator iter = s_InterpolatorForImage.find( segmentation ); if ( iter != s_InterpolatorForImage.end() ) { s_InterpolatorForImage.erase( iter ); } if (!segmentation) return; if (segmentation->GetDimension() > 4 || segmentation->GetDimension() < 3) { itkExceptionMacro("SegmentationInterpolationController needs a 3D-segmentation or 3D+t, not 2D."); } if (m_Segmentation != segmentation) { // observe Modified() event of image itk::ReceptorMemberCommand::Pointer command = itk::ReceptorMemberCommand::New(); command->SetCallbackFunction( this, &SegmentationInterpolationController::OnImageModified ); segmentation->AddObserver( itk::ModifiedEvent(), command ); } m_Segmentation = segmentation; m_SegmentationCountInSlice.resize( m_Segmentation->GetTimeSteps() ); for (unsigned int timeStep = 0; timeStep < m_Segmentation->GetTimeSteps(); ++timeStep) { m_SegmentationCountInSlice[timeStep].resize(3); for (unsigned int dim = 0; dim < 3; ++dim) { m_SegmentationCountInSlice[timeStep][dim].clear(); m_SegmentationCountInSlice[timeStep][dim].resize( m_Segmentation->GetDimension(dim) ); m_SegmentationCountInSlice[timeStep][dim].assign( m_Segmentation->GetDimension(dim), 0 ); } } s_InterpolatorForImage.insert( std::make_pair( m_Segmentation, this ) ); // for all timesteps // scan whole image for (unsigned int timeStep = 0; timeStep < m_Segmentation->GetTimeSteps(); ++timeStep) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( m_Segmentation ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer segmentation3D = timeSelector->GetOutput(); AccessFixedDimensionByItk_2( segmentation3D, ScanWholeVolume, 3, m_Segmentation, timeStep ); } //PrintStatus(); SetReferenceVolume( m_ReferenceImage ); Modified(); } void mitk::SegmentationInterpolationController::SetReferenceVolume( const Image* referenceImage ) { m_ReferenceImage = referenceImage; if ( m_ReferenceImage.IsNull() ) return; // no image set - ignore it then assert ( m_Segmentation.IsNotNull() ); // should never happen // ensure the reference image has the same dimensionality and extents as the segmentation image if ( m_ReferenceImage.IsNull() || m_Segmentation.IsNull() || m_ReferenceImage->GetDimension() != m_Segmentation->GetDimension() || m_ReferenceImage->GetPixelType().GetNumberOfComponents() != 1 || m_Segmentation->GetPixelType().GetNumberOfComponents() != 1 ) { MITK_ERROR << "original patient image does not match segmentation, ignoring patient image" << std::endl; m_ReferenceImage = NULL; return; } for (unsigned int dim = 0; dim < m_Segmentation->GetDimension(); ++dim) if ( m_ReferenceImage->GetDimension(dim) != m_Segmentation->GetDimension(dim) ) { MITK_ERROR << "original patient image does not match segmentation (different extent in dimension " << dim << "), ignoring patient image" << std::endl; m_ReferenceImage = NULL; return; } } void mitk::SegmentationInterpolationController::SetChangedVolume( const Image* sliceDiff, unsigned int timeStep ) { if ( !sliceDiff ) return; if ( sliceDiff->GetDimension() != 3 ) return; AccessFixedDimensionByItk_1( sliceDiff, ScanChangedVolume, 3, timeStep ); //PrintStatus(); Modified(); } void mitk::SegmentationInterpolationController::SetChangedSlice( const Image* sliceDiff, unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep ) { if ( !sliceDiff ) return; if ( sliceDimension > 2 ) return; if ( timeStep >= m_SegmentationCountInSlice.size() ) return; if ( sliceIndex >= m_SegmentationCountInSlice[timeStep][sliceDimension].size() ) return; unsigned int dim0(0); unsigned int dim1(1); // determine the other two dimensions switch (sliceDimension) { default: case 2: dim0 = 0; dim1 = 1; break; case 1: dim0 = 0; dim1 = 2; break; case 0: dim0 = 1; dim1 = 2; break; } mitkIpPicDescriptor* rawSlice = const_cast(sliceDiff)->GetSliceData()->GetPicDescriptor(); // we promise not to change anything! if (!rawSlice) return; AccessFixedDimensionByItk_1( sliceDiff, ScanChangedSlice, 2, SetChangedSliceOptions(sliceDimension, sliceIndex, dim0, dim1, timeStep, rawSlice->data) ); //PrintStatus(); Modified(); } template < typename DATATYPE > void mitk::SegmentationInterpolationController::ScanChangedSlice( itk::Image*, const SetChangedSliceOptions& options ) { DATATYPE* pixelData( (DATATYPE*)options.pixelData ); unsigned int timeStep( options.timeStep ); unsigned int sliceDimension( options.sliceDimension ); unsigned int sliceIndex( options.sliceIndex ); if ( sliceDimension > 2 ) return; if ( sliceIndex >= m_SegmentationCountInSlice[timeStep][sliceDimension].size() ) return; unsigned int dim0( options.dim0 ); unsigned int dim1( options.dim1 ); int numberOfPixels(0); // number of pixels in this slice that are not 0 unsigned int dim0max = m_SegmentationCountInSlice[timeStep][dim0].size(); unsigned int dim1max = m_SegmentationCountInSlice[timeStep][dim1].size(); // scan the slice from two directions // and set the flags for the two dimensions of the slice for (unsigned int v = 0; v < dim1max; ++v) { for (unsigned int u = 0; u < dim0max; ++u) { DATATYPE value = *(pixelData + u + v * dim0max); assert ( (signed) m_SegmentationCountInSlice[timeStep][dim0][u] + (signed)value >= 0 ); // just for debugging. This must always be true, otherwise some counting is going wrong assert ( (signed) m_SegmentationCountInSlice[timeStep][dim1][v] + (signed)value >= 0 ); m_SegmentationCountInSlice[timeStep][dim0][u] = static_cast( m_SegmentationCountInSlice[timeStep][dim0][u] + value ); m_SegmentationCountInSlice[timeStep][dim1][v] = static_cast( m_SegmentationCountInSlice[timeStep][dim1][v] + value ); numberOfPixels += static_cast( value ); } } // flag for the dimension of the slice itself assert ( (signed) m_SegmentationCountInSlice[timeStep][sliceDimension][sliceIndex] + numberOfPixels >= 0 ); m_SegmentationCountInSlice[timeStep][sliceDimension][sliceIndex] += numberOfPixels; //MITK_INFO << "scan t=" << timeStep << " from (0,0) to (" << dim0max << "," << dim1max << ") (" << pixelData << "-" << pixelData+dim0max*dim1max-1 << ") in slice " << sliceIndex << " found " << numberOfPixels << " pixels" << std::endl; } template < typename TPixel, unsigned int VImageDimension > void mitk::SegmentationInterpolationController::ScanChangedVolume( itk::Image* diffImage, unsigned int timeStep ) { typedef itk::ImageSliceConstIteratorWithIndex< itk::Image > IteratorType; IteratorType iter( diffImage, diffImage->GetLargestPossibleRegion() ); iter.SetFirstDirection(0); iter.SetSecondDirection(1); int numberOfPixels(0); // number of pixels in this slice that are not 0 typename IteratorType::IndexType index; unsigned int x = 0; unsigned int y = 0; unsigned int z = 0; iter.GoToBegin(); while ( !iter.IsAtEnd() ) { while ( !iter.IsAtEndOfSlice() ) { while ( !iter.IsAtEndOfLine() ) { index = iter.GetIndex(); x = index[0]; y = index[1]; z = index[2]; TPixel value = iter.Get(); assert ( (signed) m_SegmentationCountInSlice[timeStep][0][x] + (signed)value >= 0 ); // just for debugging. This must always be true, otherwise some counting is going wrong assert ( (signed) m_SegmentationCountInSlice[timeStep][1][y] + (signed)value >= 0 ); m_SegmentationCountInSlice[timeStep][0][x] = static_cast( m_SegmentationCountInSlice[timeStep][0][x] + value ); m_SegmentationCountInSlice[timeStep][1][y] = static_cast( m_SegmentationCountInSlice[timeStep][1][y] + value ); numberOfPixels += static_cast( value ); ++iter; } iter.NextLine(); } assert ( (signed) m_SegmentationCountInSlice[timeStep][2][z] + numberOfPixels >= 0 ); m_SegmentationCountInSlice[timeStep][2][z] += numberOfPixels; numberOfPixels = 0; iter.NextSlice(); } } template < typename DATATYPE > void mitk::SegmentationInterpolationController::ScanWholeVolume( itk::Image*, const Image* volume, unsigned int timeStep ) { if (!volume) return; if ( timeStep >= m_SegmentationCountInSlice.size() ) return; for (unsigned int slice = 0; slice < volume->GetDimension(2); ++slice) { DATATYPE* rawVolume = static_cast( const_cast(volume)->GetVolumeData(timeStep)->GetData() ); // we again promise not to change anything, we'll just count //DATATYPE* rawSlice = static_cast( volume->GetSliceData(slice)->GetData() ); // TODO THIS wouldn't work. Did I mess up with some internal mitk::Image data structure? DATATYPE* rawSlice = rawVolume + ( volume->GetDimension(0) * volume->GetDimension(1) * slice ); ScanChangedSlice( NULL, SetChangedSliceOptions(2, slice, 0, 1, timeStep, rawSlice) ); } } void mitk::SegmentationInterpolationController::PrintStatus() { unsigned int timeStep(0); // if needed, put a loop over time steps around everyting, but beware, output will be long MITK_INFO << "Interpolator status (timestep 0): dimensions " << m_SegmentationCountInSlice[timeStep][0].size() << " " << m_SegmentationCountInSlice[timeStep][1].size() << " " << m_SegmentationCountInSlice[timeStep][2].size() << std::endl; MITK_INFO << "Slice 0: " << m_SegmentationCountInSlice[timeStep][2][0] << std::endl; // row "x" for (unsigned int index = 0; index < m_SegmentationCountInSlice[timeStep][0].size(); ++index) { if ( m_SegmentationCountInSlice[timeStep][0][index] > 0 ) MITK_INFO << "O"; else MITK_INFO << "."; } MITK_INFO << std::endl; // rows "y" and "z" (diagonal) for (unsigned int index = 1; index < m_SegmentationCountInSlice[timeStep][1].size(); ++index) { if ( m_SegmentationCountInSlice[timeStep][1][index] > 0 ) MITK_INFO << "O"; else MITK_INFO << "."; if ( m_SegmentationCountInSlice[timeStep][2].size() > index ) // if we also have a z value here, then print it, too { for (unsigned int indent = 1; indent < index; ++indent) MITK_INFO << " "; if ( m_SegmentationCountInSlice[timeStep][2][index] > 0 ) MITK_INFO << m_SegmentationCountInSlice[timeStep][2][index];//"O"; else MITK_INFO << "."; } MITK_INFO << std::endl; } // z indices that are larger than the biggest y index for (unsigned int index = m_SegmentationCountInSlice[timeStep][1].size(); index < m_SegmentationCountInSlice[timeStep][2].size(); ++index) { for (unsigned int indent = 0; indent < index; ++indent) MITK_INFO << " "; if ( m_SegmentationCountInSlice[timeStep][2][index] > 0 ) MITK_INFO << m_SegmentationCountInSlice[timeStep][2][index];//"O"; else MITK_INFO << "."; MITK_INFO << std::endl; } } mitk::Image::Pointer mitk::SegmentationInterpolationController::Interpolate( unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep ) { if (m_Segmentation.IsNull()) return NULL; if ( timeStep >= m_SegmentationCountInSlice.size() ) return NULL; if ( sliceDimension > 2 ) return NULL; unsigned int upperLimit = m_SegmentationCountInSlice[timeStep][sliceDimension].size(); if ( sliceIndex >= upperLimit - 1 ) return NULL; // can't interpolate first and last slice if ( sliceIndex < 1 ) return NULL; if ( m_SegmentationCountInSlice[timeStep][sliceDimension][sliceIndex] > 0 ) return NULL; // slice contains a segmentation, won't interpolate anything then unsigned int lowerBound(0); unsigned int upperBound(0); bool bounds( false ); for (lowerBound = sliceIndex - 1; /*lowerBound >= 0*/; --lowerBound) { if ( m_SegmentationCountInSlice[timeStep][sliceDimension][lowerBound] > 0 ) { bounds = true; break; } if (lowerBound == 0) break; // otherwise overflow and start at something like 4294967295 } if (!bounds) return NULL; bounds = false; for (upperBound = sliceIndex + 1 ; upperBound < upperLimit; ++upperBound) { if ( m_SegmentationCountInSlice[timeStep][sliceDimension][upperBound] > 0 ) { bounds = true; break; } } if (!bounds) return NULL; // ok, we have found two neighboring slices with segmentations (and we made sure that the current slice does NOT contain anything //MITK_INFO << "Interpolate in timestep " << timeStep << ", dimension " << sliceDimension << ": estimate slice " << sliceIndex << " from slices " << lowerBound << " and " << upperBound << std::endl; mitk::Image::Pointer lowerMITKSlice; mitk::Image::Pointer upperMITKSlice; mitk::Image::Pointer resultImage; try { // extract the two neighoring slices from the segmentation volume ExtractImageFilter::Pointer extractor= ExtractImageFilter::New(); extractor->SetInput( m_Segmentation ); extractor->SetSliceDimension( sliceDimension ); extractor->SetSliceIndex( lowerBound ); extractor->SetTimeStep( timeStep ); extractor->Update(); lowerMITKSlice = extractor->GetOutput(); lowerMITKSlice->DisconnectPipeline(); // otherwise the next output of the filter will overwrite this pointer, too extractor->SetInput( m_Segmentation ); extractor->SetSliceDimension( sliceDimension ); extractor->SetSliceIndex( sliceIndex ); extractor->SetTimeStep( timeStep ); extractor->Update(); resultImage = extractor->GetOutput(); resultImage->DisconnectPipeline(); extractor->SetInput( m_Segmentation ); extractor->SetSliceDimension( sliceDimension ); extractor->SetSliceIndex( upperBound ); extractor->SetTimeStep( timeStep ); extractor->Update(); upperMITKSlice = extractor->GetOutput(); if ( lowerMITKSlice.IsNull() || upperMITKSlice.IsNull() ) return NULL; } catch(...) { return NULL; } // interpolation algorithm gets some inputs // two segmentations (guaranteed to be of the same data type, but no special data type guaranteed) // orientation (sliceDimension) of the segmentations // position of the two slices (sliceIndices) // one volume image (original patient image) // // interpolation algorithm can use e.g. itk::ImageSliceConstIteratorWithIndex to // inspect the original patient image at appropriate positions mitk::SegmentationInterpolationAlgorithm::Pointer algorithm = mitk::ShapeBasedInterpolationAlgorithm::New().GetPointer(); return algorithm->Interpolate( lowerMITKSlice.GetPointer(), lowerBound, upperMITKSlice.GetPointer(), upperBound, sliceIndex, sliceDimension, resultImage, timeStep, m_ReferenceImage ); } diff --git a/Modules/MitkExt/Interactions/mitkBinaryThresholdTool.cpp b/Modules/MitkExt/Interactions/mitkBinaryThresholdTool.cpp index 0721b4fe08..415e038983 100644 --- a/Modules/MitkExt/Interactions/mitkBinaryThresholdTool.cpp +++ b/Modules/MitkExt/Interactions/mitkBinaryThresholdTool.cpp @@ -1,311 +1,312 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkBinaryThresholdTool.h" #include "mitkBinaryThresholdTool.xpm" #include "mitkToolManager.h" #include "mitkBoundingObjectToSegmentationFilter.h" #include #include "mitkLevelWindowProperty.h" #include "mitkColorProperty.h" #include "mitkProperties.h" #include "mitkOrganTypeProperty.h" #include "mitkVtkResliceInterpolationProperty.h" #include "mitkDataStorage.h" #include "mitkRenderingManager.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkImageTimeSelector.h" #include #include #include "mitkPadImageFilter.h" #include "mitkMaskAndCutRoiImageFilter.h" namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, BinaryThresholdTool, "Thresholding tool"); } mitk::BinaryThresholdTool::BinaryThresholdTool() :m_SensibleMinimumThresholdValue(-100), m_SensibleMaximumThresholdValue(+100), m_CurrentThresholdValue(1) { this->SupportRoiOn(); m_ThresholdFeedbackNode = DataNode::New(); mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties( m_ThresholdFeedbackNode ); m_ThresholdFeedbackNode->SetProperty( "color", ColorProperty::New(1.0, 0.0, 0.0) ); m_ThresholdFeedbackNode->SetProperty( "texture interpolation", BoolProperty::New(false) ); m_ThresholdFeedbackNode->SetProperty( "layer", IntProperty::New( 100 ) ); m_ThresholdFeedbackNode->SetProperty( "levelwindow", LevelWindowProperty::New( LevelWindow(100, 1) ) ); m_ThresholdFeedbackNode->SetProperty( "name", StringProperty::New("Thresholding feedback") ); m_ThresholdFeedbackNode->SetProperty( "opacity", FloatProperty::New(0.3) ); m_ThresholdFeedbackNode->SetProperty( "helper object", BoolProperty::New(true) ); } mitk::BinaryThresholdTool::~BinaryThresholdTool() { } const char** mitk::BinaryThresholdTool::GetXPM() const { return mitkBinaryThresholdTool_xpm; } const char* mitk::BinaryThresholdTool::GetName() const { return "Thresholding"; } void mitk::BinaryThresholdTool::Activated() { m_ToolManager->RoiDataChanged += mitk::MessageDelegate(this, &mitk::BinaryThresholdTool::OnRoiDataChanged); m_OriginalImageNode = m_ToolManager->GetReferenceData(0); m_NodeForThresholding = m_OriginalImageNode; if ( m_NodeForThresholding.IsNotNull() ) { SetupPreviewNodeFor( m_NodeForThresholding ); } else { m_ToolManager->ActivateTool(-1); } } void mitk::BinaryThresholdTool::Deactivated() { m_ToolManager->RoiDataChanged -= mitk::MessageDelegate(this, &mitk::BinaryThresholdTool::OnRoiDataChanged); m_NodeForThresholding = NULL; m_OriginalImageNode = NULL; try { if (DataStorage* storage = m_ToolManager->GetDataStorage()) { storage->Remove( m_ThresholdFeedbackNode ); RenderingManager::GetInstance()->RequestUpdateAll(); } } catch(...) { // don't care } m_ThresholdFeedbackNode->SetData(NULL); } void mitk::BinaryThresholdTool::SetThresholdValue(int value) { if (m_ThresholdFeedbackNode.IsNotNull()) { m_CurrentThresholdValue = value; m_ThresholdFeedbackNode->SetProperty( "levelwindow", LevelWindowProperty::New( LevelWindow(m_CurrentThresholdValue, 1) ) ); RenderingManager::GetInstance()->RequestUpdateAll(); } } void mitk::BinaryThresholdTool::AcceptCurrentThresholdValue(const std::string& organName, const Color& color) { CreateNewSegmentationFromThreshold(m_NodeForThresholding, organName, color ); RenderingManager::GetInstance()->RequestUpdateAll(); m_ToolManager->ActivateTool(-1); } void mitk::BinaryThresholdTool::CancelThresholding() { m_ToolManager->ActivateTool(-1); } void mitk::BinaryThresholdTool::SetupPreviewNodeFor( DataNode* nodeForThresholding ) { if (nodeForThresholding) { Image::Pointer image = dynamic_cast( nodeForThresholding->GetData() ); Image::Pointer originalImage = dynamic_cast (m_OriginalImageNode->GetData()); if (image.IsNotNull()) { // initialize and a new node with the same image as our reference image // use the level window property of this image copy to display the result of a thresholding operation m_ThresholdFeedbackNode->SetData( image ); int layer(50); nodeForThresholding->GetIntProperty("layer", layer); m_ThresholdFeedbackNode->SetIntProperty("layer", layer+1); if (DataStorage* storage = m_ToolManager->GetDataStorage()) { if (storage->Exists(m_ThresholdFeedbackNode)) storage->Remove(m_ThresholdFeedbackNode); storage->Add( m_ThresholdFeedbackNode, m_OriginalImageNode ); } if (image.GetPointer() == originalImage.GetPointer()) { m_SensibleMinimumThresholdValue = static_cast( originalImage->GetScalarValueMin() ); m_SensibleMaximumThresholdValue = static_cast( originalImage->GetScalarValueMax() ); } LevelWindowProperty::Pointer lwp = dynamic_cast( m_ThresholdFeedbackNode->GetProperty( "levelwindow" )); if (lwp) { m_CurrentThresholdValue = static_cast( lwp->GetLevelWindow().GetLevel() ); } else { m_CurrentThresholdValue = (m_SensibleMaximumThresholdValue + m_SensibleMinimumThresholdValue)/2; } IntervalBordersChanged.Send(m_SensibleMinimumThresholdValue, m_SensibleMaximumThresholdValue); ThresholdingValueChanged.Send(m_CurrentThresholdValue); } } } void mitk::BinaryThresholdTool::CreateNewSegmentationFromThreshold(DataNode* node, const std::string& organName, const Color& color) { if (node) { Image::Pointer image = dynamic_cast( m_NodeForThresholding->GetData() ); if (image.IsNotNull()) { // create a new image of the same dimensions and smallest possible pixel type DataNode::Pointer emptySegmentation = Tool::CreateEmptySegmentationNode( image, organName, color ); if (emptySegmentation) { // actually perform a thresholding and ask for an organ type for (unsigned int timeStep = 0; timeStep < image->GetTimeSteps(); ++timeStep) { try { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( image ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer image3D = timeSelector->GetOutput(); AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast(emptySegmentation->GetData()), timeStep ); } catch(...) { Tool::ErrorMessage("Error accessing single time steps of the original image. Cannot create segmentation."); } } if (m_OriginalImageNode.GetPointer() != m_NodeForThresholding.GetPointer()) { mitk::PadImageFilter::Pointer padFilter = mitk::PadImageFilter::New(); padFilter->SetInput(0, dynamic_cast (emptySegmentation->GetData())); padFilter->SetInput(1, dynamic_cast (m_OriginalImageNode->GetData())); padFilter->SetBinaryFilter(true); padFilter->SetUpperThreshold(1); padFilter->SetLowerThreshold(1); padFilter->Update(); emptySegmentation->SetData(padFilter->GetOutput()); } if (DataStorage::Pointer storage = m_ToolManager->GetDataStorage()) { storage->Add( emptySegmentation, m_OriginalImageNode ); // add as a child, because the segmentation "derives" from the original } m_ToolManager->SetWorkingData( emptySegmentation ); } } } } template void mitk::BinaryThresholdTool::ITKThresholding( itk::Image* originalImage, Image* segmentation, unsigned int timeStep ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( segmentation ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer segmentation3D = timeSelector->GetOutput(); typedef itk::Image< Tool::DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations SegmentationType::Pointer itkSegmentation; CastToItkImage( segmentation3D, itkSegmentation ); // iterate over original and segmentation typedef itk::ImageRegionConstIterator< itk::Image > InputIteratorType; typedef itk::ImageRegionIterator< SegmentationType > SegmentationIteratorType; InputIteratorType inputIterator( originalImage, originalImage->GetLargestPossibleRegion() ); SegmentationIteratorType outputIterator( itkSegmentation, itkSegmentation->GetLargestPossibleRegion() ); inputIterator.GoToBegin(); outputIterator.GoToBegin(); while (!outputIterator.IsAtEnd()) { if ( (signed)inputIterator.Get() >= m_CurrentThresholdValue ) { outputIterator.Set( 1 ); } else { outputIterator.Set( 0 ); } ++inputIterator; ++outputIterator; } } void mitk::BinaryThresholdTool::OnRoiDataChanged() { mitk::DataNode::Pointer node = m_ToolManager->GetRoiData(0); if (node.IsNotNull()) { mitk::Image::Pointer image = dynamic_cast (m_NodeForThresholding->GetData()); if (image.IsNull()) return; mitk::MaskAndCutRoiImageFilter::Pointer roiFilter = mitk::MaskAndCutRoiImageFilter::New(); roiFilter->SetInput(image); roiFilter->SetRegionOfInterest(node->GetData()); roiFilter->Update(); mitk::DataNode::Pointer tmpNode = mitk::DataNode::New(); mitk::Image::Pointer tmpImage = roiFilter->GetOutput(); tmpNode->SetData(tmpImage); m_SensibleMaximumThresholdValue = static_cast (roiFilter->GetMaxValue()); m_SensibleMinimumThresholdValue = static_cast (roiFilter->GetMinValue()); SetupPreviewNodeFor( tmpNode ); m_NodeForThresholding = tmpNode; return; } else { this->SetupPreviewNodeFor(m_OriginalImageNode); m_NodeForThresholding = m_OriginalImageNode; return; } } diff --git a/Modules/MitkExt/Interactions/mitkBinaryThresholdULTool.cpp b/Modules/MitkExt/Interactions/mitkBinaryThresholdULTool.cpp index 24031b11a0..14c785035f 100644 --- a/Modules/MitkExt/Interactions/mitkBinaryThresholdULTool.cpp +++ b/Modules/MitkExt/Interactions/mitkBinaryThresholdULTool.cpp @@ -1,319 +1,320 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.0 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkBinaryThresholdULTool.h" #include "mitkBinaryThresholdULTool.xpm" #include "mitkToolManager.h" #include "mitkLevelWindowProperty.h" #include "mitkColorProperty.h" #include "mitkProperties.h" #include "mitkDataStorage.h" #include "mitkRenderingManager.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkImageTimeSelector.h" #include #include #include "mitkMaskAndCutRoiImageFilter.h" #include "mitkPadImageFilter.h" namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, BinaryThresholdULTool, "ThresholdingUL tool"); } mitk::BinaryThresholdULTool::BinaryThresholdULTool() :m_SensibleMinimumThresholdValue(-100), m_SensibleMaximumThresholdValue(+100), m_CurrentLowerThresholdValue(1), m_CurrentUpperThresholdValue(1) { this->SupportRoiOn(); m_ThresholdFeedbackNode = DataNode::New(); m_ThresholdFeedbackNode->SetProperty( "color", ColorProperty::New(1.0, 0.0, 0.0) ); m_ThresholdFeedbackNode->SetProperty( "name", StringProperty::New("Thresholding feedback") ); m_ThresholdFeedbackNode->SetProperty( "opacity", FloatProperty::New(0.3) ); m_ThresholdFeedbackNode->SetProperty("binary", BoolProperty::New(true)); m_ThresholdFeedbackNode->SetProperty( "helper object", BoolProperty::New(true) ); } mitk::BinaryThresholdULTool::~BinaryThresholdULTool() { } const char** mitk::BinaryThresholdULTool::GetXPM() const { return mitkBinaryThresholdULTool_xpm; } const char* mitk::BinaryThresholdULTool::GetName() const { return "ThresholdingUL"; } void mitk::BinaryThresholdULTool::Activated() { m_ToolManager->RoiDataChanged += mitk::MessageDelegate(this, &mitk::BinaryThresholdULTool::OnRoiDataChanged); m_OriginalImageNode = m_ToolManager->GetReferenceData(0); m_NodeForThresholding = m_OriginalImageNode; if ( m_NodeForThresholding.IsNotNull() ) { SetupPreviewNode(); } else { m_ToolManager->ActivateTool(-1); } } void mitk::BinaryThresholdULTool::Deactivated() { m_ToolManager->RoiDataChanged -= mitk::MessageDelegate(this, &mitk::BinaryThresholdULTool::OnRoiDataChanged); m_NodeForThresholding = NULL; m_OriginalImageNode = NULL; try { if (DataStorage* storage = m_ToolManager->GetDataStorage()) { storage->Remove( m_ThresholdFeedbackNode ); RenderingManager::GetInstance()->RequestUpdateAll(); } } catch(...) { // don't care } m_ThresholdFeedbackNode->SetData(NULL); } void mitk::BinaryThresholdULTool::SetThresholdValues(int lower, int upper) { if (m_ThresholdFeedbackNode.IsNotNull()) { m_CurrentLowerThresholdValue = lower; m_CurrentUpperThresholdValue = upper; UpdatePreview(); } } void mitk::BinaryThresholdULTool::AcceptCurrentThresholdValue(const std::string& organName, const Color& color) { CreateNewSegmentationFromThreshold(m_NodeForThresholding, organName, color ); RenderingManager::GetInstance()->RequestUpdateAll(); m_ToolManager->ActivateTool(-1); } void mitk::BinaryThresholdULTool::CancelThresholding() { m_ToolManager->ActivateTool(-1); } void mitk::BinaryThresholdULTool::SetupPreviewNode() { if (m_NodeForThresholding.IsNotNull()) { Image::Pointer image = dynamic_cast( m_NodeForThresholding->GetData() ); Image::Pointer originalImage = dynamic_cast (m_OriginalImageNode->GetData()); if (image.IsNotNull()) { // initialize and a new node with the same image as our reference image // use the level window property of this image copy to display the result of a thresholding operation m_ThresholdFeedbackNode->SetData( image ); int layer(50); m_NodeForThresholding->GetIntProperty("layer", layer); m_ThresholdFeedbackNode->SetIntProperty("layer", layer+1); if (DataStorage* ds = m_ToolManager->GetDataStorage()) { if (!ds->Exists(m_ThresholdFeedbackNode)) ds->Add( m_ThresholdFeedbackNode, m_OriginalImageNode ); } if (image.GetPointer() == originalImage.GetPointer()) { m_SensibleMinimumThresholdValue = static_cast( originalImage->GetScalarValueMin() ); m_SensibleMaximumThresholdValue = static_cast( originalImage->GetScalarValueMax() ); } m_CurrentLowerThresholdValue = (m_SensibleMaximumThresholdValue + m_SensibleMinimumThresholdValue) / 3; m_CurrentUpperThresholdValue = 2*m_CurrentLowerThresholdValue; IntervalBordersChanged.Send(m_SensibleMinimumThresholdValue, m_SensibleMaximumThresholdValue); ThresholdingValuesChanged.Send(m_CurrentLowerThresholdValue, m_CurrentUpperThresholdValue); } } } void mitk::BinaryThresholdULTool::CreateNewSegmentationFromThreshold(DataNode* node, const std::string& organName, const Color& color) { if (node) { Image::Pointer image = dynamic_cast( m_NodeForThresholding->GetData() ); if (image.IsNotNull()) { // create a new image of the same dimensions and smallest possible pixel type DataNode::Pointer emptySegmentation = Tool::CreateEmptySegmentationNode( image, organName, color ); if (emptySegmentation) { // actually perform a thresholding and ask for an organ type for (unsigned int timeStep = 0; timeStep < image->GetTimeSteps(); ++timeStep) { try { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( image ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer image3D = timeSelector->GetOutput(); AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast(emptySegmentation->GetData()), timeStep ); } catch(...) { Tool::ErrorMessage("Error accessing single time steps of the original image. Cannot create segmentation."); } } //since we are maybe working on a smaller image, pad it to the size of the original image if (m_OriginalImageNode.GetPointer() != m_NodeForThresholding.GetPointer()) { mitk::PadImageFilter::Pointer padFilter = mitk::PadImageFilter::New(); padFilter->SetInput(0, dynamic_cast (emptySegmentation->GetData())); padFilter->SetInput(1, dynamic_cast (m_OriginalImageNode->GetData())); padFilter->SetBinaryFilter(true); padFilter->SetUpperThreshold(1); padFilter->SetLowerThreshold(1); padFilter->Update(); emptySegmentation->SetData(padFilter->GetOutput()); } if (DataStorage* ds = m_ToolManager->GetDataStorage()) { ds->Add( emptySegmentation, m_OriginalImageNode ); } m_ToolManager->SetWorkingData( emptySegmentation ); } } } } template void mitk::BinaryThresholdULTool::ITKThresholding( itk::Image* originalImage, Image* segmentation, unsigned int timeStep ) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( segmentation ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer segmentation3D = timeSelector->GetOutput(); typedef itk::Image< Tool::DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations SegmentationType::Pointer itkSegmentation; CastToItkImage( segmentation3D, itkSegmentation ); // iterate over original and segmentation typedef itk::ImageRegionConstIterator< itk::Image > InputIteratorType; typedef itk::ImageRegionIterator< SegmentationType > SegmentationIteratorType; InputIteratorType inputIterator( originalImage, originalImage->GetLargestPossibleRegion() ); SegmentationIteratorType outputIterator( itkSegmentation, itkSegmentation->GetLargestPossibleRegion() ); inputIterator.GoToBegin(); outputIterator.GoToBegin(); while (!outputIterator.IsAtEnd()) { if ( (signed)inputIterator.Get() >= m_CurrentLowerThresholdValue && (signed)inputIterator.Get() <= m_CurrentUpperThresholdValue ) { outputIterator.Set( 1 ); } else { outputIterator.Set( 0 ); } ++inputIterator; ++outputIterator; } } void mitk::BinaryThresholdULTool::OnRoiDataChanged() { mitk::DataNode::Pointer node = m_ToolManager->GetRoiData(0); if (node.IsNotNull()) { mitk::MaskAndCutRoiImageFilter::Pointer roiFilter = mitk::MaskAndCutRoiImageFilter::New(); mitk::Image::Pointer image = dynamic_cast (m_NodeForThresholding->GetData()); if (image.IsNull()) return; roiFilter->SetInput(image); roiFilter->SetRegionOfInterest(node->GetData()); roiFilter->Update(); mitk::DataNode::Pointer tmpNode = mitk::DataNode::New(); tmpNode->SetData(roiFilter->GetOutput()); m_SensibleMinimumThresholdValue = static_cast( roiFilter->GetMinValue()); m_SensibleMaximumThresholdValue = static_cast( roiFilter->GetMaxValue()); m_NodeForThresholding = tmpNode; } else m_NodeForThresholding = m_OriginalImageNode; this->SetupPreviewNode(); this->UpdatePreview(); } void mitk::BinaryThresholdULTool::UpdatePreview() { typedef itk::Image ImageType; typedef itk::Image SegmentationType; typedef itk::BinaryThresholdImageFilter ThresholdFilterType; mitk::Image::Pointer thresholdimage = dynamic_cast (m_NodeForThresholding->GetData()); if(thresholdimage) { ImageType::Pointer itkImage = ImageType::New(); CastToItkImage(thresholdimage, itkImage); ThresholdFilterType::Pointer filter = ThresholdFilterType::New(); filter->SetInput(itkImage); filter->SetLowerThreshold(m_CurrentLowerThresholdValue); filter->SetUpperThreshold(m_CurrentUpperThresholdValue); filter->SetInsideValue(1); filter->SetOutsideValue(0); filter->Update(); mitk::Image::Pointer new_image = mitk::Image::New(); CastToMitkImage(filter->GetOutput(), new_image); m_ThresholdFeedbackNode->SetData(new_image); } RenderingManager::GetInstance()->RequestUpdateAll(); } diff --git a/Modules/MitkExt/Interactions/mitkCalculateGrayValueStatisticsTool.cpp b/Modules/MitkExt/Interactions/mitkCalculateGrayValueStatisticsTool.cpp index 1df9e39241..0f5d664ecc 100644 --- a/Modules/MitkExt/Interactions/mitkCalculateGrayValueStatisticsTool.cpp +++ b/Modules/MitkExt/Interactions/mitkCalculateGrayValueStatisticsTool.cpp @@ -1,340 +1,341 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkCalculateGrayValueStatisticsTool.h" #include "mitkCalculateGrayValueStatisticsTool.xpm" +#include "mitkImageAccessByItk.h" #include "mitkProgressBar.h" #include "mitkStatusBar.h" #include "mitkImageTimeSelector.h" #include "mitkImageCast.h" #include "mitkToolManager.h" #include #include namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, CalculateGrayValueStatisticsTool, "Statistics tool"); } mitk::CalculateGrayValueStatisticsTool::CalculateGrayValueStatisticsTool() { } mitk::CalculateGrayValueStatisticsTool::~CalculateGrayValueStatisticsTool() { } const char** mitk::CalculateGrayValueStatisticsTool::GetXPM() const { return mitkCalculateGrayValueStatisticsTool_xpm; } const char* mitk::CalculateGrayValueStatisticsTool::GetName() const { return "Statistics"; } std::string mitk::CalculateGrayValueStatisticsTool::GetErrorMessage() { return "No statistics generated for these segmentations:"; } void mitk::CalculateGrayValueStatisticsTool::StartProcessingAllData() { // clear/prepare report m_CompleteReport.str(""); } bool mitk::CalculateGrayValueStatisticsTool::ProcessOneWorkingData( DataNode* node ) { if (node) { Image::Pointer image = dynamic_cast( node->GetData() ); if (image.IsNull()) return false; DataNode* referencenode = m_ToolManager->GetReferenceData(0); if (!referencenode) return false; try { ProgressBar::GetInstance()->AddStepsToDo(1); // add to report std::string nodename("structure"); node->GetName(nodename); std::string message = "Calculating statistics for "; message += nodename; StatusBar::GetInstance()->DisplayText(message.c_str()); Image::Pointer refImage = dynamic_cast( referencenode->GetData() ); Image::Pointer image = dynamic_cast( node->GetData() ); m_CompleteReport << "======== Gray value analysis of " << nodename << " ========\n"; if (image.IsNotNull() && refImage.IsNotNull() ) { for (unsigned int timeStep = 0; timeStep < image->GetTimeSteps(); ++timeStep) { ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New(); timeSelector->SetInput( refImage ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); Image::Pointer refImage3D = timeSelector->GetOutput(); ImageTimeSelector::Pointer timeSelector2 = ImageTimeSelector::New(); timeSelector2->SetInput( image ); timeSelector2->SetTimeNr( timeStep ); timeSelector2->UpdateLargestPossibleRegion(); Image::Pointer image3D = timeSelector2->GetOutput(); if (image3D.IsNotNull() && refImage3D.IsNotNull() ) { m_CompleteReport << "=== " << nodename << ", time step " << timeStep << " ===\n"; AccessFixedDimensionByItk_2( refImage3D, ITKHistogramming, 3, image3D, m_CompleteReport ); } } } m_CompleteReport << "======== End of analysis for " << nodename << " ===========\n\n\n"; ProgressBar::GetInstance()->Progress(); } catch(...) { return false; } } return true; } void mitk::CalculateGrayValueStatisticsTool::FinishProcessingAllData() { SegmentationsProcessingTool::FinishProcessingAllData(); // show/send results StatisticsCompleted.Send(); //MITK_INFO << m_CompleteReport.str() << std::endl; } #define ROUND_P(x) ((int)((x)+0.5)) template void mitk::CalculateGrayValueStatisticsTool::CalculateMinMax( itk::Image* referenceImage, Image* segmentation, TPixel& minimum, TPixel& maximum) { typedef itk::Image ImageType; typedef itk::Image SegmentationType; typename SegmentationType::Pointer segmentationItk; CastToItkImage(segmentation, segmentationItk); typename SegmentationType::RegionType segmentationRegion = segmentationItk->GetLargestPossibleRegion(); segmentationRegion.Crop(referenceImage->GetLargestPossibleRegion()); itk::ImageRegionConstIteratorWithIndex segmentationIterator(segmentationItk, segmentationRegion); itk::ImageRegionConstIteratorWithIndex referenceIterator(referenceImage, segmentationRegion); segmentationIterator.GoToBegin(); referenceIterator.GoToBegin(); minimum = std::numeric_limits::max(); maximum = std::numeric_limits::min(); while (!segmentationIterator.IsAtEnd()) { itk::Point pt; segmentationItk->TransformIndexToPhysicalPoint(segmentationIterator.GetIndex(), pt); typename ImageType::IndexType ind; itk::ContinuousIndex contInd; if (referenceImage->TransformPhysicalPointToContinuousIndex(pt, contInd)) { for (unsigned int i = 0; i < 3; ++i) ind[i] = ROUND_P(contInd[i]); referenceIterator.SetIndex(ind); if (segmentationIterator.Get() > 0) { if (referenceIterator.Get() < minimum) minimum = referenceIterator.Get(); if (referenceIterator.Get() > maximum) maximum = referenceIterator.Get(); } } ++segmentationIterator; } } template void mitk::CalculateGrayValueStatisticsTool::ITKHistogramming( itk::Image* referenceImage, Image* segmentation, std::stringstream& report) { typedef itk::Image ImageType; typedef itk::Image SegmentationType; typename SegmentationType::Pointer segmentationItk; CastToItkImage( segmentation, segmentationItk ); // generate histogram typename SegmentationType::RegionType segmentationRegion = segmentationItk->GetLargestPossibleRegion(); segmentationRegion.Crop( referenceImage->GetLargestPossibleRegion() ); itk::ImageRegionConstIteratorWithIndex< SegmentationType > segmentationIterator( segmentationItk, segmentationRegion); itk::ImageRegionConstIteratorWithIndex< ImageType > referenceIterator( referenceImage, segmentationRegion); segmentationIterator.GoToBegin(); referenceIterator.GoToBegin(); m_ITKHistogram = HistogramType::New(); TPixel minimum = std::numeric_limits::max(); TPixel maximum = std::numeric_limits::min(); CalculateMinMax(referenceImage, segmentation, minimum, maximum); //initialize the histogram to the range of the cropped region HistogramType::SizeType size; #if defined(ITK_USE_REVIEW_STATISTICS) typedef typename HistogramType::SizeType::ValueType HSizeValueType; #else typedef typename HistogramType::SizeType::SizeValueType HSizeValueType; #endif size.Fill(static_cast (maximum - minimum + 1)); HistogramType::MeasurementVectorType lowerBound; HistogramType::MeasurementVectorType upperBound; lowerBound[0] = minimum; upperBound[0] = maximum; m_ITKHistogram->Initialize(size, lowerBound, upperBound); double mean(0.0); double sd(0.0); double voxelCount(0.0); //iterate through the cropped region add the values to the histogram while (!segmentationIterator.IsAtEnd()) { itk::Point< float, 3 > pt; segmentationItk->TransformIndexToPhysicalPoint( segmentationIterator.GetIndex(), pt ); typename ImageType::IndexType ind; itk::ContinuousIndex contInd; if (referenceImage->TransformPhysicalPointToContinuousIndex(pt, contInd)) { for (unsigned int i = 0; i < 3; ++i) ind[i] = ROUND_P(contInd[i]); referenceIterator.SetIndex( ind ); if ( segmentationIterator.Get() > 0 ) { HistogramType::MeasurementVectorType currentMeasurementVector; currentMeasurementVector[0] = static_cast (referenceIterator.Get()); m_ITKHistogram->IncreaseFrequency(currentMeasurementVector, 1); mean = (mean * (static_cast (voxelCount) / static_cast (voxelCount + 1))) // 3 points: old center * 2/3 + currentPoint * 1/3; + static_cast (referenceIterator.Get()) / static_cast (voxelCount + 1); voxelCount += 1.0; } } ++segmentationIterator; } // second pass for SD segmentationIterator.GoToBegin(); referenceIterator.GoToBegin(); while ( !segmentationIterator.IsAtEnd() ) { itk::Point< float, 3 > pt; segmentationItk->TransformIndexToPhysicalPoint( segmentationIterator.GetIndex(), pt ); typename ImageType::IndexType ind; itk::ContinuousIndex contInd; if (referenceImage->TransformPhysicalPointToContinuousIndex(pt, contInd)) { for (unsigned int i = 0; i < 3; ++i) ind[i] = ROUND_P(contInd[i]); referenceIterator.SetIndex( ind ); if ( segmentationIterator.Get() > 0 ) { sd += ((static_cast(referenceIterator.Get() ) - mean)*(static_cast(referenceIterator.Get() ) - mean)); } } ++segmentationIterator; } sd /= static_cast(voxelCount - 1); sd = sqrt( sd ); // generate quantiles TPixel histogramQuantileValues[5]; histogramQuantileValues[0] = m_ITKHistogram->Quantile(0, 0.05); histogramQuantileValues[1] = m_ITKHistogram->Quantile(0, 0.25); histogramQuantileValues[2] = m_ITKHistogram->Quantile(0, 0.50); histogramQuantileValues[3] = m_ITKHistogram->Quantile(0, 0.75); histogramQuantileValues[4] = m_ITKHistogram->Quantile(0, 0.95); // report histogram values std::locale C("C"); std::locale originalLocale = report.getloc(); report.imbue(C); report << " Minimum:" << minimum << "\n 5% quantile: " << histogramQuantileValues[0] << "\n 25% quantile: " << histogramQuantileValues[1] << "\n 50% quantile: " << histogramQuantileValues[2] << "\n 75% quantile: " << histogramQuantileValues[3] << "\n 95% quantile: " << histogramQuantileValues[4] << "\n Maximum: " << maximum << "\n Mean: " << mean << "\n SD: " << sd << "\n"; report.imbue(originalLocale); } std::string mitk::CalculateGrayValueStatisticsTool::GetReport() const { return m_CompleteReport.str(); } mitk::CalculateGrayValueStatisticsTool::HistogramType::ConstPointer mitk::CalculateGrayValueStatisticsTool::GetHistogram() { return m_ITKHistogram.GetPointer(); } diff --git a/Modules/MitkExt/Interactions/mitkPaintbrushTool.cpp b/Modules/MitkExt/Interactions/mitkPaintbrushTool.cpp index fe495a898a..8f3fe8e8b9 100644 --- a/Modules/MitkExt/Interactions/mitkPaintbrushTool.cpp +++ b/Modules/MitkExt/Interactions/mitkPaintbrushTool.cpp @@ -1,352 +1,353 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkPaintbrushTool.h" #include "mitkToolManager.h" #include "mitkOverwriteSliceImageFilter.h" #include "mitkBaseRenderer.h" +#include "mitkImageDataItem.h" #include "ipSegmentation.h" #define ROUND(a) ((a)>0 ? (int)((a)+0.5) : -(int)(0.5-(a))) int mitk::PaintbrushTool::m_Size = 1; mitk::PaintbrushTool::PaintbrushTool(int paintingPixelValue) :FeedbackContourTool("PressMoveReleaseWithCTRLInversionAllMouseMoves"), m_PaintingPixelValue(paintingPixelValue), m_LastContourSize(0) // other than initial mitk::PaintbrushTool::m_Size (around l. 28) { m_MasterContour = Contour::New(); m_MasterContour->Initialize(); } mitk::PaintbrushTool::~PaintbrushTool() { } void mitk::PaintbrushTool::Activated() { Superclass::Activated(); FeedbackContourTool::SetFeedbackContourVisible(true); SizeChanged.Send(m_Size); } void mitk::PaintbrushTool::Deactivated() { FeedbackContourTool::SetFeedbackContourVisible(false); Superclass::Deactivated(); } void mitk::PaintbrushTool::SetSize(int value) { m_Size = value; } void mitk::PaintbrushTool::UpdateContour(const StateEvent* stateEvent) { // examine stateEvent and create a contour that matches the pixel mask that we are going to draw const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (!positionEvent) return; Image::Pointer m_WorkingSlice = FeedbackContourTool::GetAffectedWorkingSlice( positionEvent ); if (m_WorkingSlice.IsNull()) return; // create a copy of this slice (at least match the pixel sizes/spacings), // then draw the desired mask on it and create a contour from it // Convert to ipMITKSegmentationTYPE (because getting pixels relys on that data type) itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeImage; CastToItkImage( m_WorkingSlice, correctPixelTypeImage ); assert (correctPixelTypeImage.IsNotNull() ); itk::Image< ipMITKSegmentationTYPE, 2 >::DirectionType imageDirection; imageDirection.SetIdentity(); correctPixelTypeImage->SetDirection(imageDirection); Image::Pointer temporarySlice = Image::New(); CastToMitkImage( correctPixelTypeImage, temporarySlice ); mitkIpPicDescriptor* stupidClone = mitkIpPicClone( temporarySlice->GetSliceData()->GetPicDescriptor() ); unsigned int pixelWidth = m_Size + 1; unsigned int pixelHeight = m_Size + 1; if ( stupidClone->n[0] <= pixelWidth || stupidClone->n[1] <= pixelHeight ) { MITK_INFO << "Brush size is bigger than your working image. Reconsider this...\n" "(Or tell your progammer until (s)he fixes this message.)" << std::endl; mitkIpPicFree( stupidClone ); return; } unsigned int lineLength( stupidClone->n[0] ); unsigned int oneContourOffset(0); float circleCenterX = (float)m_Size / 2.0; float circleCenterY = (float)m_Size / 2.0; for (unsigned int x = 0; x <= pixelWidth; ++x) { for (unsigned int y = 0; y <= pixelHeight; ++y) { unsigned int offset = lineLength * y + x; ipMITKSegmentationTYPE* current = (ipMITKSegmentationTYPE*)stupidClone->data + offset; float pixelCenterX = x + 0.5; float pixelCenterY = y + 0.5; float xoff = pixelCenterX - circleCenterX; float yoff = pixelCenterY - circleCenterY; bool inside = xoff * xoff + yoff * yoff < (m_Size * m_Size) / 4.0; // no idea, if this would work for ellipses if (inside) { *current = 1; oneContourOffset = offset; } else { *current = 0; } } } int numberOfContourPoints( 0 ); int newBufferSize( 0 ); float* contourPoints = ipMITKSegmentationGetContour8N( stupidClone, oneContourOffset, numberOfContourPoints, newBufferSize ); // memory allocated with malloc if (!contourPoints) { mitkIpPicFree( stupidClone ); return; } // copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; //ipMITKSegmentationGetContour8N returns all points, which causes vtk warnings, since the first and the last points are coincident. //leaving the last point out, the contour is still drawn correctly for (int index = 0; index < numberOfContourPoints-1; ++index) { newPoint[0] = contourPoints[ 2 * index + 0 ] - circleCenterX; // master contour should be centered around (0,0) newPoint[1] = contourPoints[ 2 * index + 1] - circleCenterY; newPoint[2] = 0.0; MITK_DEBUG << "Point [" << index << "] (" << newPoint[0] << ", " << newPoint[1] << ")" << std::endl; contourInImageIndexCoordinates->AddVertex( newPoint ); } free(contourPoints); m_MasterContour = contourInImageIndexCoordinates; mitkIpPicFree( stupidClone ); } /** Just show the contour, get one point as the central point and add surrounding points to the contour. */ bool mitk::PaintbrushTool::OnMousePressed (Action* action, const StateEvent* stateEvent) { if (FeedbackContourTool::OnMousePressed( action, stateEvent )) { const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (positionEvent) { UpdateContour( stateEvent ); } } return this->OnMouseMoved(action, stateEvent); /* return true; */ } /** Insert the point to the feedback contour,finish to build the contour and at the same time the painting function */ bool mitk::PaintbrushTool::OnMouseMoved (Action* itkNotUsed(action), const StateEvent* stateEvent) { bool leftMouseButtonPressed( stateEvent->GetId() == 530 || stateEvent->GetId() == 1 || stateEvent->GetId() == 5 ); const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (!positionEvent) return false; if ( m_LastContourSize != m_Size ) { UpdateContour( stateEvent ); m_LastContourSize = m_Size; } DataNode* workingNode( m_ToolManager->GetWorkingData(0) ); if (!workingNode) return false; Image* image = dynamic_cast(workingNode->GetData()); const PlaneGeometry* planeGeometry( dynamic_cast (positionEvent->GetSender()->GetCurrentWorldGeometry2D() ) ); if ( !image || !planeGeometry ) return false; int affectedDimension( -1 ); int affectedSlice( -1 ); if ( !SegTool2D::DetermineAffectedImageSlice( image, planeGeometry, affectedDimension, affectedSlice ) ) return false; Point3D worldCoordinates = positionEvent->GetWorldPosition(); Point3D indexCoordinates; image->GetGeometry()->WorldToIndex( worldCoordinates, indexCoordinates ); MITK_DEBUG << "Mouse at W " << worldCoordinates << std::endl; MITK_DEBUG << "Mouse at I " << indexCoordinates << std::endl; unsigned int firstDimension(0); unsigned int secondDimension(1); switch( affectedDimension ) { case 2: // transversal default: firstDimension = 0; secondDimension = 1; break; case 1: // frontal firstDimension = 0; secondDimension = 2; break; case 0: // sagittal firstDimension = 1; secondDimension = 2; break; } // round to nearest voxel center (abort if this hasn't changed) if ( m_Size % 2 == 0 ) // even { indexCoordinates[firstDimension] = ROUND( indexCoordinates[firstDimension] + 0.5); indexCoordinates[secondDimension] = ROUND( indexCoordinates[secondDimension] + 0.5 ); } else // odd { indexCoordinates[firstDimension] = ROUND( indexCoordinates[firstDimension] ) ; indexCoordinates[secondDimension] = ROUND( indexCoordinates[secondDimension] ) ; } static Point3D lastPos; // uninitialized: if somebody finds out how this can be initialized in a one-liner, tell me static bool lastLeftMouseButtonPressed(false); if ( fabs(indexCoordinates[0] - lastPos[0]) > mitk::eps || fabs(indexCoordinates[1] - lastPos[1]) > mitk::eps || fabs(indexCoordinates[2] - lastPos[2]) > mitk::eps || leftMouseButtonPressed != lastLeftMouseButtonPressed ) { lastPos = indexCoordinates; lastLeftMouseButtonPressed = leftMouseButtonPressed; } else { MITK_DEBUG << "." << std::flush; return false; } MITK_DEBUG << "Mouse at C " << indexCoordinates; Contour::Pointer contour = Contour::New(); contour->Initialize(); for (unsigned int index = 0; index < m_MasterContour->GetNumberOfPoints(); ++index) { Point3D point = m_MasterContour->GetPoints()->ElementAt(index); point[0] += indexCoordinates[ firstDimension ]; point[1] += indexCoordinates[ secondDimension ]; MITK_DEBUG << "Contour point [" << index << "] :" << point; contour->AddVertex( point ); } Image::Pointer slice = SegTool2D::GetAffectedImageSliceAs2DImage( positionEvent, image ); if ( slice.IsNull() ) return false; if (leftMouseButtonPressed) { FeedbackContourTool::FillContourInSlice( contour, slice, m_PaintingPixelValue ); OverwriteSliceImageFilter::Pointer slicewriter = OverwriteSliceImageFilter::New(); slicewriter->SetInput( image ); slicewriter->SetCreateUndoInformation( true ); slicewriter->SetSliceImage( slice ); slicewriter->SetSliceDimension( affectedDimension ); slicewriter->SetSliceIndex( affectedSlice ); slicewriter->SetTimeStep( positionEvent->GetSender()->GetTimeStep( image ) ); slicewriter->Update(); } // visualize contour Contour::Pointer displayContour = Contour::New(); displayContour->Initialize(); for (unsigned int index = 0; index < contour->GetNumberOfPoints(); ++index) { Point3D point = contour->GetPoints()->ElementAt(index); /*if ( m_Size % 2 != 0 ) // even { point[0] += 0.5; point[1] += 0.5; }*/ displayContour->AddVertex( point ); } displayContour = FeedbackContourTool::BackProjectContourFrom2DSlice( slice->GetGeometry(), displayContour ); SetFeedbackContour( *displayContour ); assert( positionEvent->GetSender()->GetRenderWindow() ); RenderingManager::GetInstance()->RequestUpdate( positionEvent->GetSender()->GetRenderWindow() ); return true; } bool mitk::PaintbrushTool::OnMouseReleased(Action* /*action*/, const StateEvent* /*stateEvent*/) { //FeedbackContourTool::SetFeedbackContourVisible(false); return true; } /** Called when the CTRL key is pressed. Will change the painting pixel value from 0 to 1 or from 1 to 0. */ bool mitk::PaintbrushTool::OnInvertLogic(Action* action, const StateEvent* stateEvent) { if (!FeedbackContourTool::OnInvertLogic(action, stateEvent)) return false; // Inversion only for 0 and 1 as painting values if (m_PaintingPixelValue == 1) { m_PaintingPixelValue = 0; FeedbackContourTool::SetFeedbackContourColor( 1.0, 0.0, 0.0 ); } else if (m_PaintingPixelValue == 0) { m_PaintingPixelValue = 1; FeedbackContourTool::SetFeedbackContourColorDefault(); } return true; } diff --git a/Modules/MitkExt/Interactions/mitkPixelManipulationTool.cpp b/Modules/MitkExt/Interactions/mitkPixelManipulationTool.cpp index 2598485567..609fa1923f 100644 --- a/Modules/MitkExt/Interactions/mitkPixelManipulationTool.cpp +++ b/Modules/MitkExt/Interactions/mitkPixelManipulationTool.cpp @@ -1,171 +1,172 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 28959 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkPixelManipulationTool.h" #include "mitkToolManager.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkProperties.h" #include "mitkBoundingObjectToSegmentationFilter.h" #include #include "mitkPixelManipulationTool.xpm" namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, PixelManipulationTool, "Pixel manipulation tool"); } mitk::PixelManipulationTool::PixelManipulationTool() : Tool("dummy"), m_Value(0), m_FixedValue(false) { this->SupportRoiOn(); } mitk::PixelManipulationTool::~PixelManipulationTool() { } void mitk::PixelManipulationTool::Activated() { m_ToolManager->RoiDataChanged += mitk::MessageDelegate (this,&mitk::PixelManipulationTool::OnRoiDataChanged); m_OriginalImageNode = m_ToolManager->GetReferenceData(0); if (m_OriginalImageNode.IsNotNull()) { mitk::Image::Pointer image = dynamic_cast (m_OriginalImageNode->GetData()); if ( image.IsNotNull()) { //mitk::ScalarType scalar = image->GetScalarValueMax(); } } else m_ToolManager->ActivateTool(-1); } void mitk::PixelManipulationTool::Deactivated() { m_ToolManager->RoiDataChanged -= mitk::MessageDelegate (this,&mitk::PixelManipulationTool::OnRoiDataChanged); } const char* mitk::PixelManipulationTool::GetName() const { return "pixelmanipulation"; } const char** mitk::PixelManipulationTool::GetXPM() const { return mitkPixelManipulationTool_xpm; } void mitk::PixelManipulationTool::OnRoiDataChanged() { } void mitk::PixelManipulationTool::CalculateImage() { if (m_OriginalImageNode.IsNotNull()) { mitk::Image::Pointer image = dynamic_cast (m_OriginalImageNode->GetData()); mitk::DataNode* maskNode = m_ToolManager->GetRoiData(0); mitk::Image::Pointer roi = mitk::Image::New(); if (maskNode) { mitk::BoundingObject* boundingObject = dynamic_cast (maskNode->GetData()); if (boundingObject) { mitk::BoundingObjectToSegmentationFilter::Pointer filter = mitk::BoundingObjectToSegmentationFilter::New(); filter->SetBoundingObject( boundingObject); filter->SetInput(image); filter->Update(); roi = filter->GetOutput(); } else roi = dynamic_cast (maskNode->GetData()); mitk::Image::Pointer newImage = mitk::Image::New(); newImage->Initialize(image); if (image) { AccessByItk_3(image, ITKPixelManipulation, roi, newImage, m_Value); this->AddImageToDataStorage(newImage); } } } } template void mitk::PixelManipulationTool::ITKPixelManipulation( itk::Image* originalImage, Image* maskImage, Image* newImage, int newValue) { typedef itk::Image< TPixel, VImageDimension> itkImageType; typedef itk::Image< unsigned char, 3> itkMaskType; typename itkImageType::Pointer itkImage; typename itkMaskType::Pointer itkMask; CastToItkImage( newImage, itkImage); CastToItkImage( maskImage, itkMask); typedef itk::ImageRegionConstIterator< itkImageType > InputIteratorType; typedef itk::ImageRegionIterator< itkImageType > OutputIteratorType; typedef itk::ImageRegionConstIterator< itkMaskType > MaskIteratorType; MaskIteratorType maskIterator ( itkMask, itkMask->GetLargestPossibleRegion() ); InputIteratorType inputIterator( originalImage, originalImage->GetLargestPossibleRegion() ); OutputIteratorType outputIterator( itkImage, itkImage->GetLargestPossibleRegion() ); inputIterator.GoToBegin(); outputIterator.GoToBegin(); maskIterator.GoToBegin(); while (!outputIterator.IsAtEnd()) { if (maskIterator.Get()) { if (m_FixedValue) outputIterator.Set(newValue); else outputIterator.Set( inputIterator.Get()+ newValue); } else outputIterator.Set( inputIterator.Get()); ++inputIterator; ++outputIterator; ++maskIterator; } } void mitk::PixelManipulationTool::AddImageToDataStorage(mitk::Image::Pointer image) { if (image.IsNotNull()) { mitk::DataNode::Pointer node = mitk::DataNode::New(); std::string name = m_OriginalImageNode->GetName(); name.append("_modified"); node->SetName(name); node->SetProperty("binary", mitk::BoolProperty::New(false)); node->SetData(image); if (m_ToolManager) m_ToolManager->GetDataStorage()->Add(node, m_OriginalImageNode); } -} \ No newline at end of file +} diff --git a/Modules/MitkExt/Interactions/mitkRegionGrow3DTool.cpp b/Modules/MitkExt/Interactions/mitkRegionGrow3DTool.cpp index 576f6b8683..e4a0b9e01d 100644 --- a/Modules/MitkExt/Interactions/mitkRegionGrow3DTool.cpp +++ b/Modules/MitkExt/Interactions/mitkRegionGrow3DTool.cpp @@ -1,441 +1,442 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 28959 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkRegionGrow3DTool.h" #include "mitkToolManager.h" #include "mitkRenderingManager.h" #include "mitkLevelWindowProperty.h" #include "mitkPointSetInteractor.h" #include "mitkGlobalInteraction.h" #include "mitkITKImageImport.h" #include "itkImage.h" #include "itkBinaryThresholdImageFilter.h" #include "itkConnectedAdaptiveThresholdImageFilter.h" #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include "mitkMaskAndCutRoiImageFilter.h" #include "mitkPadImageFilter.h" #include "mitkRegionGrow3DTool.xpm" namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, RegionGrow3DTool, "RegionGrower 3D"); } mitk::RegionGrow3DTool::RegionGrow3DTool(): Tool("PressMoveRelease"), m_LowerThreshold(-5000), m_UpperThreshold(5000), m_CurrentRGDirectionIsUpwards(false) { CONNECT_ACTION( 42, OnMouseReleased ); this->SupportRoiOn(); m_FeedbackNode = DataNode::New(); m_FeedbackNode->SetProperty( "color", ColorProperty::New(1.0, 0.0, 0.0) ); m_FeedbackNode->SetProperty( "texture interpolation", BoolProperty::New(false) ); m_FeedbackNode->SetProperty( "layer", IntProperty::New( 100 ) ); m_FeedbackNode->SetProperty( "levelwindow", LevelWindowProperty::New( LevelWindow(100, 1) ) ); m_FeedbackNode->SetProperty( "name", StringProperty::New("failsafe region grow feedback") ); m_FeedbackNode->SetProperty( "opacity", FloatProperty::New(0.3) ); m_FeedbackNode->SetProperty( "helper object", BoolProperty::New(true) ); m_FeedbackNode->SetVisibility(false); m_PointSetNode = mitk::DataNode::New(); m_PointSetNode->SetName("regiongrow3d pointset"); m_PointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true)); m_PointSetNode->SetProperty("layer", mitk::IntProperty::New(2)); mitk::PointSet::Pointer pointSet = mitk::PointSet::New(); m_PointSetNode->SetData(pointSet); } mitk::RegionGrow3DTool::~RegionGrow3DTool() { } bool mitk::RegionGrow3DTool::OnMouseReleased(Action*, const StateEvent* stateEvent) { mitk::PointSetInteractor::Pointer interactor = dynamic_cast (m_PointSetNode->GetInteractor()); if (interactor.IsNotNull()) { mitk::PointSet::Pointer pointSet = dynamic_cast (m_PointSetNode->GetData()); if (pointSet.IsNotNull()) { if (pointSet->GetSize() == 1) { //check if we have a valid picture this->RunSegmentation(); SeedButtonToggled.Send(false); } } } return true; } void mitk::RegionGrow3DTool::Activated() { if (m_ToolManager) { m_ToolManager->RoiDataChanged += mitk::MessageDelegate(this, &mitk::RegionGrow3DTool::UpdatePreview); m_OriginalImageNode = m_ToolManager->GetReferenceData(0); m_NodeToProceed = m_OriginalImageNode; if (m_NodeToProceed.IsNotNull()) { SetupPreviewNodeFor(m_NodeToProceed); mitk::Image::Pointer image = dynamic_cast (m_OriginalImageNode->GetData()); if (image.IsNotNull()) { m_RoiMin = image->GetScalarValueMin(); m_RoiMax = image->GetScalarValueMax(); } } else m_ToolManager->ActivateTool(-1); } } void mitk::RegionGrow3DTool::Deactivated() { m_ToolManager->RoiDataChanged -= mitk::MessageDelegate(this, &mitk::RegionGrow3DTool::UpdatePreview); if (mitk::DataStorage* ds = m_ToolManager->GetDataStorage()) { ds->Remove(m_PointSetNode); ds->Remove(m_FeedbackNode); } m_FeedbackNode->SetData(NULL); m_FeedbackNode->SetLevelWindow(NULL); m_FeedbackNode->SetVisibility(false); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } const char* mitk::RegionGrow3DTool::GetName() const { return "RegionGrower 3D"; } const char** mitk::RegionGrow3DTool::GetXPM() const { return mitkRegionGrow3DTool_xpm; } void mitk::RegionGrow3DTool::SetSeedPoint(bool toggled) { if (!m_ToolManager->GetDataStorage()->Exists(m_PointSetNode)) //no pointSet present m_ToolManager->GetDataStorage()->Add(m_PointSetNode, m_OriginalImageNode); //add Interactor if there is none and add it to GlobalInteraction if (toggled == true) // button is down { mitk::PointSetInteractor::Pointer interactor = dynamic_cast (m_PointSetNode->GetInteractor()); if (interactor.IsNull()) { //create a new interactor and add it to node interactor = mitk::PointSetInteractor::New("singlepointinteractorwithoutshiftclick", m_PointSetNode, 1); } mitk::GlobalInteraction::GetInstance()->AddInteractor(interactor); } else { mitk::PointSetInteractor::Pointer interactor = dynamic_cast (m_PointSetNode->GetInteractor()); if (interactor.IsNotNull()) { m_PointSetNode->SetInteractor(NULL); mitk::GlobalInteraction::GetInstance()->RemoveInteractor(interactor); } } } void mitk::RegionGrow3DTool::RunSegmentation() { //safety if no pointSet or pointSet empty mitk::PointSet::Pointer seedPointSet = dynamic_cast (m_PointSetNode->GetData()); if (seedPointSet.IsNull()) { return; } if (!(seedPointSet->GetSize() > 0)) { return; } mitk::PointSet::PointType seedPoint = seedPointSet->GetPointSet()->GetPoints()->Begin().Value(); mitk::Image::Pointer image = dynamic_cast (m_NodeToProceed->GetData()); if (image.IsNotNull()) { m_LowerThreshold = static_cast (m_RoiMin); m_UpperThreshold = static_cast (m_RoiMax); AccessByItk_2(image, StartRegionGrowing, image->GetGeometry(), seedPoint); } } template void mitk::RegionGrow3DTool::StartRegionGrowing(itk::Image* itkImage, mitk::Geometry3D* imageGeometry, mitk::PointSet::PointType seedPoint) { typedef itk::Image InputImageType; typedef typename InputImageType::IndexType IndexType; typedef itk::ConnectedAdaptiveThresholdImageFilter RegionGrowingFilterType; typename RegionGrowingFilterType::Pointer regionGrower = RegionGrowingFilterType::New(); if ( !imageGeometry->IsInside(seedPoint) ) { return; } IndexType seedIndex; imageGeometry->WorldToIndex( seedPoint, seedIndex);// convert world coordinates to image indices //int seedValue = itkImage->GetPixel(seedIndex); regionGrower->SetInput( itkImage ); regionGrower->AddSeed( seedIndex ); regionGrower->SetLower( m_LowerThreshold ); regionGrower->SetUpper( m_UpperThreshold ); regionGrower->SetGrowingDirectionIsUpwards( m_CurrentRGDirectionIsUpwards ); try { regionGrower->Update(); } catch( ... ) { MITK_ERROR << "Something went wrong!" << endl; return; } m_SeedpointValue = regionGrower->GetSeedpointValue(); //initialize slider if(m_CurrentRGDirectionIsUpwards) { UpperThresholdValueChanged.Send(m_UpperThreshold); LowerThresholdValueChanged.Send(m_SeedpointValue); } else { UpperThresholdValueChanged.Send(m_SeedpointValue); LowerThresholdValueChanged.Send(m_LowerThreshold); } m_DetectedLeakagePoint = regionGrower->GetLeakagePoint(); mitk::Image::Pointer resultImage = mitk::ImportItkImage( regionGrower->GetOutput() ); m_FeedbackNode->SetData( resultImage ); m_FeedbackNode->SetVisibility(true); InitializeLevelWindow(); } void mitk::RegionGrow3DTool::InitializeLevelWindow() { mitk::LevelWindow tempLevelWindow; m_FeedbackNode->GetLevelWindow(tempLevelWindow, NULL, "levelWindow"); mitk::ScalarType* level = new mitk::ScalarType(0.5); mitk::ScalarType* window = new mitk::ScalarType(1); int upper; if (m_CurrentRGDirectionIsUpwards) { upper = m_UpperThreshold - m_SeedpointValue; } else { upper = m_SeedpointValue - m_LowerThreshold; } tempLevelWindow.SetRangeMinMax(mitk::ScalarType(0), mitk::ScalarType(upper)); tempLevelWindow.SetLevelWindow(*level, *window); m_FeedbackNode->SetLevelWindow(tempLevelWindow, NULL, "levelWindow"); //get the suggested threshold from the detected leakage-point and adjust the slider if (m_CurrentRGDirectionIsUpwards) { SliderValueChanged.Send(m_SeedpointValue + m_DetectedLeakagePoint -1); } else { SliderValueChanged.Send(m_SeedpointValue - m_DetectedLeakagePoint +1); } mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void mitk::RegionGrow3DTool::ChangeLevelWindow(int value) { if (m_FeedbackNode.IsNull()) return; mitk::LevelWindow tempLevelWindow; m_FeedbackNode->GetLevelWindow(tempLevelWindow, NULL, "levelWindow"); //get the levelWindow associated with the preview mitk::ScalarType level;// = this->m_UPPERTHRESHOLD - newValue + 0.5; mitk::ScalarType* window = new mitk::ScalarType(1); //adjust the levelwindow according to the position of the slider (newvalue) if (m_CurrentRGDirectionIsUpwards) { level = m_UpperThreshold - value + 0.5; tempLevelWindow.SetLevelWindow(level, *window); } else { level = value - m_LowerThreshold +0.5; tempLevelWindow.SetLevelWindow(level, *window); } m_FeedbackNode->SetLevelWindow(tempLevelWindow, NULL, "levelWindow"); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void mitk::RegionGrow3DTool::ConfirmSegmentation( std::string name, mitk::Color color) { mitk::DataNode::Pointer new_node = mitk::DataNode::New(); new_node->SetColor(color); new_node->SetName(name); new_node->SetProperty("binary", mitk::BoolProperty::New("true")); mitk::Image* image = dynamic_cast (m_FeedbackNode->GetData()); mitk::LevelWindow tempLevelWindow; m_FeedbackNode->GetLevelWindow( tempLevelWindow, NULL, "levelWindow"); int upperThresholdLabeledImage = (short int) tempLevelWindow.GetRangeMax(); int lowerThresholdLabeledImage = (short int) tempLevelWindow.GetLowerWindowBound() + 1; typedef itk::Image InputImageType; typedef itk::Image SegmentationType; typedef itk::BinaryThresholdImageFilter ThresholdFilterType; ThresholdFilterType::Pointer filter = ThresholdFilterType::New(); InputImageType::Pointer itkImage; mitk::CastToItkImage(image, itkImage); filter->SetInput(itkImage); filter->SetInsideValue(1); filter->SetOutsideValue(0); filter->SetUpperThreshold(upperThresholdLabeledImage); filter->SetLowerThreshold(lowerThresholdLabeledImage); filter->Update(); mitk::Image::Pointer new_image = mitk::Image::New(); mitk::CastToMitkImage(filter->GetOutput(), new_image); //pad to original size if (m_OriginalImageNode.GetPointer() != m_NodeToProceed.GetPointer()) { mitk::PadImageFilter::Pointer padFilter = mitk::PadImageFilter::New(); padFilter->SetInput(0, new_image); padFilter->SetInput(1, dynamic_cast (m_OriginalImageNode->GetData())); padFilter->SetBinaryFilter(true); padFilter->SetUpperThreshold(1); padFilter->SetLowerThreshold(1); padFilter->Update(); new_image = padFilter->GetOutput(); } new_node->SetData(new_image); m_ToolManager->GetDataStorage()->Add(new_node); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); m_ToolManager->ActivateTool(-1); } void mitk::RegionGrow3DTool::CancelSegmentation() { m_ToolManager->ActivateTool(-1); } void mitk::RegionGrow3DTool::SetupPreviewNodeFor( DataNode* nodeToProceed) { if (nodeToProceed) { Image::Pointer image = dynamic_cast( nodeToProceed->GetData() ); if (image.IsNotNull()) { m_FeedbackNode->SetData( image ); int layer(50); nodeToProceed->GetIntProperty("layer", layer); m_FeedbackNode->SetIntProperty("layer", layer+1); m_FeedbackNode->SetLevelWindow(NULL); if (DataStorage* storage = m_ToolManager->GetDataStorage()) { if (storage->Exists(m_FeedbackNode)) storage->Remove(m_FeedbackNode); storage->Add( m_FeedbackNode, nodeToProceed ); } } } mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void mitk::RegionGrow3DTool::UpdatePreview() { typedef itk::Image ItkImageType; typedef itk::Image ItkMaskType; mitk::DataNode::Pointer node = m_ToolManager->GetRoiData(0); if (node.IsNull()) { this->SetupPreviewNodeFor(m_OriginalImageNode); m_NodeToProceed = m_OriginalImageNode; mitk::Image::Pointer image = dynamic_cast (m_OriginalImageNode->GetData()); if (image.IsNotNull()) { m_RoiMin = image->GetScalarValueMin(); m_RoiMax = image->GetScalarValueMax(); } return; } mitk::MaskAndCutRoiImageFilter::Pointer roiFilter = mitk::MaskAndCutRoiImageFilter::New(); roiFilter->SetInput(dynamic_cast (m_NodeToProceed->GetData())); roiFilter->SetRegionOfInterest(node->GetData()); roiFilter->Update(); mitk::DataNode::Pointer new_node = mitk::DataNode::New(); mitk::Image::Pointer tmpImage = roiFilter->GetOutput(); new_node->SetData(tmpImage); m_RoiMax = roiFilter->GetMaxValue(); m_RoiMin = roiFilter->GetMinValue(); this->SetupPreviewNodeFor(new_node); m_NodeToProceed = new_node; //this->RunSegmentation(); } void mitk::RegionGrow3DTool::SetCurrentRGDirectionIsUpwards(bool flag) { m_CurrentRGDirectionIsUpwards = flag; } diff --git a/Modules/MitkExt/Interactions/mitkRegionGrowingTool.cpp b/Modules/MitkExt/Interactions/mitkRegionGrowingTool.cpp index de9b6efa1f..3c098bb5a0 100644 --- a/Modules/MitkExt/Interactions/mitkRegionGrowingTool.cpp +++ b/Modules/MitkExt/Interactions/mitkRegionGrowingTool.cpp @@ -1,711 +1,712 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkRegionGrowingTool.h" #include "mitkToolManager.h" #include "mitkOverwriteSliceImageFilter.h" +#include "mitkImageDataItem.h" #include "mitkBaseRenderer.h" #include "mitkRenderingManager.h" #include "mitkApplicationCursor.h" #include "ipSegmentation.h" #include "mitkRegionGrowingTool.xpm" #include "mitkOverwriteDirectedPlaneImageFilter.h" #include "mitkExtractDirectedPlaneImageFilterNew.h" namespace mitk { MITK_TOOL_MACRO(MitkExt_EXPORT, RegionGrowingTool, "Region growing tool"); } #define ROUND(a) ((a)>0 ? (int)((a)+0.5) : -(int)(0.5-(a))) mitk::RegionGrowingTool::RegionGrowingTool() :FeedbackContourTool("PressMoveRelease"), m_LowerThreshold(200), m_UpperThreshold(200), m_InitialLowerThreshold(200), m_InitialUpperThreshold(200), m_ScreenYDifference(0), m_OriginalPicSlice(NULL), m_SeedPointMemoryOffset(0), m_VisibleWindow(0), m_DefaultWindow(0), m_MouseDistanceScaleFactor(3.0), m_LastWorkingSeed(-1), m_FillFeedbackContour(true) { } mitk::RegionGrowingTool::~RegionGrowingTool() { } const char** mitk::RegionGrowingTool::GetXPM() const { return mitkRegionGrowingTool_xpm; } const char* mitk::RegionGrowingTool::GetName() const { return "Region Growing"; } void mitk::RegionGrowingTool::Activated() { Superclass::Activated(); } void mitk::RegionGrowingTool::Deactivated() { Superclass::Deactivated(); } /** 1 Determine which slice is clicked into 2 Determine if the user clicked inside or outside of the segmentation 3 Depending on the pixel value under the mouse click position, two different things happen: (separated out into OnMousePressedInside and OnMousePressedOutside) 3.1 Create a skeletonization of the segmentation and try to find a nice cut 3.1.1 Call a ipSegmentation algorithm to create a nice cut 3.1.2 Set the result of this algorithm as the feedback contour 3.2 Initialize region growing 3.2.1 Determine memory offset inside the original image 3.2.2 Determine initial region growing parameters from the level window settings of the image 3.2.3 Perform a region growing (which generates a new feedback contour) */ bool mitk::RegionGrowingTool::OnMousePressed (Action* action, const StateEvent* stateEvent) { //ToolLogger::SetVerboseness(3); MITK_INFO << "OnMousePressed" << std::endl; if (FeedbackContourTool::OnMousePressed( action, stateEvent )) { MITK_INFO << "OnMousePressed: FeedbackContourTool says ok" << std::endl; // 1. Find out which slice the user clicked, find out which slice of the toolmanager's reference and working image corresponds to that const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (positionEvent) { MITK_INFO << "OnMousePressed: got positionEvent" << std::endl; m_ReferenceSlice = FeedbackContourTool::GetAffectedReferenceSlice( positionEvent ); m_WorkingSlice = FeedbackContourTool::GetAffectedWorkingSlice( positionEvent ); if ( m_WorkingSlice.IsNotNull() ) // can't do anything without the segmentation { MITK_INFO << "OnMousePressed: got working slice" << std::endl; // 2. Determine if the user clicked inside or outside of the segmentation const Geometry3D* workingSliceGeometry = m_WorkingSlice->GetGeometry(); Point3D mprojectedPointIn2D; workingSliceGeometry->WorldToIndex( positionEvent->GetWorldPosition(), mprojectedPointIn2D); itk::Index<2> projectedPointInWorkingSlice2D; projectedPointInWorkingSlice2D[0] = static_cast( mprojectedPointIn2D[0] - 0.5 ); projectedPointInWorkingSlice2D[1] = static_cast( mprojectedPointIn2D[1] - 0.5 ); if ( workingSliceGeometry->IsIndexInside( projectedPointInWorkingSlice2D ) ) { MITK_INFO << "OnMousePressed: point " << positionEvent->GetWorldPosition() << " (index coordinates " << projectedPointInWorkingSlice2D << ") IS in working slice" << std::endl; // Convert to ipMITKSegmentationTYPE (because getting pixels relys on that data type) itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeImage; CastToItkImage( m_WorkingSlice, correctPixelTypeImage ); assert (correctPixelTypeImage.IsNotNull() ); // possible bug in CastToItkImage ? // direction maxtrix is wrong/broken/not working after CastToItkImage, leading to a failed assertion in // mitk/Core/DataStructures/mitkSlicedGeometry3D.cpp, 479: // virtual void mitk::SlicedGeometry3D::SetSpacing(const mitk::Vector3D&): Assertion `aSpacing[0]>0 && aSpacing[1]>0 && aSpacing[2]>0' failed // solution here: we overwrite it with an unity matrix itk::Image< ipMITKSegmentationTYPE, 2 >::DirectionType imageDirection; imageDirection.SetIdentity(); correctPixelTypeImage->SetDirection(imageDirection); Image::Pointer temporarySlice = Image::New(); // temporarySlice = ImportItkImage( correctPixelTypeImage ); CastToMitkImage( correctPixelTypeImage, temporarySlice ); mitkIpPicDescriptor* workingPicSlice = temporarySlice->GetSliceData()->GetPicDescriptor(); int initialWorkingOffset = projectedPointInWorkingSlice2D[1] * workingPicSlice->n[0] + projectedPointInWorkingSlice2D[0]; if ( initialWorkingOffset < static_cast( workingPicSlice->n[0] * workingPicSlice->n[1] ) && initialWorkingOffset >= 0 ) { // 3. determine the pixel value under the last click bool inside = static_cast(workingPicSlice->data)[initialWorkingOffset] != 0; m_PaintingPixelValue = inside ? 0 : 1; // if inside, we want to remove a part, otherwise we want to add something if ( m_LastWorkingSeed >= static_cast( workingPicSlice->n[0] * workingPicSlice->n[1] ) || m_LastWorkingSeed < 0 ) { inside = false; } if ( m_ReferenceSlice.IsNotNull() ) { MITK_INFO << "OnMousePressed: got reference slice" << std::endl; m_OriginalPicSlice = m_ReferenceSlice->GetSliceData()->GetPicDescriptor(); // 3.1. Switch depending on the pixel value if (inside) { OnMousePressedInside(action, stateEvent, workingPicSlice, initialWorkingOffset); } else { OnMousePressedOutside(action, stateEvent); } } } } } } } MITK_INFO << "end OnMousePressed" << std::endl; return true; } /** 3.1 Create a skeletonization of the segmentation and try to find a nice cut 3.1.1 Call a ipSegmentation algorithm to create a nice cut 3.1.2 Set the result of this algorithm as the feedback contour */ bool mitk::RegionGrowingTool::OnMousePressedInside(Action* itkNotUsed( action ), const StateEvent* stateEvent, mitkIpPicDescriptor* workingPicSlice, int initialWorkingOffset) { const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); // checked in OnMousePressed // 3.1.1. Create a skeletonization of the segmentation and try to find a nice cut // apply the skeletonization-and-cut algorithm // generate contour to remove // set m_ReferenceSlice = NULL so nothing will happen during mouse move // remember to fill the contour with 0 in mouserelease mitkIpPicDescriptor* segmentationHistory = ipMITKSegmentationCreateGrowerHistory( workingPicSlice, m_LastWorkingSeed, NULL ); // free again if (segmentationHistory) { tCutResult cutContour = ipMITKSegmentationGetCutPoints( workingPicSlice, segmentationHistory, initialWorkingOffset ); // tCutResult is a ipSegmentation type mitkIpPicFree( segmentationHistory ); if (cutContour.cutIt) { // 3.1.2 copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; for (int index = 0; index < cutContour.deleteSize; ++index) { newPoint[0] = cutContour.deleteCurve[ 2 * index + 0 ]; newPoint[1] = cutContour.deleteCurve[ 2 * index + 1 ]; newPoint[2] = 0.0; contourInImageIndexCoordinates->AddVertex( newPoint - 0.5 ); } free(cutContour.traceline); free(cutContour.deleteCurve); // perhaps visualize this for fun? free(cutContour.onGradient); Contour::Pointer contourInWorldCoordinates = FeedbackContourTool::BackProjectContourFrom2DSlice( m_WorkingSlice->GetGeometry(), contourInImageIndexCoordinates, true ); // true: sub 0.5 for ipSegmentation correction FeedbackContourTool::SetFeedbackContour( *contourInWorldCoordinates ); FeedbackContourTool::SetFeedbackContourVisible(true); mitk::RenderingManager::GetInstance()->RequestUpdate( positionEvent->GetSender()->GetRenderWindow() ); m_FillFeedbackContour = true; } else { m_FillFeedbackContour = false; } } else { m_FillFeedbackContour = false; } m_ReferenceSlice = NULL; return true; } /** 3.2 Initialize region growing 3.2.1 Determine memory offset inside the original image 3.2.2 Determine initial region growing parameters from the level window settings of the image 3.2.3 Perform a region growing (which generates a new feedback contour) */ bool mitk::RegionGrowingTool::OnMousePressedOutside(Action* itkNotUsed( action ), const StateEvent* stateEvent) { const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); // checked in OnMousePressed // 3.2 If we have a reference image, then perform an initial region growing, considering the reference image's level window // if click was outside the image, don't continue const Geometry3D* sliceGeometry = m_ReferenceSlice->GetGeometry(); Point3D mprojectedPointIn2D; sliceGeometry->WorldToIndex( positionEvent->GetWorldPosition(), mprojectedPointIn2D ); itk::Index<2> projectedPointIn2D; projectedPointIn2D[0] = static_cast( mprojectedPointIn2D[0] - 0.5 ); projectedPointIn2D[1] = static_cast( mprojectedPointIn2D[1] - 0.5 ); if ( sliceGeometry->IsIndexInside( mprojectedPointIn2D ) ) { MITK_INFO << "OnMousePressed: point " << positionEvent->GetWorldPosition() << " (index coordinates " << mprojectedPointIn2D << ") IS in reference slice" << std::endl; // 3.2.1 Remember Y cursor position and initial seed point //m_ScreenYPositionAtStart = static_cast(positionEvent->GetDisplayPosition()[1]); m_LastScreenPosition = ApplicationCursor::GetInstance()->GetCursorPosition(); m_ScreenYDifference = 0; m_SeedPointMemoryOffset = projectedPointIn2D[1] * m_OriginalPicSlice->n[0] + projectedPointIn2D[0]; m_LastWorkingSeed = m_SeedPointMemoryOffset; // remember for skeletonization if ( m_SeedPointMemoryOffset < static_cast( m_OriginalPicSlice->n[0] * m_OriginalPicSlice->n[1] ) && m_SeedPointMemoryOffset >= 0 ) { // 3.2.2 Get level window from reference DataNode // Use some logic to determine initial gray value bounds LevelWindow lw(0, 500); m_ToolManager->GetReferenceData(0)->GetLevelWindow(lw); // will fill lw if levelwindow property is present, otherwise won't touch it. m_VisibleWindow = lw.GetWindow(); // necessary for limiting the upper and lower threshold to the maximum gray values m_DefaultWindow = lw.GetDefaultWindow(); static bool initializedAlready = false; // just evaluated once if (!initializedAlready) { m_InitialLowerThreshold = static_cast(m_VisibleWindow / 10.0); // 20% of the visible gray values m_InitialUpperThreshold = static_cast(m_VisibleWindow / 10.0); initializedAlready = true; } m_LowerThreshold = m_InitialLowerThreshold; m_UpperThreshold = m_InitialUpperThreshold; DisplayGeometry* displayGeometry = positionEvent->GetSender()->GetDisplayGeometry(); if (displayGeometry) { m_MouseDistanceScaleFactor = m_VisibleWindow / ( 3.0 * displayGeometry->GetDisplayHeight() ); } // 3.2.3. Actually perform region growing mitkIpPicDescriptor* result = PerformRegionGrowingAndUpdateContour(); ipMITKSegmentationFree( result); // display the contour FeedbackContourTool::SetFeedbackContourVisible(true); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); m_FillFeedbackContour = true; } } return true; } /** If in region growing mode (m_ReferenceSlice != NULL), then 1. Calculate the new thresholds from mouse position (relative to first position) 2. Perform a new region growing and update the feedback contour */ bool mitk::RegionGrowingTool::OnMouseMoved (Action* action, const StateEvent* stateEvent) { if (FeedbackContourTool::OnMouseMoved( action, stateEvent )) { if ( m_ReferenceSlice.IsNotNull() && m_OriginalPicSlice ) { const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (positionEvent) { ApplicationCursor* cursor = ApplicationCursor::GetInstance(); if (!cursor) return false; m_ScreenYDifference += cursor->GetCursorPosition()[1] - m_LastScreenPosition[1]; cursor->SetCursorPosition( m_LastScreenPosition ); m_LowerThreshold = m_InitialLowerThreshold + static_cast( m_ScreenYDifference * m_MouseDistanceScaleFactor ); if (m_LowerThreshold < 1) m_LowerThreshold = 1; if (m_LowerThreshold > m_VisibleWindow / 2) m_LowerThreshold = m_VisibleWindow / 2; m_UpperThreshold = m_InitialUpperThreshold + static_cast( m_ScreenYDifference * m_MouseDistanceScaleFactor ); if (m_UpperThreshold < 1) m_UpperThreshold = 1; if (m_UpperThreshold > m_VisibleWindow / 2) m_UpperThreshold = m_VisibleWindow / 2; //MITK_INFO << "new interval: l " << m_LowerThreshold << " u " << m_UpperThreshold << std::endl; // 2. Perform region growing again and show the result mitkIpPicDescriptor* result = PerformRegionGrowingAndUpdateContour(); ipMITKSegmentationFree( result ); // 3. Update the contour mitk::RenderingManager::GetInstance()->ForceImmediateUpdate(positionEvent->GetSender()->GetRenderWindow()); } } } return true; } /** If the feedback contour should be filled, then it is done here. (Contour is NOT filled, when skeletonization is done but no nice cut was found) */ bool mitk::RegionGrowingTool::OnMouseReleased(Action* action, const StateEvent* stateEvent) { if (FeedbackContourTool::OnMouseReleased( action, stateEvent )) { // 1. If we have a working slice, use the contour to fill a new piece on segmentation on it (or erase a piece that was selected by ipMITKSegmentationGetCutPoints) if ( m_WorkingSlice.IsNotNull() && m_OriginalPicSlice ) { const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (positionEvent) { // remember parameters for next time m_InitialLowerThreshold = m_LowerThreshold; m_InitialUpperThreshold = m_UpperThreshold; if (m_FillFeedbackContour) { // 3. use contour to fill a region in our working slice Contour* feedbackContour( FeedbackContourTool::GetFeedbackContour() ); if (feedbackContour) { Contour::Pointer projectedContour = FeedbackContourTool::ProjectContourTo2DSlice( m_WorkingSlice, feedbackContour, false, false ); // false: don't add any 0.5 // false: don't constrain the contour to the image's inside if (projectedContour.IsNotNull()) { FeedbackContourTool::FillContourInSlice( projectedContour, m_WorkingSlice, m_PaintingPixelValue ); // 4. write working slice back into image volume int affectedDimension( -1 ); int affectedSlice( -1 ); const PlaneGeometry* planeGeometry( dynamic_cast (positionEvent->GetSender()->GetCurrentWorldGeometry2D() ) ); FeedbackContourTool::DetermineAffectedImageSlice( dynamic_cast( m_ToolManager->GetWorkingData(0)->GetData() ), planeGeometry, affectedDimension, affectedSlice ); MITK_INFO << "OnMouseReleased: writing back to dimension " << affectedDimension << ", slice " << affectedSlice << " in working image" << std::endl; //If dazu gemacht Image::Pointer workingImage = dynamic_cast( m_ToolManager->GetWorkingData(0)->GetData() ); if ( affectedDimension != -1 ) { OverwriteSliceImageFilter::Pointer slicewriter = OverwriteSliceImageFilter::New(); slicewriter->SetInput( workingImage ); slicewriter->SetCreateUndoInformation( true ); slicewriter->SetSliceImage( m_WorkingSlice ); slicewriter->SetSliceDimension( affectedDimension ); slicewriter->SetSliceIndex( affectedSlice ); slicewriter->SetTimeStep( positionEvent->GetSender()->GetTimeStep( workingImage ) ); slicewriter->Update(); if ( m_ToolManager->GetRememberContourPosition() ) { this->AddContourmarker(positionEvent); } } else { OverwriteDirectedPlaneImageFilter::Pointer slicewriter = OverwriteDirectedPlaneImageFilter::New(); slicewriter->SetInput( workingImage ); slicewriter->SetCreateUndoInformation( false ); slicewriter->SetSliceImage( m_WorkingSlice ); slicewriter->SetPlaneGeometry3D( m_WorkingSlice->GetGeometry() ); slicewriter->SetTimeStep( positionEvent->GetSender()->GetTimeStep( workingImage ) ); slicewriter->Update(); if ( m_ToolManager->GetRememberContourPosition() ) { this->AddContourmarker(positionEvent); } } } } } FeedbackContourTool::SetFeedbackContourVisible(false); mitk::RenderingManager::GetInstance()->RequestUpdate( positionEvent->GetSender()->GetRenderWindow() ); } } } m_ReferenceSlice = NULL; // don't leak m_WorkingSlice = NULL; m_OriginalPicSlice = NULL; return true; } /** Uses ipSegmentation algorithms to do the actual region growing. The result (binary image) is first smoothed by a 5x5 circle mask, then its contour is extracted and converted to MITK coordinates. */ mitkIpPicDescriptor* mitk::RegionGrowingTool::PerformRegionGrowingAndUpdateContour() { // 1. m_OriginalPicSlice and m_SeedPointMemoryOffset are set to sensitive values, as well as m_LowerThreshold and m_UpperThreshold assert (m_OriginalPicSlice); if (m_OriginalPicSlice->n[0] != 256 || m_OriginalPicSlice->n[1] != 256) // ??? assert( (m_SeedPointMemoryOffset < static_cast( m_OriginalPicSlice->n[0] * m_OriginalPicSlice->n[1] )) && (m_SeedPointMemoryOffset >= 0) ); // inside the image // 2. ipSegmentation is used to perform region growing float ignored; int oneContourOffset( 0 ); mitkIpPicDescriptor* regionGrowerResult = ipMITKSegmentationGrowRegion4N( m_OriginalPicSlice, m_SeedPointMemoryOffset, // seed point true, // grayvalue interval relative to seed point gray value? m_LowerThreshold, m_UpperThreshold, 0, // continue until done (maxIterations == 0) NULL, // allocate new memory (only this time, on mouse move we'll reuse the old buffer) oneContourOffset, // a pixel that is near the resulting contour ignored // ignored by us ); if (!regionGrowerResult || oneContourOffset == -1) { Contour::Pointer dummyContour = Contour::New(); dummyContour->Initialize(); FeedbackContourTool::SetFeedbackContour( *dummyContour ); if (regionGrowerResult) ipMITKSegmentationFree(regionGrowerResult); return NULL; } // 3. We smooth the result a little to reduce contour complexity bool smoothResult( true ); // currently fixed, perhaps remove else block mitkIpPicDescriptor* smoothedRegionGrowerResult; if (smoothResult) { // Smooth the result (otherwise very detailed contour) smoothedRegionGrowerResult = SmoothIPPicBinaryImage( regionGrowerResult, oneContourOffset ); ipMITKSegmentationFree( regionGrowerResult ); } else { smoothedRegionGrowerResult = regionGrowerResult; } // 4. convert the result of region growing into a mitk::Contour // At this point oneContourOffset could be useless, if smoothing destroyed a thin bridge. In these // cases, we have two or more unconnected segmentation regions, and we don't know, which one is touched by oneContourOffset. // In the bad case, the contour is not the one around our seedpoint, so the result looks very strange to the user. // -> we remove the point where the contour started so far. Then we look from the bottom of the image for the first segmentation pixel // and start another contour extraction from there. This is done, until the seedpoint is inside the contour int numberOfContourPoints( 0 ); int newBufferSize( 0 ); float* contourPoints = ipMITKSegmentationGetContour8N( smoothedRegionGrowerResult, oneContourOffset, numberOfContourPoints, newBufferSize ); // memory allocated with malloc if (contourPoints) { while ( !ipMITKSegmentationIsInsideContour( contourPoints, // contour numberOfContourPoints, // points in contour m_SeedPointMemoryOffset % smoothedRegionGrowerResult->n[0], // test point x m_SeedPointMemoryOffset / smoothedRegionGrowerResult->n[0] // test point y ) ) { // we decide that this cannot be part of the segmentation because the seedpoint is not contained in the contour (fill the 4-neighborhood with 0) ipMITKSegmentationReplaceRegion4N( smoothedRegionGrowerResult, oneContourOffset, 0 ); // move the contour offset to the last row (x position of the seed point) int rowLength = smoothedRegionGrowerResult->n[0]; // number of pixels in a row oneContourOffset = m_SeedPointMemoryOffset % smoothedRegionGrowerResult->n[0] // x of seed point + rowLength*(smoothedRegionGrowerResult->n[1]-1); // y of last row while ( oneContourOffset >=0 && (*(static_cast(smoothedRegionGrowerResult->data) + oneContourOffset) == 0) ) { oneContourOffset -= rowLength; // if pixel at data+oneContourOffset is 0, then move up one row } if ( oneContourOffset < 0 ) { break; // just use the last contour we found } free(contourPoints); // release contour memory contourPoints = ipMITKSegmentationGetContour8N( smoothedRegionGrowerResult, oneContourOffset, numberOfContourPoints, newBufferSize ); // memory allocated with malloc } // copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; for (int index = 0; index < numberOfContourPoints; ++index) { newPoint[0] = contourPoints[ 2 * index + 0 ]; newPoint[1] = contourPoints[ 2 * index + 1 ]; newPoint[2] = 0; contourInImageIndexCoordinates->AddVertex( newPoint - 0.5); } free(contourPoints); Contour::Pointer contourInWorldCoordinates = FeedbackContourTool::BackProjectContourFrom2DSlice( m_ReferenceSlice->GetGeometry(), contourInImageIndexCoordinates, true ); // true: sub 0.5 for ipSegmentation correctio FeedbackContourTool::SetFeedbackContour( *contourInWorldCoordinates ); } // 5. Result HAS TO BE freed by caller, contains the binary region growing result return smoothedRegionGrowerResult; } /** Helper method for SmoothIPPicBinaryImage. Smoothes a given part of and image. \param sourceImage The original binary image. \param dest The smoothed image (will be written without bounds checking). \param contourOfs One offset of the contour. Is updated if a pixel is changed (which might change the contour). \param maskOffsets Memory offsets that describe the smoothing mask. \param maskSize Entries of the mask. \param startOffset First pixel that should be smoothed using this mask. \param endOffset Last pixel that should be smoothed using this mask. */ void mitk::RegionGrowingTool::SmoothIPPicBinaryImageHelperForRows( mitkIpPicDescriptor* sourceImage, mitkIpPicDescriptor* dest, int &contourOfs, int* maskOffsets, int maskSize, int startOffset, int endOffset ) { // work on the very first row ipMITKSegmentationTYPE* current; ipMITKSegmentationTYPE* source = ((ipMITKSegmentationTYPE*)sourceImage->data) + startOffset; // + 1! don't read at start-1 ipMITKSegmentationTYPE* end = ((ipMITKSegmentationTYPE*)dest->data) + endOffset; int ofs = startOffset; int minority = (maskSize - 1) / 2; for (current = ((ipMITKSegmentationTYPE*)dest->data) + startOffset; current minority) { *current = 1; contourOfs = ofs; } else { *current = 0; } ++source; ++ofs; } } /** Smoothes a binary ipPic image with a 5x5 mask. The image borders (some first and last rows) are treated differently. */ mitkIpPicDescriptor* mitk::RegionGrowingTool::SmoothIPPicBinaryImage( mitkIpPicDescriptor* image, int &contourOfs, mitkIpPicDescriptor* dest ) { if (!image) return NULL; // Original code from /trunk/mbi-qm/Qmitk/Qmitk2DSegTools/RegionGrowerTool.cpp (first version by T. Boettger?). Reformatted and documented and restructured. #define MSK_SIZE5x5 21 #define MSK_SIZE3x3 5 #define MSK_SIZE3x1 3 // mask is an array of coordinates that form a rastered circle like this // // OOO // OOOOO // OOOOO // OOOOO // OOO // // int mask5x5[MSK_SIZE5x5][2] = { /******/ {-1,-2}, {0,-2}, {1,-2}, /*****/ {-2,-1}, {-1,-1}, {0,-1}, {1,-1}, {2,-1}, {-2, 0}, {-1, 0}, {0, 0}, {1, 0}, {2, 0}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, /******/ {-1, 2}, {0, 2}, {1, 2} /*****/ }; int mask3x3[MSK_SIZE3x3][2] = { /******/ {0,-1}, /*****/ {-1, 0}, {0, 0}, {1, 0}, /******/ {0, 1} /*****/ }; int mask3x1[MSK_SIZE3x1][2] = { {-1, 0}, {0, 0}, {1, 0} }; // The following lines iterate over all the pixels of a (sliced) image (except the first and last three rows). // For each pixel, all the coordinates around it (according to mask) are evaluated (this means 21 pixels). // If more than 10 of the evaluated pixels are non-zero, then the central pixel is set to 1, else to 0. // This is determining a majority. If there is no clear majority, then the central pixel itself "decides". int maskOffset5x5[MSK_SIZE5x5]; int line = image->n[0]; for (int i=0; in[0]; int spareOut1Rows = 1*image->n[0]; if ( image->n[1] > 0 ) SmoothIPPicBinaryImageHelperForRows( image, dest, contourOfs, maskOffset3x1, MSK_SIZE3x1, 1, dest->n[0] ); if ( image->n[1] > 3 ) SmoothIPPicBinaryImageHelperForRows( image, dest, contourOfs, maskOffset3x3, MSK_SIZE3x3, spareOut1Rows, dest->n[0]*3 ); if ( image->n[1] > 6 ) SmoothIPPicBinaryImageHelperForRows( image, dest, contourOfs, maskOffset5x5, MSK_SIZE5x5, spareOut3Rows, dest->n[0]*dest->n[1] - spareOut3Rows ); if ( image->n[1] > 8 ) SmoothIPPicBinaryImageHelperForRows( image, dest, contourOfs, maskOffset3x3, MSK_SIZE3x3, dest->n[0]*dest->n[1] -spareOut3Rows, dest->n[0]*dest->n[1] - spareOut1Rows ); if ( image->n[1] > 10) SmoothIPPicBinaryImageHelperForRows( image, dest, contourOfs, maskOffset3x1, MSK_SIZE3x1, dest->n[0]*dest->n[1] -spareOut1Rows, dest->n[0]*dest->n[1] - 1 ); // correction for first pixel (sorry for the ugliness) if ( *((ipMITKSegmentationTYPE*)(dest->data)+1) == 1 ) { *((ipMITKSegmentationTYPE*)(dest->data)+0) = 1; } if (dest->n[0] * dest->n[1] > 2) { // correction for last pixel if ( *((ipMITKSegmentationTYPE*)(dest->data)+dest->n[0]*dest->n[1]-2) == 1 ) { *((ipMITKSegmentationTYPE*)(dest->data)+dest->n[0]*dest->n[1]-1) = 1; } } return dest; } diff --git a/Modules/MitkExt/Interactions/mitkSetRegionTool.cpp b/Modules/MitkExt/Interactions/mitkSetRegionTool.cpp index 0b054eedf1..cc442927ac 100644 --- a/Modules/MitkExt/Interactions/mitkSetRegionTool.cpp +++ b/Modules/MitkExt/Interactions/mitkSetRegionTool.cpp @@ -1,351 +1,352 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkSetRegionTool.h" #include "mitkToolManager.h" #include "mitkOverwriteSliceImageFilter.h" #include "ipSegmentation.h" #include "mitkBaseRenderer.h" +#include "mitkImageDataItem.h" #include "mitkOverwriteDirectedPlaneImageFilter.h" mitk::SetRegionTool::SetRegionTool(int paintingPixelValue) :FeedbackContourTool("PressMoveReleaseWithCTRLInversion"), m_PaintingPixelValue(paintingPixelValue), m_FillContour(false), m_StatusFillWholeSlice(false) { } mitk::SetRegionTool::~SetRegionTool() { } void mitk::SetRegionTool::Activated() { Superclass::Activated(); } void mitk::SetRegionTool::Deactivated() { Superclass::Deactivated(); } bool mitk::SetRegionTool::OnMousePressed (Action* action, const StateEvent* stateEvent) { if (!FeedbackContourTool::OnMousePressed( action, stateEvent )) return false; const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (!positionEvent) return false; // 1. Get the working image Image::Pointer workingSlice = FeedbackContourTool::GetAffectedWorkingSlice( positionEvent ); if ( workingSlice.IsNull() ) return false; // can't do anything without the segmentation // if click was outside the image, don't continue const Geometry3D* sliceGeometry = workingSlice->GetGeometry(); itk::Index<2> projectedPointIn2D; sliceGeometry->WorldToIndex( positionEvent->GetWorldPosition(), projectedPointIn2D ); if ( !sliceGeometry->IsIndexInside( projectedPointIn2D ) ) { MITK_ERROR << "point apparently not inside segmentation slice" << std::endl; return false; // can't use that as a seed point } // Convert to ipMITKSegmentationTYPE (because ipMITKSegmentationGetContour8N relys on that data type) itk::Image< ipMITKSegmentationTYPE, 2 >::Pointer correctPixelTypeImage; CastToItkImage( workingSlice, correctPixelTypeImage ); assert (correctPixelTypeImage.IsNotNull() ); // possible bug in CastToItkImage ? // direction maxtrix is wrong/broken/not working after CastToItkImage, leading to a failed assertion in // mitk/Core/DataStructures/mitkSlicedGeometry3D.cpp, 479: // virtual void mitk::SlicedGeometry3D::SetSpacing(const mitk::Vector3D&): Assertion `aSpacing[0]>0 && aSpacing[1]>0 && aSpacing[2]>0' failed // solution here: we overwrite it with an unity matrix itk::Image< ipMITKSegmentationTYPE, 2 >::DirectionType imageDirection; imageDirection.SetIdentity(); correctPixelTypeImage->SetDirection(imageDirection); Image::Pointer temporarySlice = Image::New(); // temporarySlice = ImportItkImage( correctPixelTypeImage ); CastToMitkImage( correctPixelTypeImage, temporarySlice ); // check index positions mitkIpPicDescriptor* originalPicSlice = temporarySlice->GetSliceData()->GetPicDescriptor(); int m_SeedPointMemoryOffset = projectedPointIn2D[1] * originalPicSlice->n[0] + projectedPointIn2D[0]; if ( m_SeedPointMemoryOffset >= static_cast( originalPicSlice->n[0] * originalPicSlice->n[1] ) || m_SeedPointMemoryOffset < 0 ) { MITK_ERROR << "Memory offset calculation if mitk::SetRegionTool has some serious flaw! Aborting.." << std::endl; return false; } // 2. Determine the contour that surronds the selected "piece of the image" // find a contour seed point unsigned int oneContourOffset = static_cast( m_SeedPointMemoryOffset ); // safe because of earlier check if m_SeedPointMemoryOffset < 0 /** * The logic of finding a starting point for the contour is the following: * * - If the initial seed point is 0, we are either inside a hole or outside of every segmentation. * We move to the right until we hit a 1, which must be part of a contour. * * - If the initial seed point is 1, then ... * we now do the same (running to the right) until we hit a 1 * * In both cases the found contour point is used to extract a contour and * then a test is applied to find out if the initial seed point is contained * in the contour. If this is the case, filling should be applied, otherwise * nothing is done. */ unsigned int size = originalPicSlice->n[0] * originalPicSlice->n[1]; /* unsigned int rowSize = originalPicSlice->n[0]; */ ipMITKSegmentationTYPE* data = static_cast(originalPicSlice->data); if ( data[oneContourOffset] == 0 ) // initial seed 0 { for ( ; oneContourOffset < size; ++oneContourOffset ) { if ( data[oneContourOffset] > 0 ) break; } } else if ( data[oneContourOffset] == 1 ) // initial seed 1 { unsigned int lastValidPixel = size-1; // initialization, will be changed lateron bool inSeg = true; // inside segmentation? for ( ; oneContourOffset < size; ++oneContourOffset ) { if ( ( data[oneContourOffset] == 0 ) && inSeg ) // pixel 0 and inside-flag set: this happens at the first pixel outside a filled region { inSeg = false; lastValidPixel = oneContourOffset - 1; // store the last pixel position inside a filled region break; } else // pixel 1, inside-flag doesn't matter: this happens while we are inside a filled region { inSeg = true; // first iteration lands here } } oneContourOffset = lastValidPixel; } else { MITK_ERROR << "Fill/Erase was never intended to work with other than binary images." << std::endl; m_FillContour = false; return false; } if (oneContourOffset == size) // nothing found until end of slice { m_FillContour = false; return false; } int numberOfContourPoints( 0 ); int newBufferSize( 0 ); //MITK_INFO << "getting contour from offset " << oneContourOffset << " ("<n[0]<<","<n[0]<<")"< 0); bool cursorInsideContour = ipMITKSegmentationIsInsideContour( contourPoints, numberOfContourPoints, projectedPointIn2D[0], projectedPointIn2D[1]); // decide if contour should be filled or not m_FillContour = cursorInsideContour; if (m_FillContour) { // copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; for (int index = 0; index < numberOfContourPoints; ++index) { newPoint[0] = contourPoints[ 2 * index + 0 ]; newPoint[1] = contourPoints[ 2 * index + 1]; newPoint[2] = 0; contourInImageIndexCoordinates->AddVertex( newPoint - 0.5 ); } m_SegmentationContourInWorldCoordinates = FeedbackContourTool::BackProjectContourFrom2DSlice( workingSlice->GetGeometry(), contourInImageIndexCoordinates, true ); // true, correct the result from ipMITKSegmentationGetContour8N // 3. Show the contour FeedbackContourTool::SetFeedbackContour( *m_SegmentationContourInWorldCoordinates ); FeedbackContourTool::SetFeedbackContourVisible(true); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); } // always generate a second contour, containing the whole image (used when CTRL is pressed) { // copy point from float* to mitk::Contour Contour::Pointer contourInImageIndexCoordinates = Contour::New(); contourInImageIndexCoordinates->Initialize(); Point3D newPoint; newPoint[0] = 0; newPoint[1] = 0; newPoint[2] = 0.0; contourInImageIndexCoordinates->AddVertex( newPoint ); newPoint[0] = originalPicSlice->n[0]; newPoint[1] = 0; newPoint[2] = 0.0; contourInImageIndexCoordinates->AddVertex( newPoint ); newPoint[0] = originalPicSlice->n[0]; newPoint[1] = originalPicSlice->n[1]; newPoint[2] = 0.0; contourInImageIndexCoordinates->AddVertex( newPoint ); newPoint[0] = 0; newPoint[1] = originalPicSlice->n[1]; newPoint[2] = 0.0; contourInImageIndexCoordinates->AddVertex( newPoint ); m_WholeImageContourInWorldCoordinates = FeedbackContourTool::BackProjectContourFrom2DSlice( workingSlice->GetGeometry(), contourInImageIndexCoordinates, true ); // true, correct the result from ipMITKSegmentationGetContour8N // 3. Show the contour FeedbackContourTool::SetFeedbackContour( *m_SegmentationContourInWorldCoordinates ); FeedbackContourTool::SetFeedbackContourVisible(true); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); } free(contourPoints); return true; } bool mitk::SetRegionTool::OnMouseReleased(Action* action, const StateEvent* stateEvent) { // 1. Hide the feedback contour, find out which slice the user clicked, find out which slice of the toolmanager's working image corresponds to that FeedbackContourTool::SetFeedbackContourVisible(false); const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (!positionEvent) return false; assert( positionEvent->GetSender()->GetRenderWindow() ); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); if (!m_FillContour && !m_StatusFillWholeSlice) return true; if (!FeedbackContourTool::OnMouseReleased( action, stateEvent )) return false; DataNode* workingNode( m_ToolManager->GetWorkingData(0) ); if (!workingNode) return false; Image* image = dynamic_cast(workingNode->GetData()); const PlaneGeometry* planeGeometry( dynamic_cast (positionEvent->GetSender()->GetCurrentWorldGeometry2D() ) ); if ( !image || !planeGeometry ) return false; int affectedDimension( -1 ); int affectedSlice( -1 ); FeedbackContourTool::DetermineAffectedImageSlice( image, planeGeometry, affectedDimension, affectedSlice ); Image::Pointer slice = FeedbackContourTool::GetAffectedImageSliceAs2DImage( positionEvent, image ); if ( slice.IsNull() ) { MITK_ERROR << "Unable to extract slice." << std::endl; return false; } Contour* feedbackContour( FeedbackContourTool::GetFeedbackContour() ); Contour::Pointer projectedContour = FeedbackContourTool::ProjectContourTo2DSlice( slice, feedbackContour, false, false ); // false: don't add 0.5 (done by FillContourInSlice) // false: don't constrain the contour to the image's inside if (projectedContour.IsNull()) return false; FeedbackContourTool::FillContourInSlice( projectedContour, slice, m_PaintingPixelValue ); if ( affectedDimension != -1 ) { // 5. Write the modified 2D working data slice back into the image OverwriteSliceImageFilter::Pointer slicewriter = OverwriteSliceImageFilter::New(); slicewriter->SetInput( image ); slicewriter->SetCreateUndoInformation( true ); slicewriter->SetSliceImage( slice ); slicewriter->SetSliceDimension( affectedDimension ); slicewriter->SetSliceIndex( affectedSlice ); slicewriter->SetTimeStep( positionEvent->GetSender()->GetTimeStep( image ) ); slicewriter->Update(); if ( m_ToolManager->GetRememberContourPosition() ) { this->AddContourmarker(positionEvent); } } else if ( affectedDimension == -1 ) { OverwriteDirectedPlaneImageFilter::Pointer slicewriter = OverwriteDirectedPlaneImageFilter::New(); slicewriter->SetInput( image ); slicewriter->SetCreateUndoInformation( false ); slicewriter->SetSliceImage( slice ); slicewriter->SetPlaneGeometry3D( slice->GetGeometry() ); slicewriter->SetTimeStep( positionEvent->GetSender()->GetTimeStep( image ) ); slicewriter->Update(); if ( m_ToolManager->GetRememberContourPosition() ) { this->AddContourmarker(positionEvent); } } else { MITK_ERROR << "FeedbackContourTool could not determine which slice of the image you are drawing on." << std::endl; } // 6. Make sure the result is drawn again --> is visible then. assert( positionEvent->GetSender()->GetRenderWindow() ); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); m_WholeImageContourInWorldCoordinates = NULL; m_SegmentationContourInWorldCoordinates = NULL; return true; } /** Called when the CTRL key is pressed. Will change the painting pixel value from 0 to 1 or from 1 to 0. */ bool mitk::SetRegionTool::OnInvertLogic(Action* action, const StateEvent* stateEvent) { if (!FeedbackContourTool::OnInvertLogic(action, stateEvent)) return false; const PositionEvent* positionEvent = dynamic_cast(stateEvent->GetEvent()); if (!positionEvent) return false; if (m_StatusFillWholeSlice) { // use contour extracted from image data if (m_SegmentationContourInWorldCoordinates.IsNotNull()) FeedbackContourTool::SetFeedbackContour( *m_SegmentationContourInWorldCoordinates ); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); } else { // use some artificial contour if (m_WholeImageContourInWorldCoordinates.IsNotNull()) FeedbackContourTool::SetFeedbackContour( *m_WholeImageContourInWorldCoordinates ); mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow()); } m_StatusFillWholeSlice = !m_StatusFillWholeSlice; return true; } diff --git a/Modules/MitkExt/Testing/mitkCompareImageSliceTestHelper.h b/Modules/MitkExt/Testing/mitkCompareImageSliceTestHelper.h index 4762e50a45..d2209c2eff 100644 --- a/Modules/MitkExt/Testing/mitkCompareImageSliceTestHelper.h +++ b/Modules/MitkExt/Testing/mitkCompareImageSliceTestHelper.h @@ -1,161 +1,163 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkCompareImageSliceTestHelperhincluded #define mitkCompareImageSliceTestHelperhincluded #include "mitkImageCast.h" +#include "mitkImageAccessByItk.h" #include #include // copied from mitk/Core/Algorithms/mitkOverwriteSliceImageFilter.cpp // basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h #define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \ if ( typeId == typeid(pixeltype) ) \ { \ typedef itk::Image ImageType; \ typedef mitk::ImageToItk ImageToItkType; \ itk::SmartPointer imagetoitk = ImageToItkType::New(); \ imagetoitk->SetInput(mitkImage); \ imagetoitk->Update(); \ itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \ } #define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \ { \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, double, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, float, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, char, dimension, itkimage2) else \ myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned char, dimension, itkimage2) \ } class CompareImageSliceTestHelper { private: /* variables to be used by CompareSlice only */ static unsigned int m_Dimension0; static unsigned int m_Dimension1; static unsigned int m_SliceDimension; static unsigned int m_SliceIndex; static bool m_ComparisonResult; static mitk::Image* m_SliceImage; public: template static void ItkImageCompare( itk::Image* inputImage, itk::Image* outputImage ) { m_ComparisonResult = false; typedef itk::Image SliceImageType; typedef itk::Image VolumeImageType; typedef itk::ImageSliceConstIteratorWithIndex< VolumeImageType > OutputSliceIteratorType; typedef itk::ImageRegionConstIterator< SliceImageType > InputSliceIteratorType; typename VolumeImageType::RegionType sliceInVolumeRegion; sliceInVolumeRegion = outputImage->GetLargestPossibleRegion(); sliceInVolumeRegion.SetSize( m_SliceDimension, 1 ); // just one slice sliceInVolumeRegion.SetIndex( m_SliceDimension, m_SliceIndex ); // exactly this slice, please OutputSliceIteratorType outputIterator( outputImage, sliceInVolumeRegion ); outputIterator.SetFirstDirection(m_Dimension0); outputIterator.SetSecondDirection(m_Dimension1); InputSliceIteratorType inputIterator( inputImage, inputImage->GetLargestPossibleRegion() ); // iterate over output slice (and over input slice simultaneously) outputIterator.GoToBegin(); inputIterator.GoToBegin(); while ( !outputIterator.IsAtEnd() ) { while ( !outputIterator.IsAtEndOfSlice() ) { while ( !outputIterator.IsAtEndOfLine() ) { m_ComparisonResult = outputIterator.Get() == (TPixel2) inputIterator.Get(); if (!m_ComparisonResult) return; // return on first mismatch ++outputIterator; ++inputIterator; } outputIterator.NextLine(); } outputIterator.NextSlice(); } } template static void ItkImageSwitch( itk::Image* itkImage ) { const std::type_info& typeId=*(m_SliceImage->GetPixelType().GetTypeId()); - myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage ); + //myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage ); + AccessFixedDimensionByItk_1(m_SliceImage, ItkImageCompare, 2, itkImage) } static bool CompareSlice( mitk::Image* image, unsigned int sliceDimension, unsigned int sliceIndex, mitk::Image* slice ) { if ( !image || ! slice ) return false; switch (sliceDimension) { default: case 2: m_Dimension0 = 0; m_Dimension1 = 1; break; case 1: m_Dimension0 = 0; m_Dimension1 = 2; break; case 0: m_Dimension0 = 1; m_Dimension1 = 2; break; } if ( slice->GetDimension() != 2 || image->GetDimension() != 3 || slice->GetDimension(0) != image->GetDimension(m_Dimension0) || slice->GetDimension(1) != image->GetDimension(m_Dimension1) ) { std::cerr << "Slice and image dimensions differ. Sorry, cannot work like this." << std::endl; return false; } // this will do a long long if/else to find out both pixel typesA m_SliceImage = slice; m_SliceIndex = sliceIndex; m_SliceDimension = sliceDimension; m_ComparisonResult = false; AccessFixedDimensionByItk( image, ItkImageSwitch, 3 ); return m_ComparisonResult; } }; // end class #endif diff --git a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.cpp b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.cpp index 22448475e5..f7ee6d8907 100644 --- a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.cpp +++ b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.cpp @@ -1,110 +1,121 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-01-14 14:20:26 +0100 (Do, 14 Jan 2010) $ Version: $Revision: 21047 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkImageToOpenCVImageFilter.h" #include #include #include mitk::ImageToOpenCVImageFilter::ImageToOpenCVImageFilter() : m_OpenCVImage(0) { } mitk::ImageToOpenCVImageFilter::~ImageToOpenCVImageFilter() { m_OpenCVImage = 0; } +int mitk::ImageToOpenCVImageFilter::GetDepth(const std::type_info& typeInfo) const +{ + if(typeInfo == typeid(unsigned char)) + { + return IPL_DEPTH_8U; + } + else if(typeInfo == typeid(char)) + { + return IPL_DEPTH_8S; + } + else if(typeInfo == typeid(unsigned short)) + { + return IPL_DEPTH_16U; + } + else if(typeInfo == typeid(short)) + { + return IPL_DEPTH_16S; + } + else if(typeInfo == typeid(int)) + { + return IPL_DEPTH_32S; + } + else if(typeInfo == typeid(float)) + { + return IPL_DEPTH_32F; + } + else if(typeInfo == typeid(double)) + { + return IPL_DEPTH_64F; + } + // rgb image + else if(typeInfo == typeid(UCRGBPixelType)) + { + return IPL_DEPTH_8U; + } + else if(typeInfo == typeid(USRGBPixelType)) + { + return IPL_DEPTH_16U; + } + else if(typeInfo == typeid(FloatRGBPixelType)) + { + return IPL_DEPTH_64F; + } + else if(typeInfo == typeid(DoubleRGBPixelType)) + { + return IPL_DEPTH_64F; + } + else return -1; +} + bool mitk::ImageToOpenCVImageFilter::CheckImage( mitk::Image* image ) { if(image == 0) { MITK_WARN << "MITK Image is 0"; return false; } if(image->GetDimension() != 2) { MITK_WARN << "Only 2D Images allowed"; return false; } return true; } IplImage* mitk::ImageToOpenCVImageFilter::GetOpenCVImage() { if(!m_OpenCVImage && this->CheckImage( m_Image ) == true ) { - // gray image - if(m_Image->GetPixelType() == typeid(unsigned char)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, unsigned char, 2, IPL_DEPTH_8U ); - } - else if(m_Image->GetPixelType() == typeid(char)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, char, 2, IPL_DEPTH_8S ); - } - else if(m_Image->GetPixelType() == typeid(unsigned short)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, unsigned short, 2, IPL_DEPTH_16U ); - } - else if(m_Image->GetPixelType() == typeid(short)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, short, 2, IPL_DEPTH_16S ); - } - else if(m_Image->GetPixelType() == typeid(int)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, int, 2, IPL_DEPTH_32S ); - } - else if(m_Image->GetPixelType() == typeid(float)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, float, 2, IPL_DEPTH_32F ); - } - else if(m_Image->GetPixelType() == typeid(double)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, double, 2, IPL_DEPTH_64F ); - } - - // rgb image - else if(m_Image->GetPixelType() == typeid(UCRGBPixelType)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, UCRGBPixelType, 2, IPL_DEPTH_8U ); - } - else if(m_Image->GetPixelType() == typeid(USRGBPixelType)) + try { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, USRGBPixelType, 2, IPL_DEPTH_16U ); + AccessFixedTypeByItk(m_Image.GetPointer(), ItkImageProcessing, + MITK_ACCESSBYITK_PIXEL_TYPES_SEQ // gray image + (UCRGBPixelType)(USRGBPixelType)(FloatRGBPixelType)(DoubleRGBPixelType), // rgb image + (2) // dimensions + ) } - else if(m_Image->GetPixelType() == typeid(FloatRGBPixelType)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, FloatRGBPixelType, 2, IPL_DEPTH_64F ); - } - else if(m_Image->GetPixelType() == typeid(DoubleRGBPixelType)) - { - AccessFixedTypeByItk_1 ( m_Image.GetPointer(), ItkImageProcessing, DoubleRGBPixelType, 2, IPL_DEPTH_64F ); - } - + catch (const AccessByItkException& ) {} } return m_OpenCVImage; } void mitk::ImageToOpenCVImageFilter::SetImage( mitk::Image* _Image ) { if(m_Image == _Image) return; m_Image = _Image; m_OpenCVImage = 0; -} \ No newline at end of file +} diff --git a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h index 5a98ff885d..10ad739b61 100644 --- a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h +++ b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h @@ -1,140 +1,142 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-01-28 18:32:03 +0100 (Do, 28 Jan 2010) $ Version: $Revision: 21147 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkImageToOpenCVImageFilter_h #define mitkImageToOpenCVImageFilter_h #include #include #include #include #include #include #include #include #include "mitkOpenCVVideoSupportExports.h" namespace mitk { /** \brief A pseudo-Filter for creating OpenCV images from MITK images with the option of copying data or referencing it Last contributor: $Author: mueller $ */ class MITK_OPENCVVIDEOSUPPORT_EXPORT ImageToOpenCVImageFilter : public itk::Object { public: typedef itk::RGBPixel< unsigned char > UCRGBPixelType; typedef itk::RGBPixel< unsigned short > USRGBPixelType; typedef itk::RGBPixel< float > FloatRGBPixelType; typedef itk::RGBPixel< double > DoubleRGBPixelType; template static mitk::Image::Pointer ConvertIplToMitkImage( const IplImage * input, bool copyBuffer = true ); mitkClassMacro(ImageToOpenCVImageFilter, itk::Object); itkNewMacro(ImageToOpenCVImageFilter); void SetImage( mitk::Image* _Image ); itkGetMacro(Image, mitk::Image*); bool CheckImage(mitk::Image* image); /// /// Get the produced OpenCVImage. /// ATTENTION: Do not forget to release this image again with cvReleaseImage(). /// IplImage* GetOpenCVImage(); protected: ImageToOpenCVImageFilter(); // purposely hidden virtual ~ImageToOpenCVImageFilter(); + int GetDepth(const std::type_info& typeInfo) const; + template - void ItkImageProcessing( itk::Image* image, int depth ); + void ItkImageProcessing( itk::Image* image ); template - void ItkImageProcessing( itk::Image,VImageDimension>* image, int depth ); + void ItkImageProcessing( itk::Image,VImageDimension>* image ); protected: /// /// Saves if the filter should copy the data or just reference it /// mitk::WeakPointer m_Image; IplImage* m_OpenCVImage; }; template - void mitk::ImageToOpenCVImageFilter::ItkImageProcessing( itk::Image* image, int depth ) + void mitk::ImageToOpenCVImageFilter::ItkImageProcessing( itk::Image* image ) { typedef itk::Image ImageType; const unsigned int numberOfPixels = m_Image->GetDimension(0) * m_Image->GetDimension(1); const unsigned int numberOfBytes = numberOfPixels * sizeof( typename ImageType::PixelType ); const typename ImageType::PixelType * itkBuffer = image->GetBufferPointer(); typename ImageType::SizeType size = image->GetLargestPossibleRegion().GetSize(); // create new opencv image m_OpenCVImage = cvCreateImage( cvSize( size[0], size[1] ) - , depth, 1 ); + , GetDepth(typeid(TPixel)), 1 ); memcpy( m_OpenCVImage->imageData, itkBuffer, numberOfBytes ); } template - void mitk::ImageToOpenCVImageFilter::ItkImageProcessing( itk::Image,VImageDimension>* image, int depth ) + void mitk::ImageToOpenCVImageFilter::ItkImageProcessing( itk::Image,VImageDimension>* image ) { typedef itk::RGBPixel RGBPixelType; typedef itk::Image RGBImageType; typedef itk::ImageRegionIterator RGBIteratorType; RGBIteratorType it(image, image->GetLargestPossibleRegion()); typename RGBImageType::SizeType size = image->GetLargestPossibleRegion().GetSize(); // create new opencv image - m_OpenCVImage = cvCreateImage( cvSize( size[0], size[1] ), depth, 3 ); + m_OpenCVImage = cvCreateImage( cvSize( size[0], size[1] ), GetDepth(typeid(RGBPixelType)), 3 ); unsigned int x = 0,y = 0; CvScalar s; for ( it.GoToBegin(); !it.IsAtEnd(); ++it ) { s.val[0] = it.Value().GetBlue(); s.val[1] = it.Value().GetGreen(); s.val[2] = it.Value().GetRed(); //MITK_DEBUG << "[" << x << "," << y << "] " << s.val[0] << "(B)," << s.val[1] << "(G)," << s.val[2] << "(R)"; cvSet2D(m_OpenCVImage,y,x,s); ++x; // next line found if( x == size[0] ) { x = 0; ++y; } } } } // namespace #endif // mitkImageToOpenCVImageFilter_h diff --git a/Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp b/Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp index 6d2d791c2e..459944acad 100644 --- a/Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp +++ b/Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp @@ -1,637 +1,638 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkThresholdComponent.h" #include "ui_QmitkThresholdComponentControls.h" #include #include #include "mitkRenderingManager.h" #include "mitkProperties.h" #include "mitkDataNodeFactory.h" #include "mitkImageTimeSelector.h" #include "mitkLevelWindowProperty.h" #include #include #include #include #include #include #include +#include #include //#include #include /*************** CONSTRUCTOR ***************/ QmitkThresholdComponent::QmitkThresholdComponent(QObject * parent, const char * parentName, bool updateSelector, bool showSelector, QmitkStdMultiWidget * /*mitkStdMultiWidget*/) : QmitkFunctionalityComponentContainer(parent, parentName, updateSelector, showSelector), m_ThresholdImageNode(NULL), m_ThresholdComponentGUI(NULL), m_ThresholdNodeExisting(false) { SetAvailability(true); SetComponentName("ThresholdFinder"); } /*************** DESTRUCTOR ***************/ QmitkThresholdComponent::~QmitkThresholdComponent() { } /************** SET SELECTOR VISIBILITY ***************/ void QmitkThresholdComponent::SetSelectorVisibility(bool /*visibility*/) { if(m_ThresholdComponentGUI) { //m_ImageContent->setShown(visibility); m_ImageContent->setShown(true); } } /*************** GET IMAGE CONTENT ***************/ QGroupBox* QmitkThresholdComponent::GetImageContent() { return (QGroupBox*) m_ImageContent; } /*************** GET TREE NODE SELECTOR ***************/ QmitkDataStorageComboBox* QmitkThresholdComponent::GetTreeNodeSelector() { return m_TreeNodeSelector; } /*************** CONNECTIONS ***************/ void QmitkThresholdComponent::CreateConnections() { if ( m_ThresholdComponentGUI ) { connect( (QObject*)(m_TreeNodeSelector), SIGNAL(OnSelectionChanged (const mitk::DataNode *)), (QObject*) this, SLOT(ImageSelected(const mitk::DataNode *))); connect( (QObject*)(m_ThresholdFinder), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowThresholdFinderContent(bool))); connect( (QObject*)(m_ThresholdSelectDataGroupBox), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowImageContent(bool))); connect( (QObject*)(m_ThresholdInputSlider), SIGNAL(sliderMoved(int)), (QObject*) this, SLOT(ThresholdSliderChanged(int))); connect( (QObject*)(m_ThresholdInputNumber), SIGNAL(returnPressed()), (QObject*) this, SLOT(ThresholdValueChanged())); //connect( (QObject*)( m_ShowThresholdGroupBox), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowThreshold(bool))); //to connect the toplevel checkable GroupBox with the method SetContentContainerVisibility to inform all containing komponent to shrink or to expand connect( (QObject*)(m_ThresholdFinder), SIGNAL(toggled(bool)), (QObject*) this, SLOT(SetContentContainerVisibility(bool))); connect( (QObject*)(m_CreateSegmentationButton), SIGNAL(released()), (QObject*) this, SLOT(CreateThresholdSegmentation())); } } /*************** DATA STORAGE CHANGED ***************/ void QmitkThresholdComponent::DataStorageChanged(mitk::DataStorage::Pointer ds) { if(!ds) return; m_DataStorage = ds; m_TreeNodeSelector->SetDataStorage(ds); if(m_ThresholdComponentGUI != NULL) { for(unsigned int i = 0; i < m_AddedChildList.size(); i++) { QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast(m_AddedChildList[i]); if (functionalityComponent != NULL) functionalityComponent->DataStorageChanged(ds); } } if(!ds) return; DataObjectSelected(); SetSliderRange(); ShowThreshold(); } /*************** IMAGE SELECTED ***************/ void QmitkThresholdComponent::ImageSelected(const mitk::DataNode* item) { if(m_ThresholdComponentGUI != NULL) { mitk::DataNode::Pointer selectedItem = const_cast< mitk::DataNode*>(item); m_TreeNodeSelector->SetSelectedNode(selectedItem); for(unsigned int i = 0; i < m_AddedChildList.size(); i++) { QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast(m_AddedChildList[i]); if (functionalityComponent != NULL) functionalityComponent->ImageSelected(item); } } DataObjectSelected(); SetSliderRange(); ShowThreshold(); } /*************** DATA OBJECT SELECTED **************/ void QmitkThresholdComponent::DataObjectSelected() { if(m_Active) { if(m_ThresholdNodeExisting) { m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData()); } else { CreateThresholdImageNode(); m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData()); } ShowThreshold(); } } /** \brief Method to set the DataStorage*/ void QmitkThresholdComponent::SetDataStorage(mitk::DataStorage::Pointer dataStorage) { m_DataStorage = dataStorage; } /** \brief Method to get the DataStorage*/ mitk::DataStorage::Pointer QmitkThresholdComponent::GetDataStorage() { return m_DataStorage; } /*************** CREATE CONTAINER WIDGET **************/ void QmitkThresholdComponent::CreateQtPartControl(QWidget * /*parent*/, mitk::DataStorage::Pointer dataStorage) { m_GUI = new QWidget; m_ThresholdComponentGUI = new Ui::QmitkThresholdComponentControls; m_ThresholdComponentGUI->setupUi(m_GUI); /*CREATE GUI ELEMENTS*/ m_ThresholdFinder = new QGroupBox("2. Find Threshold", m_GUI); m_ThresholdSelectDataGroupBox = new QGroupBox("Show Image Selector", m_ThresholdFinder); m_TreeNodeSelector = new QmitkDataStorageComboBox(m_ThresholdSelectDataGroupBox); m_ImageContent = new QGroupBox("m_ImageContent", m_ThresholdSelectDataGroupBox); m_ContainerContent = new QGroupBox(m_ImageContent); m_ShowThresholdGroupBox = new QGroupBox("m_ShowThresholdGroupBox", m_ContainerContent); m_ThresholdInputNumber = new QLineEdit(m_ShowThresholdGroupBox); m_ThresholdInputSlider = new QSlider(m_ShowThresholdGroupBox); m_ThresholdInputSlider->setOrientation(Qt::Horizontal); m_ThresholdValueContent = new QGroupBox("m_ThresholdValueContent", m_ShowThresholdGroupBox); m_CreateSegmentationButton = new QPushButton("Create Segmentation", m_ThresholdValueContent); m_DeleateImageIfDeactivatedCheckBox = new QCheckBox("Deleate Threshold Image if \nComponent is deactivated", m_ThresholdValueContent); m_ThresholdFinder->setCheckable(true); m_ThresholdFinder->setChecked(true); m_ThresholdSelectDataGroupBox->setCheckable(true); m_ThresholdSelectDataGroupBox->setChecked(true); m_ThresholdInputNumber->setFixedSize(40, 20); QIntValidator* intValid = new QIntValidator(-32000, 5000, m_ThresholdInputNumber); m_ThresholdInputNumber->setValidator(intValid); m_ThresholdInputNumber->setText("0"); m_ThresholdValueContent->setMaximumHeight(90); // m_ThresholdSelectDataGroupBox->setContentsMargins(0,9,9,9); // m_ImageContent->setContentsMargins(0,9,9,9); // m_ContainerContent->setContentsMargins(0,9,9,9); // m_ShowThresholdGroupBox->setContentsMargins(0,9,9,9); //m_ThresholdValueContent->setContentsMargins(0,9,9,9); //m_ThresholdFinder->setFlat(true); //m_ThresholdSelectDataGroupBox->setFlat(true); //m_ImageContent->setFlat(true); //m_ContainerContent->setFlat(true); //m_ShowThresholdGroupBox->setFlat(true); //m_ThresholdValueContent->setFlat(true); QVBoxLayout* guiLayout = new QVBoxLayout(m_GUI); m_GUI->setLayout(guiLayout); guiLayout->addWidget(m_ThresholdFinder); QVBoxLayout* thresholdFinderLayout = new QVBoxLayout(m_ThresholdFinder); thresholdFinderLayout->setContentsMargins(0,9,0,9); m_ThresholdFinder->setLayout(thresholdFinderLayout); thresholdFinderLayout->addWidget(m_ThresholdSelectDataGroupBox); thresholdFinderLayout->addWidget(m_ImageContent); QVBoxLayout* thresholdSelectDataGroupBoxLayout = new QVBoxLayout(m_ThresholdSelectDataGroupBox); thresholdSelectDataGroupBoxLayout->setContentsMargins(0,9,0,9); m_ThresholdSelectDataGroupBox->setLayout(thresholdSelectDataGroupBoxLayout); thresholdSelectDataGroupBoxLayout->addWidget(m_TreeNodeSelector); QVBoxLayout* imageContentLayout = new QVBoxLayout(m_ImageContent); imageContentLayout->setContentsMargins(0,9,0,9); m_ImageContent->setLayout(imageContentLayout); imageContentLayout->addWidget(m_ContainerContent); QVBoxLayout* containerContentLayout = new QVBoxLayout(m_ContainerContent); containerContentLayout->setContentsMargins(0,9,0,9); m_ContainerContent->setLayout(containerContentLayout); containerContentLayout->addWidget(m_ShowThresholdGroupBox); QVBoxLayout* showThresholdGroupBoxLayout = new QVBoxLayout(m_ShowThresholdGroupBox); showThresholdGroupBoxLayout->setContentsMargins(0,9,0,9); m_ShowThresholdGroupBox->setLayout(showThresholdGroupBoxLayout); QHBoxLayout* thresholdInputLayout = new QHBoxLayout(m_ShowThresholdGroupBox); thresholdInputLayout->addWidget(m_ThresholdInputNumber); thresholdInputLayout->addWidget(m_ThresholdInputSlider); showThresholdGroupBoxLayout->addLayout(thresholdInputLayout); showThresholdGroupBoxLayout->addWidget(m_ThresholdValueContent); QVBoxLayout* thresholdValueContentLayout = new QVBoxLayout(m_ThresholdValueContent); thresholdValueContentLayout->setContentsMargins(0,9,0,9); m_ThresholdValueContent->setLayout(thresholdValueContentLayout); thresholdValueContentLayout->addWidget(m_DeleateImageIfDeactivatedCheckBox); thresholdValueContentLayout->addWidget(m_CreateSegmentationButton); this->CreateConnections(); SetDataStorage(dataStorage); m_TreeNodeSelector->SetDataStorage(dataStorage); m_TreeNodeSelector->SetPredicate(mitk::NodePredicateDataType::New("Image")); if(m_ShowSelector) { m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked()); //m_ImageContent->setShown(true); } else { m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector); //m_ThresholdSelectDataGroupBox->setShown(true); } } /*************** GET CONTENT CONTAINER ***************/ QGroupBox * QmitkThresholdComponent::GetContentContainer() { return m_ContainerContent; } /************ GET MAIN CHECK BOX CONTAINER ************/ QGroupBox * QmitkThresholdComponent::GetMainCheckBoxContainer() { return m_ThresholdFinder; } ///*********** SET CONTENT CONTAINER VISIBLE ************/ //void QmitkThresholdComponent::SetContentContainerVisibility() //{ // for(unsigned int i = 0; i < m_AddedChildList.size(); i++) // { // if(m_AddedChildList[i]->GetContentContainer() != NULL) // { // m_AddedChildList[i]->GetContentContainer()->setShown(GetMainCheckBoxContainer()->isChecked()); // } // } //} /*************** ACTIVATED ***************/ void QmitkThresholdComponent::Activated() { QmitkBaseFunctionalityComponent::Activated(); m_Active = true; for(unsigned int i = 0; i < m_AddedChildList.size(); i++) { m_AddedChildList[i]->Activated(); } CreateThresholdImageNode(); ShowThreshold(); SetSliderRange(); } /*************** DEACTIVATED ***************/ void QmitkThresholdComponent::Deactivated() { QmitkBaseFunctionalityComponent::Deactivated(); m_Active = false; for(unsigned int i = 0; i < m_AddedChildList.size(); i++) { m_AddedChildList[i]->Deactivated(); } ShowThreshold(); if( m_DeleateImageIfDeactivatedCheckBox->isChecked()) { DeleteThresholdNode(); } } ///************ SHOW THRESHOLD FINDER CONTENT ***********/ void QmitkThresholdComponent::ShowThresholdFinderContent(bool) { // m_ShowThresholdGroupBox->setShown( m_ThresholdFinder->isChecked()); // m_ContainerContent->setShown( m_ThresholdSelectDataGroupBox->isChecked()); m_ContainerContent->setShown( m_ThresholdFinder->isChecked()); if(m_ShowSelector) { //m_ThresholdSelectDataGroupBox->setShown( m_ThresholdSelectDataGroupBox->isChecked()); //m_ThresholdSelectDataGroupBox->setShown( true); m_ThresholdSelectDataGroupBox->setShown(m_ThresholdFinder->isChecked()); } //ShowThreshold(); } ///*************** SHOW IMAGE CONTENT **************/ void QmitkThresholdComponent::ShowImageContent(bool) { //m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked()); m_ImageContent->setShown( true); if(m_ShowSelector) { //m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked()); m_ImageContent->setShown( true); } else { //m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector); m_ThresholdSelectDataGroupBox->setShown(true); } } ///*************** SHOW THRESHOLD **************/ void QmitkThresholdComponent::ShowThreshold(bool) { if(m_ThresholdImageNode) { if(m_Active == true) { m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New(( m_ThresholdFinder->isChecked())) ); } else { if( m_DeleateImageIfDeactivatedCheckBox->isChecked()) { m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New((false)) ); } } mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } } ///*************** THRESHOLD VALUE CHANGED **************/ //By Slider void QmitkThresholdComponent::ThresholdSliderChanged(int) { int value = m_ThresholdInputSlider->value(); if (m_ThresholdImageNode) { m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1)); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } m_ThresholdInputNumber->setText(QString::number(value)); } ///*************** THRESHOLD VALUE CHANGED **************/ //By LineEdit void QmitkThresholdComponent::ThresholdValueChanged( ) { int value = atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData() ); if (m_ThresholdImageNode) { m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1)); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } m_ThresholdInputSlider->setValue(value); } ///*************** SET SLIDER RANGE **************/ void QmitkThresholdComponent::SetSliderRange() { if(m_Active) { if( m_ThresholdFinder->isChecked()==true) { if(!m_TreeNodeSelector->GetSelectedNode()) return; if(!m_TreeNodeSelector->GetSelectedNode()->GetData()) return; mitk::Image* currentImage = dynamic_cast(m_TreeNodeSelector->GetSelectedNode()->GetData()); if(currentImage) { int min = (int) currentImage->GetScalarValueMin(); int max = (int) currentImage->GetScalarValueMaxNoRecompute(); //int realMax = currentImage->GetScalarValueMax(); if(min < -32000) { min = (int) currentImage->GetScalarValue2ndMin(); max = (int) currentImage->GetScalarValue2ndMaxNoRecompute(); } QIntValidator* intValid = new QIntValidator(min-150, max+150, m_ThresholdInputNumber); m_ThresholdInputNumber->setValidator(intValid); m_ThresholdInputNumber->setText("1"); m_ThresholdInputSlider->setMinimum(min-150); m_ThresholdInputSlider->setMaximum(max+150); m_ThresholdInputSlider->setRange(min-150, max+150); m_ThresholdInputSlider->setPageStep(1); m_ThresholdInputSlider->setValue(1); m_GUI->repaint(); //m_ThresholdInputSlider->resize(); /* m_ThresholdInputSlider->setMinValue((int)currentImage->GetScalarValueMin()); m_ThresholdInputSlider->setMaxValue((int)currentImage->GetScalarValueMaxNoRecompute());*/ } } } } ///*************** DELETE THRESHOLD NODE **************/ void QmitkThresholdComponent::DeleteThresholdNode() { if(m_ThresholdImageNode) { mitk::DataNode::Pointer foundNode = m_DataStorage->GetNamedNode("Thresholdview image"); foundNode->Delete(); m_ThresholdNodeExisting = false; return; } } ///*************CREATE THRESHOLD IMAGE NODE************/ void QmitkThresholdComponent::CreateThresholdImageNode() { if(m_Active) { if( m_ThresholdNodeExisting) return; if(!m_TreeNodeSelector) return; if(!m_TreeNodeSelector->GetSelectedNode()) return; m_ThresholdImageNode = mitk::DataNode::New(); mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New("Thresholdview image" ); m_ThresholdImageNode->SetProperty( "name", nameProp ); mitk::BoolProperty::Pointer componentThresholdImageProp = mitk::BoolProperty::New(true); m_ThresholdImageNode->SetProperty( "isComponentThresholdImage", componentThresholdImageProp ); m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData()); m_ThresholdImageNode->SetColor(0.0,1.0,0.0); m_ThresholdImageNode->SetOpacity(.25); int layer = 0; m_ThresholdImageNode->GetIntProperty("layer", layer); m_ThresholdImageNode->SetIntProperty("layer", layer+1); m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData()),1)); m_ThresholdNodeExisting = true; m_DataStorage->Add(m_ThresholdImageNode); } } /*************CREAET THRESHOLD SEGMENTATION************/ void QmitkThresholdComponent::CreateThresholdSegmentation() { mitk::Image::Pointer original = dynamic_cast(m_TreeNodeSelector->GetSelectedNode()->GetData()); // we NEED a reference image for size etc. if (!original) return; // actually create a new empty segmentation mitk::PixelType pixelType( typeid(DefaultSegmentationDataType) ); mitk::Image::Pointer segmentation = mitk::Image::New(); //segmentation->SetProperty( "organ type", OrganTypeProperty::New( organType ) ); segmentation->Initialize( pixelType, original->GetDimension(), original->GetDimensions() ); unsigned int byteSize = sizeof(DefaultSegmentationDataType); for (unsigned int dim = 0; dim < segmentation->GetDimension(); ++dim) { byteSize *= segmentation->GetDimension(dim); } memset( segmentation->GetData(), 0, byteSize ); if (original->GetTimeSlicedGeometry() ) { mitk::AffineGeometryFrame3D::Pointer originalGeometryAGF = original->GetTimeSlicedGeometry()->Clone(); mitk::TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast( originalGeometryAGF.GetPointer() ); segmentation->SetGeometry( originalGeometry ); } else { MITK_INFO<<"Original image does not have a 'Time sliced geometry'! Cannot create a segmentation."; return ; } mitk::DataNode::Pointer emptySegmentationNode = CreateSegmentationNode( segmentation); if (emptySegmentationNode) { // actually perform a thresholding and ask for an organ type for (unsigned int timeStep = 0; timeStep < original->GetTimeSteps(); ++timeStep) { try { mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New(); timeSelector->SetInput( original ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); mitk::Image::Pointer image3D = timeSelector->GetOutput(); AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast(emptySegmentationNode->GetData()), timeStep ); } catch(...) { MITK_INFO<<"Error accessing single time steps of the original image. Cannot create segmentation."; } } mitk::DataNode::Pointer originalNode = m_TreeNodeSelector->GetSelectedNode(); m_DataStorage->Add( emptySegmentationNode, originalNode ); // add as a child, because the segmentation "derives" from the original } } mitk::DataNode::Pointer QmitkThresholdComponent::CreateSegmentationNode( mitk::Image* image) { if (!image) return NULL; // decorate the datatreenode with some properties mitk::DataNode::Pointer segmentationNode = mitk::DataNode::New(); segmentationNode->SetData( image ); // name segmentationNode->SetProperty( "name", mitk::StringProperty::New( "TH segmentation from ThresholdFinder" ) ); // visualization properties segmentationNode->SetProperty( "binary", mitk::BoolProperty::New(true) ); segmentationNode->SetProperty( "color", mitk::ColorProperty::New(0.0, 1.0, 0.0) ); segmentationNode->SetProperty( "texture interpolation", mitk::BoolProperty::New(false) ); segmentationNode->SetProperty( "layer", mitk::IntProperty::New(10) ); segmentationNode->SetProperty( "levelwindow", mitk::LevelWindowProperty::New( mitk::LevelWindow(0.5, 1) ) ); segmentationNode->SetProperty( "opacity", mitk::FloatProperty::New(0.3) ); segmentationNode->SetProperty( "segmentation", mitk::BoolProperty::New(true) ); segmentationNode->SetProperty( "showVolume", mitk::BoolProperty::New( false ) ); return segmentationNode; } template void QmitkThresholdComponent::ITKThresholding( itk::Image* originalImage, mitk::Image* segmentation, unsigned int timeStep ) { mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New(); timeSelector->SetInput( segmentation ); timeSelector->SetTimeNr( timeStep ); timeSelector->UpdateLargestPossibleRegion(); mitk::Image::Pointer segmentation3D = timeSelector->GetOutput(); typedef itk::Image< DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations SegmentationType::Pointer itkSegmentation; CastToItkImage( segmentation3D, itkSegmentation ); // iterate over original and segmentation typedef itk::ImageRegionConstIterator< itk::Image > InputIteratorType; typedef itk::ImageRegionIterator< SegmentationType > SegmentationIteratorType; InputIteratorType inputIterator( originalImage, originalImage->GetLargestPossibleRegion() ); SegmentationIteratorType outputIterator( itkSegmentation, itkSegmentation->GetLargestPossibleRegion() ); inputIterator.GoToBegin(); outputIterator.GoToBegin(); while (!outputIterator.IsAtEnd()) { if ( (signed)inputIterator.Get() >= atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData()) ) { outputIterator.Set( 1 ); } else { outputIterator.Set( 0 ); } ++inputIterator; ++outputIterator; } } diff --git a/Modules/RigidRegistration/mitkImageRegistrationMethod-TYPE.cpp b/Modules/RigidRegistration/mitkImageRegistrationMethod-TYPE.cpp index bf7536e58a..22840d05a2 100644 --- a/Modules/RigidRegistration/mitkImageRegistrationMethod-TYPE.cpp +++ b/Modules/RigidRegistration/mitkImageRegistrationMethod-TYPE.cpp @@ -1,20 +1,24 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include +#include +#include -InstantiateAccessFunctionForFixedPixelType( mitk::ImageRegistrationMethod::GenerateData2, @TYPE@); +#define InstantiateAccessFunction_RegistrationAccessItkImage(pixelType, dim) \ + template void mitk::ImageRegistrationMethodAccessFunctor::AccessItkImage(itk::Image* itkImage1, mitk::ImageRegistrationMethod* method); + +InstantiateAccessFunctionForFixedPixelType(RegistrationAccessItkImage, (@TYPE@)) diff --git a/Modules/RigidRegistration/mitkImageRegistrationMethod.cpp b/Modules/RigidRegistration/mitkImageRegistrationMethod.cpp index 8d98b8e91d..d2f310500b 100644 --- a/Modules/RigidRegistration/mitkImageRegistrationMethod.cpp +++ b/Modules/RigidRegistration/mitkImageRegistrationMethod.cpp @@ -1,94 +1,94 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkImageRegistrationMethod.h" - +#include "mitkImageRegistrationMethodAccessFunctor.h" namespace mitk { ImageRegistrationMethod::ImageRegistrationMethod() : m_Interpolator(0) { m_ReferenceImage = Image::New(); m_OptimizerScales.clear(); } ImageRegistrationMethod::~ImageRegistrationMethod() { } void ImageRegistrationMethod::GenerateData() { if (this->GetInput()) { - AccessByItk(this->GetInput(), GenerateData2); + ImageRegistrationMethodAccessFunctor()(this->GetInput(), this); } } void ImageRegistrationMethod::SetObserver(RigidRegistrationObserver::Pointer observer) { m_Observer = observer; } void ImageRegistrationMethod::SetInterpolator(int interpolator) { m_Interpolator = interpolator; } void ImageRegistrationMethod::SetReferenceImage(Image::Pointer fixedImage) { m_ReferenceImage = fixedImage; SetNthInput(1, m_ReferenceImage); Modified(); } void ImageRegistrationMethod::SetMovingMask(Image::Pointer movingMask) { m_MovingMask = movingMask; SetNthInput(3, m_MovingMask); Modified(); } void ImageRegistrationMethod::SetFixedMask(Image::Pointer FixedMask) { m_FixedMask = FixedMask; SetNthInput(4, m_FixedMask); Modified(); } void ImageRegistrationMethod::SetTransform(itk::Object::Pointer transform) { m_Transform = transform; } void ImageRegistrationMethod::SetMetric(itk::Object::Pointer metric) { m_Metric = metric; } void ImageRegistrationMethod::SetOptimizer(itk::Object::Pointer optimizer) { m_Optimizer = optimizer; } void ImageRegistrationMethod::SetOptimizerScales(itk::Array scales) { m_OptimizerScales = scales; } } // end namespace diff --git a/Modules/RigidRegistration/mitkImageRegistrationMethod.h b/Modules/RigidRegistration/mitkImageRegistrationMethod.h index 035bb2a63c..f419598d4e 100644 --- a/Modules/RigidRegistration/mitkImageRegistrationMethod.h +++ b/Modules/RigidRegistration/mitkImageRegistrationMethod.h @@ -1,103 +1,100 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKIMAGEREGISTRATIONMETHOD_H #define MITKIMAGEREGISTRATIONMETHOD_H #include "itkImageRegistrationMethod.h" #include "MitkRigidRegistrationExports.h" #include "itkSingleValuedNonLinearOptimizer.h" #include "mitkImageToImageFilter.h" #include "mitkImageAccessByItk.h" #include "mitkRigidRegistrationObserver.h" #include "mitkCommon.h" #include "itkImageMaskSpatialObject.h" #include "mitkRigidRegistrationPreset.h" namespace mitk { /*! \brief Main class for the rigid registration pipeline. \ingroup RigidRegistration \author Daniel Stein */ class MITK_RIGIDREGISTRATION_EXPORT ImageRegistrationMethod : public ImageToImageFilter { public: typedef itk::SingleValuedNonLinearOptimizer OptimizerType; typedef itk::ImageMaskSpatialObject< 3 > MaskType; mitkClassMacro(ImageRegistrationMethod, ImageToImageFilter); itkNewMacro(Self); static const int LINEARINTERPOLATOR = 0; static const int NEARESTNEIGHBORINTERPOLATOR = 1; void SetObserver(RigidRegistrationObserver::Pointer observer); void SetInterpolator(int interpolator); virtual void GenerateData(); virtual void SetReferenceImage( Image::Pointer fixedImage); virtual void SetFixedMask( Image::Pointer fixedMask); virtual void SetMovingMask( Image::Pointer movingMask); void SetOptimizerScales(itk::Array scales); void SetTransform(itk::Object::Pointer transform); void SetMetric(itk::Object::Pointer metric); void SetOptimizer(itk::Object::Pointer optimizer); protected: ImageRegistrationMethod(); virtual ~ImageRegistrationMethod(); - template < typename TPixel, unsigned int VImageDimension > - void GenerateData2( itk::Image* itkImage1); + friend struct ImageRegistrationMethodAccessFunctor; RigidRegistrationObserver::Pointer m_Observer; int m_Interpolator; Image::Pointer m_ReferenceImage; Image::Pointer m_FixedMask; Image::Pointer m_MovingMask; virtual void GenerateOutputInformation(){}; private: itk::Object::Pointer m_Transform; itk::Object::Pointer m_Metric; itk::Object::Pointer m_Optimizer; itk::Array m_OptimizerScales; }; } -//#include "mitkImageRegistrationMethod.txx" - #endif // MITKIMAGEREGISTRATIONMETHOD_H diff --git a/Modules/RigidRegistration/mitkImageRegistrationMethod.txx b/Modules/RigidRegistration/mitkImageRegistrationMethod.txx deleted file mode 100644 index 2fc85d43d9..0000000000 --- a/Modules/RigidRegistration/mitkImageRegistrationMethod.txx +++ /dev/null @@ -1,166 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2007-09-05 13:45:48 +0200 (Mi, 05 Sep 2007) $ -Version: $Revision: 9502 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include "mitkImageRegistrationMethod.h" - -#include "mitkITKImageImport.h" -#include "mitkRigidRegistrationObserver.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -namespace mitk { - - template - void ImageRegistrationMethod::GenerateData2(itk::Image* itkImage1) - { - //convert mitk masks to itk masks - typedef typename itk::Image FixedImageType; - typedef typename itk::Image MovingImageType; - typedef typename itk::Image< unsigned char, VImageDimension > MaskImageType; - typedef typename itk::ImageMaskSpatialObject< VImageDimension > ImageMaskType; - typename ImageMaskType::Pointer movingImageMask; - if(m_MovingMask.IsNotNull()) - { - typename MovingImageType::Pointer movingMask = MovingImageType::New(); - mitk::CastToItkImage(m_MovingMask, movingMask); - typename itk::CastImageFilter::Pointer maskImageCaster = itk::CastImageFilter::New(); - maskImageCaster->SetInput(movingMask); - maskImageCaster->UpdateLargestPossibleRegion(); - movingImageMask = ImageMaskType::New(); - movingImageMask->SetImage(maskImageCaster->GetOutput()); - } - typename ImageMaskType::Pointer fixedImageMask; - if(m_FixedMask.IsNotNull()) - { - typename FixedImageType::Pointer fixedMask = FixedImageType::New(); - mitk::CastToItkImage(m_FixedMask, fixedMask); - typename itk::CastImageFilter::Pointer maskImageCaster = itk::CastImageFilter::New(); - maskImageCaster->SetInput(fixedMask); - maskImageCaster->UpdateLargestPossibleRegion(); - fixedImageMask = ImageMaskType::New(); - fixedImageMask->SetImage(maskImageCaster->GetOutput()); - } - // typedefs - typedef typename itk::Image FixedImageType; - typedef typename itk::Image MovingImageType; - typedef typename itk::LinearInterpolateImageFunction InterpolatorType; - typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType2; - typedef typename itk::ImageRegistrationMethod RegistrationType; - typedef typename itk::Transform< double, VImageDimension, VImageDimension > TransformType; - typedef typename TransformType::Pointer TransformPointer; - typedef typename itk::ImageToImageMetric MetricType; - typedef typename MetricType::Pointer MetricPointer; - typedef typename itk::SingleValuedNonLinearOptimizer OptimizerType; - // the fixed and the moving image - typename FixedImageType::Pointer fixedImage = FixedImageType::New(); - typename MovingImageType::Pointer movingImage = itkImage1; - mitk::CastToItkImage(m_ReferenceImage, fixedImage); - // the metric - MetricPointer metric = dynamic_cast(m_Metric.GetPointer()); - if(movingImageMask.IsNotNull()) - metric->SetMovingImageMask(movingImageMask); - if(fixedImageMask.IsNotNull()) - metric->SetFixedImageMask(fixedImageMask); - // the transform - TransformPointer transform = dynamic_cast(m_Transform.GetPointer()); - // the optimizer - typename OptimizerType::Pointer optimizer = dynamic_cast(m_Optimizer.GetPointer()); - // optimizer scales - if (m_OptimizerScales.Size() != 0) - { - typename OptimizerType::ScalesType scales( transform->GetNumberOfParameters() ); - for (unsigned int i = 0; i < scales.Size(); i++) - { - scales[i] = m_OptimizerScales[i]; - } - optimizer->SetScales( scales ); - } - // the registration method - typename RegistrationType::Pointer registration = RegistrationType::New(); - registration->SetMetric(metric); - registration->SetOptimizer(optimizer); - registration->SetTransform(transform); - registration->SetFixedImage(fixedImage); - registration->SetMovingImage(movingImage); - registration->SetFixedImageRegion(fixedImage->GetBufferedRegion()); -// if(transFac->GetTransformParameters()->GetInitialParameters().size()) -// { -// registration->SetInitialTransformParameters( transFac->GetTransformParameters()->GetInitialParameters() ); -// } -// else -// { - itk::Array zeroInitial; - zeroInitial.set_size(transform->GetNumberOfParameters()); - zeroInitial.fill(0.0); - if (zeroInitial.size() >= 1) - { - zeroInitial[0] = 1.0; - } - if (zeroInitial.size() >= 5) - { - zeroInitial[4] = 1.0; - } - if (zeroInitial.size() >= 9) - { - zeroInitial[8] = 1.0; - } - registration->SetInitialTransformParameters( zeroInitial ); - optimizer->SetInitialPosition( zeroInitial ); -// } - if (m_Interpolator == LINEARINTERPOLATOR) - { - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - registration->SetInterpolator(interpolator); - } - else if (m_Interpolator == NEARESTNEIGHBORINTERPOLATOR) - { - typename InterpolatorType2::Pointer interpolator = InterpolatorType2::New(); - registration->SetInterpolator(interpolator); - } - // registering command observer with the optimizer - if (m_Observer.IsNotNull()) - { - m_Observer->AddStepsToDo(20); - optimizer->AddObserver(itk::AnyEvent(), m_Observer); - registration->AddObserver(itk::AnyEvent(), m_Observer); - transform->AddObserver(itk::AnyEvent(), m_Observer); - } - registration->Update(); - if (m_Observer.IsNotNull()) - { - optimizer->RemoveAllObservers(); - registration->RemoveAllObservers(); - transform->RemoveAllObservers(); - m_Observer->SetRemainingProgress(15); - } - if (m_Observer.IsNotNull()) - { - m_Observer->SetRemainingProgress(5); - } - } -} // end namespace diff --git a/Core/Code/Algorithms/mitkImageCast.h b/Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.h similarity index 51% copy from Core/Code/Algorithms/mitkImageCast.h copy to Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.h index 931b9a6194..cd3a7dbbbd 100644 --- a/Core/Code/Algorithms/mitkImageCast.h +++ b/Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.h @@ -1,27 +1,43 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#ifndef MITKIMAGEREGISTRATIONMETHODACCESSFUNCTOR_H +#define MITKIMAGEREGISTRATIONMETHODACCESSFUNCTOR_H -#ifndef MITKIMAGECAST_H_HEADER_INCLUDED -#define MITKIMAGECAST_H_HEADER_INCLUDED +#include -#include "itkDiffusionTensor3D.h" -#include "itkVector.h" +namespace mitk +{ + class ImageRegistrationMethod; -#include + struct ImageRegistrationMethodAccessFunctor + { + typedef ImageRegistrationMethodAccessFunctor Self; + + void operator()(const mitk::Image* img, ImageRegistrationMethod* method) + { + AccessByItk_1(img, AccessItkImage, method) + } + + template < typename TPixel, unsigned int VImageDimension > + void AccessItkImage( itk::Image* itkImage1, + ImageRegistrationMethod* method); + }; +} + +#endif // MITKIMAGEREGISTRATIONMETHODACCESSFUNCTOR_H -#endif // of MITKIMAGECAST_H_HEADER_INCLUDED diff --git a/Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.txx b/Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.txx new file mode 100644 index 0000000000..7351fede91 --- /dev/null +++ b/Modules/RigidRegistration/mitkImageRegistrationMethodAccessFunctor.txx @@ -0,0 +1,157 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +method software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include "mitkImageRegistrationMethodAccessFunctor.h" +#include "mitkImageRegistrationMethod.h" + +#include + +#include + +namespace mitk { + +template +void ImageRegistrationMethodAccessFunctor::AccessItkImage(itk::Image* itkImage1, + ImageRegistrationMethod* method) +{ + //convert mitk masks to itk masks + typedef typename itk::Image FixedImageType; + typedef typename itk::Image MovingImageType; + typedef typename itk::Image< unsigned char, VImageDimension > MaskImageType; + typedef typename itk::ImageMaskSpatialObject< VImageDimension > ImageMaskType; + typename ImageMaskType::Pointer movingImageMask; + if(method->m_MovingMask.IsNotNull()) + { + typename MovingImageType::Pointer movingMask = MovingImageType::New(); + mitk::CastToItkImage(method->m_MovingMask, movingMask); + typename itk::CastImageFilter::Pointer maskImageCaster = itk::CastImageFilter::New(); + maskImageCaster->SetInput(movingMask); + maskImageCaster->UpdateLargestPossibleRegion(); + movingImageMask = ImageMaskType::New(); + movingImageMask->SetImage(maskImageCaster->GetOutput()); + } + typename ImageMaskType::Pointer fixedImageMask; + if(method->m_FixedMask.IsNotNull()) + { + typename FixedImageType::Pointer fixedMask = FixedImageType::New(); + mitk::CastToItkImage(method->m_FixedMask, fixedMask); + typename itk::CastImageFilter::Pointer maskImageCaster = itk::CastImageFilter::New(); + maskImageCaster->SetInput(fixedMask); + maskImageCaster->UpdateLargestPossibleRegion(); + fixedImageMask = ImageMaskType::New(); + fixedImageMask->SetImage(maskImageCaster->GetOutput()); + } + // typedefs + typedef typename itk::Image FixedImageType; + typedef typename itk::Image MovingImageType; + typedef typename itk::LinearInterpolateImageFunction InterpolatorType; + typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType2; + typedef typename itk::ImageRegistrationMethod RegistrationType; + typedef typename itk::Transform< double, VImageDimension, VImageDimension > TransformType; + typedef typename TransformType::Pointer TransformPointer; + typedef typename itk::ImageToImageMetric MetricType; + typedef typename MetricType::Pointer MetricPointer; + typedef typename itk::SingleValuedNonLinearOptimizer OptimizerType; + // the fixed and the moving image + typename FixedImageType::Pointer fixedImage = FixedImageType::New(); + typename MovingImageType::Pointer movingImage = itkImage1; + mitk::CastToItkImage(method->m_ReferenceImage, fixedImage); + // the metric + MetricPointer metric = dynamic_cast(method->m_Metric.GetPointer()); + if(movingImageMask.IsNotNull()) + metric->SetMovingImageMask(movingImageMask); + if(fixedImageMask.IsNotNull()) + metric->SetFixedImageMask(fixedImageMask); + // the transform + TransformPointer transform = dynamic_cast(method->m_Transform.GetPointer()); + // the optimizer + typename OptimizerType::Pointer optimizer = dynamic_cast(method->m_Optimizer.GetPointer()); + // optimizer scales + if (method->m_OptimizerScales.Size() != 0) + { + typename OptimizerType::ScalesType scales( transform->GetNumberOfParameters() ); + for (unsigned int i = 0; i < scales.Size(); i++) + { + scales[i] = method->m_OptimizerScales[i]; + } + optimizer->SetScales( scales ); + } + // the registration method + typename RegistrationType::Pointer registration = RegistrationType::New(); + registration->SetMetric(metric); + registration->SetOptimizer(optimizer); + registration->SetTransform(transform); + registration->SetFixedImage(fixedImage); + registration->SetMovingImage(movingImage); + registration->SetFixedImageRegion(fixedImage->GetBufferedRegion()); +// if(transFac->GetTransformParameters()->GetInitialParameters().size()) +// { +// registration->SetInitialTransformParameters( transFac->GetTransformParameters()->GetInitialParameters() ); +// } +// else +// { + itk::Array zeroInitial; + zeroInitial.set_size(transform->GetNumberOfParameters()); + zeroInitial.fill(0.0); + if (zeroInitial.size() >= 1) + { + zeroInitial[0] = 1.0; + } + if (zeroInitial.size() >= 5) + { + zeroInitial[4] = 1.0; + } + if (zeroInitial.size() >= 9) + { + zeroInitial[8] = 1.0; + } + registration->SetInitialTransformParameters( zeroInitial ); + optimizer->SetInitialPosition( zeroInitial ); +// } + if (method->m_Interpolator == ImageRegistrationMethod::LINEARINTERPOLATOR) + { + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + registration->SetInterpolator(interpolator); + } + else if (method->m_Interpolator == ImageRegistrationMethod::NEARESTNEIGHBORINTERPOLATOR) + { + typename InterpolatorType2::Pointer interpolator = InterpolatorType2::New(); + registration->SetInterpolator(interpolator); + } + // registering command observer with the optimizer + if (method->m_Observer.IsNotNull()) + { + method->m_Observer->AddStepsToDo(20); + optimizer->AddObserver(itk::AnyEvent(), method->m_Observer); + registration->AddObserver(itk::AnyEvent(), method->m_Observer); + transform->AddObserver(itk::AnyEvent(), method->m_Observer); + } + registration->Update(); + if (method->m_Observer.IsNotNull()) + { + optimizer->RemoveAllObservers(); + registration->RemoveAllObservers(); + transform->RemoveAllObservers(); + method->m_Observer->SetRemainingProgress(15); + } + if (method->m_Observer.IsNotNull()) + { + method->m_Observer->SetRemainingProgress(5); + } +} + +} // end namespace diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod-TYPE.cpp b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod-TYPE.cpp index 724c9f0178..703a795012 100644 --- a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod-TYPE.cpp +++ b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod-TYPE.cpp @@ -1,20 +1,25 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Thu, 28 May 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include +#include +#include + +#define InstantiateAccessFunction_PyramidalAccessItkImage(pixelType, dim) \ + template void mitk::PyramidalRegistrationMethodAccessFunctor::AccessItkImage(itk::Image* itkImage1, mitk::PyramidalRegistrationMethod* method); + +InstantiateAccessFunctionForFixedPixelType(PyramidalAccessItkImage, (@TYPE@)) -InstantiateAccessFunctionForFixedPixelType( mitk::PyramidalRegistrationMethod::GenerateData2, @TYPE@); diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.cpp b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.cpp index 234caea4cd..f089e2680d 100644 --- a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.cpp +++ b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.cpp @@ -1,180 +1,180 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Thu, 28 May 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkPyramidalRegistrationMethod.h" - +#include "mitkPyramidalRegistrationMethodAccessFunctor.h" namespace mitk { PyramidalRegistrationMethod::PyramidalRegistrationMethod() : m_Observer(NULL), m_Interpolator(0) { m_OptimizerParameters = OptimizerParameters::New(); m_TransformParameters = TransformParameters::New(); m_MetricParameters = MetricParameters::New(); m_ReferenceImage = Image::New(); m_MovingMask = Image::New(); m_FixedMask = Image::New(); m_Preset = new mitk::RigidRegistrationPreset(); bool succeed = m_Preset->LoadPreset(); if(!succeed) { std::cout << "RigidRegistrationParameters.xml is empty or does not exist. There are no presets to select." << std::endl; return; } m_UseMask = false; m_BlurMovingImage = true; m_BlurFixedImage = true; } PyramidalRegistrationMethod::~PyramidalRegistrationMethod() { } void PyramidalRegistrationMethod::GenerateData() { if (this->GetInput()) { - AccessByItk(this->GetInput(), GenerateData2); + PyramidalRegistrationMethodAccessFunctor()(this->GetInput(), this); } } void PyramidalRegistrationMethod::SetObserver(RigidRegistrationObserver::Pointer observer) { m_Observer = observer; } void PyramidalRegistrationMethod::SetInterpolator(int interpolator) { m_Interpolator = interpolator; } void PyramidalRegistrationMethod::SetReferenceImage(Image::Pointer fixedImage) { m_ReferenceImage = fixedImage; SetNthInput(1, m_ReferenceImage); Modified(); } mitk::TransformParameters::Pointer PyramidalRegistrationMethod::ParseTransformParameters(itk::Array transformValues) { mitk::TransformParameters::Pointer transformParameters = TransformParameters::New(); itk::Array initialParameters; if(transformParameters->GetInitialParameters().size()) { initialParameters = transformParameters->GetInitialParameters(); } transformParameters = mitk::TransformParameters::New(); transformParameters->SetTransform(transformValues[0]); if(transformParameters->GetInitialParameters().size()) { transformParameters->SetInitialParameters(initialParameters); } // Set scales. Every type of transform has a different number of scales!!! // TODO: Finish for al types of transform (or find a better solution) itk::Array scales; if(transformValues[0] == mitk::TransformParameters::AFFINETRANSFORM) scales.SetSize(12); if(transformValues[0] == mitk::TransformParameters::TRANSLATIONTRANSFORM) scales.SetSize(3); for(unsigned int i = 0; i < scales.size(); i++) { scales[i] = transformValues[i+2]; } transformParameters->SetScales(scales); transformParameters->SetTransformInitializerOn(false); // Use Scales if(transformValues[1] == 1) { transformParameters->SetUseOptimizerScales(true); } return transformParameters; } mitk::MetricParameters::Pointer PyramidalRegistrationMethod::ParseMetricParameters(itk::Array metricValues) { mitk::MetricParameters::Pointer metricParameters = mitk::MetricParameters::New(); metricParameters->SetMetric(metricValues[0]); metricParameters->SetComputeGradient(metricValues[1]); // Some things have to be checked for every metric individually if(metricValues[0] == mitk::MetricParameters::MUTUALINFORMATIONHISTOGRAMIMAGETOIMAGEMETRIC) { metricParameters->SetNumberOfHistogramBinsMutualInformationHistogram(metricValues[2]); } if(metricValues[0] == mitk::MetricParameters::MATTESMUTUALINFORMATIONIMAGETOIMAGEMETRIC) { metricParameters->SetSpatialSamplesMattesMutualInformation(metricValues[3]); metricParameters->SetNumberOfHistogramBinsMattesMutualInformation(metricValues[4]); } return metricParameters; } mitk::OptimizerParameters::Pointer PyramidalRegistrationMethod::ParseOptimizerParameters(itk::Array optimizerValues) { mitk::OptimizerParameters::Pointer optimizerParameters = mitk::OptimizerParameters::New(); optimizerParameters->SetOptimizer(optimizerValues[0]); optimizerParameters->SetMaximize(optimizerValues[1]); //should be when used with maximize mutual information for example if(optimizerValues[0] == mitk::OptimizerParameters::GRADIENTDESCENTOPTIMIZER) { optimizerParameters->SetLearningRateGradientDescent(optimizerValues[2]); optimizerParameters->SetNumberOfIterationsGradientDescent(optimizerValues[3]); } if(optimizerValues[0] == mitk::OptimizerParameters::REGULARSTEPGRADIENTDESCENTOPTIMIZER) { cout << "use regularstepgradientdescent" << endl; optimizerParameters->SetGradientMagnitudeToleranceRegularStepGradientDescent(optimizerValues[2]); optimizerParameters->SetMinimumStepLengthRegularStepGradientDescent(optimizerValues[3]); optimizerParameters->SetMaximumStepLengthRegularStepGradientDescent(optimizerValues[4]); optimizerParameters->SetRelaxationFactorRegularStepGradientDescent(optimizerValues[5]); optimizerParameters->SetNumberOfIterationsRegularStepGradientDescent(optimizerValues[6]); } return optimizerParameters; } void PyramidalRegistrationMethod::SetMovingMask(Image::Pointer movingMask) { m_MovingMask = movingMask; SetNthInput(3, m_MovingMask); Modified(); } void PyramidalRegistrationMethod::SetFixedMask(Image::Pointer FixedMask) { m_FixedMask = FixedMask; SetNthInput(4, m_FixedMask); Modified(); } } // end namespace diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.h b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.h index 19404311f5..d2e8911e24 100644 --- a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.h +++ b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.h @@ -1,167 +1,166 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Thu, 28 May 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef MITKPYRAMIDALREGISTRATIONMETHOD_H #define MITKPYRAMIDALREGISTRATIONMETHOD_H #include "itkImageRegistrationMethod.h" #include "MitkRigidRegistrationExports.h" #include "itkSingleValuedNonLinearOptimizer.h" #include "mitkImageToImageFilter.h" #include "mitkImageAccessByItk.h" #include "mitkRigidRegistrationObserver.h" #include "mitkCommon.h" #include "mitkOptimizerParameters.h" #include "mitkTransformParameters.h" #include "mitkMetricParameters.h" #include "itkImageMaskSpatialObject.h" #include "mitkRigidRegistrationPreset.h" namespace mitk { /*! \brief Main class for the rigid registration pipeline. \ingroup RigidRegistration \author Thomas van Bruggen */ class MITK_RIGIDREGISTRATION_EXPORT PyramidalRegistrationMethod : public ImageToImageFilter { public: typedef itk::SingleValuedNonLinearOptimizer OptimizerType; typedef itk::ImageMaskSpatialObject< 3 > MaskType; mitkClassMacro(PyramidalRegistrationMethod, ImageToImageFilter); itkNewMacro(Self); static const int LINEARINTERPOLATOR = 0; static const int NEARESTNEIGHBORINTERPOLATOR = 1; void SetObserver(RigidRegistrationObserver::Pointer observer); void SetInterpolator(int interpolator); virtual void GenerateData(); virtual void SetReferenceImage( Image::Pointer fixedImage); virtual void SetFixedMask( Image::Pointer fixedMask); virtual void SetMovingMask( Image::Pointer movingMask); void SetOptimizerParameters(OptimizerParameters::Pointer optimizerParameters) { m_OptimizerParameters = optimizerParameters; } OptimizerParameters::Pointer GetOptimizerParameters() { return m_OptimizerParameters; } void SetTransformParameters(TransformParameters::Pointer transformParameters) { m_TransformParameters = transformParameters; } TransformParameters::Pointer GetTransformParameters() { return m_TransformParameters; } void SetMetricParameters(MetricParameters::Pointer metricParameters) { m_MetricParameters = metricParameters; } MetricParameters::Pointer GetMetricParameters() { return m_MetricParameters; } void SetPresets(std::vector presets) { m_Presets = presets; } itkSetMacro(FixedSchedule, itk::Array2D); itkSetMacro(MovingSchedule, itk::Array2D); itkSetMacro(MatchHistograms, bool); itkGetMacro(Preset, mitk::RigidRegistrationPreset*); itkSetMacro(BlurFixedImage, bool); itkSetMacro(BlurMovingImage, bool); protected: PyramidalRegistrationMethod(); virtual ~PyramidalRegistrationMethod(); - template < typename TPixel, unsigned int VImageDimension > - void GenerateData2( itk::Image* itkImage1); + friend struct PyramidalRegistrationMethodAccessFunctor; RigidRegistrationObserver::Pointer m_Observer; int m_Interpolator; Image::Pointer m_ReferenceImage; Image::Pointer m_FixedMask; Image::Pointer m_MovingMask; void GenerateOutputInformation(){}; private: OptimizerParameters::Pointer m_OptimizerParameters; TransformParameters::Pointer m_TransformParameters; MetricParameters::Pointer m_MetricParameters; std::vector m_Presets; mitk::RigidRegistrationPreset* m_Preset; // Schedules itk::Array2D m_FixedSchedule; itk::Array2D m_MovingSchedule; bool m_UseMask; bool m_MatchHistograms; bool m_BlurFixedImage; bool m_BlurMovingImage; MaskType::Pointer m_BrainMask; mitk::TransformParameters::Pointer ParseTransformParameters(itk::Array transformValues); mitk::MetricParameters::Pointer ParseMetricParameters(itk::Array metricValues); mitk::OptimizerParameters::Pointer ParseOptimizerParameters(itk::Array optimizerValues); }; } #endif // MITKIMAGEREGISTRATIONMETHOD_H diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.txx b/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.txx deleted file mode 100644 index a075e53833..0000000000 --- a/Modules/RigidRegistration/mitkPyramidalRegistrationMethod.txx +++ /dev/null @@ -1,291 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2007-09-05 13:45:48 +0200 (Mi, 05 Sep 2007) $ -Version: $Revision: 9502 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include "mitkPyramidalRegistrationMethod.h" - -#include "mitkMetricFactory.h" -#include "mitkTransformFactory.h" -#include "mitkOptimizerFactory.h" -#include "mitkTransformParameters.h" -#include "mitkMetricParameters.h" -#include -#include "mitkRigidRegistrationObserver.h" - -#include "itkResampleImageFilter.h" -#include "itkImageRegistrationMethod.h" -#include "itkMultiResolutionImageRegistrationMethod.h" -#include "itkLinearInterpolateImageFunction.h" -#include "itkNearestNeighborInterpolateImageFunction.h" -#include "itkImage.h" - -#include "itkImageToImageMetric.h" -#include "itkSingleValuedNonLinearOptimizer.h" - - -#include "itkDiscreteGaussianImageFilter.h" - -#include "mitkRegistrationInterfaceCommand.h" - -#include -#include -#include - -#include -#include - -namespace mitk { - - - template - void PyramidalRegistrationMethod::GenerateData2(itk::Image* itkImage1) - { - - // TYPEDEFS - typedef itk::Image< TPixel, VImageDimension > ImageType; - - typedef float InternalPixelType; - typedef itk::Image< InternalPixelType, VImageDimension > InternalImageType; - - typedef typename itk::Transform - < double, VImageDimension, VImageDimension > TransformType; - typedef mitk::TransformFactory TransformFactoryType; - typedef itk::LinearInterpolateImageFunction - < InternalImageType, double > InterpolatorType; - typedef mitk::MetricFactory - MetricFactoryType; - typedef itk::RecursiveMultiResolutionPyramidImageFilter< - InternalImageType, - InternalImageType > ImagePyramidType; - typedef itk::DiscreteGaussianImageFilter - GaussianFilterType; - - - - typedef itk::MultiResolutionImageRegistrationMethod< - InternalImageType, - InternalImageType > RegistrationType; - typedef RegistrationInterfaceCommand - CommandType; - - typedef itk::CastImageFilter CastImageFilterType; - - itk::Array initialParameters; - if(m_TransformParameters->GetInitialParameters().size()) - { - initialParameters = m_TransformParameters->GetInitialParameters(); - } - - // LOAD PARAMETERS - itk::Array transformValues = m_Preset->getTransformValues(m_Presets[0]); - itk::Array metricValues = m_Preset->getMetricValues(m_Presets[0]); - itk::Array optimizerValues = m_Preset->getOptimizerValues(m_Presets[0]); - m_TransformParameters = ParseTransformParameters(transformValues); - m_MetricParameters = ParseMetricParameters(metricValues); - m_OptimizerParameters = ParseOptimizerParameters(optimizerValues); - - - // The fixed and the moving image - typename InternalImageType::Pointer fixedImage = InternalImageType::New(); - typename InternalImageType::Pointer movingImage = InternalImageType::New(); - - - - - mitk::CastToItkImage(m_ReferenceImage, fixedImage); - - // Blur the moving image - if(m_BlurMovingImage) - { - typename GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); - gaussianFilter->SetInput(itkImage1); - gaussianFilter->SetVariance(6.0); - gaussianFilter->SetMaximumError( 0.1 ); - //gaussianFilter->SetMaximumKernelWidth ( 3 ); - gaussianFilter->Update(); - movingImage = gaussianFilter->GetOutput(); - } else{ - typename CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); - castImageFilter->SetInput(itkImage1); - castImageFilter->Update(); - movingImage = castImageFilter->GetOutput(); - } - - if(m_MatchHistograms) - { - typedef itk::RescaleIntensityImageFilter FilterType; - typedef itk::HistogramMatchingImageFilter HEFilterType; - - typename FilterType::Pointer inputRescaleFilter = FilterType::New(); - typename FilterType::Pointer referenceRescaleFilter = FilterType::New(); - - referenceRescaleFilter->SetInput(fixedImage); - inputRescaleFilter->SetInput(movingImage); - - const float desiredMinimum = 0.0; - const float desiredMaximum = 255.0; - - referenceRescaleFilter->SetOutputMinimum( desiredMinimum ); - referenceRescaleFilter->SetOutputMaximum( desiredMaximum ); - referenceRescaleFilter->UpdateLargestPossibleRegion(); - inputRescaleFilter->SetOutputMinimum( desiredMinimum ); - inputRescaleFilter->SetOutputMaximum( desiredMaximum ); - inputRescaleFilter->UpdateLargestPossibleRegion(); - - // Histogram match the images - typename HEFilterType::Pointer intensityEqualizeFilter = HEFilterType::New(); - - intensityEqualizeFilter->SetReferenceImage( inputRescaleFilter->GetOutput() ); - intensityEqualizeFilter->SetInput( referenceRescaleFilter->GetOutput() ); - intensityEqualizeFilter->SetNumberOfHistogramLevels( 64 ); - intensityEqualizeFilter->SetNumberOfMatchPoints( 12 ); - intensityEqualizeFilter->ThresholdAtMeanIntensityOn(); - intensityEqualizeFilter->Update(); - - //fixedImage = referenceRescaleFilter->GetOutput(); - //movingImage = IntensityEqualizeFilter->GetOutput(); - - fixedImage = intensityEqualizeFilter->GetOutput(); - movingImage = inputRescaleFilter->GetOutput(); - - } - - - - typename TransformFactoryType::Pointer transFac = TransformFactoryType::New(); - transFac->SetTransformParameters(m_TransformParameters); - transFac->SetFixedImage(fixedImage); - transFac->SetMovingImage(movingImage); - typename TransformType::Pointer transform = transFac->GetTransform(); - - - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - typename MetricFactoryType::Pointer metFac = MetricFactoryType::New(); - metFac->SetMetricParameters(m_MetricParameters); - - - typename OptimizerFactory::Pointer optFac = OptimizerFactory::New(); - optFac->SetOptimizerParameters(m_OptimizerParameters); - optFac->SetNumberOfTransformParameters(transform->GetNumberOfParameters()); - typename OptimizerType::Pointer optimizer = optFac->GetOptimizer(); - - // optimizer scales - if (m_TransformParameters->GetUseOptimizerScales()) - { - itk::Array optimizerScales = m_TransformParameters->GetScales(); - typename OptimizerType::ScalesType scales( transform->GetNumberOfParameters() ); - for (unsigned int i = 0; i < scales.Size(); i++) - { - scales[i] = optimizerScales[i]; - } - optimizer->SetScales( scales ); - } - - typename ImagePyramidType::Pointer fixedImagePyramid = ImagePyramidType::New(); - typename ImagePyramidType::Pointer movingImagePyramid = ImagePyramidType::New(); - - if(m_FixedSchedule.size() > 0 && m_MovingSchedule.size() > 0) - { - fixedImagePyramid->SetSchedule(m_FixedSchedule); - movingImagePyramid->SetSchedule(m_MovingSchedule); - // Otherwise just use the default schedule - } - - - - - typename RegistrationType::Pointer registration = RegistrationType::New(); - registration->SetOptimizer( optimizer ); - registration->SetTransform( transform ); - registration->SetInterpolator( interpolator ); - registration->SetMetric( metFac->GetMetric() ); - registration->SetFixedImagePyramid( fixedImagePyramid ); - registration->SetMovingImagePyramid( movingImagePyramid ); - registration->SetFixedImage( fixedImage ); - registration->SetMovingImage( movingImage ); - registration->SetFixedImageRegion( fixedImage->GetBufferedRegion() ); - - if(transFac->GetTransformParameters()->GetInitialParameters().size()) - { - registration->SetInitialTransformParameters( transFac->GetTransformParameters()->GetInitialParameters() ); - } - else - { - itk::Array zeroInitial; - zeroInitial.set_size(transform->GetNumberOfParameters()); - zeroInitial.fill(0.0); - zeroInitial[0] = 1.0; - zeroInitial[4] = 1.0; - zeroInitial[8] = 1.0; - registration->SetInitialTransformParameters( zeroInitial ); - } - - - if(m_UseMask) - { - itk::ImageMaskSpatialObject< VImageDimension>* mask = - dynamic_cast< itk::ImageMaskSpatialObject< VImageDimension>* > ( m_BrainMask.GetPointer() ); - registration->GetMetric()->SetFixedImageMask(mask); - } - - // registering command observer with the optimizer - if (m_Observer.IsNotNull()) - { - m_Observer->AddStepsToDo(20); - optimizer->AddObserver(itk::AnyEvent(), m_Observer); - registration->AddObserver(itk::AnyEvent(), m_Observer); - transform->AddObserver(itk::AnyEvent(), m_Observer); - } - - typename CommandType::Pointer command = CommandType::New(); - command->observer = m_Observer; - command->m_Presets = m_Presets; - command->m_UseMask = m_UseMask; - command->m_BrainMask = m_BrainMask; - - registration->AddObserver( itk::IterationEvent(), command ); - registration->SetSchedules(m_FixedSchedule, m_MovingSchedule); - - - // Start the registration process - try - { - registration->StartRegistration(); - } - catch( itk::ExceptionObject & err ) - { - std::cout << "ExceptionObject caught !" << std::endl; - std::cout << err << std::endl; - } - if (m_Observer.IsNotNull()) - { - optimizer->RemoveAllObservers(); - registration->RemoveAllObservers(); - transform->RemoveAllObservers(); - m_Observer->SetRemainingProgress(15); - } - if (m_Observer.IsNotNull()) - { - m_Observer->SetRemainingProgress(5); - } - - } - - - -} // end namespace diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.h b/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.h new file mode 100644 index 0000000000..9c4e41d0c9 --- /dev/null +++ b/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.h @@ -0,0 +1,43 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#ifndef MITKPYRAMIDALREGISTRATIONMETHODACCESSFUNCTOR_H +#define MITKPYRAMIDALREGISTRATIONMETHODACCESSFUNCTOR_H + +#include + +namespace mitk +{ + class PyramidalRegistrationMethod; + + struct PyramidalRegistrationMethodAccessFunctor + { + typedef PyramidalRegistrationMethodAccessFunctor Self; + + void operator()(const mitk::Image* img, PyramidalRegistrationMethod* method) + { + AccessByItk_1(img, AccessItkImage, method) + } + + template < typename TPixel, unsigned int VImageDimension > + void AccessItkImage( itk::Image* itkImage1, + PyramidalRegistrationMethod* method); + }; +} + +#endif // MITKPYRAMIDALREGISTRATIONMETHODACCESSFUNCTOR_H + diff --git a/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.txx b/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.txx new file mode 100644 index 0000000000..c5668e93be --- /dev/null +++ b/Modules/RigidRegistration/mitkPyramidalRegistrationMethodAccessFunctor.txx @@ -0,0 +1,248 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +method software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include "mitkPyramidalRegistrationMethodAccessFunctor.h" +#include "mitkPyramidalRegistrationMethod.h" + +#include + +#include +#include +#include +#include + +#include "mitkMetricFactory.h" +#include "mitkTransformFactory.h" +#include "mitkOptimizerFactory.h" +#include "mitkRegistrationInterfaceCommand.h" + +namespace mitk { + +template +void PyramidalRegistrationMethodAccessFunctor::AccessItkImage(itk::Image* itkImage1, + PyramidalRegistrationMethod* method) +{ + + // TYPEDEFS + typedef itk::Image< TPixel, VImageDimension > ImageType; + + typedef float InternalPixelType; + typedef itk::Image InternalImageType; + + typedef typename itk::Transform TransformType; + typedef mitk::TransformFactory TransformFactoryType; + typedef itk::LinearInterpolateImageFunction InterpolatorType; + typedef mitk::MetricFactory MetricFactoryType; + typedef itk::RecursiveMultiResolutionPyramidImageFilter ImagePyramidType; + typedef itk::DiscreteGaussianImageFilter GaussianFilterType; + + typedef itk::MultiResolutionImageRegistrationMethod RegistrationType; + typedef RegistrationInterfaceCommand CommandType; + + typedef itk::CastImageFilter CastImageFilterType; + + itk::Array initialParameters; + if(method->m_TransformParameters->GetInitialParameters().size()) + { + initialParameters = method->m_TransformParameters->GetInitialParameters(); + } + + // LOAD PARAMETERS + itk::Array transformValues = method->m_Preset->getTransformValues(method->m_Presets[0]); + itk::Array metricValues = method->m_Preset->getMetricValues(method->m_Presets[0]); + itk::Array optimizerValues = method->m_Preset->getOptimizerValues(method->m_Presets[0]); + method->m_TransformParameters = method->ParseTransformParameters(transformValues); + method->m_MetricParameters = method->ParseMetricParameters(metricValues); + method->m_OptimizerParameters = method->ParseOptimizerParameters(optimizerValues); + + + // The fixed and the moving image + typename InternalImageType::Pointer fixedImage = InternalImageType::New(); + typename InternalImageType::Pointer movingImage = InternalImageType::New(); + + mitk::CastToItkImage(method->m_ReferenceImage, fixedImage); + + // Blur the moving image + if(method->m_BlurMovingImage) + { + typename GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); + gaussianFilter->SetInput(itkImage1); + gaussianFilter->SetVariance(6.0); + gaussianFilter->SetMaximumError( 0.1 ); + //gaussianFilter->SetMaximumKernelWidth ( 3 ); + gaussianFilter->Update(); + movingImage = gaussianFilter->GetOutput(); + } + else + { + typename CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); + castImageFilter->SetInput(itkImage1); + castImageFilter->Update(); + movingImage = castImageFilter->GetOutput(); + } + + if(method->m_MatchHistograms) + { + typedef itk::RescaleIntensityImageFilter FilterType; + typedef itk::HistogramMatchingImageFilter HEFilterType; + + typename FilterType::Pointer inputRescaleFilter = FilterType::New(); + typename FilterType::Pointer referenceRescaleFilter = FilterType::New(); + + referenceRescaleFilter->SetInput(fixedImage); + inputRescaleFilter->SetInput(movingImage); + + const float desiredMinimum = 0.0; + const float desiredMaximum = 255.0; + + referenceRescaleFilter->SetOutputMinimum( desiredMinimum ); + referenceRescaleFilter->SetOutputMaximum( desiredMaximum ); + referenceRescaleFilter->UpdateLargestPossibleRegion(); + inputRescaleFilter->SetOutputMinimum( desiredMinimum ); + inputRescaleFilter->SetOutputMaximum( desiredMaximum ); + inputRescaleFilter->UpdateLargestPossibleRegion(); + + // Histogram match the images + typename HEFilterType::Pointer intensityEqualizeFilter = HEFilterType::New(); + + intensityEqualizeFilter->SetReferenceImage( inputRescaleFilter->GetOutput() ); + intensityEqualizeFilter->SetInput( referenceRescaleFilter->GetOutput() ); + intensityEqualizeFilter->SetNumberOfHistogramLevels( 64 ); + intensityEqualizeFilter->SetNumberOfMatchPoints( 12 ); + intensityEqualizeFilter->ThresholdAtMeanIntensityOn(); + intensityEqualizeFilter->Update(); + + //fixedImage = referenceRescaleFilter->GetOutput(); + //movingImage = IntensityEqualizeFilter->GetOutput(); + + fixedImage = intensityEqualizeFilter->GetOutput(); + movingImage = inputRescaleFilter->GetOutput(); + } + + typename TransformFactoryType::Pointer transFac = TransformFactoryType::New(); + transFac->SetTransformParameters(method->m_TransformParameters); + transFac->SetFixedImage(fixedImage); + transFac->SetMovingImage(movingImage); + typename TransformType::Pointer transform = transFac->GetTransform(); + + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + typename MetricFactoryType::Pointer metFac = MetricFactoryType::New(); + metFac->SetMetricParameters(method->m_MetricParameters); + + typename OptimizerFactory::Pointer optFac = OptimizerFactory::New(); + optFac->SetOptimizerParameters(method->m_OptimizerParameters); + optFac->SetNumberOfTransformParameters(transform->GetNumberOfParameters()); + typename PyramidalRegistrationMethod::OptimizerType::Pointer optimizer = optFac->GetOptimizer(); + + // optimizer scales + if (method->m_TransformParameters->GetUseOptimizerScales()) + { + itk::Array optimizerScales = method->m_TransformParameters->GetScales(); + typename PyramidalRegistrationMethod::OptimizerType::ScalesType scales( transform->GetNumberOfParameters() ); + for (unsigned int i = 0; i < scales.Size(); i++) + { + scales[i] = optimizerScales[i]; + } + optimizer->SetScales( scales ); + } + + typename ImagePyramidType::Pointer fixedImagePyramid = ImagePyramidType::New(); + typename ImagePyramidType::Pointer movingImagePyramid = ImagePyramidType::New(); + + if(method->m_FixedSchedule.size() > 0 && method->m_MovingSchedule.size() > 0) + { + fixedImagePyramid->SetSchedule(method->m_FixedSchedule); + movingImagePyramid->SetSchedule(method->m_MovingSchedule); + // Otherwise just use the default schedule + } + + typename RegistrationType::Pointer registration = RegistrationType::New(); + registration->SetOptimizer( optimizer ); + registration->SetTransform( transform ); + registration->SetInterpolator( interpolator ); + registration->SetMetric( metFac->GetMetric() ); + registration->SetFixedImagePyramid( fixedImagePyramid ); + registration->SetMovingImagePyramid( movingImagePyramid ); + registration->SetFixedImage( fixedImage ); + registration->SetMovingImage( movingImage ); + registration->SetFixedImageRegion( fixedImage->GetBufferedRegion() ); + + if(transFac->GetTransformParameters()->GetInitialParameters().size()) + { + registration->SetInitialTransformParameters( transFac->GetTransformParameters()->GetInitialParameters() ); + } + else + { + itk::Array zeroInitial; + zeroInitial.set_size(transform->GetNumberOfParameters()); + zeroInitial.fill(0.0); + zeroInitial[0] = 1.0; + zeroInitial[4] = 1.0; + zeroInitial[8] = 1.0; + registration->SetInitialTransformParameters( zeroInitial ); + } + + if(method->m_UseMask) + { + itk::ImageMaskSpatialObject< VImageDimension>* mask = + dynamic_cast< itk::ImageMaskSpatialObject< VImageDimension>* > ( method->m_BrainMask.GetPointer() ); + registration->GetMetric()->SetFixedImageMask(mask); + } + + // registering command observer with the optimizer + if (method->m_Observer.IsNotNull()) + { + method->m_Observer->AddStepsToDo(20); + optimizer->AddObserver(itk::AnyEvent(), method->m_Observer); + registration->AddObserver(itk::AnyEvent(), method->m_Observer); + transform->AddObserver(itk::AnyEvent(), method->m_Observer); + } + + typename CommandType::Pointer command = CommandType::New(); + command->observer = method->m_Observer; + command->m_Presets = method->m_Presets; + command->m_UseMask = method->m_UseMask; + command->m_BrainMask = method->m_BrainMask; + + registration->AddObserver( itk::IterationEvent(), command ); + registration->SetSchedules(method->m_FixedSchedule, method->m_MovingSchedule); + + // Start the registration process + try + { + registration->StartRegistration(); + } + catch( itk::ExceptionObject & err ) + { + std::cout << "ExceptionObject caught !" << std::endl; + std::cout << err << std::endl; + } + if (method->m_Observer.IsNotNull()) + { + optimizer->RemoveAllObservers(); + registration->RemoveAllObservers(); + transform->RemoveAllObservers(); + method->m_Observer->SetRemainingProgress(15); + } + if (method->m_Observer.IsNotNull()) + { + method->m_Observer->SetRemainingProgress(5); + } + +} + +} // end namespace diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkAffineTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkAffineTransformView.cpp index 1a482db407..e12d9ef343 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkAffineTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkAffineTransformView.cpp @@ -1,258 +1,259 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkAffineTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkAffineTransformView::QmitkAffineTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkAffineTransformView::~QmitkAffineTransformView() { } mitk::TransformParameters::TransformType QmitkAffineTransformView::GetTransformType() { return mitk::TransformParameters::AFFINETRANSFORM; } itk::Object::Pointer QmitkAffineTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkAffineTransformView::GetTransform2(itk::Image* /*itkImage1*/) { typedef typename itk::Image< TPixelType, VImageDimension > FixedImageType; typedef typename itk::Image< TPixelType, VImageDimension > MovingImageType; typename FixedImageType::Pointer fixedImage; mitk::CastToItkImage(m_FixedImage, fixedImage); typename MovingImageType::Pointer movingImage; mitk::CastToItkImage(m_MovingImage, movingImage); typename itk::AffineTransform< double, VImageDimension>::Pointer transformPointer = itk::AffineTransform< double, VImageDimension>::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerAffine->isChecked()) { typedef typename itk::AffineTransform< double, VImageDimension > AffineTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage ); transformInitializer->SetMovingImage( movingImage ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsAffine->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } itk::Array QmitkAffineTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(15); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesAffine->isChecked(); transformValues[1] = m_Controls.m_ScalesAffineTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesAffineTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesAffineTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesAffineTransformScale4->text().toDouble(); transformValues[5] = m_Controls.m_ScalesAffineTransformScale5->text().toDouble(); transformValues[6] = m_Controls.m_ScalesAffineTransformScale6->text().toDouble(); transformValues[7] = m_Controls.m_ScalesAffineTransformScale7->text().toDouble(); transformValues[8] = m_Controls.m_ScalesAffineTransformScale8->text().toDouble(); transformValues[9] = m_Controls.m_ScalesAffineTransformScale9->text().toDouble(); transformValues[10] = m_Controls.m_ScalesAffineTransformScaleTranslationX->text().toDouble(); transformValues[11] = m_Controls.m_ScalesAffineTransformScaleTranslationY->text().toDouble(); transformValues[12] = m_Controls.m_ScalesAffineTransformScaleTranslationZ->text().toDouble(); transformValues[13] = m_Controls.m_CenterForInitializerAffine->isChecked(); transformValues[14] = m_Controls.m_MomentsAffine->isChecked(); return transformValues; } void QmitkAffineTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesAffine->setChecked(transformValues[0]); m_Controls.m_ScalesAffineTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesAffineTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesAffineTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesAffineTransformScale4->setText(QString::number(transformValues[4])); m_Controls.m_ScalesAffineTransformScale5->setText(QString::number(transformValues[5])); m_Controls.m_ScalesAffineTransformScale6->setText(QString::number(transformValues[6])); m_Controls.m_ScalesAffineTransformScale7->setText(QString::number(transformValues[7])); m_Controls.m_ScalesAffineTransformScale8->setText(QString::number(transformValues[8])); m_Controls.m_ScalesAffineTransformScale9->setText(QString::number(transformValues[9])); m_Controls.m_ScalesAffineTransformScaleTranslationX->setText(QString::number(transformValues[10])); m_Controls.m_ScalesAffineTransformScaleTranslationY->setText(QString::number(transformValues[11])); m_Controls.m_ScalesAffineTransformScaleTranslationZ->setText(QString::number(transformValues[12])); m_Controls.m_CenterForInitializerAffine->setChecked(transformValues[13]); m_Controls.m_MomentsAffine->setChecked(transformValues[14]); m_Controls.m_GeometryAffine->setChecked(!transformValues[14]); } QString QmitkAffineTransformView::GetName() { return "Affine"; } void QmitkAffineTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesAffineTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale4->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale5->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale6->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale7->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale8->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScale9->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesAffineTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); } itk::Array QmitkAffineTransformView::GetScales() { itk::Array scales; scales.SetSize(12); scales.Fill(1.0); scales[0] = m_Controls.m_ScalesAffineTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesAffineTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesAffineTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesAffineTransformScale4->text().toDouble(); scales[4] = m_Controls.m_ScalesAffineTransformScale5->text().toDouble(); scales[5] = m_Controls.m_ScalesAffineTransformScale6->text().toDouble(); scales[6] = m_Controls.m_ScalesAffineTransformScale7->text().toDouble(); scales[7] = m_Controls.m_ScalesAffineTransformScale8->text().toDouble(); scales[8] = m_Controls.m_ScalesAffineTransformScale9->text().toDouble(); scales[9] = m_Controls.m_ScalesAffineTransformScaleTranslationX->text().toDouble(); scales[10] = m_Controls.m_ScalesAffineTransformScaleTranslationY->text().toDouble(); scales[11] = m_Controls.m_ScalesAffineTransformScaleTranslationZ->text().toDouble(); return scales; } vtkTransform* QmitkAffineTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { // - the 9 rotation-coefficients are copied // directly to the top left part of the matrix int m = 0; for (unsigned int i = 0; i < m_FixedImage->GetDimension(); i++) { for (unsigned int j = 0; j < m_FixedImage->GetDimension(); j++) { vtkmatrix->SetElement(i, j, transformParams[m]); m++; } } // - the 3 translation-coefficients are corrected to take // into account the center of the transformation float center[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; std::cout<< "rotation center: " << center[0] << " " << center[1] << " " << center [2] << std::endl; float translation[4]; vtkmatrix->MultiplyPoint(center, translation); if (m_FixedImage->GetDimension() == 2) { vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[4]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[5]); } else if (m_FixedImage->GetDimension() == 3) { vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[9]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[10]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[11]); } // set the transform matrix to init the transform vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkAffineTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) { m_Controls.m_ScalesAffineTransformScale7->hide(); m_Controls.m_ScalesAffineTransformScale8->hide(); m_Controls.m_ScalesAffineTransformScale9->hide(); m_Controls.m_ScalesAffineTransformScaleTranslationX->hide(); m_Controls.m_ScalesAffineTransformScaleTranslationY->hide(); m_Controls.m_ScalesAffineTransformScaleTranslationZ->hide(); m_Controls.textLabel2_7->setText("Translation Scale X:"); m_Controls.textLabel3_6->setText("Translation Scale Y:"); m_Controls.textLabel4_4->hide(); m_Controls.textLabel5_4->hide(); m_Controls.textLabel6_4->hide(); m_Controls.textLabel11_3->hide(); m_Controls.textLabel12_3->hide(); m_Controls.textLabel13_2->hide(); return 6; } else { m_Controls.m_ScalesAffineTransformScale7->show(); m_Controls.m_ScalesAffineTransformScale8->show(); m_Controls.m_ScalesAffineTransformScale9->show(); m_Controls.m_ScalesAffineTransformScaleTranslationX->show(); m_Controls.m_ScalesAffineTransformScaleTranslationY->show(); m_Controls.m_ScalesAffineTransformScaleTranslationZ->show(); m_Controls.textLabel2_7->setText("Scale 5:"); m_Controls.textLabel3_6->setText("Scale 6:"); m_Controls.textLabel4_4->show(); m_Controls.textLabel5_4->show(); m_Controls.textLabel6_4->show(); m_Controls.textLabel11_3->show(); m_Controls.textLabel12_3->show(); m_Controls.textLabel13_2->show(); return 12; } } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredRigid2DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredRigid2DTransformView.cpp index 97d6a1e2e0..df287b188f 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredRigid2DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredRigid2DTransformView.cpp @@ -1,178 +1,179 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkCenteredRigid2DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkCenteredRigid2DTransformView::QmitkCenteredRigid2DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkCenteredRigid2DTransformView::~QmitkCenteredRigid2DTransformView() { } mitk::TransformParameters::TransformType QmitkCenteredRigid2DTransformView::GetTransformType() { return mitk::TransformParameters::CENTEREDRIGID2DTRANSFORM; } itk::Object::Pointer QmitkCenteredRigid2DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkCenteredRigid2DTransformView::GetTransform2(itk::Image* /* itkImage1 */) { if (VImageDimension == 2) { typedef typename itk::Image< TPixelType, 2 > FixedImage2DType; typedef typename itk::Image< TPixelType, 2 > MovingImage2DType; typename FixedImage2DType::Pointer fixedImage2D; mitk::CastToItkImage(m_FixedImage, fixedImage2D); typename MovingImage2DType::Pointer movingImage2D; mitk::CastToItkImage(m_MovingImage, movingImage2D); typename itk::CenteredRigid2DTransform< double >::Pointer transformPointer = itk::CenteredRigid2DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerCenteredRigid2D->isChecked()) { typedef typename itk::CenteredRigid2DTransform< double > CenteredRigid2DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage2D ); transformInitializer->SetMovingImage( movingImage2D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsCenteredRigid2D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } transformPointer->SetAngle( m_Controls.m_AngleCenteredRigid2D->text().toFloat() ); m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkCenteredRigid2DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(9); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesCenteredRigid2D->isChecked(); transformValues[1] = m_Controls.m_RotationScaleCenteredRigid2D->text().toDouble(); transformValues[2] = m_Controls.m_CenterXScaleCenteredRigid2D->text().toDouble(); transformValues[3] = m_Controls.m_CenterYScaleCenteredRigid2D->text().toDouble(); transformValues[4] = m_Controls.m_TranslationXScaleCenteredRigid2D->text().toDouble(); transformValues[5] = m_Controls.m_TranslationYScaleCenteredRigid2D->text().toDouble(); transformValues[6] = m_Controls.m_AngleCenteredRigid2D->text().toFloat(); transformValues[7] = m_Controls.m_CenterForInitializerCenteredRigid2D->isChecked(); transformValues[8] = m_Controls.m_MomentsCenteredRigid2D->isChecked(); return transformValues; } void QmitkCenteredRigid2DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesCenteredRigid2D->setChecked(transformValues[0]); m_Controls.m_RotationScaleCenteredRigid2D->setText(QString::number(transformValues[1])); m_Controls.m_CenterXScaleCenteredRigid2D->setText(QString::number(transformValues[2])); m_Controls.m_CenterYScaleCenteredRigid2D->setText(QString::number(transformValues[3])); m_Controls.m_TranslationXScaleCenteredRigid2D->setText(QString::number(transformValues[4])); m_Controls.m_TranslationYScaleCenteredRigid2D->setText(QString::number(transformValues[5])); m_Controls.m_AngleCenteredRigid2D->setText(QString::number(transformValues[6])); m_Controls.m_CenterForInitializerCenteredRigid2D->setChecked(transformValues[7]); m_Controls.m_MomentsCenteredRigid2D->setChecked(transformValues[8]); m_Controls.m_GeometryCenteredRigid2D->setChecked(!transformValues[8]); } QString QmitkCenteredRigid2DTransformView::GetName() { return "CenteredRigid2D"; } void QmitkCenteredRigid2DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_AngleCenteredRigid2D->setValidator(validatorLineEditInputFloat); m_Controls.m_RotationScaleCenteredRigid2D->setValidator(validatorLineEditInputFloat); m_Controls.m_CenterXScaleCenteredRigid2D->setValidator(validatorLineEditInputFloat); m_Controls.m_CenterYScaleCenteredRigid2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationXScaleCenteredRigid2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationYScaleCenteredRigid2D->setValidator(validatorLineEditInputFloat); } itk::Array QmitkCenteredRigid2DTransformView::GetScales() { itk::Array scales; scales.SetSize(5); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesCenteredRigid2D->isChecked()) { scales[0] = m_Controls.m_RotationScaleCenteredRigid2D->text().toDouble(); scales[1] = m_Controls.m_CenterXScaleCenteredRigid2D->text().toDouble(); scales[2] = m_Controls.m_CenterYScaleCenteredRigid2D->text().toDouble(); scales[3] = m_Controls.m_TranslationXScaleCenteredRigid2D->text().toDouble(); scales[4] = m_Controls.m_TranslationYScaleCenteredRigid2D->text().toDouble(); } return scales; } vtkTransform* QmitkCenteredRigid2DTransformView::Transform(vtkMatrix4x4* /* vtkmatrix */, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { mitk::ScalarType angle = transformParams[0] * 45.0 / atan(1.0);; vtktransform->PostMultiply(); vtktransform->Translate(-transformParams[1], -transformParams[2], 0); vtktransform->RotateZ(angle); vtktransform->Translate(transformParams[1], transformParams[2], 0); vtktransform->Translate(transformParams[3], transformParams[4], 0); vtktransform->PreMultiply(); } return vtktransform; } int QmitkCenteredRigid2DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 5; else return 0; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredSimilarity2DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredSimilarity2DTransformView.cpp index a4e979504e..04a5726d18 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredSimilarity2DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkCenteredSimilarity2DTransformView.cpp @@ -1,186 +1,187 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkCenteredSimilarity2DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkCenteredSimilarity2DTransformView::QmitkCenteredSimilarity2DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkCenteredSimilarity2DTransformView::~QmitkCenteredSimilarity2DTransformView() { } mitk::TransformParameters::TransformType QmitkCenteredSimilarity2DTransformView::GetTransformType() { return mitk::TransformParameters::CENTEREDSIMILARITY2DTRANSFORM; } itk::Object::Pointer QmitkCenteredSimilarity2DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkCenteredSimilarity2DTransformView::GetTransform2(itk::Image* /* itkImage1 */) { if (VImageDimension == 2) { typedef typename itk::Image< TPixelType, 2 > FixedImage2DType; typedef typename itk::Image< TPixelType, 2 > MovingImage2DType; typename FixedImage2DType::Pointer fixedImage2D; mitk::CastToItkImage(m_FixedImage, fixedImage2D); typename MovingImage2DType::Pointer movingImage2D; mitk::CastToItkImage(m_MovingImage, movingImage2D); typename itk::CenteredSimilarity2DTransform< double >::Pointer transformPointer = itk::CenteredSimilarity2DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerCenteredSimilarity2D->isChecked()) { typedef typename itk::CenteredSimilarity2DTransform< double > CenteredSimilarity2DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage2D ); transformInitializer->SetMovingImage( movingImage2D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsCenteredSimilarity2D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } transformPointer->SetScale( m_Controls.m_InitialScaleCenteredSimilarity2D->text().toFloat() ); transformPointer->SetAngle( m_Controls.m_AngleCenteredSimilarity2D->text().toFloat() ); m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkCenteredSimilarity2DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(11); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesCenteredSimilarity2D->isChecked(); transformValues[1] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale4->text().toDouble(); transformValues[5] = m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationX->text().toDouble(); transformValues[6] = m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationY->text().toDouble(); transformValues[7] = m_Controls.m_InitialScaleCenteredSimilarity2D->text().toFloat(); transformValues[8] = m_Controls.m_AngleCenteredSimilarity2D->text().toFloat(); transformValues[9] = m_Controls.m_CenterForInitializerCenteredSimilarity2D->isChecked(); transformValues[10] = m_Controls.m_MomentsCenteredSimilarity2D->isChecked(); return transformValues; } void QmitkCenteredSimilarity2DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesCenteredSimilarity2D->setChecked(transformValues[0]); m_Controls.m_ScalesCenteredSimilarity2DTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesCenteredSimilarity2DTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesCenteredSimilarity2DTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesCenteredSimilarity2DTransformScale4->setText(QString::number(transformValues[4])); m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationX->setText(QString::number(transformValues[5])); m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationY->setText(QString::number(transformValues[6])); m_Controls.m_InitialScaleCenteredSimilarity2D->setText(QString::number(transformValues[7])); m_Controls.m_AngleCenteredSimilarity2D->setText(QString::number(transformValues[8])); m_Controls.m_CenterForInitializerCenteredSimilarity2D->setChecked(transformValues[9]); m_Controls.m_MomentsCenteredSimilarity2D->setChecked(transformValues[10]); m_Controls.m_GeometryCenteredSimilarity2D->setChecked(!transformValues[10]); } QString QmitkCenteredSimilarity2DTransformView::GetName() { return "CenteredSimilarity2D"; } void QmitkCenteredSimilarity2DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesCenteredSimilarity2DTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesCenteredSimilarity2DTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesCenteredSimilarity2DTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesCenteredSimilarity2DTransformScale4->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); } itk::Array QmitkCenteredSimilarity2DTransformView::GetScales() { itk::Array scales; scales.SetSize(6); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesCenteredSimilarity2D->isChecked()) { scales[0] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesCenteredSimilarity2DTransformScale4->text().toDouble(); scales[4] = m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationX->text().toDouble(); scales[5] = m_Controls.m_ScalesCenteredSimilarity2DTransformScaleTranslationY->text().toDouble(); } return scales; } vtkTransform* QmitkCenteredSimilarity2DTransformView::Transform(vtkMatrix4x4* /*vtkmatrix*/, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { mitk::ScalarType angle = transformParams[1] * 45.0 / atan(1.0); vtktransform->PostMultiply(); vtktransform->Translate(-transformParams[2], -transformParams[3], 0); vtktransform->Scale(transformParams[0], transformParams[0], 1); vtktransform->RotateZ(angle); vtktransform->Translate(transformParams[2], transformParams[3], 0); vtktransform->Translate(transformParams[4], transformParams[5], 0); vtktransform->PreMultiply(); } return vtktransform; } int QmitkCenteredSimilarity2DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 6; else return 0; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkEuler2DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkEuler2DTransformView.cpp index 9a5a820e13..2567d428f0 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkEuler2DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkEuler2DTransformView.cpp @@ -1,162 +1,163 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkEuler2DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkEuler2DTransformView::QmitkEuler2DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkEuler2DTransformView::~QmitkEuler2DTransformView() { } mitk::TransformParameters::TransformType QmitkEuler2DTransformView::GetTransformType() { return mitk::TransformParameters::EULER2DTRANSFORM; } itk::Object::Pointer QmitkEuler2DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkEuler2DTransformView::GetTransform2(itk::Image* /* itkImage1 */) { if (VImageDimension == 2) { typedef typename itk::Image< TPixelType, 2 > FixedImage2DType; typedef typename itk::Image< TPixelType, 2 > MovingImage2DType; typename FixedImage2DType::Pointer fixedImage2D; mitk::CastToItkImage(m_FixedImage, fixedImage2D); typename MovingImage2DType::Pointer movingImage2D; mitk::CastToItkImage(m_MovingImage, movingImage2D); typename itk::Euler2DTransform< double >::Pointer transformPointer = itk::Euler2DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerEuler2D->isChecked()) { typedef typename itk::Euler2DTransform< double > Euler2DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage2D ); transformInitializer->SetMovingImage( movingImage2D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsEuler2D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkEuler2DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(6); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesEuler2D->isChecked(); transformValues[1] = m_Controls.m_RotationScaleEuler2D->text().toDouble(); transformValues[2] = m_Controls.m_TranslationXScaleEuler2D->text().toDouble(); transformValues[3] = m_Controls.m_TranslationYScaleEuler2D->text().toDouble(); transformValues[4] = m_Controls.m_CenterForInitializerEuler2D->isChecked(); transformValues[5] = m_Controls.m_MomentsEuler2D->isChecked(); return transformValues; } void QmitkEuler2DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesEuler2D->setChecked(transformValues[0]); m_Controls.m_RotationScaleEuler2D->setText(QString::number(transformValues[1])); m_Controls.m_TranslationXScaleEuler2D->setText(QString::number(transformValues[2])); m_Controls.m_TranslationYScaleEuler2D->setText(QString::number(transformValues[3])); m_Controls.m_CenterForInitializerEuler2D->setChecked(transformValues[4]); m_Controls.m_MomentsEuler2D->setChecked(transformValues[5]); m_Controls.m_GeometryEuler2D->setChecked(!transformValues[5]); } QString QmitkEuler2DTransformView::GetName() { return "Euler2D"; } void QmitkEuler2DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_RotationScaleEuler2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationXScaleEuler2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationYScaleEuler2D->setValidator(validatorLineEditInputFloat); } itk::Array QmitkEuler2DTransformView::GetScales() { itk::Array scales; scales.SetSize(3); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesEuler2D->isChecked()) { scales[0] = m_Controls.m_RotationScaleEuler2D->text().toDouble(); scales[1] = m_Controls.m_TranslationXScaleEuler2D->text().toDouble(); scales[2] = m_Controls.m_TranslationYScaleEuler2D->text().toDouble(); } return scales; } vtkTransform* QmitkEuler2DTransformView::Transform(vtkMatrix4x4* /*vtkmatrix*/, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { mitk::ScalarType angle = transformParams[0] * 45.0 / atan(1.0); vtktransform->PostMultiply(); vtktransform->RotateZ(angle); vtktransform->Translate(transformParams[1], transformParams[2], 0); vtktransform->PreMultiply(); } return vtktransform; } int QmitkEuler2DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 3; else return 0; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkFixedCenterOfRotationAffineTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkFixedCenterOfRotationAffineTransformView.cpp index 2104c292e4..4fb3812c22 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkFixedCenterOfRotationAffineTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkFixedCenterOfRotationAffineTransformView.cpp @@ -1,253 +1,254 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkFixedCenterOfRotationAffineTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkFixedCenterOfRotationAffineTransformView::QmitkFixedCenterOfRotationAffineTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkFixedCenterOfRotationAffineTransformView::~QmitkFixedCenterOfRotationAffineTransformView() { } mitk::TransformParameters::TransformType QmitkFixedCenterOfRotationAffineTransformView::GetTransformType() { return mitk::TransformParameters::FIXEDCENTEROFROTATIONAFFINETRANSFORM; } itk::Object::Pointer QmitkFixedCenterOfRotationAffineTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkFixedCenterOfRotationAffineTransformView::GetTransform2(itk::Image* /*itkImage1*/) { typedef typename itk::Image< TPixelType, VImageDimension > FixedImageType; typedef typename itk::Image< TPixelType, VImageDimension > MovingImageType; typename FixedImageType::Pointer fixedImage; mitk::CastToItkImage(m_FixedImage, fixedImage); typename MovingImageType::Pointer movingImage; mitk::CastToItkImage(m_MovingImage, movingImage); typedef typename itk::FixedCenterOfRotationAffineTransform< double, VImageDimension > CenteredAffineTransformType; typename itk::FixedCenterOfRotationAffineTransform< double, VImageDimension>::Pointer transformPointer = itk::FixedCenterOfRotationAffineTransform< double, VImageDimension>::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerFixedCenterOfRotationAffine->isChecked()) { typedef typename itk::FixedCenterOfRotationAffineTransform< double, VImageDimension > FixedCenterOfRotationAffineTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage ); transformInitializer->SetMovingImage( movingImage ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsFixedCenterOfRotationAffine->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; transformInitializer->InitializeTransform(); } m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } itk::Array QmitkFixedCenterOfRotationAffineTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(15); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesFixedCenterOfRotationAffine->isChecked(); transformValues[1] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale4->text().toDouble(); transformValues[5] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale5->text().toDouble(); transformValues[6] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale6->text().toDouble(); transformValues[7] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->text().toDouble(); transformValues[8] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->text().toDouble(); transformValues[9] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->text().toDouble(); transformValues[10] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->text().toDouble(); transformValues[11] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->text().toDouble(); transformValues[12] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->text().toDouble(); transformValues[13] = m_Controls.m_CenterForInitializerFixedCenterOfRotationAffine->isChecked(); transformValues[14] = m_Controls.m_MomentsFixedCenterOfRotationAffine->isChecked(); return transformValues; } void QmitkFixedCenterOfRotationAffineTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesFixedCenterOfRotationAffine->setChecked(transformValues[0]); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale4->setText(QString::number(transformValues[4])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale5->setText(QString::number(transformValues[5])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale6->setText(QString::number(transformValues[6])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->setText(QString::number(transformValues[7])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->setText(QString::number(transformValues[8])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->setText(QString::number(transformValues[9])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->setText(QString::number(transformValues[10])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->setText(QString::number(transformValues[11])); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->setText(QString::number(transformValues[12])); m_Controls.m_CenterForInitializerFixedCenterOfRotationAffine->setChecked(transformValues[13]); m_Controls.m_MomentsFixedCenterOfRotationAffine->setChecked(transformValues[14]); m_Controls.m_GeometryFixedCenterOfRotationAffine->setChecked(!transformValues[14]); } QString QmitkFixedCenterOfRotationAffineTransformView::GetName() { return "FixedCenterOfRotationAffine"; } void QmitkFixedCenterOfRotationAffineTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale4->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale5->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale6->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); } itk::Array QmitkFixedCenterOfRotationAffineTransformView::GetScales() { itk::Array scales; scales.SetSize(12); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesFixedCenterOfRotationAffine->isChecked()) { scales[0] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale4->text().toDouble(); scales[4] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale5->text().toDouble(); scales[5] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale6->text().toDouble(); scales[6] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->text().toDouble(); scales[7] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->text().toDouble(); scales[8] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->text().toDouble(); scales[9] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->text().toDouble(); scales[10] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->text().toDouble(); scales[11] = m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->text().toDouble(); } return scales; } vtkTransform* QmitkFixedCenterOfRotationAffineTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { int m = 0; for (unsigned int i = 0; i < m_FixedImage->GetDimension(); i++) { for (unsigned int j = 0; j < m_FixedImage->GetDimension(); j++) { vtkmatrix->SetElement(i, j, transformParams[m]); m++; } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); if (m_FixedImage->GetDimension() == 2) { vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[4]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[5]); } else if (m_FixedImage->GetDimension() == 3) { vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[9]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[10]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[11]); } vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkFixedCenterOfRotationAffineTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) { m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->hide(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->hide(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->hide(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->hide(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->hide(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->hide(); m_Controls.textLabel2_7_2_2->setText("Translation Scale X:"); m_Controls.textLabel3_6_2_2->setText("Translation Scale Y:"); m_Controls.textLabel4_4_3_2->hide(); m_Controls.textLabel5_4_2_2->hide(); m_Controls.textLabel6_4_2_2->hide(); m_Controls.textLabel11_3_2_2->hide(); m_Controls.textLabel12_3_2_2->hide(); m_Controls.textLabel13_2_2_2->hide(); return 6; } else { m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale7->show(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale8->show(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScale9->show(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationX->show(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationY->show(); m_Controls.m_ScalesFixedCenterOfRotationAffineTransformScaleTranslationZ->show(); m_Controls.textLabel2_7_2_2->setText("Scale 5:"); m_Controls.textLabel3_6_2_2->setText("Scale 6:"); m_Controls.textLabel4_4_3_2->show(); m_Controls.textLabel5_4_2_2->show(); m_Controls.textLabel6_4_2_2->show(); m_Controls.textLabel11_3_2_2->show(); m_Controls.textLabel12_3_2_2->show(); m_Controls.textLabel13_2_2_2->show(); return 12; } } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkQuaternionRigidTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkQuaternionRigidTransformView.cpp index 39568c1b6d..9fbc045293 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkQuaternionRigidTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkQuaternionRigidTransformView.cpp @@ -1,197 +1,198 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkQuaternionRigidTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkQuaternionRigidTransformView::QmitkQuaternionRigidTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkQuaternionRigidTransformView::~QmitkQuaternionRigidTransformView() { } mitk::TransformParameters::TransformType QmitkQuaternionRigidTransformView::GetTransformType() { return mitk::TransformParameters::QUATERNIONRIGIDTRANSFORM; } itk::Object::Pointer QmitkQuaternionRigidTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkQuaternionRigidTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 3) { typedef typename itk::Image< TPixelType, 3 > FixedImage3DType; typedef typename itk::Image< TPixelType, 3 > MovingImage3DType; typename FixedImage3DType::Pointer fixedImage3D; mitk::CastToItkImage(m_FixedImage, fixedImage3D); typename MovingImage3DType::Pointer movingImage3D; mitk::CastToItkImage(m_MovingImage, movingImage3D); typename itk::QuaternionRigidTransform< double >::Pointer transformPointer = itk::QuaternionRigidTransform< double >::New(); transformPointer->SetIdentity(); typedef typename itk::QuaternionRigidTransform< double > QuaternionRigidTransformType; if (m_Controls.m_CenterForInitializerQuaternionRigid->isChecked()) { typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage3D ); transformInitializer->SetMovingImage( movingImage3D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsQuaternionRigid->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkQuaternionRigidTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(10); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesQuaternionRigid->isChecked(); transformValues[1] = m_Controls.m_ScalesQuaternionRigidTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesQuaternionRigidTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesQuaternionRigidTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesQuaternionRigidTransformScale4->text().toDouble(); transformValues[5] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationX->text().toDouble(); transformValues[6] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationY->text().toDouble(); transformValues[7] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationZ->text().toDouble(); transformValues[8] = m_Controls.m_CenterForInitializerQuaternionRigid->isChecked(); transformValues[9] = m_Controls.m_MomentsQuaternionRigid->isChecked(); return transformValues; } void QmitkQuaternionRigidTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesQuaternionRigid->setChecked(transformValues[0]); m_Controls.m_ScalesQuaternionRigidTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesQuaternionRigidTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesQuaternionRigidTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesQuaternionRigidTransformScale4->setText(QString::number(transformValues[4])); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationX->setText(QString::number(transformValues[5])); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationY->setText(QString::number(transformValues[6])); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationZ->setText(QString::number(transformValues[7])); m_Controls.m_CenterForInitializerQuaternionRigid->setChecked(transformValues[8]); m_Controls.m_MomentsQuaternionRigid->setChecked(transformValues[9]); m_Controls.m_GeometryQuaternionRigid->setChecked(!transformValues[9]); } QString QmitkQuaternionRigidTransformView::GetName() { return "QuaternionRigid"; } void QmitkQuaternionRigidTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesQuaternionRigidTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScale4->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); } itk::Array QmitkQuaternionRigidTransformView::GetScales() { itk::Array scales; scales.SetSize(7); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesQuaternionRigid->isChecked()) { scales[0] = m_Controls.m_ScalesQuaternionRigidTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesQuaternionRigidTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesQuaternionRigidTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesQuaternionRigidTransformScale4->text().toDouble(); scales[4] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationX->text().toDouble(); scales[5] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationY->text().toDouble(); scales[6] = m_Controls.m_ScalesQuaternionRigidTransformScaleTranslationZ->text().toDouble(); } return scales; } vtkTransform* QmitkQuaternionRigidTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { itk::QuaternionRigidTransform::Pointer quaternionTransform = itk::QuaternionRigidTransform::New(); quaternionTransform->SetParameters(transformParams); itk::Matrix Matrix = quaternionTransform->GetMatrix(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vtkmatrix->SetElement(i, j, Matrix[i][j]); } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[4]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[5]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[6]); vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkQuaternionRigidTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 0; else return 7; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkRigid2DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkRigid2DTransformView.cpp index ff79248055..5b9c4f9c4e 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkRigid2DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkRigid2DTransformView.cpp @@ -1,162 +1,163 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkRigid2DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkRigid2DTransformView::QmitkRigid2DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkRigid2DTransformView::~QmitkRigid2DTransformView() { } mitk::TransformParameters::TransformType QmitkRigid2DTransformView::GetTransformType() { return mitk::TransformParameters::RIGID2DTRANSFORM; } itk::Object::Pointer QmitkRigid2DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkRigid2DTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 2) { typedef typename itk::Image< TPixelType, 2 > FixedImage2DType; typedef typename itk::Image< TPixelType, 2 > MovingImage2DType; typename FixedImage2DType::Pointer fixedImage2D; mitk::CastToItkImage(m_FixedImage, fixedImage2D); typename MovingImage2DType::Pointer movingImage2D; mitk::CastToItkImage(m_MovingImage, movingImage2D); typename itk::Rigid2DTransform< double >::Pointer transformPointer = itk::Rigid2DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerRigid2D->isChecked()) { typedef typename itk::Rigid2DTransform< double > Rigid2DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage2D ); transformInitializer->SetMovingImage( movingImage2D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsRigid2D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkRigid2DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(6); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesRigid2D->isChecked(); transformValues[1] = m_Controls.m_ScalesRigid2DTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesRigid2DTransformScaleTranslationX->text().toDouble(); transformValues[3] = m_Controls.m_ScalesRigid2DTransformScaleTranslationY->text().toDouble(); transformValues[4] = m_Controls.m_CenterForInitializerRigid2D->isChecked(); transformValues[5] = m_Controls.m_MomentsRigid2D->isChecked(); return transformValues; } void QmitkRigid2DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesRigid2D->setChecked(transformValues[0]); m_Controls.m_ScalesRigid2DTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesRigid2DTransformScaleTranslationX->setText(QString::number(transformValues[2])); m_Controls.m_ScalesRigid2DTransformScaleTranslationY->setText(QString::number(transformValues[3])); m_Controls.m_CenterForInitializerRigid2D->setChecked(transformValues[4]); m_Controls.m_MomentsRigid2D->setChecked(transformValues[5]); m_Controls.m_GeometryRigid2D->setChecked(!transformValues[5]); } QString QmitkRigid2DTransformView::GetName() { return "Rigid2D"; } void QmitkRigid2DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesRigid2DTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesRigid2DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesRigid2DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); } itk::Array QmitkRigid2DTransformView::GetScales() { itk::Array scales; scales.SetSize(3); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesRigid2D->isChecked()) { scales[0] = m_Controls.m_ScalesRigid2DTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesRigid2DTransformScaleTranslationX->text().toDouble(); scales[2] = m_Controls.m_ScalesRigid2DTransformScaleTranslationY->text().toDouble(); } return scales; } vtkTransform* QmitkRigid2DTransformView::Transform(vtkMatrix4x4* /*vtkmatrix*/, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { mitk::ScalarType angle = transformParams[0] * 45.0 / atan(1.0); vtktransform->PostMultiply(); vtktransform->RotateZ(angle); vtktransform->Translate(transformParams[1], transformParams[2], 0); vtktransform->PreMultiply(); } return vtktransform; } int QmitkRigid2DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 3; else return 0; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkScaleSkewVersor3DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkScaleSkewVersor3DTransformView.cpp index 1aeb9c7a7f..16d16f913c 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkScaleSkewVersor3DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkScaleSkewVersor3DTransformView.cpp @@ -1,228 +1,229 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkScaleSkewVersor3DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkScaleSkewVersor3DTransformView::QmitkScaleSkewVersor3DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkScaleSkewVersor3DTransformView::~QmitkScaleSkewVersor3DTransformView() { } mitk::TransformParameters::TransformType QmitkScaleSkewVersor3DTransformView::GetTransformType() { return mitk::TransformParameters::SCALESKEWVERSOR3DTRANSFORM; } itk::Object::Pointer QmitkScaleSkewVersor3DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkScaleSkewVersor3DTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 3) { typedef typename itk::Image< TPixelType, 3 > FixedImage3DType; typedef typename itk::Image< TPixelType, 3 > MovingImage3DType; typename FixedImage3DType::Pointer fixedImage3D; mitk::CastToItkImage(m_FixedImage, fixedImage3D); typename MovingImage3DType::Pointer movingImage3D; mitk::CastToItkImage(m_MovingImage, movingImage3D); typename itk::ScaleSkewVersor3DTransform< double >::Pointer transformPointer = itk::ScaleSkewVersor3DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerScaleSkewVersorRigid3D->isChecked()) { typedef typename itk::ScaleSkewVersor3DTransform< double > ScaleSkewVersor3DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage3D ); transformInitializer->SetMovingImage( movingImage3D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsScaleSkewVersorRigid3D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkScaleSkewVersor3DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(18); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesScaleSkewVersorRigid3DTransform->isChecked(); transformValues[1] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationX->text().toDouble(); transformValues[5] = m_Controls.m_ScaleScaleSkewVersorRigid3DTransformScaleTranslationY->text().toDouble(); transformValues[6] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationZ->text().toDouble(); transformValues[7] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale7->text().toDouble(); transformValues[8] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale8->text().toDouble(); transformValues[9] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale9->text().toDouble(); transformValues[10] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale10->text().toDouble(); transformValues[11] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale11->text().toDouble(); transformValues[12] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale12->text().toDouble(); transformValues[13] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale13->text().toDouble(); transformValues[14] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale14->text().toDouble(); transformValues[15] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale15->text().toDouble(); transformValues[16] = m_Controls.m_CenterForInitializerScaleSkewVersorRigid3D->isChecked(); transformValues[17] = m_Controls.m_MomentsScaleSkewVersorRigid3D->isChecked(); return transformValues; } void QmitkScaleSkewVersor3DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesScaleSkewVersorRigid3DTransform->setChecked(transformValues[0]); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationX->setText(QString::number(transformValues[4])); m_Controls.m_ScaleScaleSkewVersorRigid3DTransformScaleTranslationY->setText(QString::number(transformValues[5])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationZ->setText(QString::number(transformValues[6])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale7->setText(QString::number(transformValues[7])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale8->setText(QString::number(transformValues[8])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale9->setText(QString::number(transformValues[9])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale10->setText(QString::number(transformValues[10])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale11->setText(QString::number(transformValues[11])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale12->setText(QString::number(transformValues[12])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale13->setText(QString::number(transformValues[13])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale14->setText(QString::number(transformValues[14])); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale15->setText(QString::number(transformValues[15])); m_Controls.m_CenterForInitializerScaleSkewVersorRigid3D->setChecked(transformValues[16]); m_Controls.m_MomentsScaleSkewVersorRigid3D->setChecked(transformValues[17]); m_Controls.m_GeometryScaleSkewVersorRigid3D->setChecked(!transformValues[17]); } QString QmitkScaleSkewVersor3DTransformView::GetName() { return "ScaleSkewVersor3D"; } void QmitkScaleSkewVersor3DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScaleScaleSkewVersorRigid3DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale7->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale8->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale9->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale10->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale11->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale12->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale13->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale14->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale15->setValidator(validatorLineEditInputFloat); } itk::Array QmitkScaleSkewVersor3DTransformView::GetScales() { itk::Array scales; scales.SetSize(15); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesScaleSkewVersorRigid3DTransform->isChecked()) { scales[0] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationX->text().toDouble(); scales[4] = m_Controls.m_ScaleScaleSkewVersorRigid3DTransformScaleTranslationY->text().toDouble(); scales[5] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScaleTranslationZ->text().toDouble(); scales[6] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale7->text().toDouble(); scales[7] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale8->text().toDouble(); scales[8] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale9->text().toDouble(); scales[9] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale10->text().toDouble(); scales[10] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale11->text().toDouble(); scales[11] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale12->text().toDouble(); scales[12] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale13->text().toDouble(); scales[13] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale14->text().toDouble(); scales[14] = m_Controls.m_ScalesScaleSkewVersorRigid3DTransformScale15->text().toDouble(); } return scales; } vtkTransform* QmitkScaleSkewVersor3DTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { itk::ScaleSkewVersor3DTransform::Pointer versorTransform = itk::ScaleSkewVersor3DTransform::New(); versorTransform->SetParameters(transformParams); itk::Matrix Matrix = versorTransform->GetMatrix(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vtkmatrix->SetElement(i, j, Matrix[i][j]); } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[3]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[4]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[5]); vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkScaleSkewVersor3DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 0; else return 15; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity2DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity2DTransformView.cpp index 52f3b3b69a..16fa157492 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity2DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity2DTransformView.cpp @@ -1,173 +1,174 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkSimilarity2DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkSimilarity2DTransformView::QmitkSimilarity2DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkSimilarity2DTransformView::~QmitkSimilarity2DTransformView() { } mitk::TransformParameters::TransformType QmitkSimilarity2DTransformView::GetTransformType() { return mitk::TransformParameters::SIMILARITY2DTRANSFORM; } itk::Object::Pointer QmitkSimilarity2DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkSimilarity2DTransformView::GetTransform2(itk::Image* /* itkImage1 */) { if (VImageDimension == 2) { typedef typename itk::Image< TPixelType, 2 > FixedImage2DType; typedef typename itk::Image< TPixelType, 2 > MovingImage2DType; typename FixedImage2DType::Pointer fixedImage2D; mitk::CastToItkImage(m_FixedImage, fixedImage2D); typename MovingImage2DType::Pointer movingImage2D; mitk::CastToItkImage(m_MovingImage, movingImage2D); typename itk::Similarity2DTransform< double >::Pointer transformPointer = itk::Similarity2DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerSimilarity2D->isChecked()) { typedef typename itk::Similarity2DTransform< double > Similarity2DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage2D ); transformInitializer->SetMovingImage( movingImage2D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsSimilarity2D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } transformPointer->SetScale( m_Controls.m_InitialScaleSimilarity2D->text().toFloat() ); transformPointer->SetAngle( m_Controls.m_AngleSimilarity2D->text().toFloat() ); m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkSimilarity2DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(9); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesSimilarity2D->isChecked(); transformValues[1] = m_Controls.m_ScalingScaleSimilarity2D->text().toDouble(); transformValues[2] = m_Controls.m_RotationScaleSimilarity2D->text().toDouble(); transformValues[3] = m_Controls.m_TranslationXScaleSimilarity2D->text().toDouble(); transformValues[4] = m_Controls.m_TranslationYScaleSimilarity2D->text().toDouble(); transformValues[5] = m_Controls.m_InitialScaleSimilarity2D->text().toFloat(); transformValues[6] = m_Controls.m_AngleSimilarity2D->text().toFloat(); transformValues[7] = m_Controls.m_CenterForInitializerSimilarity2D->isChecked(); transformValues[8] = m_Controls.m_MomentsSimilarity2D->isChecked(); return transformValues; } void QmitkSimilarity2DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesSimilarity2D->setChecked(transformValues[0]); m_Controls.m_ScalingScaleSimilarity2D->setText(QString::number(transformValues[1])); m_Controls.m_RotationScaleSimilarity2D->setText(QString::number(transformValues[2])); m_Controls.m_TranslationXScaleSimilarity2D->setText(QString::number(transformValues[3])); m_Controls.m_TranslationYScaleSimilarity2D->setText(QString::number(transformValues[4])); m_Controls.m_InitialScaleSimilarity2D->setText(QString::number(transformValues[5])); m_Controls.m_AngleSimilarity2D->setText(QString::number(transformValues[6])); m_Controls.m_CenterForInitializerSimilarity2D->setChecked(transformValues[7]); m_Controls.m_MomentsSimilarity2D->setChecked(transformValues[8]); m_Controls.m_GeometrySimilarity2D->setChecked(!transformValues[8]); } QString QmitkSimilarity2DTransformView::GetName() { return "Similarity2D"; } void QmitkSimilarity2DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalingScaleSimilarity2D->setValidator(validatorLineEditInputFloat); m_Controls.m_RotationScaleSimilarity2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationXScaleSimilarity2D->setValidator(validatorLineEditInputFloat); m_Controls.m_TranslationYScaleSimilarity2D->setValidator(validatorLineEditInputFloat); } itk::Array QmitkSimilarity2DTransformView::GetScales() { itk::Array scales; scales.SetSize(4); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesSimilarity2D->isChecked()) { scales[0] = m_Controls.m_ScalingScaleSimilarity2D->text().toDouble(); scales[1] = m_Controls.m_RotationScaleSimilarity2D->text().toDouble(); scales[2] = m_Controls.m_TranslationXScaleSimilarity2D->text().toDouble(); scales[3] = m_Controls.m_TranslationYScaleSimilarity2D->text().toDouble(); } return scales; } vtkTransform* QmitkSimilarity2DTransformView::Transform(vtkMatrix4x4* /* vtkmatrix */, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { mitk::ScalarType angle = transformParams[1] * 45.0 / atan(1.0); vtktransform->PostMultiply(); vtktransform->Scale(transformParams[0], transformParams[0], 1); vtktransform->RotateZ(angle); vtktransform->Translate(transformParams[2], transformParams[3], 0); vtktransform->PreMultiply(); } return vtktransform; } int QmitkSimilarity2DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 4; else return 0; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity3DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity3DTransformView.cpp index 05f298bbf3..0bfc2b9cb4 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity3DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkSimilarity3DTransformView.cpp @@ -1,197 +1,198 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkSimilarity3DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkSimilarity3DTransformView::QmitkSimilarity3DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkSimilarity3DTransformView::~QmitkSimilarity3DTransformView() { } mitk::TransformParameters::TransformType QmitkSimilarity3DTransformView::GetTransformType() { return mitk::TransformParameters::SIMILARITY3DTRANSFORM; } itk::Object::Pointer QmitkSimilarity3DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkSimilarity3DTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 3) { typedef typename itk::Image< TPixelType, 3 > FixedImage3DType; typedef typename itk::Image< TPixelType, 3 > MovingImage3DType; typename FixedImage3DType::Pointer fixedImage3D; mitk::CastToItkImage(m_FixedImage, fixedImage3D); typename MovingImage3DType::Pointer movingImage3D; mitk::CastToItkImage(m_MovingImage, movingImage3D); typename itk::Similarity3DTransform< double >::Pointer transformPointer = itk::Similarity3DTransform< double >::New(); transformPointer->SetIdentity(); if (m_Controls.m_CenterForInitializerSimilarity3D->isChecked()) { typedef typename itk::Similarity3DTransform< double > Similarity3DTransformType; typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage3D ); transformInitializer->SetMovingImage( movingImage3D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsSimilarity3D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkSimilarity3DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(10); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesSimilarity3D->isChecked(); transformValues[1] = m_Controls.m_ScalesSimilarity3DTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesSimilarity3DTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesSimilarity3DTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesSimilarity3DTransformScale4->text().toDouble(); transformValues[5] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationX->text().toDouble(); transformValues[6] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationY->text().toDouble(); transformValues[7] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationZ->text().toDouble(); transformValues[8] = m_Controls.m_CenterForInitializerSimilarity3D->isChecked(); transformValues[9] = m_Controls.m_MomentsSimilarity3D->isChecked(); return transformValues; } void QmitkSimilarity3DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesSimilarity3D->setChecked(transformValues[0]); m_Controls.m_ScalesSimilarity3DTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesSimilarity3DTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesSimilarity3DTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesSimilarity3DTransformScale4->setText(QString::number(transformValues[4])); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationX->setText(QString::number(transformValues[5])); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationY->setText(QString::number(transformValues[6])); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationZ->setText(QString::number(transformValues[7])); m_Controls.m_CenterForInitializerSimilarity3D->setChecked(transformValues[8]); m_Controls.m_MomentsSimilarity3D->setChecked(transformValues[9]); m_Controls.m_GeometrySimilarity3D->setChecked(!transformValues[9]); } QString QmitkSimilarity3DTransformView::GetName() { return "Similarity3D"; } void QmitkSimilarity3DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesSimilarity3DTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScale4->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesSimilarity3DTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); } itk::Array QmitkSimilarity3DTransformView::GetScales() { itk::Array scales; scales.SetSize(7); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesSimilarity3D->isChecked()) { scales[0] = m_Controls.m_ScalesSimilarity3DTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesSimilarity3DTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesSimilarity3DTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesSimilarity3DTransformScale4->text().toDouble(); scales[4] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationX->text().toDouble(); scales[5] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationY->text().toDouble(); scales[6] = m_Controls.m_ScalesSimilarity3DTransformScaleTranslationZ->text().toDouble(); } return scales; } vtkTransform* QmitkSimilarity3DTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { itk::Similarity3DTransform::Pointer similarityTransform = itk::Similarity3DTransform::New(); similarityTransform->SetParameters(transformParams); itk::Matrix Matrix = similarityTransform->GetMatrix(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vtkmatrix->SetElement(i, j, Matrix[i][j]); } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[4]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[5]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[6]); vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkSimilarity3DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 0; else return 7; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorRigid3DTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorRigid3DTransformView.cpp index e0c5b62e03..3ec9a4a320 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorRigid3DTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorRigid3DTransformView.cpp @@ -1,208 +1,209 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkVersorRigid3DTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkVersorRigid3DTransformView::QmitkVersorRigid3DTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkVersorRigid3DTransformView::~QmitkVersorRigid3DTransformView() { } mitk::TransformParameters::TransformType QmitkVersorRigid3DTransformView::GetTransformType() { return mitk::TransformParameters::VERSORRIGID3DTRANSFORM; } itk::Object::Pointer QmitkVersorRigid3DTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkVersorRigid3DTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 3) { typedef typename itk::Image< TPixelType, 3 > FixedImage3DType; typedef typename itk::Image< TPixelType, 3 > MovingImage3DType; typename FixedImage3DType::Pointer fixedImage3D; mitk::CastToItkImage(m_FixedImage, fixedImage3D); typename MovingImage3DType::Pointer movingImage3D; mitk::CastToItkImage(m_MovingImage, movingImage3D); typename itk::VersorRigid3DTransform< double >::Pointer transformPointer = itk::VersorRigid3DTransform< double >::New(); transformPointer->SetIdentity(); typedef typename itk::VersorRigid3DTransform< double > VersorRigid3DTransformType; if (m_Controls.m_CenterForInitializerVersorRigid3D->isChecked()) { typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage3D ); transformInitializer->SetMovingImage( movingImage3D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsVersorRigid3D->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } typedef VersorRigid3DTransformType::VersorType VersorType; typedef VersorType::VectorType VectorType; VersorType rotation; VectorType axis; axis[0] = 0.0; axis[1] = 0.0; axis[2] = 1.0; const double angle = 0; rotation.Set( axis, angle ); transformPointer->SetRotation( rotation ); m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkVersorRigid3DTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(9); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesVersorRigid3D->isChecked(); transformValues[1] = m_Controls.m_ScalesVersorRigid3DTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesVersorRigid3DTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesVersorRigid3DTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationX->text().toDouble(); transformValues[5] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationY->text().toDouble(); transformValues[6] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationZ->text().toDouble(); transformValues[7] = m_Controls.m_CenterForInitializerVersorRigid3D->isChecked(); transformValues[8] = m_Controls.m_MomentsVersorRigid3D->isChecked(); return transformValues; } void QmitkVersorRigid3DTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesVersorRigid3D->setChecked(transformValues[0]); m_Controls.m_ScalesVersorRigid3DTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesVersorRigid3DTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesVersorRigid3DTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationX->setText(QString::number(transformValues[4])); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationY->setText(QString::number(transformValues[5])); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationZ->setText(QString::number(transformValues[6])); m_Controls.m_CenterForInitializerVersorRigid3D->setChecked(transformValues[7]); m_Controls.m_MomentsVersorRigid3D->setChecked(transformValues[8]); m_Controls.m_GeometryVersorRigid3D->setChecked(!transformValues[8]); } QString QmitkVersorRigid3DTransformView::GetName() { return "VersorRigid3D"; } void QmitkVersorRigid3DTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesVersorRigid3DTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorRigid3DTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorRigid3DTransformScale3->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat); } itk::Array QmitkVersorRigid3DTransformView::GetScales() { itk::Array scales; scales.SetSize(6); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesVersorRigid3D->isChecked()) { scales[0] = m_Controls.m_ScalesVersorRigid3DTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesVersorRigid3DTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesVersorRigid3DTransformScale3->text().toDouble(); scales[3] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationX->text().toDouble(); scales[4] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationY->text().toDouble(); scales[5] = m_Controls.m_ScalesVersorRigid3DTransformScaleTranslationZ->text().toDouble(); } return scales; } vtkTransform* QmitkVersorRigid3DTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { itk::VersorRigid3DTransform::Pointer versorTransform = itk::VersorRigid3DTransform::New(); versorTransform->SetParameters(transformParams); itk::Matrix Matrix = versorTransform->GetMatrix(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vtkmatrix->SetElement(i, j, Matrix[i][j]); } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); vtkmatrix->SetElement(0, 3, -translation[0] + center[0] + transformParams[3]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1] + transformParams[4]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2] + transformParams[5]); vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkVersorRigid3DTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 0; else return 6; } else return 0; } diff --git a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorTransformView.cpp b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorTransformView.cpp index 77d6d5e965..7eb2c4a033 100644 --- a/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorTransformView.cpp +++ b/Modules/RigidRegistrationUI/RigidRegistrationTransforms/QmitkVersorTransformView.cpp @@ -1,181 +1,182 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: -1 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkVersorTransformView.h" #include "mitkImageAccessByItk.h" +#include #include #include #include QmitkVersorTransformView::QmitkVersorTransformView(QWidget* parent, Qt::WindowFlags f ) : QmitkRigidRegistrationTransformsGUIBase(parent, f), m_CenterX(0), m_CenterY(0), m_CenterZ(0) { } QmitkVersorTransformView::~QmitkVersorTransformView() { } mitk::TransformParameters::TransformType QmitkVersorTransformView::GetTransformType() { return mitk::TransformParameters::VERSORTRANSFORM; } itk::Object::Pointer QmitkVersorTransformView::GetTransform() { if (m_FixedImage.IsNotNull()) { AccessByItk(m_FixedImage, GetTransform2); return m_TransformObject; } return NULL; } template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer QmitkVersorTransformView::GetTransform2(itk::Image* /*itkImage1*/) { if (VImageDimension == 3) { typedef typename itk::Image< TPixelType, 3 > FixedImage3DType; typedef typename itk::Image< TPixelType, 3 > MovingImage3DType; typename FixedImage3DType::Pointer fixedImage3D; mitk::CastToItkImage(m_FixedImage, fixedImage3D); typename MovingImage3DType::Pointer movingImage3D; mitk::CastToItkImage(m_MovingImage, movingImage3D); typename itk::VersorTransform< double >::Pointer transformPointer = itk::VersorTransform< double >::New(); transformPointer->SetIdentity(); typedef typename itk::VersorTransform< double > VersorTransformType; if (m_Controls.m_CenterForInitializerVersor->isChecked()) { typedef typename itk::CenteredTransformInitializer TransformInitializerType; typename TransformInitializerType::Pointer transformInitializer = TransformInitializerType::New(); transformInitializer->SetFixedImage( fixedImage3D ); transformInitializer->SetMovingImage( movingImage3D ); transformInitializer->SetTransform( transformPointer ); if (m_Controls.m_MomentsVersor->isChecked()) { transformInitializer->MomentsOn(); } else { transformInitializer->GeometryOn(); } transformInitializer->InitializeTransform(); } m_CenterX = transformPointer->GetCenter()[0]; m_CenterY = transformPointer->GetCenter()[1]; m_CenterZ = transformPointer->GetCenter()[2]; m_TransformObject = transformPointer.GetPointer(); return transformPointer.GetPointer(); } return NULL; } itk::Array QmitkVersorTransformView::GetTransformParameters() { itk::Array transformValues; transformValues.SetSize(6); transformValues.fill(0); transformValues[0] = m_Controls.m_UseOptimizerScalesVersor->isChecked(); transformValues[1] = m_Controls.m_ScalesVersorTransformScale1->text().toDouble(); transformValues[2] = m_Controls.m_ScalesVersorTransformScale2->text().toDouble(); transformValues[3] = m_Controls.m_ScalesVersorTransformScale3->text().toDouble(); transformValues[4] = m_Controls.m_CenterForInitializerVersor->isChecked(); transformValues[5] = m_Controls.m_MomentsVersor->isChecked(); return transformValues; } void QmitkVersorTransformView::SetTransformParameters(itk::Array transformValues) { m_Controls.m_UseOptimizerScalesVersor->setChecked(transformValues[0]); m_Controls.m_ScalesVersorTransformScale1->setText(QString::number(transformValues[1])); m_Controls.m_ScalesVersorTransformScale2->setText(QString::number(transformValues[2])); m_Controls.m_ScalesVersorTransformScale3->setText(QString::number(transformValues[3])); m_Controls.m_CenterForInitializerVersor->setChecked(transformValues[4]); m_Controls.m_MomentsVersor->setChecked(transformValues[5]); m_Controls.m_GeometryVersor->setChecked(!transformValues[5]); } QString QmitkVersorTransformView::GetName() { return "Versor"; } void QmitkVersorTransformView::SetupUI(QWidget* parent) { m_Controls.setupUi(parent); QValidator* validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this); m_Controls.m_ScalesVersorTransformScale1->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorTransformScale2->setValidator(validatorLineEditInputFloat); m_Controls.m_ScalesVersorTransformScale3->setValidator(validatorLineEditInputFloat); } itk::Array QmitkVersorTransformView::GetScales() { itk::Array scales; scales.SetSize(3); scales.Fill(1.0); if (m_Controls.m_UseOptimizerScalesVersor->isChecked()) { scales[0] = m_Controls.m_ScalesVersorTransformScale1->text().toDouble(); scales[1] = m_Controls.m_ScalesVersorTransformScale2->text().toDouble(); scales[2] = m_Controls.m_ScalesVersorTransformScale3->text().toDouble(); } return scales; } vtkTransform* QmitkVersorTransformView::Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array transformParams) { if (m_MovingImage.IsNotNull()) { itk::VersorTransform::Pointer versorTransform = itk::VersorTransform::New(); versorTransform->SetParameters(transformParams); itk::Matrix Matrix = versorTransform->GetMatrix(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vtkmatrix->SetElement(i, j, Matrix[i][j]); } } float center[4]; float translation[4]; center[0] = m_CenterX; center[1] = m_CenterY; center[2] = m_CenterZ; center[3] = 1; vtkmatrix->MultiplyPoint(center, translation); vtkmatrix->SetElement(0, 3, -translation[0] + center[0]); vtkmatrix->SetElement(1, 3, -translation[1] + center[1]); vtkmatrix->SetElement(2, 3, -translation[2] + center[2]); vtktransform->SetMatrix(vtkmatrix); } return vtktransform; } int QmitkVersorTransformView::GetNumberOfTransformParameters() { if (m_FixedImage.IsNotNull()) { if (m_FixedImage->GetDimension() == 2) return 0; else return 3; } else return 0; } diff --git a/SuperBuild.cmake b/SuperBuild.cmake index 65fccf4c57..d755e98569 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -1,245 +1,249 @@ #----------------------------------------------------------------------------- # Convenient macro allowing to download a file #----------------------------------------------------------------------------- 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 #----------------------------------------------------------------------------- #----------------------------- Qt --------------------------- if(MITK_USE_QT) find_package(Qt4 REQUIRED) set(vtk_QT_ARGS -DDESIRED_QT_VERSION:STRING=4 -DVTK_USE_GUISUPPORT:BOOL=ON -DVTK_USE_QVTK_QTOPENGL:BOOL=ON -DVTK_USE_QT:BOOL=ON -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) endif() #----------------------------------------------------------------------------- # External project settings #----------------------------------------------------------------------------- INCLUDE(ExternalProject) SET(ep_base "${CMAKE_BINARY_DIR}/CMakeExternals") SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${ep_base}) SET(ep_install_dir ${ep_base}/Install) #SET(ep_build_dir ${ep_base}/Build) SET(ep_source_dir ${ep_base}/Source) #SET(ep_parallelism_level) SET(ep_build_shared_libs ON) SET(ep_build_testing OFF) # 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() # Use this value where semi-colons are needed in ep_add args: set(sep "^^") ## IF(MSVC90 OR MSVC10) SET(ep_common_C_FLAGS "${CMAKE_C_FLAGS} /bigobj /MP") SET(ep_common_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /MP") ELSE() SET(ep_common_C_FLAGS "${CMAKE_C_FLAGS} -DLINUX_EXTRA") SET(ep_common_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX_EXTRA") ENDIF() SET(ep_common_args -DBUILD_TESTING:BOOL=${ep_build_testing} -DCMAKE_INSTALL_PREFIX:PATH=${ep_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=${ep_common_C_FLAGS} -DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} #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} ) #----------------------------------------------------------------------------- # ExternalProjects #----------------------------------------------------------------------------- SET(external_projects VTK GDCM ITK Boost DCMTK CTK OpenCV MITKData ) # Include external projects FOREACH(p ${external_projects}) INCLUDE(CMakeExternals/${p}.cmake) ENDFOREACH() #----------------------------------------------------------------------------- # Set superbuild boolean args #----------------------------------------------------------------------------- SET(mitk_cmake_boolean_args BUILD_SHARED_LIBS WITH_COVERAGE BUILD_TESTING MITK_USE_QT MITK_INSTALL_RPATH_RELATIVE MITK_BUILD_ALL_PLUGINS MITK_BUILD_TUTORIAL MITK_USE_Boost MITK_USE_BLUEBERRY MITK_USE_CTK MITK_USE_DCMTK MITK_USE_OpenCV ) #----------------------------------------------------------------------------- # Generate cmake variable names for MITK bundles #----------------------------------------------------------------------------- INCLUDE(mitkSuperBuildPlugins) FOREACH(plugin ${MITK_SUPERBUILD_PLUGINS}) LIST(APPEND mitk_cmake_boolean_args MITK_BUILD_${plugin}) OPTION(MITK_BUILD_${plugin} "Build the MITK ${plugin} plugin" OFF) ENDFOREACH() #----------------------------------------------------------------------------- # 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 # Mandatory dependencies ${VTK_DEPENDS} ${ITK_DEPENDS} # Optionnal dependencies ${Boost_DEPENDS} ${CTK_DEPENDS} ${DCMTK_DEPENDS} ${OpenCV_DEPENDS} ${MITK-Data_DEPENDS} ) #----------------------------------------------------------------------------- # MITK Configure #----------------------------------------------------------------------------- IF(MITK_INITIAL_CACHE_FILE) SET(mitk_initial_cache_arg -C "${MITK_INITIAL_CACHE_FILE}") ENDIF() SET(proj MITK-Configure) STRING(REPLACE ";" "^^" MITK_MODULES_TO_BUILD_PARAM "${MITK_MODULES_TO_BUILD}") MESSAGE("PARAM: ${MITK_MODULES_TO_BUILD_PARAM}") ExternalProject_Add(${proj} LIST_SEPARATOR ^^ DOWNLOAD_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} ${mitk_superbuild_boolean_args} -DMITK_USE_SUPERBUILD:BOOL=OFF -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} -DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS} -DMITK_SUPERBUILD_BINARY_DIR:PATH=${MITK_BINARY_DIR} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DMITK_KWSTYLE_EXECUTABLE:FILEPATH=${MITK_KWSTYLE_EXECUTABLE} -DMITK_MODULES_TO_BUILD:INTERNAL=${MITK_MODULES_TO_BUILD_PARAM} -DCTK_DIR:PATH=${CTK_DIR} -DDCMTK_DIR:PATH=${DCMTK_DIR} -DVTK_DIR:PATH=${VTK_DIR} # FindVTK expects VTK_DIR -DITK_DIR:PATH=${ITK_DIR} # FindITK expects ITK_DIR -DOpenCV_DIR:PATH=${OpenCV_DIR} -DGDCM_DIR:PATH=${GDCM_DIR} -DBOOST_ROOT:PATH=${BOOST_ROOT} -DMITK_DATA_DIR:PATH=${MITK_DATA_DIR} + -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_DIMENSIONS:STRING=${MITK_ACCESSBYITK_DIMENSIONS} ${mitk_initial_cache_arg} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/MITK-build BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS MITK-Utilities ) #----------------------------------------------------------------------------- # MITK #----------------------------------------------------------------------------- #MESSAGE(STATUS SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:${SUPERBUILD_EXCLUDE_MITKBUILD_TARGET}) IF(NOT DEFINED SUPERBUILD_EXCLUDE_MITKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_MITKBUILD_TARGET) SET(proj MITK-build) ExternalProject_Add(${proj} DOWNLOAD_COMMAND "" CMAKE_GENERATOR ${gen} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} BINARY_DIR MITK-build INSTALL_COMMAND "" DEPENDS "MITK-Configure" ) ENDIF() #----------------------------------------------------------------------------- # Custom target allowing to drive the build of MITK project itself #----------------------------------------------------------------------------- ADD_CUSTOM_TARGET(MITK COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/MITK-build WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build ) diff --git a/mitkConfig.h.in b/mitkConfig.h.in index 8ca3344777..76743f7327 100644 --- a/mitkConfig.h.in +++ b/mitkConfig.h.in @@ -1,20 +1,43 @@ /* mitkConfig.h this file is generated. Do not change! */ + +#ifndef MITKCONFIG_H +#define MITKCONFIG_H + #define MITK_ROOT "${PROJECT_SOURCE_DIR}/" #cmakedefine MITK_BUILD_SHARED_CORE #cmakedefine USE_ITKZLIB #cmakedefine MITK_CHILI_PLUGIN #cmakedefine MITK_USE_TD_MOUSE +#define MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES @MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES@ +#define MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES @MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES@ +#define MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES @MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES@ +#define MITK_ACCESSBYITK_PIXEL_TYPES @MITK_ACCESSBYITK_PIXEL_TYPES@ + +#define MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ @MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ@ +#define MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ @MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ@ +#define MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES_SEQ @MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES_SEQ@ +#define MITK_ACCESSBYITK_PIXEL_TYPES_SEQ @MITK_ACCESSBYITK_PIXEL_TYPES_SEQ@ + +#define MITK_ACCESSBYITK_DIMENSIONS @MITK_ACCESSBYITK_DIMENSIONS@ +#define MITK_ACCESSBYITK_DIMENSIONS_SEQ @MITK_ACCESSBYITK_DIMENSIONS_SEQ@ + +#define MITK_ACCESSBYITK_INTEGRAL_TYPES_DIMN_SEQ(dim) @MITK_ACCESSBYITK_INTEGRAL_TYPES_DIMN_SEQ@ +#define MITK_ACCESSBYITK_FLOATING_TYPES_DIMN_SEQ(dim) @MITK_ACCESSBYITK_FLOATING_TYPES_DIMN_SEQ@ +#define MITK_ACCESSBYITK_COMPOSITE_TYPES_DIMN_SEQ(dim) @MITK_ACCESSBYITK_COMPOSITE_TYPES_DIMN_SEQ@ +#define MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dim) @MITK_ACCESSBYITK_TYPES_DIMN_SEQ@ + #define MITK_CHILI_PLUGIN_SDK_IPPIC_H "@MITK_CHILI_PLUGIN_SDK_IPPIC_H@" #define MITK_CHILI_PLUGIN_SDK_IPTYPES_H "@MITK_CHILI_PLUGIN_SDK_IPTYPES_H@" #define MITK_DOXYGEN_OUTPUT_DIR "@MITK_DOXYGEN_OUTPUT_DIR@" #define MITK_HELPPAGES_OUTPUT_DIR "@MITK_HELPPAGES_OUTPUT_DIR@" #define MITK_VERSION_MAJOR @MITK_VERSION_MAJOR@ #define MITK_VERSION_MINOR @MITK_VERSION_MINOR@ #define MITK_VERSION_PATCH @MITK_VERSION_PATCH@ #define MITK_VERSION_STRING "@MITK_VERSION_STRING@" +#endif // MITKCONFIG_H