diff --git a/Modules/US/USHardwareEpiphan/CMakeLists.txt b/Modules/US/USHardwareEpiphan/CMakeLists.txt index e38c9d1719..4e0bfbe4f1 100644 --- a/Modules/US/USHardwareEpiphan/CMakeLists.txt +++ b/Modules/US/USHardwareEpiphan/CMakeLists.txt @@ -1,29 +1,31 @@ option(MITK_USE_EPIPHAN_SDK "Enable support for Epiphan devices" OFF) if(MITK_USE_EPIPHAN_SDK) set(MITK_EPIPHAN_SDK_PATH CACHE PATH "") if(MITK_EPIPHAN_SDK_PATH) -set(MITK_EPIPHAN_INCLUDE_DIR ${MITK_EPIPHAN_SDK_PATH}/include) -set(MITK_EPIPHAN_FRMGRAB_INCLUDE_DIR ${MITK_EPIPHAN_SDK_PATH}/frmgrab/include) -set(MITK_EPIPHAN_FRMGRAB_LIBRARY ${MITK_EPIPHAN_SDK_PATH}/frmgrab/lib/win/x64/frmgrab.lib) +find_library(MITK_EPIPHAN_FRMGRAB_LIBRARY frmgrab ${MITK_EPIPHAN_SDK_PATH}/frmgrab/lib/win/x64/ "Path which contains the Epiphan frmgrab.lib library.") +find_path(MITK_EPIPHAN_INCLUDE_DIR v2u_defs.h ${MITK_EPIPHAN_SDK_PATH}/include "Include directory of the Epiphan library.") +find_path(MITK_EPIPHAN_FRMGRAB_INCLUDE_DIR frmgrab.h ${MITK_EPIPHAN_SDK_PATH}/frmgrab/include "Include directory of the Epiphan frmgrab library.") +#set(MITK_EPIPHAN_INCLUDE_DIR ${MITK_EPIPHAN_SDK_PATH}/include) +#set(MITK_EPIPHAN_FRMGRAB_INCLUDE_DIR ${MITK_EPIPHAN_SDK_PATH}/frmgrab/include) +#set(MITK_EPIPHAN_FRMGRAB_LIBRARY ${MITK_EPIPHAN_SDK_PATH}/frmgrab/lib/win/x64/frmgrab.lib) MITK_CREATE_MODULE( SUBPROJECTS DEPENDS MitkUS INCLUDE_DIRS ${MITK_EPIPHAN_INCLUDE_DIR} ${MITK_EPIPHAN_FRMGRAB_INCLUDE_DIR} - INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL} ADDITIONAL_LIBS ${MITK_EPIPHAN_FRMGRAB_LIBRARY} AUTOLOAD_WITH MitkUS ) else() message(FATAL_ERROR "Please set the Epiphan SDK root path (MITK_EPIPHAN_SDK_PATH).") endif() endif() diff --git a/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.cpp b/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.cpp index 62b08d9be2..3ad271ac86 100644 --- a/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.cpp +++ b/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.cpp @@ -1,32 +1,44 @@ /*=================================================================== 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 -#include "frmgrab.h" -mitk::USEpiphanImageSource::USEpiphanImageSource() +mitk::USEpiphanImageSource::USEpiphanImageSource() {} + +mitk::USEpiphanImageSource::~USEpiphanImageSource() {} + +void mitk::USEpiphanImageSource::GetNextRawImage(std::vector &) { + FrmGrab_Open("local:"); } -mitk::USEpiphanImageSource::~USEpiphanImageSource() +void mitk::USEpiphanImageSource::StartGrabbing() { + m_FrameGrabber = FrmGrab_Open(0); + V2U_BOOL isStarted; + isStarted = FrmGrab_Start(m_FrameGrabber); + + std::cout << "FG open and grab started: " << isStarted << std::endl; } -void mitk::USEpiphanImageSource::GetNextRawImage(std::vector &) +void mitk::USEpiphanImageSource::StopGrabbing() { - FrmGrab_Open("local:"); + //FrmGrab_Stop(m_FrameGrabber); + //FrmGrab_Close(m_FrameGrabber); + // + //std::cout << "FG closed and grab stopped: " << std::endl; } diff --git a/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.h b/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.h index 630488d768..296f53998b 100644 --- a/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.h +++ b/Modules/US/USHardwareEpiphan/mitkUSEpiphanImageSource.h @@ -1,42 +1,49 @@ /*=================================================================== 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 MITKUSEpiphanImageSource_H_HEADER_INCLUDED_ #define MITKUSEpiphanImageSource_H_HEADER_INCLUDED_ #include "mitkUSImageSource.h" +#include "frmgrab.h" -namespace mitk { -/** - * \brief Implementation of mitk::USImageSource for Epiphan API devices. - */ -class USEpiphanImageSource : public USImageSource +namespace mitk { -public: - mitkClassMacro(USEpiphanImageSource, USImageSource) - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) + /** + * \brief Implementation of mitk::USImageSource for Epiphan API devices. + */ + class USEpiphanImageSource : public USImageSource + { + public: + mitkClassMacro(USEpiphanImageSource, USImageSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self) - void GetNextRawImage(std::vector &); + void GetNextRawImage(std::vector &); + + void StartGrabbing(); -protected: - USEpiphanImageSource(); - virtual ~USEpiphanImageSource( ); + void StopGrabbing(); -}; + FrmGrabber *m_FrameGrabber; + + protected: + USEpiphanImageSource(); + virtual ~USEpiphanImageSource(); + + + }; } // namespace mitk #endif // MITKUSEpiphanImageSource_H