diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 5b5c2aa0b2..3ee68005c2 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -1,82 +1,81 @@ # Modules must be listed according to their dependencies set(module_dirs LegacyIO DataTypesExt AlgorithmsExt MapperExt DICOMReader DICOMTesting Qt4Qt5TestModule SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction ImageStatistics LegacyAdaptors SceneSerialization GraphAlgorithms ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation OpenViewCore QmlItems Overlays QtWidgets QtWidgetsExt SegmentationUI DiffusionImaging GPGPU IGTBase - IGT OpenIGTLink - IGTLink + IGT CameraCalibration RigidRegistration RigidRegistrationUI DeformableRegistration DeformableRegistrationUI OpenCL OpenCVVideoSupport QtOverlays InputDevices ToFHardware ToFProcessing ToFUI US USUI DicomUI Simulation Remeshing Python Persistence IGTUI VtkShaders DicomRT IOExt ) if(MITK_ENABLE_PIC_READER) list(APPEND module_dirs IpPicSupportIO) endif() set(MITK_DEFAULT_SUBPROJECTS MITK-Modules) foreach(module_dir ${module_dirs}) add_subdirectory(${module_dir}) endforeach() if(MITK_PRIVATE_MODULES) file(GLOB all_subdirs RELATIVE ${MITK_PRIVATE_MODULES} ${MITK_PRIVATE_MODULES}/*) foreach(subdir ${all_subdirs}) string(FIND ${subdir} "." _result) if(_result EQUAL -1) if(EXISTS ${MITK_PRIVATE_MODULES}/${subdir}/CMakeLists.txt) message(STATUS "Found private module ${subdir}") add_subdirectory(${MITK_PRIVATE_MODULES}/${subdir} private_modules/${subdir}) endif() endif() endforeach() endif(MITK_PRIVATE_MODULES) diff --git a/Modules/IGTLink/mitkIGTLMessageToNavigationDataFilter.cpp b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.cpp similarity index 100% rename from Modules/IGTLink/mitkIGTLMessageToNavigationDataFilter.cpp rename to Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.cpp diff --git a/Modules/IGTLink/mitkIGTLMessageToNavigationDataFilter.h b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h similarity index 100% rename from Modules/IGTLink/mitkIGTLMessageToNavigationDataFilter.h rename to Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h diff --git a/Modules/IGT/CMakeLists.txt b/Modules/IGT/CMakeLists.txt index 96b0db800a..babf68ab87 100644 --- a/Modules/IGT/CMakeLists.txt +++ b/Modules/IGT/CMakeLists.txt @@ -1,56 +1,56 @@ include(MITKIGTHardware.cmake) if(MITK_USE_MICRON_TRACKER) set(INCLUDE_DIRS_INTERNAL ${INCLUDE_DIRS_INTERNAL} ${MITK_MICRON_TRACKER_INCLUDE_DIR}) set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_MICRON_TRACKER_LIB}) endif(MITK_USE_MICRON_TRACKER) if(MITK_USE_OPTITRACK_TRACKER) set(INCLUDE_DIRS_INTERNAL ${INCLUDE_DIRS_INTERNAL} ${MITK_OPTITRACK_TRACKER_INCLUDE_DIR}) set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_OPTITRACK_TRACKER_LIB}) add_definitions( -DMITK_USE_OPTITRACK_TRACKER ) endif(MITK_USE_OPTITRACK_TRACKER) if(MITK_USE_MICROBIRD_TRACKER) set(INCLUDE_DIRS_INTERNAL ${INCLUDE_DIRS_INTERNAL} ${MITK_USE_MICROBIRD_TRACKER_INCLUDE_DIR}) set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_USE_MICROBIRD_TRACKER_LIB}) endif(MITK_USE_MICROBIRD_TRACKER) MITK_CREATE_MODULE( SUBPROJECTS MITK-IGT INCLUDE_DIRS Algorithms Common DataManagement ExceptionHandling IO Rendering TrackingDevices TestingHelper INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL} - DEPENDS MitkImageStatistics MitkSceneSerialization MitkIGTBase - PACKAGE_DEPENDS ITK|ITKRegistrationCommon tinyxml + DEPENDS MitkImageStatistics MitkSceneSerialization MitkIGTBase MitkOpenIGTLink + PACKAGE_DEPENDS ITK|ITKRegistrationCommon tinyxml OpenIGTLink ADDITIONAL_LIBS "${ADDITIONAL_LIBS}" #WARNINGS_AS_ERRORS disabled for release 2014-03 because of bug 17463 ) if(MitkIGT_IS_ENABLED) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/ClaronMicron.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/IntuitiveDaVinci.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAurora.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAurora_Dome.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraCompactFG_Dome.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraPlanarFG_Dome.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraTabletopFG_Dome.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraTabletopFG_Prototype_Dome.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisOldModel.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisSpectra.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisSpectraExtendedPyramid.stl ) MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisVicra.stl ) endif() if(NOT MODULE_IS_ENABLED) message(STATUS "IGTTutorialStep1 won't be built. Missing: ${_RESULT}") else() ## create IGT config configure_file(mitkIGTConfig.h.in ${PROJECT_BINARY_DIR}/mitkIGTConfig.h @ONLY) # add test programm for serial communication classADD_EXECUTABLE(SerialCommunicationTest IGTTrackingDevices/mitkSerialCommunicationTest.cpp)target_link_libraries(SerialCommunicationTest mitkIGT Mitk tinyxml PocoXML) add_subdirectory(Tutorial) add_subdirectory(Testing) endif() diff --git a/Modules/IGT/files.cmake b/Modules/IGT/files.cmake index a23020d003..ec413d0ff5 100644 --- a/Modules/IGT/files.cmake +++ b/Modules/IGT/files.cmake @@ -1,90 +1,91 @@ set(CPP_FILES TestingHelper/mitkNavigationToolStorageTestHelper.cpp Algorithms/mitkNavigationDataDelayFilter.cpp Algorithms/mitkNavigationDataDisplacementFilter.cpp Algorithms/mitkNavigationDataEvaluationFilter.cpp Algorithms/mitkNavigationDataLandmarkTransformFilter.cpp Algorithms/mitkNavigationDataReferenceTransformFilter.cpp Algorithms/mitkNavigationDataSmoothingFilter.cpp Algorithms/mitkNavigationDataToMessageFilter.cpp Algorithms/mitkNavigationDataToNavigationDataFilter.cpp Algorithms/mitkNavigationDataToPointSetFilter.cpp Algorithms/mitkNavigationDataTransformFilter.cpp + Algorithms/mitkIGTLMessageToNavigationDataFilter.cpp Common/mitkIGTTimeStamp.cpp Common/mitkSerialCommunication.cpp Common/mitkTrackingTypes.cpp DataManagement/mitkNavigationData.cpp DataManagement/mitkNavigationDataSet.cpp DataManagement/mitkNavigationDataSource.cpp DataManagement/mitkNavigationTool.cpp DataManagement/mitkNavigationToolStorage.cpp DataManagement/mitkTrackingDeviceSourceConfigurator.cpp DataManagement/mitkTrackingDeviceSource.cpp ExceptionHandling/mitkIGTException.cpp ExceptionHandling/mitkIGTHardwareException.cpp ExceptionHandling/mitkIGTIOException.cpp IO/mitkNavigationDataPlayer.cpp IO/mitkNavigationDataPlayerBase.cpp IO/mitkNavigationDataRecorder.cpp IO/mitkNavigationDataRecorderDeprecated.cpp IO/mitkNavigationDataSequentialPlayer.cpp IO/mitkNavigationToolReader.cpp IO/mitkNavigationToolStorageSerializer.cpp IO/mitkNavigationToolStorageDeserializer.cpp IO/mitkNavigationToolWriter.cpp IO/mitkNavigationDataReaderInterface.cpp IO/mitkNavigationDataReaderXML.cpp IO/mitkNavigationDataReaderCSV.cpp IO/mitkNavigationDataSetWriterXML.cpp IO/mitkNavigationDataSetWriterCSV.cpp Rendering/mitkCameraVisualization.cpp Rendering/mitkNavigationDataObjectVisualizationFilter.cpp TrackingDevices/mitkClaronTool.cpp TrackingDevices/mitkClaronTrackingDevice.cpp TrackingDevices/mitkInternalTrackingTool.cpp TrackingDevices/mitkNDIPassiveTool.cpp TrackingDevices/mitkNDIProtocol.cpp TrackingDevices/mitkNDITrackingDevice.cpp TrackingDevices/mitkTrackingDevice.cpp TrackingDevices/mitkTrackingTool.cpp TrackingDevices/mitkTrackingVolumeGenerator.cpp TrackingDevices/mitkVirtualTrackingDevice.cpp TrackingDevices/mitkVirtualTrackingTool.cpp TrackingDevices/mitkOptitrackErrorMessages.cpp TrackingDevices/mitkOptitrackTrackingDevice.cpp TrackingDevices/mitkOptitrackTrackingTool.cpp ) set(RESOURCE_FILES ClaronMicron.stl IntuitiveDaVinci.stl NDIAurora.stl NDIAurora_Dome.stl NDIAuroraCompactFG_Dome.stl NDIAuroraPlanarFG_Dome.stl NDIAuroraTabletopFG_Dome.stl NDIAuroraTabletopFG_Prototype_Dome.stl NDIPolarisOldModel.stl NDIPolarisSpectra.stl NDIPolarisSpectraExtendedPyramid.stl NDIPolarisVicra.stl ) if(MITK_USE_MICRON_TRACKER) set(CPP_FILES ${CPP_FILES} TrackingDevices/mitkClaronInterface.cpp) else() set(CPP_FILES ${CPP_FILES} TrackingDevices/mitkClaronInterfaceStub.cpp) endif(MITK_USE_MICRON_TRACKER) if(MITK_USE_MICROBIRD_TRACKER) set(CPP_FILES ${CPP_FILES} TrackingDevices/mitkMicroBirdTrackingDevice.cpp) endif(MITK_USE_MICROBIRD_TRACKER) diff --git a/Modules/IGTBase/mitkIGTTimeStamp.cpp b/Modules/IGTBase/mitkIGTTimeStamp.cpp deleted file mode 100644 index 3ff1a2b10a..0000000000 --- a/Modules/IGTBase/mitkIGTTimeStamp.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "mitkIGTTimeStamp.h" -#include - -#include "mitkRealTimeClock.h" - -mitk::IGTTimeStamp::Pointer mitk::IGTTimeStamp::s_Instance = NULL; - -mitk::IGTTimeStamp::IGTTimeStamp() : itk::Object() -, m_Time(-1.0), m_ReferenceTime(0.0) -{ -} - -mitk::IGTTimeStamp::~IGTTimeStamp() -{ -} - -mitk::IGTTimeStamp* mitk::IGTTimeStamp::CreateInstance() -{ -return mitk::IGTTimeStamp::GetInstance(); -} - -mitk::IGTTimeStamp* mitk::IGTTimeStamp::GetInstance() -{ - if (IGTTimeStamp::s_Instance.IsNull()) - { - mitk::IGTTimeStamp::Pointer ts = new mitk::IGTTimeStamp; - s_Instance = ts; - return s_Instance; - } - else - return s_Instance; -} - -void mitk::IGTTimeStamp::Start(itk::Object::Pointer device) -{ - if (m_RealTimeClock.IsNull()) - { - Initialize(); - } - if ( s_Instance.IsNotNull() ) - { - if (m_DeviceMap.empty()) - { - m_ReferenceTime = GetCurrentStamp(); - m_Time = 0.0; - } - m_DeviceMap.insert( std::pair(device, this->GetElapsed()) ); - } - else - { - itkGenericOutputMacro("Trying to use mitk::TimeStamp::Start() " - << "without an available singleton instance. Either no instance has " - << "been created (use TimeStamp::CreateInstance) or it has already " - << "been destroyed."); - } -} - -void mitk::IGTTimeStamp::Stop(itk::Object::Pointer device) -{ - if ( s_Instance.IsNotNull() ) - { - m_MapIterator = m_DeviceMap.find(device); - if ( m_MapIterator != m_DeviceMap.end() ) - { - m_DeviceMap.erase( m_MapIterator ); - } - - if (m_DeviceMap.empty()) - { - m_ReferenceTime = 0; - m_Time = -1; - } - } - else - { - itkGenericOutputMacro("Trying to use mitk::TimeStamp::Stop() " - << "without an available singleton instance. Either no instance has " - << "been created (use TimeStamp::CreateInstance) or it has already " - << "been destroyed."); - } -} - - -double mitk::IGTTimeStamp::GetElapsed() -{ - if (m_Time > -1) - { - m_Time = GetCurrentStamp(); - m_Time = m_Time - m_ReferenceTime; - } - return (double) m_Time; -} - - -double mitk::IGTTimeStamp::GetElapsed(itk::Object::Pointer device) -{ - double offset = this->GetOffset( device ); - if ( offset > -1 ) - { - double time = this->GetElapsed(); - return (double) time - this->GetOffset(device); - } - else - { - return (double) -1; - } -} - -double mitk::IGTTimeStamp::GetCurrentStamp() -{ - if (m_RealTimeClock.IsNotNull()) - { - return m_RealTimeClock->GetCurrentStamp(); - } - else return 0.0; -} - -void mitk::IGTTimeStamp::SetRealTimeClock(mitk::RealTimeClock::Pointer Clock) -{ - m_RealTimeClock = Clock; -} - -double mitk::IGTTimeStamp::GetOffset(itk::Object::Pointer Device) -{ - m_MapIterator = m_DeviceMap.find(Device); - if ( m_MapIterator != m_DeviceMap.end() ) - { - return m_MapIterator->second; - } - else - { - return -1.0; - } -} - -void mitk::IGTTimeStamp::Initialize() -{ - if ( m_RealTimeClock.IsNull() ) - m_RealTimeClock = mitk::RealTimeClock::New(); -} diff --git a/Modules/IGTBase/mitkIGTTimeStamp.h b/Modules/IGTBase/mitkIGTTimeStamp.h deleted file mode 100644 index 029b56b33b..0000000000 --- a/Modules/IGTBase/mitkIGTTimeStamp.h +++ /dev/null @@ -1,190 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef MITKTIMESTAMP_H_HEADER_INCLUDED_ -#define MITKTIMESTAMP_H_HEADER_INCLUDED_ - -#include -#include -#include - -#include "mitkRealTimeClock.h" - - -namespace mitk { - - /** - * \brief Time stamp in milliseconds - * - * This class provides a timestamp in milliseconds. - * It is a Singleton class, that internally uses a mitkRealTimeClock() for - * time-acquisition. - * - * First you have to call Start() in order to set the reference-time to the current time. - * If the user has not created and set his own "RealTimeClock", initialize() will be called and a - * default mitkRealTimeClock() is created. - * In addition the TimeStamp() saves a pointer to the device calling and the respective offset-time. - * The first device will have an offset of 0, the following's offset will be the time elapsed since the - * starting of the first device. This offset can be prompted by calling GetOffset(); - * - * You can always get the time elapsed since calling Start() with GetElapsed(). It returns the - * time spent in milliseconds as a double. - * - * When the TimeStamp is no longer used, you can call Stop(). This erases the pointer to the device - * and the offset. When all devices have "stopped tracking" the reference-time and the current-time are reset to 0. - * - * \ingroup IGT - */ - class MitkIGT_EXPORT IGTTimeStamp : public itk::Object - { - public: - - mitkClassMacro(IGTTimeStamp, itk::Object); - - /** - * \brief creates a new instance of mitkTimeStamp - * - * This method returns a pointer to the currently existing TimeStamp. - * If there is no exisiting instance, a new one is created and returned automatically - * - * DECREPATED: Use GetInstance instead - */ - static IGTTimeStamp* CreateInstance(); - - /** - * \brief returns a pointer to the current instance of mitkTimeStamp - * - * This method returns a pointer to the currently existing TimeStamp. - * If there is no exisiting instance, a new one is created and returned automatically - */ - static IGTTimeStamp* GetInstance(); - - /** - * \brief starts the time-acquisition - * - * Each device is to call this method when it starts tracking. - * The current time is saved as a reference-value (m_Time = 0). - * Internally the device (pointer) and its offset are saved in a map, so that - * no device can call this method twice. - * If the user has not set its own RealTimeClock, a default one is created dependant on the OS - * in use. - * - */ - void Start( itk::Object::Pointer device ); - - /** - * \brief stops the time-acqusition - * - * Each device has to call Stop() when it has finished and its - * pointer will be erased from the map. When the last device has "stopped" - * the reference-time and the current-time will be reset to 0. - * - */ - void Stop( itk::Object::Pointer device ); - - /** - * \brief returns the time elapsed since calling Start() for the first time in milliseconds - * - * GetElapsed() returns the time elapsed since Start() has been called first, no matter - * which itk::Object did the call. - * This method-call can be used if you want to need to have several processes you want to - * monitor and need timestamps in the same space of time, e.g. when using two tracking-devices - * on the same experiment. - */ - double GetElapsed(); - - /** - * \brief returns the time elapsed since 'device' called Start() in milliseconds - * - * GetElapsed(itk::Object device) returns the time elapsed since the given itk::Object called - * Start(). - * This overloaded method should be used when you only have one independent process to keep - * track of, e.g. when you want to measure how long it takes to execute a piece of code. - */ - double GetElapsed(itk::Object::Pointer device); - - - /** - * \brief returns the offset of this device's starting-time to the - * reference-time in ms - * - * Device 'A' is the first device to call Start(). Device 'B' calls Start() - * some time later. This time-difference is the offset, that each device has realtive to the - * device that started the time-acquisition. - * Each device's offset is stored in a map with a pointer to the device. - * - * If this device has not been or is no longer saved in the map of devices, - * -1 will be returned. - * - * - * only used internally - */ - double GetOffset(itk::Object::Pointer Device); - - /** - * \brief setter for the internally used RealTimeClock() - * - * If you want to use a "third-party" RealTimeClock, e.g PocoRealTimeClock, BoostRealTimeClock - * or ITKRealTimeClock, you can set it using this method: - * mitk::RealTimeClock::Pointer RealTimeClock = mitk::RealTimeClock::New(); - * mitk::TimeStamp::GetInstance()->SetRealTimeClock(RealTimeClock); - * - * Right now, none of these RealTimeClocks have been implemented!! - * - * Notice: The mitk-implementation of an os-dependant RealTimeClock is used - * by default. - */ - void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock); - - /** - * \brief creates a new RealTimeClock - * - * Instanciates a new RealTimeClock, that will be specific for the Operating System. - * This will only be called internally when no other RealTimeClock has been set - * by the user. - * - */ - void Initialize(); - - protected: - - IGTTimeStamp(); - - virtual ~IGTTimeStamp(); - - double GetCurrentStamp(); - - /* the current timestamp when GetCurrentStamp() is called. */ - double m_Time; - - /* the timestamp in ms acquired when Start() was called. */ - double m_ReferenceTime; - - /* pointer to the RealTimeClock used internally */ - mitk::RealTimeClock::Pointer m_RealTimeClock; - - /* pointer to the current instance */ - static mitk::IGTTimeStamp::Pointer s_Instance; - - /* map, in which pointer to all devices calling Start(), are saved */ - std::map m_DeviceMap; - - std::map::iterator m_MapIterator; - }; -} // namespace mitk - -#endif /* MITKTIMESTAMP_H_HEADER_INCLUDED_ */ diff --git a/Modules/IGTLink/CMakeLists.txt b/Modules/IGTLink/CMakeLists.txt deleted file mode 100644 index 79a946368a..0000000000 --- a/Modules/IGTLink/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ - -MITK_CREATE_MODULE( - DEPENDS MitkCore MitkIGT MitkOpenIGTLink - #PACKAGE_DEPENDS OpenIGTLink - EXPORT_DEFINE MITK_IGTLINK_EXPORT -) diff --git a/Modules/IGTLink/files.cmake b/Modules/IGTLink/files.cmake deleted file mode 100644 index 4f4c430e82..0000000000 --- a/Modules/IGTLink/files.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(CPP_FILES - mitkIGTLMessageToNavigationDataFilter.cpp -) diff --git a/Plugins/org.mitk.gui.qt.igtlplugin/CMakeLists.txt b/Plugins/org.mitk.gui.qt.igtlplugin/CMakeLists.txt index c0fef73169..1bceffe2b2 100644 --- a/Plugins/org.mitk.gui.qt.igtlplugin/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.igtlplugin/CMakeLists.txt @@ -1,8 +1,8 @@ project(org_mitk_gui_qt_igtlplugin) MACRO_CREATE_MITK_CTK_PLUGIN( DEPENDS EXPORT_DIRECTIVE IGTLPLUGIN_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkOpenIGTLink MitkOpenIGTLink MitkIGTLink MitkIGT + MODULE_DEPENDS MitkQtWidgetsExt MitkOpenIGTLink MitkOpenIGTLink MitkIGT )