diff --git a/CMakeLists.txt b/CMakeLists.txt index 177bcf9fb7..5bc466eae4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,450 +1,451 @@ 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(FATAL_ERROR "MITK_CMAKE_${type}_OUTPUT_DIRECTORY is set to a non-existing 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_GDCMIO "Use the GDCMIO class instead of ImageIO2 for DICOM" ON) option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON) option(MITK_USE_CTK "EXEPERIMENTAL, superbuild only: Use CTK in MITK" OFF) option(MITK_USE_DCMTK "EXEPERIMENTAL, superbuild only: Use DCMTK in MITK" OFF) option(MITK_USE_OPEN_CV "Use Intel's OpenCV library" OFF) mark_as_advanced(MITK_INSTALL_RPATH_RELATIVE MITK_BUILD_ALL_PLUGINS MITK_USE_CTK MITK_USE_DCMTK ) #----------------------------------------------------------------------------- # 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-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) # Generate Project.xml file expected by the CTest driver script mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} ${PROJECT_NAME} "${CTEST_PROJECT_SUBPROJECTS}" ${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(mitkMacroCreateModuleConf) include(mitkMacroCreateModule) include(mitkMacroCheckModule) include(mitkMacroCreateModuleTests) include(mitkMacroUseModule) include(mitkMacroMultiplexPicType) include(mitkMacroInstall) include(mitkMacroInstallHelperApp) include(mitkMacroInstallTargets) include(mitkMacroGenerateToolsLibrary) #----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- # 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 "${CMAKE_C_FLAGS} ${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}") set(MITK_CXX_FLAGS "${CMAKE_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() - configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h) 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 ${MITK_CXX_FLAGS}) set(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) add_subdirectory(CoreUI) add_subdirectory(Modules) 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 #----------------------------------------------------------------------------- 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 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 #----------------------------------------------------------------------------- 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) diff --git a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h index a0bc56036a..30326f8c7b 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h @@ -1,259 +1,258 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-06 10:44:43 +0200 (Mi, 06 Mai 2009) $ Version: $Revision: 17109 $ 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 !defined(QmitkIGTExampleView_H__INCLUDED) #define QmitkIGTExampleView_H__INCLUDED #include "QmitkFunctionality.h" -#include "mitkTestingConfig.h" #include "mitkTrackingDeviceSource.h" #include "mitkNavigationDataDisplacementFilter.h" #include "mitkTrackingDevice.h" #include "mitkNavigationDataRecorder.h" #include "mitkNavigationDataPlayer.h" #include "mitkNavigationDataToPointSetFilter.h" #include "mitkNavigationDataToMessageFilter.h" #include "QmitkPlotWidget.h" #include "ui_QmitkIGTExampleViewControls.h" #include "../IgtexampleDll.h" class QmitkStdMultiWidget; class QmitkIGTExampleViewControls; class QTextEdit; /*! \brief QmitkIGTExampleView Example functionality that shows the usage of the MITK-IGT component \sa QmitkFunctionality \ingroup Functionalities */ class QmitkIGTExampleView : public QObject, public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkIGTExampleView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkIGTExampleView(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); virtual void AddToFunctionalityOptionsList(mitk::PropertyList* p); /*! \brief method for creating an QAction object, i.e. button & menu entry @param parent the parent QWidget */ //Port virtual QAction * CreateAction(QActionGroup *parent); /*! \brief method is called when the bundle is started */ virtual void Activated(); /*! \brief method is called when the bundle is closed */ virtual void Deactivated(); #ifdef BUILD_TESTING /** * \brief This method performs an automated functionality test. */ virtual int TestYourself(); #endif protected slots: /**Documentation * \brief executes MITK-IGT-Tracking code * * This method will create and initialize a mitk::NDITrackingDevice with one tool. * It will start the tracking, read the tracking data from the tool 50 times and * then clean up everything. */ void OnTestTracking(); /**Documentation * \brief executes MITK-IGT-Navigation code * * This method will create and initialize a mitk::NDITrackingDevice with one tool. * Then it builds an example MITK-IGT filter pipeline: * - TrackingDeviceSource filter initialized with the NDITrackingDevice as source of the pipeline * - NavigationDataDisplacementFilter * The Offset parameter of the displacement filter is searched in the functionality's options list. * It can be written to that list either by the method OnParametersChanged() that gets called after * the user changes the parameter in the GUI or by the persistence mechanism of MITK (the complete * options list will be saved to disk on application exit and restored on the next application restart). * if the Offset parameter is not found in the list, a default value is used. * After building the filter pipeline, it is initialized and tracking is started, so that following * calls to OnMeasure() can trigger pipeline updates and retrieve NavigationData objects. */ void OnTestNavigation(); /**Documentation * \brief performs one measurement using the navigation pipeline * * This method uses the MITK-IGT pipeline that was set up by OnTestNavigation() before. * it iterates over all outputs of the last filter in the pipeline, updates each and writes * its transformed tracking data to the GUI. */ void OnMeasure(); /**Documentation * \brief performs continuous measurements using the navigation pipeline * * This method calls the above OnMeasure() */ void OnMeasureContinuously(); /** * \brief stops the navigation pipeline and perform clean up */ void OnStop(); /**Documentation * \brief reads the filter parameters from the GUI after they were changed * * The Control widget will store all parameters of the displacement filter * in a mitk::PropertyList. OnParametersChanged() gets called after the user * changed the parameters. It will add that list to the functionality's own * m_Options PropertyList, overwriting any properties that might exist with * the same name (all MITK-IGT filters should use unique property names). * OnTestNavigation() will use the functionality's m_Options list to initialize * the DisplacementFilter. */ void OnParametersChanged(); /**Documentation * \brief Starts recording of tracking data * * This method sets up a IGT pipeline that connects a tracking device * with a NavigationDataRecorder filter and then starts a timer that * updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the recorder will be stopped. */ void OnRecordingToggle(bool toggled); /**Documentation * \brief Stops the recording of tracking data and starts the replay * * This method sets up a new pipeline that connects a NavigationDataPlayer with a * NavigationDataToPointSetFilter as an example for an alternative visualization * method and then starts a Replay timer that updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the Replay timer will be stopped. */ void OnPlayingToggle(bool toggled); /**Documentation * \brief Timer update method for recording of tracking data * * updates the recording filter and displays a message in the status bar */ void OnRecording(); /**Documentation * \brief Timer update method for replaying of tracking data * * updates the replay filter, rerenders the 3D render window and * displays a message in the status bar */ void OnPlaying(); /**Documentation * \brief Display a graph and progress bar that shows error values from the first navigation data * * This method is an example of how to use NavigationDataToMessageFilter to update * GUI elements from a IGT pipeline. It creates a NavigationDataToMessageFilter, * sets its input to the first output of the displacement filter * and registers the OnErrorValueChanged() method as a callback whenever the * error value of the input navigation data changes. */ void OnShowErrorPlot(); /**Documentation * \brief Callback method of the NavigationDataToMessageFilter * * This method will be called by NavigationDataToMessageFilter when the * error value of its input navigation data object changes. * The method calculates an overall error value and adds it both to an * error plot widget and to a progress bar. If the error is above a hardcoded * threshold, a warning is also displayed in the text output widget */ void OnErrorValueChanged(mitk::NavigationData::CovarianceMatrixType v, unsigned int index); /**Documentation * \brief Shows a file dialog for choosing tool description files * * This method is called when the m_ToolBtn is pressed and a tracking * device was selected which needs tool description data. * */ void OnLoadTool(); /**Documentation * \brief Chooses the current tracking device * * This method is called when the m_TrackingDevice selector changed. */ void OnTrackingDeviceTextChanged( const QString & ); protected: mitk::TrackingDevice::Pointer ConfigureTrackingDevice(); ///< create the selected tracker object and configure it (using values from m_Controls) QmitkStdMultiWidget * m_MultiWidget; ///< default render widget Ui::QmitkIGTExampleControls * m_Controls; ///< GUI widget for this functionality mitk::TrackingDeviceSource::Pointer m_Source; ///< first filter in the pipeline mitk::NavigationDataDisplacementFilter::Pointer m_Displacer; ///< displacement filter that adds an offset to NDs mitk::NavigationDataToNavigationDataFilter::Pointer m_EndOfPipeline; // Pointer to last filter in the pipeline mitk::NavigationDataRecorder::Pointer m_Recorder; ///< records NDs to a XML file mitk::NavigationDataPlayer::Pointer m_Player; ///< plays a XML file mitk::NavigationDataToPointSetFilter::Pointer m_PointSetFilter; ///< has a NDs as input and a PointSet as output mitk::NavigationDataToMessageFilter::Pointer m_MessageFilter; ///< calls OnErrorValueChanged when the error value of its input changes mitk::PointSet::Pointer m_PointSet; ///< stores the output of the pointsetfilter QmitkPlotWidget::DataVector m_XValues; ///< X-Values of the error plot (timestamp of navigation data) QmitkPlotWidget::DataVector m_YValues; ///< Y-Values of the error plot (error value of navigation data QTextEdit* out; ///< pointer to output widget QTimer* m_Timer; ///< timer for continuous tracking update QTimer* m_RecordingTimer; ///< timer for continuous recording QTimer* m_PlayingTimer; ///< timer for continuous playing QStringList m_ToolList; ///< list to the tool description files }; #endif // !defined(QmitkIGTExampleView_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h index 6d5be4f9b0..e15e60bb21 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h @@ -1,109 +1,108 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-06 10:44:43 +0200 (Mi, 06 Mai 2009) $ Version: $Revision: 17109 $ 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 !defined(QmitkIGTRecorderView_H__INCLUDED) #define QmitkIGTRecorderView_H__INCLUDED #include "QmitkFunctionality.h" -#include "mitkTestingConfig.h" #include "mitkTrackingDeviceSource.h" #include "mitkTrackingDevice.h" #include "mitkNavigationDataRecorder.h" #include "mitkNavigationDataPlayer.h" #include "mitkNavigationDataToPointSetFilter.h" #include "mitkNavigationDataToMessageFilter.h" #include "mitkNavigationDataObjectVisualizationFilter.h" #include "ui_QmitkIGTRecorderViewControls.h" #include "../IgtexampleDll.h" class QmitkStdMultiWidget; class QmitkIGTRecorderViewControls; class QTextEdit; class QmitkNDIConfigurationWidget; /*! \brief QmitkIGTRecorderView Example functionality that shows the usage of the MITK-IGT component \sa QmitkFunctionality \ingroup Functionalities */ class QmitkIGTRecorderView : public QObject, public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkIGTRecorderView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkIGTRecorderView(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); protected slots: void OnStartRecording(); void OnStopRecording(); void OnPauseRecording(bool pause); void OnStartReplaying(); void OnStopReplaying(); void RecordFrame(); void OnConnect(); void OnDisconnect(); protected: mitk::TrackingDevice::Pointer ConfigureTrackingDevice(); ///< create the selected tracker object and configure it (using values from m_Controls) void SetupIGTPipeline(mitk::TrackingDevice::Pointer tracker, QString fileName); mitk::DataNode::Pointer CreateInstrumentVisualization(const char* label); QmitkStdMultiWidget * m_MultiWidget; ///< default render widget Ui::QmitkIGTRecorderControls * m_Controls; ///< GUI widget for this functionality mitk::TrackingDeviceSource::Pointer m_Source; ///< first filter in the pipeline mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; mitk::NavigationDataRecorder::Pointer m_Recorder; ///< records NDs to a XML file mitk::NavigationDataToPointSetFilter::Pointer m_PointSetFilter; ///< has a NDs as input and a PointSet as output mitk::NavigationDataToMessageFilter::Pointer m_MessageFilter; ///< calls OnErrorValueChanged when the error value of its input changes //mitk::NavigationDataPlayer::Pointer m_Player; ///< plays a XML file QTimer* m_Timer; ///< timer for continuous tracking update QTimer* m_RecordingTimer; ///< timer for continuous recording QTimer* m_PlayingTimer; ///< timer for continuous playing QStringList m_ToolList; ///< list to the tool description files QmitkNDIConfigurationWidget* m_ConfigWidget; }; #endif // !defined(QmitkIGTRecorderView_H__INCLUDED)