19 m_IsActive(false), m_TelemedDevice(device),
20 m_ProbesCollection(0), m_Probe(0)
33 MITK_WARN(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
34 <<
"Cannot activate probe controls while device is not set.";
59 std::vector<mitk::USProbe::Pointer> usProbes(
m_ProbesSet.size(), 0);
60 for (
unsigned int n = 0; n <
m_ProbesSet.size(); ++n)
71 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
72 <<
"Cannot select probe with index " << index <<
". Maximum possible index is " <<
m_ProbesSet.size()-1 <<
".";
73 mitkThrow() <<
"Cannot select probe with index " << index <<
74 ". Maximum possible index is " <<
m_ProbesSet.size()-1 <<
".";
90 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
92 ". Maximum possible index is " <<
m_ProbesSet.size()-1 <<
".";
94 ". Maximum possible index is " <<
m_ProbesSet.size()-1 <<
".";
136 IUnknown* tmp_obj =
nullptr;
140 Usgfw2Lib::IUsgfw2* usgMainInterface =
m_TelemedDevice->GetUsgMainInterface();
141 if ( ! usgMainInterface )
143 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
144 <<
"Main interface of Telemed device must not be null.";
145 mitkThrow() <<
"Main interface of Telemed device must not be null.";
149 hr = usgMainInterface->get_ProbesCollection(&tmp_obj);
150 if (FAILED(hr) || ! tmp_obj)
152 MITK_WARN(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
153 <<
"Error on getting probes collection (" << hr <<
").";
159 hr = tmp_obj->QueryInterface(Usgfw2Lib::IID_IUsgCollection,(
void**)&
m_ProbesCollection);
161 if (FAILED(hr) || ! m_ProbesCollection)
163 MITK_WARN(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
164 <<
"Error on querying interface for probes collection (" << hr <<
").";
175 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
176 <<
"Cannot get probe set without ProbesCollection being initialized before.";
177 mitkThrow() <<
"Cannot get probe set without ProbesCollection being initialized before.";
181 LONG probes_count = 0;
183 if (FAILED(hr)) {
mitkThrow() <<
"Could not get probes count (" << hr <<
")."; }
187 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
188 <<
"Telemed device must not be null when creating probes set.";
189 mitkThrow() <<
"Telemed device must not be null when creating probes set.";
193 Usgfw2Lib::IUsgfw2* usgMainInterface =
m_TelemedDevice->GetUsgMainInterface();
194 if ( ! usgMainInterface )
196 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
197 <<
"Usg main interface must not be null when creating probes set.";
198 mitkThrow() <<
"Usg main interface must not be null when creating probes set.";
202 m_ProbesSet = std::vector<mitk::USTelemedProbe::Pointer>(probes_count, 0);
204 for (LONG n = 0; n < probes_count; ++n)
207 IUnknown* tmp_obj =
nullptr;
211 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
212 <<
"Could not get probe with index " << n <<
".";
213 mitkThrow() <<
"Could not get probe with index " << n <<
".";
217 Usgfw2Lib::IProbe* probe;
218 hr = tmp_obj->QueryInterface(Usgfw2Lib::IID_IProbe,(
void**)&probe);
221 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
222 <<
"Error on querying interface for probe with index "<< n <<
".";
223 mitkThrow() <<
"Error on querying interface for probe with index "<< n <<
".";
227 Usgfw2Lib::IUsgDataView* usgDataView;
228 Usgfw2Lib::IUsgDataViewPtr usgDataViewTmp;
229 usgDataViewTmp = usgMainInterface->CreateDataView(probe);
230 usgDataViewTmp->QueryInterface(Usgfw2Lib::IID_IUsgDataView, (
void**)&usgDataView);
233 MITK_ERROR(
"USTelemedProbesControls")(
"USControlInterfaceProbes")
234 <<
"Could not create data view for selected probe.";
235 mitkThrow() <<
"Could not create data view for selected probe.";
virtual void OnSelectProbe(unsigned int index)
Virtual method which is called inside mitk::USControlInterfaceProbes::SelectProbe(). Implement this method to handle the actual selecting of the probe at the device api.
std::vector< USTelemedProbe::Pointer > m_ProbesSet
virtual bool GetIsActive()
void ProbeRemoved(unsigned int index)
Usgfw2Lib::IUsgCollection * m_ProbesCollection
virtual ~USTelemedProbesControls()
Interface defining methods for probe selection of ultrasound devices. It consists of methods for gett...
virtual std::vector< USProbe::Pointer > GetProbeSet()
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< USTelemedDevice > m_TelemedDevice
USTelemedProbesControls(itk::SmartPointer< USTelemedDevice > device)
virtual USProbe::Pointer GetSelectedProbe()
bool CreateProbesCollection()
virtual void SetIsActive(bool)
virtual unsigned int GetProbesCount() const
void ProbeAdded(unsigned int index)
unsigned int m_SelectedProbeIndex