27 m_IsActive = isActive;
37 MITK_INFO <<
"Set Crop Area L:" << newArea.
left <<
" R:" << newArea.
right
38 <<
" T:" << newArea.
top <<
" B:" << newArea.
bottom;
40 if (m_ImageSource.IsNotNull())
43 if ((newArea.
bottom == 0) && (newArea.
top == 0) &&
44 (newArea.
left == 0) && (newArea.
right == 0))
46 m_ImageSource->RemoveRegionOfInterest();
50 m_ImageSource->SetCropping(newArea);
55 MITK_WARN <<
"Cannot set crop are, source is not initialized!";
61 if (m_Device.IsNotNull())
63 if( m_Device->GetCurrentProbe().IsNotNull() )
65 m_Device->GetCurrentProbe()->SetCurrentDepth(depth);
66 MITK_INFO <<
"SetCurrentDepth of currentProbe: " << depth;
69 m_Device->DepthChanged(depth);
74 if( m_Device.IsNotNull() )
76 m_Device->SetCurrentProbe(probename);
78 m_Device->ProbeChanged(probename);
84 mitk::USVideoDevice::Pointer device =
dynamic_cast<mitk::USVideoDevice*
>(m_Device.GetPointer());
85 if (device.IsNotNull())
87 mitk::USProbe::Pointer probe = device->GetCurrentProbe();
88 if (probe.IsNotNull())
90 return probe->GetProbeCropping();
94 return defaultCropping;
99 mitk::USVideoDevice::Pointer device =
dynamic_cast<mitk::USVideoDevice*
>(m_Device.GetPointer());
100 if (device.IsNotNull())
102 mitk::USProbe::Pointer probe = device->GetCurrentProbe();
103 if( probe.IsNotNull() )
105 probe->SetProbeCropping(cropping.
top, cropping.
bottom, cropping.
left, cropping.
right);
117 mitk::USProbe::Pointer probe = m_Device->GetProbeByName(name);
118 std::map<int, mitk::Vector3D> depthsAndSpacings = probe->GetDepthsAndSpacing();
119 std::vector<int> depths;
120 for (std::map<int, mitk::Vector3D>::iterator it = depthsAndSpacings.begin(); it != depthsAndSpacings.end(); it++)
122 depths.push_back((it->first));
129 m_Device->SetDefaultProbeAsCurrentProbe();
Superclass for all ultrasound device control interfaces. Defines an interface for activating and deac...
itk::WeakPointer< USDevice > m_Device
This class can be pointed to a video file or a videodevice and delivers USImages.
void SetNewProbeIdentifier(std::string probename)
USVideoDeviceCustomControls(itk::SmartPointer< USDevice > device)
~USVideoDeviceCustomControls() override
std::vector< mitk::USProbe::Pointer > GetProbes()
Get all the probes for the current device.
void SetDefaultProbeAsCurrentProbe()
Sets the first existing probe or the default probe of a USVideoDevice as the current probe of the USV...
mitk::USProbe::USProbeCropping GetCropArea()
bool GetIsActive() override
void SetCropArea(USImageVideoSource::USImageCropping newArea)
Sets the area that will be cropped from the US image. Set [0,0,0,0] to disable it,...
USImageVideoSource::Pointer m_ImageSource
std::vector< int > GetDepthsForProbe(std::string name)
Get the scanning dephts of the given probe.
void SetNewDepth(double depth)
Sets a new depth value to the current probe.
void UpdateProbeCropping(mitk::USImageVideoSource::USImageCropping cropping)
Updates the cropping of the current probe given by the crop area of the USImageVideoSource.
void SetIsActive(bool isActive) override
A mitk::USVideoDevice is the common class for video only devices. They capture video input either fro...
std::vector< mitk::USProbe::Pointer > GetAllProbes() override
Return all probes for this USVideoDevice or an empty vector it no probes were set Returns a std::vect...
Defines a region of interest by distances to the four image borders.
Struct to define a probe specific ultrasound image cropping.