diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp b/Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.cpp similarity index 56% copy from Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp copy to Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.cpp index 952c2c16b9..3456a872ac 100644 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp +++ b/Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.cpp @@ -1,38 +1,36 @@ /*=================================================================== 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 "mitkUSDiPhASDopplerControls.h" -#include "mitkUSDiPhASDevice.h" -#include +#include "mitkUSDiPhASDeviceCustomControls.h" -mitk::USDiPhASDopplerControls::USDiPhASDopplerControls(itk::SmartPointer device) - : mitk::USControlInterfaceDoppler(device.GetPointer()) +mitk::USDiPhASDeviceCustomControls::USDiPhASDeviceCustomControls(itk::SmartPointer device) + : mitk::USAbstractControlInterface(device.GetPointer()), m_IsActive(false) { } -mitk::USDiPhASDopplerControls::~USDiPhASDopplerControls() +mitk::USDiPhASDeviceCustomControls::~USDiPhASDeviceCustomControls() { } -void mitk::USDiPhASDopplerControls::SetIsActive(bool isActive) +void mitk::USDiPhASDeviceCustomControls::SetIsActive(bool isActive) { m_IsActive = isActive; } -bool mitk::USDiPhASDopplerControls::GetIsActive() +bool mitk::USDiPhASDeviceCustomControls::GetIsActive() { return m_IsActive; } \ No newline at end of file diff --git a/Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.h b/Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.h new file mode 100644 index 0000000000..072f20a9e5 --- /dev/null +++ b/Modules/US/USControlInterfaces/mitkUSDiPhASDeviceCustomControls.h @@ -0,0 +1,59 @@ +/*=================================================================== + +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 MITKUSDiPhASDeviceCustomControls_H_HEADER_INCLUDED_ +#define MITKUSDiPhASDeviceCustomControls_H_HEADER_INCLUDED_ + +#include "mitkUSAbstractControlInterface.h" +#include "mitkUSImageVideoSource.h" +#include "mitkUSDevice.h" + +#include + +namespace mitk { +/** + * \brief Custom controls for mitk::USDiPhASDevice. + */ +class MITKUS_EXPORT USDiPhASDeviceCustomControls : public USAbstractControlInterface +{ +public: + mitkClassMacro(USDiPhASDeviceCustomControls, USAbstractControlInterface); + mitkNewMacro1Param(Self, itk::SmartPointer); + + /** + * Activate or deactivate the custom controls. This is just for handling + * widget visibility in a GUI for example. + */ + virtual void SetIsActive( bool isActive ) override; + + /** + * \return if this custom controls are currently activated + */ + virtual bool GetIsActive( ) override; + +protected: + /** + * Class needs an mitk::USDevice object for beeing constructed. + */ + USDiPhASDeviceCustomControls( itk::SmartPointer device ); + virtual ~USDiPhASDeviceCustomControls( ); + + bool m_IsActive; + USImageVideoSource::Pointer m_ImageSource; +}; +} // namespace mitk + +#endif // MITKUSDiPhASDeviceCustomControls_H_HEADER_INCLUDED_ \ No newline at end of file diff --git a/Modules/US/USHardwareDiPhAS/files.cmake b/Modules/US/USHardwareDiPhAS/files.cmake index b53abbc22c..9ed8ba8f95 100644 --- a/Modules/US/USHardwareDiPhAS/files.cmake +++ b/Modules/US/USHardwareDiPhAS/files.cmake @@ -1,9 +1,8 @@ SET(CPP_FILES mitkUSDiPhASActivator.cpp mitkUSDiPhASDevice.cpp mitkUSDiPhASImageSource.cpp mitkUSDiPhASProbe.cpp -mitkUSDiPhASBModeControls.cpp -mitkUSDiPhASDopplerControls.cpp mitkUSDiPhASProbesControls.cpp +mitkUSDiPhASCustomControls.cpp ) diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.cpp b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.cpp deleted file mode 100644 index b3d778d49d..0000000000 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.cpp +++ /dev/null @@ -1,193 +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 "mitkUSDiPhASBModeControls.h" -#include "mitkUSDiPhASDevice.h" -#include - -#define DiPhAS_FREQUENCY_FACTOR 1000000 - -mitk::USDiPhASBModeControls::USDiPhASBModeControls(itk::SmartPointer device) -: mitk::USControlInterfaceBMode(device.GetPointer()), - m_Active(false), m_PowerSteps(new double[3]), - m_GainSteps(new double[3]), m_RejectionSteps(new double[3]), - m_DynamicRangeSteps(new double[3]) -{ -} - -mitk::USDiPhASBModeControls::~USDiPhASBModeControls() -{ - //this->ReleaseControls(); - - delete[] m_PowerSteps; - delete[] m_GainSteps; - delete[] m_RejectionSteps; - delete[] m_DynamicRangeSteps; -} - - -/*void mitk::USDiPhASBModeControls::ReinitializeControls() -{ - this->ReleaseControls(); - this->CreateControls(); -} -*/ -void mitk::USDiPhASBModeControls::SetIsActive(bool active) -{ - if (active) - { - //this->CreateControls(); - m_Active = true; - } - else - { - //this->ReleaseControls(); - m_Active = false; - } -} - -bool mitk::USDiPhASBModeControls::GetIsActive() -{ - return m_Active; -} - -double mitk::USDiPhASBModeControls::GetScanningFrequency() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningFrequency(double value) -{ -} - -std::vector mitk::USDiPhASBModeControls::GetScanningFrequencyValues() -{ - std::vector h; - h.push_back(3); - return h; -} - -double mitk::USDiPhASBModeControls::GetScanningPower() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningPower(double value) -{ -} - -double mitk::USDiPhASBModeControls::GetScanningPowerMin() -{ - return m_PowerSteps[0]; -} - -double mitk::USDiPhASBModeControls::GetScanningPowerMax() -{ - return m_PowerSteps[1]; -} - -double mitk::USDiPhASBModeControls::GetScanningPowerTick() -{ - return m_PowerSteps[2]; -} - -double mitk::USDiPhASBModeControls::GetScanningDepth() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningDepth(double value) -{ -} - -std::vector mitk::USDiPhASBModeControls::GetScanningDepthValues() -{ - std::vector h; - h.push_back(3); - return h; -} - -double mitk::USDiPhASBModeControls::GetScanningGain() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningGain(double value) -{ -} - -double mitk::USDiPhASBModeControls::GetScanningGainMin() -{ - return m_GainSteps[0]; -} - -double mitk::USDiPhASBModeControls::GetScanningGainMax() -{ - return m_GainSteps[1]; -} - -double mitk::USDiPhASBModeControls::GetScanningGainTick() -{ - return m_GainSteps[2]; -} - -double mitk::USDiPhASBModeControls::GetScanningRejection() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningRejection(double value) -{ -} - -double mitk::USDiPhASBModeControls::GetScanningRejectionMin() -{ - return m_RejectionSteps[0]; -} - -double mitk::USDiPhASBModeControls::GetScanningRejectionMax() -{ - return m_RejectionSteps[1]; -} - -double mitk::USDiPhASBModeControls::GetScanningRejectionTick() -{ - return m_RejectionSteps[2]; -} - -double mitk::USDiPhASBModeControls::GetScanningDynamicRange() -{ - return 0; -} - -void mitk::USDiPhASBModeControls::OnSetScanningDynamicRange(double value) -{ -} - -double mitk::USDiPhASBModeControls::GetScanningDynamicRangeMin() -{ - return m_DynamicRangeSteps[0]; -} - -double mitk::USDiPhASBModeControls::GetScanningDynamicRangeMax() -{ - return m_DynamicRangeSteps[1]; -} - -double mitk::USDiPhASBModeControls::GetScanningDynamicRangeTick() -{ - return m_DynamicRangeSteps[2]; -} diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.h b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.h deleted file mode 100644 index caad55e31b..0000000000 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASBModeControls.h +++ /dev/null @@ -1,94 +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 MITKUSDiPhASBModeControls_H_HEADER_INCLUDED_ -#define MITKUSDiPhASBModeControls_H_HEADER_INCLUDED_ - -#include "Framework.IBMT.US.CWrapper.h" -#include "mitkUSControlInterfaceBMode.h" - -#include - -namespace mitk { - class USDiPhASDevice; - - /** - * \brief Implementation of mitk::USControlInterfaceBMode for DiPhAS ultrasound devices. - * See documentation of mitk::USControlInterfaceBMode for a description of the interface methods. - */ - class USDiPhASBModeControls : public USControlInterfaceBMode - { - public: - mitkClassMacro(USDiPhASBModeControls, USControlInterfaceBMode); - mitkNewMacro1Param(Self, itk::SmartPointer); - - /** - * Scan mode is set to b mode when this controls are activated. - * All necessary controls are created at the DiPhAS API. - */ - virtual void SetIsActive( bool ); - - /** - * \return true if API controls are created and scan mode is set to b mode - */ - virtual bool GetIsActive( ); - - virtual double GetScanningFrequency( ); - virtual void OnSetScanningFrequency( double frequency ); - virtual std::vector GetScanningFrequencyValues( ); - - virtual double GetScanningPower( ); - virtual void OnSetScanningPower( double power ); - virtual double GetScanningPowerMin( ); - virtual double GetScanningPowerMax( ); - virtual double GetScanningPowerTick( ); - - virtual double GetScanningDepth( ); - virtual void OnSetScanningDepth( double ); - virtual std::vector GetScanningDepthValues( ); - - virtual double GetScanningGain( ); - virtual void OnSetScanningGain( double ); - virtual double GetScanningGainMin( ); - virtual double GetScanningGainMax( ); - virtual double GetScanningGainTick( ); - - virtual double GetScanningRejection( ); - virtual void OnSetScanningRejection( double ); - virtual double GetScanningRejectionMin( ); - virtual double GetScanningRejectionMax( ); - virtual double GetScanningRejectionTick( ); - - virtual double GetScanningDynamicRange( ); - virtual void OnSetScanningDynamicRange( double ); - virtual double GetScanningDynamicRangeMin( ); - virtual double GetScanningDynamicRangeMax( ); - virtual double GetScanningDynamicRangeTick( ); - - protected: - USDiPhASBModeControls(itk::SmartPointer device); - virtual ~USDiPhASBModeControls(); - - bool m_Active; - - double* m_PowerSteps; // array holding possible power values: [min, max, tick] - double* m_GainSteps; // array holding possible gains: [min, max, tick] - double* m_RejectionSteps; // array holding possible rejections: [min, max, tick] - double* m_DynamicRangeSteps; // array holding possible dynamic range values: [min, max, tick] - }; -} // namespace mitk - -#endif // MITKUSDiPhASBModeControls_H_HEADER_INCLUDED_ \ No newline at end of file diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.cpp similarity index 56% rename from Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp rename to Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.cpp index 952c2c16b9..bdc5e7fe34 100644 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.cpp +++ b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.cpp @@ -1,38 +1,36 @@ /*=================================================================== 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 "mitkUSDiPhASDopplerControls.h" -#include "mitkUSDiPhASDevice.h" -#include +#include "mitkUSDiPhASCustomControls.h" -mitk::USDiPhASDopplerControls::USDiPhASDopplerControls(itk::SmartPointer device) - : mitk::USControlInterfaceDoppler(device.GetPointer()) +mitk::USDiPhASCustomControls::USDiPhASCustomControls(USDiPhASDevice* device) + : mitk::USDiPhASDeviceCustomControls(device), m_IsActive(false) { } -mitk::USDiPhASDopplerControls::~USDiPhASDopplerControls() +mitk::USDiPhASCustomControls::~USDiPhASCustomControls() { } -void mitk::USDiPhASDopplerControls::SetIsActive(bool isActive) +void mitk::USDiPhASCustomControls::SetIsActive(bool isActive) { m_IsActive = isActive; } -bool mitk::USDiPhASDopplerControls::GetIsActive() +bool mitk::USDiPhASCustomControls::GetIsActive() { return m_IsActive; } \ No newline at end of file diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.h b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.h new file mode 100644 index 0000000000..c7905de010 --- /dev/null +++ b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASCustomControls.h @@ -0,0 +1,61 @@ +/*=================================================================== + +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 MITKUSDiPhASCustomControls_H_HEADER_INCLUDED_ +#define MITKUSDiPhASCustomControls_H_HEADER_INCLUDED_ + +#include "mitkUSDevice.h" +#include "mitkUSDiPhASDeviceCustomControls.h" +#include "mitkUSDiPhASDevice.h" + +#include + +namespace mitk { +/** + * \brief Custom controls for mitk::USDiPhASDevice. + */ +class USDiPhASDevice; +class USDiPhASCustomControls : public USDiPhASDeviceCustomControls +{ +public: + mitkClassMacro(USDiPhASCustomControls, USAbstractControlInterface); + mitkNewMacro1Param(Self, mitk::USDiPhASDevice*); + + /** + * Activate or deactivate the custom controls. This is just for handling + * widget visibility in a GUI for example. + */ + virtual void SetIsActive( bool isActive ) override; + + /** + * \return if this custom controls are currently activated + */ + virtual bool GetIsActive( ) override; + +protected: + /** + * Class needs an mitk::USDiPhASDevice object for beeing constructed. + * This object's ScanMode will be manipulated by the custom controls methods. + */ + USDiPhASCustomControls(USDiPhASDevice* device); + virtual ~USDiPhASCustomControls( ); + + bool m_IsActive; + USImageVideoSource::Pointer m_ImageSource; +}; +} // namespace mitk + +#endif // MITKUSDiPhASCustomControls_H_HEADER_INCLUDED_ \ No newline at end of file diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.cpp b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.cpp index 63300f7ef3..0dd51b8f8f 100644 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.cpp +++ b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.cpp @@ -1,230 +1,232 @@ /*=================================================================== 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 "mitkUSDiPhASDevice.h" +#include "mitkUSDiPhASCustomControls.h" mitk::USDiPhASDevice::USDiPhASDevice(std::string manufacturer, std::string model) : mitk::USDevice(manufacturer, model), m_ControlsProbes(mitk::USDiPhASProbesControls::New(this)), - m_ControlsBMode(mitk::USDiPhASBModeControls::New(this)), - m_ControlsDoppler(mitk::USDiPhASDopplerControls::New(this)), m_ImageSource(mitk::USDiPhASImageSource::New(this)), + m_ControlInterfaceCustom(mitk::USDiPhASCustomControls::New(this)), m_IsRunning(false) { SetNumberOfOutputs(1); SetNthOutput(0, this->MakeOutput(0)); - //m_MessageCallbackWrapper = [](const char* message)->void{/*this->MessageCallback(message); */}; } mitk::USDiPhASDevice::~USDiPhASDevice() { } std::string mitk::USDiPhASDevice::GetDeviceClass() { return "org.mitk.modules.us.USDiPhASDevice"; } -/*mitk::USControlInterfaceBMode::Pointer mitk::USDiPhASDevice::GetControlInterfaceBMode() -{ - return m_ControlsBMode.GetPointer(); -}*/ - mitk::USControlInterfaceProbes::Pointer mitk::USDiPhASDevice::GetControlInterfaceProbes() { return m_ControlsProbes.GetPointer(); }; -/*mitk::USControlInterfaceDoppler::Pointer mitk::USDiPhASDevice::GetControlInterfaceDoppler() -{ - return m_ControlsDoppler.GetPointer(); -};*/ - mitk::USAbstractControlInterface::Pointer mitk::USDiPhASDevice::GetControlInterfaceCustom() { - return m_ControlsCustom.GetPointer(); + return m_ControlInterfaceCustom.GetPointer(); } mitk::USImageSource::Pointer mitk::USDiPhASDevice::GetUSImageSource() { return m_ImageSource.GetPointer(); } ScanModeNative& mitk::USDiPhASDevice::GetScanMode() { return m_ScanMode; } // Setup and Cleanup bool mitk::USDiPhASDevice::OnInitialization() { MITK_INFO<<"I was initialized"; return true; } //---------------------------------------------------------------------------------------------------------------------------- /* ugly wrapper stuff - find better solution so it isn't necessary to create a global pointer to USDiPhASDevice... * passing a lambda function would be nicer - sadly something goes wrong when passing the adress of a lambda function: * the API produces access violations. Passing the Lambda function itself would be preferable, but that's not possible */ mitk::USDiPhASDevice* w_device; mitk::USDiPhASImageSource* w_ISource; void WrapperMessageCallback(const char* message) { - w_device->MessageCallback(message); + w_device->MessageCallback(message); } void WrapperImageDataCallback( short* rfDataChannelData, int channelDatalinesPerDataset, int channelDataSamplesPerChannel, int channelDataTotalDatasets, short* rfDataArrayBeamformed, int beamformedLines, int beamformedSamples, int beamformedTotalDatasets, unsigned char* imageData, int imageWidth, int imageHeight, int imagePixelFormat, int imageSetsTotal, double timeStamp) { w_ISource->ImageDataCallback( rfDataChannelData, channelDatalinesPerDataset, channelDatalinesPerDataset, channelDataTotalDatasets, rfDataArrayBeamformed, beamformedLines, beamformedSamples, beamformedTotalDatasets, imageData, imageWidth, imageHeight, imagePixelFormat, imageSetsTotal, timeStamp); } //---------------------------------------------------------------------------------------------------------------------------- +#include + + +void mitk::USDiPhASDevice::MessageCallbackWrapper(const char* message, mitk::USDiPhASDevice::Pointer device) +{ + device->MessageCallback(message); +} + bool mitk::USDiPhASDevice::OnConnection() { + //testcode---------------------------------------------------------------------------------------------------------------------- + std::function hi = std::bind(USDiPhASDevice::MessageCallbackWrapper, std::placeholders::_1, this); + auto k = [](std::function h)->void {h("lol"); }; + k(hi); + //testcode---------------------------------------------------------------------------------------------------------------------- + //just the way I'd like the Callbacks to be + w_device = this; w_ISource = m_ImageSource; // Need those pointers for the forwarders to call member functions; createBeamformer expects non-member function pointers. createBeamformer((StringMessageCallback)&WrapperMessageCallback, (NewDataCallback)&WrapperImageDataCallback); - - initBeamformer(); this->InitializeScanMode(); // pass the new scanmode to the device: setupScan(this->m_ScanMode); return true; } bool mitk::USDiPhASDevice::OnDisconnection() { //close the beamformer so hardware is disconnected closeBeamformer(); return true; } bool mitk::USDiPhASDevice::OnActivation() { // probe controls are available now m_ControlsProbes->SetIsActive(true); if (m_ControlsProbes->GetProbesCount() < 1) { MITK_WARN("USDevice")("USDiPhASDevice") << "No probe found."; return false; } m_ControlsProbes->SelectProbe(0); // toggle the beamformer of the API if(!m_IsRunning) m_IsRunning=toggleFreeze(); return true; } bool mitk::USDiPhASDevice::OnDeactivation() { if(m_IsRunning) m_IsRunning=toggleFreeze(); return true; } void mitk::USDiPhASDevice::OnFreeze(bool freeze) { if(m_IsRunning==freeze) m_IsRunning=toggleFreeze(); // toggleFreeze() returns true if it starts running the beamformer, otherwise false } void mitk::USDiPhASDevice::InitializeScanMode() { m_ScanMode.scanModeName = "UltrasoundMode"; // configure a linear transducer m_ScanMode.transducerName = "L2-7 "; m_ScanMode.transducerCurvedRadiusMeter = 0; m_ScanMode.transducerElementCount = 128; m_ScanMode.transducerFrequencyHz = 5000000; m_ScanMode.transducerPitchMeter = 0.0003f; m_ScanMode.transducerType = 1; // configure the transmit sequence(s): int numChannels = 128; m_ScanMode.transmitEventsCount = 1; m_ScanMode.BurstHalfwaveClockCountAllChannels = 11; // 120 MHz / (2 * (predefinedBurstHalfwaveClockCount + 1)) --> 5 MHz m_ScanMode.transmitPhaseLengthSeconds = 1e-6f; m_ScanMode.voltageV = 70; // configure the receive paramters: m_ScanMode.receivePhaseLengthSeconds = 65e-6f; // 5 cm imaging depth m_ScanMode.tgcdB = new unsigned char[8]; for (int tgc = 0; tgc < 8; ++tgc) m_ScanMode.tgcdB[tgc] = tgc * 2 + 10; m_ScanMode.accumulation = 1; m_ScanMode.bandpassApply = false; m_ScanMode.averagingCount = 1; // configure general processing: m_ScanMode.transferChannelData = false; // configure reconstruction processing: m_ScanMode.averageSpeedOfSound = 1540; m_ScanMode.computeBeamforming = true; m_ScanMode.beamformingAlgorithm = (int)Beamforming::PlaneWaveCompound; // setup beamforming parameters: BeamformingParametersPlaneWaveCompound parametersPW; parametersPW.SpeedOfSoundMeterPerSecond = 1540; parametersPW.angleSkipFactor = 1; m_ScanMode.beamformingAlgorithmParameters = (void*)¶metersPW; m_ScanMode.reconstructedLinePitchMmOrAngleDegree = 0.3f; m_ScanMode.reconstructionLines = 128; m_ScanMode.reconstructionSamplesPerLine = 2048; m_ScanMode.transferBeamformedData = false; // configure bandpass: m_ScanMode.bandpassApply = false; m_ScanMode.bandpassFrequencyLowHz = 1e6f; m_ScanMode.bandpassFrequencyHighHz = 20e6f; // configure image generation: m_ScanMode.imageWidth = 512; m_ScanMode.imageHeight = 512; m_ScanMode.imageMultiplier = 1; m_ScanMode.imageLeveling = 0; m_ScanMode.transferImageData = true; } // callback for the DiPhAS API void mitk::USDiPhASDevice::MessageCallback(const char* message) { MITK_INFO << "DiPhAS API: " << message << '\n'; } diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.h b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.h index 95834edb3d..a57e895f9f 100644 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.h +++ b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDevice.h @@ -1,160 +1,159 @@ /*=================================================================== 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 MITKUSDiPhASDevice_H_HEADER_INCLUDED_ #define MITKUSDiPhASDevice_H_HEADER_INCLUDED_ #include #include "mitkUSDevice.h" #include "mitkUSDiPhASImageSource.h" #include "mitkUSDiPhASProbesControls.h" -#include "mitkUSDiPhASBModeControls.h" -#include "mitkUSDiPhASDopplerControls.h" +#include "mitkUSDiPhASCustomControls.h" #include "Framework.IBMT.US.CWrapper.h" #include #include #include #include #include +#include + + namespace mitk { /** * \brief Implementation of mitk::USDevice for DiPhAS API devices. * Connects to a DiPhAS API device through its COM library interface. * * This class handles all API communications and creates interfaces for * b mode, doppler and probes controls. * Images given by the device are put into an object of * mitk::USDiPhASImageSource. */ class USDiPhASDevice : public USDevice { public: mitkClassMacro(USDiPhASDevice, mitk::USDevice); mitkNewMacro2Param(Self, std::string, std::string); /** * \brief Returns the class of the device. */ virtual std::string GetDeviceClass(); - // virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode(); virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes(); - //virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler(); - virtual mitk::USAbstractControlInterface::Pointer GetControlInterfaceCustom(); + virtual itk::SmartPointer GetControlInterfaceCustom(); /** * \brief Is called during the initialization process. * There is nothing done on the initialization of a mik::USDiPhASDevive object. * * \return always true */ virtual bool OnInitialization(); /** * \brief Is called during the connection process. * Connect to the DiPhAS API. * * \return true if successfull, false if no device is connected to the pc * \throws mitk::Exception if something goes wrong at the API calls */ virtual bool OnConnection(); /** * \brief Is called during the disconnection process. * Deactivate and remove all DiPhAS API controls. A disconnect from the * DiPhAS API is not possible for which reason the hardware stays in connected * state even after calling this method. * * \return always true * \throws mitk::Exception if something goes wrong at the API calls */ virtual bool OnDisconnection(); /** * \brief Is called during the activation process. * After this method is finished, the device is generating images in b mode. * Changing scanning mode is possible afterwards by using the appropriate * control interfaces. * * \return always true * \throws mitk::Exception if something goes wrong at the API calls */ virtual bool OnActivation(); /** * \brief Is called during the deactivation process. * After a call to this method the device is connected, but not producing images anymore. * * \return always true * \throws mitk::Exception if something goes wrong at the API calls */ virtual bool OnDeactivation(); /** * \brief Changes scan state of the device if freeze is toggeled in mitk::USDevice. */ virtual void OnFreeze(bool freeze); /** @return Returns the current image source of this device. */ USImageSource::Pointer GetUSImageSource( ); /** @return Returns the currently used scanmode of this device*/ ScanModeNative& GetScanMode(); - void MessageCallback(const char* message); + void MessageCallback(const char* message); + static void MessageCallbackWrapper(const char* message, mitk::USDiPhASDevice::Pointer device); protected: /** * Constructs a mitk::USDiPhASDevice object by given manufacturer * and model string. These strings are just for labeling the device * in the micro service. * * Control interfaces and image source are available directly after * construction. Registration at the micro service happens not before * initialization method was called. */ USDiPhASDevice(std::string manufacturer, std::string model); virtual ~USDiPhASDevice(); /** * The DiPhAS API expects callback functions to pass * both status messages and the processed images to the user. * The message callback is here, the data itself is given directly to the image source. */ /** * This method sets up the scanmode at the begining */ void InitializeScanMode(); - USDiPhASProbesControls::Pointer m_ControlsProbes; - USDiPhASBModeControls::Pointer m_ControlsBMode; - USDiPhASDopplerControls::Pointer m_ControlsDoppler; - USAbstractControlInterface::Pointer m_ControlsCustom; + USDiPhASProbesControls::Pointer m_ControlsProbes; + itk::SmartPointer m_ControlInterfaceCustom; - USDiPhASImageSource::Pointer m_ImageSource; + USDiPhASImageSource::Pointer m_ImageSource; - bool m_IsRunning; - ScanModeNative m_ScanMode; + bool m_IsRunning; + ScanModeNative m_ScanMode; }; } // namespace mitk #endif // MITKUSDiPhASDevice_H_HEADER_INCLUDED_ \ No newline at end of file diff --git a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.h b/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.h deleted file mode 100644 index 5e2933a674..0000000000 --- a/Modules/US/USHardwareDiPhAS/mitkUSDiPhASDopplerControls.h +++ /dev/null @@ -1,50 +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 MITKUSDiPhASDopplerControls_H_HEADER_INCLUDED_ -#define MITKUSDiPhASDopplerControls_H_HEADER_INCLUDED_ - -#include "Framework.IBMT.US.CWrapper.h" -#include "mitkUSControlInterfaceDoppler.h" - -#include - -namespace mitk { - class USDiPhASDevice; - /** - * \brief Implementation of mitk::USControlInterfaceDoppler for DiPhAS ultrasound devices. - * See documentation of mitk::USControlInterfaceBMode for a description of the interface methods. - * - * This implementation does nothing, yet! - */ - class USDiPhASDopplerControls : public USControlInterfaceDoppler - { - public: - mitkClassMacro(USDiPhASDopplerControls, USControlInterfaceDoppler); - mitkNewMacro1Param(Self, itk::SmartPointer); - - virtual void SetIsActive(bool); - virtual bool GetIsActive(); - - protected: - USDiPhASDopplerControls(itk::SmartPointer device); - virtual ~USDiPhASDopplerControls(); - - bool m_IsActive; - }; -} - -#endif // MITKUSDiPhASDopplerControls_H_HEADER_INCLUDED_ \ No newline at end of file diff --git a/Modules/US/files.cmake b/Modules/US/files.cmake index b33692f223..50593a9e1e 100644 --- a/Modules/US/files.cmake +++ b/Modules/US/files.cmake @@ -1,27 +1,28 @@ SET(CPP_FILES ## Module Activator mitkUSActivator.cpp ## Model Classes USModel/mitkUSImage.cpp USModel/mitkUSImageMetadata.cpp USModel/mitkUSDevice.cpp USModel/mitkUSIGTLDevice.cpp USModel/mitkUSVideoDevice.cpp USModel/mitkUSVideoDeviceCustomControls.cpp USModel/mitkUSProbe.cpp USModel/mitkUSDevicePersistence.cpp ## Filters and Sources USFilters/mitkUSImageLoggingFilter.cpp USFilters/mitkUSImageSource.cpp USFilters/mitkUSImageVideoSource.cpp USFilters/mitkIGTLMessageToUSImageFilter.cpp ## Control Interfaces USControlInterfaces/mitkUSAbstractControlInterface.cpp USControlInterfaces/mitkUSControlInterfaceBMode.cpp USControlInterfaces/mitkUSControlInterfaceProbes.cpp USControlInterfaces/mitkUSControlInterfaceDoppler.cpp +USControlInterfaces/mitkUSDiPhASDeviceCustomControls.cpp ) diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.cpp b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.cpp new file mode 100644 index 0000000000..5b9c81eb00 --- /dev/null +++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.cpp @@ -0,0 +1,64 @@ +/*=================================================================== + +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 "QmitkUSControlsCustomDiPhASDeviceWidget.h" +#include "ui_QmitkUSControlsCustomDiPhASDeviceWidget.h" +#include + +#include + +QmitkUSControlsCustomDiPhASDeviceWidget::QmitkUSControlsCustomDiPhASDeviceWidget(QWidget *parent) + : QmitkUSAbstractCustomWidget(parent), ui(new Ui::QmitkUSControlsCustomDiPhASDeviceWidget) +{ +} + +QmitkUSControlsCustomDiPhASDeviceWidget::~QmitkUSControlsCustomDiPhASDeviceWidget() +{ + delete ui; +} + +std::string QmitkUSControlsCustomDiPhASDeviceWidget::GetDeviceClass() const +{ + return "org.mitk.modules.us.USDiPhASDevice"; +} + +QmitkUSAbstractCustomWidget* QmitkUSControlsCustomDiPhASDeviceWidget::Clone(QWidget* parent) const +{ + QmitkUSAbstractCustomWidget* clonedWidget = new QmitkUSControlsCustomDiPhASDeviceWidget(parent); + clonedWidget->SetDevice(this->GetDevice()); + return clonedWidget; +} + +void QmitkUSControlsCustomDiPhASDeviceWidget::OnDeviceSet() +{ + m_ControlInterface = dynamic_cast + (this->GetDevice()->GetControlInterfaceCustom().GetPointer()); + + if ( m_ControlInterface.IsNotNull() ) + { + } + else + { + MITK_WARN("QmitkUSAbstractCustomWidget")("QmitkUSControlsCustomDiPhASDeviceWidget") + << "Did not get a custom video device control interface."; + } + +} + +void QmitkUSControlsCustomDiPhASDeviceWidget::Initialize() +{ + ui->setupUi(this); +} \ No newline at end of file diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h new file mode 100644 index 0000000000..0e5929f0f0 --- /dev/null +++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h @@ -0,0 +1,83 @@ +/*=================================================================== + +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 QmitkUSControlsCustomDiPhASDeviceWidget_H +#define QmitkUSControlsCustomDiPhASDeviceWidget_H + +#include "QmitkUSAbstractCustomWidget.h" +#include "mitkUSDiPhASDeviceCustomControls.h" + +#include "mitkUSDevice.h" + +#include + +namespace Ui { +class QmitkUSControlsCustomDiPhASDeviceWidget; +} + +/** \brief Widget for custom controls of mitk::USDiPhASDevice. + * This class handles the itk::USDiPhASDeviceCustomControls of video device + * objects. + */ +class QmitkUSControlsCustomDiPhASDeviceWidget : public QmitkUSAbstractCustomWidget +{ + Q_OBJECT + +private slots: + +public: + /** + * Constructs widget object. All gui control elements will be disabled until + * QmitkUSAbstractCustomWidget::SetDevice() was called. + */ + explicit QmitkUSControlsCustomDiPhASDeviceWidget(QWidget *parent = 0); + ~QmitkUSControlsCustomDiPhASDeviceWidget(); + + /** + * Getter for the device class of mitk:USDiPhASDevice. + */ + virtual std::string GetDeviceClass() const override; + + /** + * Creates new QmitkUSAbstractCustomWidget with the same mitk::USDiPhASDevice + * and the same mitk::USDiPhASDeviceCustomControls which were set on the + * original object. + * + * This method is just for being calles by the factory. Use + * QmitkUSAbstractCustomWidget::CloneForQt() instead, if you want a clone of + * an object. + */ + virtual QmitkUSAbstractCustomWidget* Clone(QWidget* parent = 0) const override; + + /** + * Gets control interface from the device which was currently set. Control + * elements are according to current crop area of the device. If custom + * control interface is null, the control elements stay disabled. + */ + virtual void OnDeviceSet() override; + + virtual void Initialize() override; + +protected: + void BlockSignalAndSetValue(QSpinBox* target, int value); + +private: + Ui::QmitkUSControlsCustomDiPhASDeviceWidget* ui; + + mitk::USDiPhASDeviceCustomControls::Pointer m_ControlInterface; +}; + +#endif // QmitkUSControlsCustomDiPhASDeviceWidget_H \ No newline at end of file diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.ui b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.ui new file mode 100644 index 0000000000..8b0222de99 --- /dev/null +++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.ui @@ -0,0 +1,218 @@ + + + QmitkUSControlsCustomDiPhASDeviceWidget + + + + 0 + 0 + 369 + 88 + + + + Form + + + + + + <html><head/><body><p><span style=" font-weight:600;">Crop Ultrasound Image:</span></p></body></html> + + + + + + + + + + + Top + + + + + + + + + 0 + + + 999 + + + 5 + + + 0 + + + + + + + px + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Bottom + + + + + + + + + 999 + + + 5 + + + + + + + px + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Right + + + + + + + + + 999 + + + 5 + + + + + + + px + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Left + + + + + + + + + 999 + + + 5 + + + + + + + px + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/Modules/USUI/files.cmake b/Modules/USUI/files.cmake index d88a79270d..697d196f7f 100644 --- a/Modules/USUI/files.cmake +++ b/Modules/USUI/files.cmake @@ -1,36 +1,39 @@ set(CPP_FILES mitkUSUIActivator.cpp mitkUSUICustomWidgetFactory.cpp Qmitk/QmitkUSDeviceManagerWidget.cpp Qmitk/QmitkUSNewVideoDeviceWidget.cpp Qmitk/QmitkUSControlsBModeWidget.cpp Qmitk/QmitkUSControlsDopplerWidget.cpp Qmitk/QmitkUSControlsProbesWidget.cpp Qmitk/QmitkUSControlsCustomVideoDeviceWidget.cpp + Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.cpp Qmitk/QmitkUSAbstractCustomWidget.cpp Qmitk/QmitkComboBoxStepThrough.cpp ) set(UI_FILES Qmitk/QmitkUSDeviceManagerWidgetControls.ui Qmitk/QmitkUSNewVideoDeviceWidgetControls.ui Qmitk/QmitkUSControlsBModeWidget.ui Qmitk/QmitkUSControlsDopplerWidget.ui Qmitk/QmitkUSControlsProbesWidget.ui Qmitk/QmitkUSControlsCustomVideoDeviceWidget.ui + Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.ui ) set(MOC_H_FILES Qmitk/QmitkUSDeviceManagerWidget.h Qmitk/QmitkUSNewVideoDeviceWidget.h Qmitk/QmitkUSControlsBModeWidget.h Qmitk/QmitkUSControlsDopplerWidget.h Qmitk/QmitkUSControlsProbesWidget.h Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h + Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h Qmitk/QmitkUSAbstractCustomWidget.h Qmitk/QmitkComboBoxStepThrough.h ) set(QRC_FILES resources/USUI.qrc ) diff --git a/Modules/USUI/mitkUSUIActivator.cpp b/Modules/USUI/mitkUSUIActivator.cpp index ca510835fd..23317bf34d 100644 --- a/Modules/USUI/mitkUSUIActivator.cpp +++ b/Modules/USUI/mitkUSUIActivator.cpp @@ -1,64 +1,79 @@ /*=================================================================== 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 "mitkUSUIActivator.h" #include "mitkUSUICustomWidgetFactory.h" #include "QmitkUSControlsCustomVideoDeviceWidget.h" +#include "QmitkUSControlsCustomDiPhASDeviceWidget.h" mitk::USUIActivator::USUIActivator() - : m_CustomWidgetFactory(0), m_CustomVideoDeviceWidget(0) + : m_CustomWidgetFactory(0), m_CustomVideoDeviceWidget(0), m_CustomDiPhASDeviceWidget(0) { } mitk::USUIActivator::~USUIActivator() { - delete m_CustomWidgetFactory; + for(auto i : m_CustomWidgetFactory) + delete i; delete m_CustomVideoDeviceWidget; if ( m_ServiceRegistration ) { m_ServiceRegistration.Unregister(); } } void mitk::USUIActivator::Load(us::ModuleContext* context) { // create a custom video device widget, which will be used as // a prototype for the custom widget factory - if ( ! m_CustomVideoDeviceWidget ) + + if (!m_CustomVideoDeviceWidget) { m_CustomVideoDeviceWidget = new QmitkUSControlsCustomVideoDeviceWidget(); } - // create a factory for custom widgets, using the video device - // widget as a prototype - if ( ! m_CustomWidgetFactory ) + // create a custom DiPhAS device widget, which will be used as + // a prototype for the custom widget factory + + if (!m_CustomDiPhASDeviceWidget) { - m_CustomWidgetFactory = new mitk::USUICustomWidgetFactory(m_CustomVideoDeviceWidget); + m_CustomDiPhASDeviceWidget = new QmitkUSControlsCustomDiPhASDeviceWidget(); } - // register the custom widget factory as a microservice - m_ServiceRegistration = m_CustomWidgetFactory->RegisterService(context); + // create a factory for custom widgets, using the video device + // widget as a prototype + m_CustomWidgetFactory.push_back(new mitk::USUICustomWidgetFactory(m_CustomVideoDeviceWidget)); + + // create a factory for custom widgets, using the DiPhAS device + // widget as a prototype + m_CustomWidgetFactory.push_back(new mitk::USUICustomWidgetFactory(m_CustomDiPhASDeviceWidget)); + + // register the custom widget factories as a microservice + for (auto i : m_CustomWidgetFactory) + m_ServiceRegistration = i->RegisterService(context); } void mitk::USUIActivator::Unload(us::ModuleContext* /*context*/) { m_ServiceRegistration.Unregister(); m_ServiceRegistration = 0; - delete m_CustomWidgetFactory; - m_CustomWidgetFactory = 0; + for (auto i : m_CustomWidgetFactory) + delete i; + + m_CustomWidgetFactory.clear(); delete m_CustomVideoDeviceWidget; m_CustomVideoDeviceWidget = 0; } diff --git a/Modules/USUI/mitkUSUIActivator.h b/Modules/USUI/mitkUSUIActivator.h index 663871d4b0..d99d46b974 100644 --- a/Modules/USUI/mitkUSUIActivator.h +++ b/Modules/USUI/mitkUSUIActivator.h @@ -1,65 +1,67 @@ /*=================================================================== 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 __mitkUSUIActivator_h #define __mitkUSUIActivator_h #include "QmitkUSAbstractCustomWidget.h" // Microservices #include #include class QmitkUSControlsCustomVideoDeviceWidget; +class QmitkUSControlsCustomDiPhASDeviceWidget; namespace mitk { class USUICustomWidgetFactory; /** * \brief Module activator for the USUI module. * Registers custom widget for mitk::USVideoDevice as microservice. */ class USUIActivator : public us::ModuleActivator { public: USUIActivator(); virtual ~USUIActivator(); /** * Custom video device widget is registered as a micro service on module * load. A plugin can get this widget then when using a * mitk::USVideoDevice. */ void Load(us::ModuleContext* context) override; /** * Custom video device widget is deregistered from micro service on module * unload. */ void Unload(us::ModuleContext* context) override; protected: us::ServiceRegistration m_ServiceRegistration; - USUICustomWidgetFactory* m_CustomWidgetFactory; + std::vector m_CustomWidgetFactory; QmitkUSControlsCustomVideoDeviceWidget* m_CustomVideoDeviceWidget; + QmitkUSControlsCustomDiPhASDeviceWidget* m_CustomDiPhASDeviceWidget; }; } // namespace mitk US_EXPORT_MODULE_ACTIVATOR(mitk::USUIActivator) #endif // __mitkUSUIActivator_h