![]() |
ImFusion SDK 4.3
|
#include <ImFusion/US/FrameGeometry.h>
Represents the (fan) geometry of an ultrasound frame acquired through scanline-based imaging. More...
Inheritance diagram for FrameGeometry:Represents the (fan) geometry of an ultrasound frame acquired through scanline-based imaging.
Currently, there are four types of possible frame geometries:
The linear geometry looks like this:
In contrast, sector and convex geometries are defined in the following way:
The circular geometry represents a simple circle.
Each of these types are implemented in separate derived classes. They share the following common properties:
The class combines all internal computations for drawing the frame geometry into the views, and to provide manipulators for intuitive parameter changes.
Use an instance of the class FrameGeometryMetadata as a value-type member in algorithms, if you want the frame geometry to be configurable.
Classes | |
| struct | Fan |
| Helper struct for drawing the fan and fan manipulation. More... | |
Public Types | |
| enum class | OrientationIndicatorPosition { Nearside = 0 , Farside = 1 } |
| Position of external orientation indicator (e.g. colored knob) More... | |
| enum class | TransformationMode { NormalizedRawToScanConverted = 0 , NormalizedPrescanToScanConverted = 0 , ScanConvertedToNormalizedRaw = 1 , ScanConvertedToNormalizedPrescan = 1 } |
| Used in transformPoint() to specify which geometric transformation to apply. More... | |
Public Member Functions | |
| FrameGeometry (CoordinateSystem coordSys) | |
| Constructor requires the coordinate system to be defined. It cannot be changed afterward. | |
| virtual bool | operator== (const FrameGeometry &rhs) const |
| Checks for equality, also considering the image descriptor. | |
| bool | operator!= (const FrameGeometry &rhs) const |
| Checks for inequality, also considering the image descriptor. | |
| vec2 | offset () const |
| Offset of the geometry within the image. | |
| void | setOffset (const vec2 &offset) |
| Sets the offset of the geometry. | |
| bool | isTopDown () const |
| Returns if the geometry is oriented top to bottom, where the frame geometry origin is higher on the image than the end. | |
| void | setTopDown (bool b) |
| Sets if the geometry is oriented top to bottom, or bottom to top. | |
| const ImageDescriptor & | imgDesc () const |
| Returns the ImageDescriptor for the frame geometry. | |
| const ImageDescriptor & | imgDescPrescan () const |
| Returns the ImageDescriptor for the pre-scanconverted image. | |
| void | setImgDesc (const ImageDescriptor &imgDescr) |
| Sets the ImageDescriptor for the frame geometry. | |
| void | setImgDescPrescan (const ImageDescriptor &imgDescrPrescan) |
| Sets the ImageDescriptor for the pre-scanconverted image. | |
| OrientationIndicatorPosition | indicatorPos () const |
| Returns the OrientationIndicatorPosition for the frame geometry. | |
| void | setIndicatorPos (OrientationIndicatorPosition pos) |
| Sets the OrientationIndicatorPosition for the frame geometry. | |
| CoordinateSystem | coordinateSystem () const |
| Returns the CoordinateSystem used in the frame geometry. | |
| Geometry::AlignedBox | bounds () const |
| Returns the Bounds of the frame geometry. | |
| mat4 | transformation () const |
| Convenience method to get the 2D transformation formed by the offset and orientation. | |
| virtual std::unique_ptr< FrameGeometry > | convertTo (CoordinateSystem coordSys) const |
| Returns a copy where internal values were converted to new units. | |
| virtual std::unique_ptr< FrameGeometry > | clone () const =0 |
| Clones the current frame geometry, including the image descriptor. | |
| virtual vec2 | transformPoint (const vec2 &p, TransformationMode mode) const =0 |
| Applies the specified geometric transformation to a point. | |
| virtual std::unique_ptr< GlGeometricTransform > | glGeometricTransform () const |
| Returns the geometric transformation between image coordinates and pre-scan converted coordinates, if available. | |
| virtual bool | contains (vec2 coord) const =0 |
| Returns true if the given point is within the fan. | |
| virtual double | depth () const =0 |
| Returns the depth. | |
| virtual vec2 | frameCenter () const |
| Returns the center of the frame. | |
| virtual void | setDepth (double newDepth)=0 |
| Sets a new depth. If the depth is derived from multiple members, the bottom one will be changed, i.e. the top remains fixed. | |
| bool | isLinear () const |
| Convenience type check. | |
| bool | isCircular () const |
| Convenience type check. | |
| bool | isConvex () const |
| Convenience type check. | |
| bool | isSector () const |
| Convenience type check. | |
| virtual FrameGeometryLinear * | asLinear () |
| Convenience cast to the derived type, or nullptr if not possible. | |
| virtual FrameGeometryConvex * | asConvex () |
| Convenience cast to the derived type, or nullptr if not possible. | |
| virtual FrameGeometryConvexSteered * | asConvexSteered () |
| virtual FrameGeometrySector * | asSector () |
| Convenience cast to the derived type, or nullptr if not possible. | |
| virtual FrameGeometryCircular * | asCircular () |
| Convenience cast to the derived type, or nullptr if not possible. | |
| const FrameGeometryLinear * | asLinear () const |
| Convenience cast to the derived type, or nullptr if not possible. | |
| const FrameGeometryConvex * | asConvex () const |
| Convenience cast to the derived type, or nullptr if not possible. | |
| const FrameGeometryConvexSteered * | asConvexSteered () const |
| const FrameGeometrySector * | asSector () const |
| Convenience cast to the derived type, or nullptr if not possible. | |
| const FrameGeometryCircular * | asCircular () const |
| Convenience cast to the derived type, or nullptr if not possible. | |
| virtual bool | isSimilar (const FrameGeometry *other, bool ignoreOffset=false, double eps=1e-1) const =0 |
| Compares the frame geometry to another one. | |
| virtual FrameGeometry::Fan | createFan () |
| Computes the fan geometry edges and points. | |
Protected Member Functions | |
| virtual FrameGeometry::Fan | createFanImpl ()=0 |
| Internal fan geometry generation to be implemented by subclass. | |
| void | configure (const Properties *) override |
| Sets general properties. Only intended to be called from derived classes. See FrameGeometryMetadata. | |
| void | configuration (Properties *) const override |
| Retrieves general properties. Only intended to be called from derived classes. See FrameGeometryMetadata. | |
| void | onCenterChanged (vec2 delta) |
| Manipulation callback. | |
| vec2 | conversionSpacing () const |
| Internal helper methods returning the spacing or its inverse, dependent on the current coordinate system, either as vec2, are as the diagonal of a 2x2 matrix. | |
| mat2 | localCoordinateFrame () const |
Protected Member Functions inherited from Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Protected Attributes | |
| vec2 | m_offset = vec2::Zero() |
| location of the fan center (virtual apex) wrt. transducer center (image top) | |
| bool | m_isTopDown = true |
| Orientation of fan. | |
| OrientationIndicatorPosition | m_indicatorPosition |
| Position of the external orientation indicator. | |
| CoordinateSystem | m_coordSys = CoordinateSystem::Image |
| Coordinate system this geometry is defined in. | |
| ImageDescriptor | m_imgDesc |
| Image descriptor for frame conversion. | |
| ImageDescriptor | m_imgDescPrescan |
| Image descriptor for pre-scanconverted image conversion. | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Static Protected Attributes | |
| static constexpr double | m_insetEpsilon = 1e-7 |
| Inset distance to avoid numerical errors when computing frame boundaries. | |
|
strong |
|
strong |
Used in transformPoint() to specify which geometric transformation to apply.
|
virtual |
Checks for equality, also considering the image descriptor.
Reimplemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
| vec2 offset | ( | ) | const |
Offset of the geometry within the image.
In image coordinates, this is the distance from the center of the image to the center of the geometry. In pixel coordinates, this is the distance from the top-left corner of the image to the top-left corner of the geometry.
| void setOffset | ( | const vec2 & | offset | ) |
Sets the offset of the geometry.
In image coordinates, this is the distance from the center of the image to the center of the geometry. In pixel coordinates, this is the distance from the top-left corner of the image to the top-left corner of the geometry.
|
virtual |
Returns a copy where internal values were converted to new units.
The image descriptor of the object is used for the conversion.
| std::runtime_error | if image descriptor is not valid. |
Reimplemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
pure virtual |
Clones the current frame geometry, including the image descriptor.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
pure virtual |
Applies the specified geometric transformation to a point.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
virtual |
Returns the geometric transformation between image coordinates and pre-scan converted coordinates, if available.
Reimplemented in FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
pure virtual |
Returns true if the given point is within the fan.
Note that whenever angular computations are made, these should be done in the image coordinate system to avoid errors when non-isotropic spacing is used.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
pure virtual |
Returns the depth.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
virtual |
Returns the center of the frame.
Reimplemented in FrameGeometryCircular, and FrameGeometryLinear.
|
pure virtual |
Sets a new depth. If the depth is derived from multiple members, the bottom one will be changed, i.e. the top remains fixed.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
virtual |
Convenience cast to the derived type, or nullptr if not possible.
Reimplemented in FrameGeometryLinear.
|
virtual |
Convenience cast to the derived type, or nullptr if not possible.
Reimplemented in FrameGeometryConvex.
|
virtual |
Reimplemented in FrameGeometryConvexSteered.
|
virtual |
Convenience cast to the derived type, or nullptr if not possible.
Reimplemented in FrameGeometrySector.
|
virtual |
Convenience cast to the derived type, or nullptr if not possible.
Reimplemented in FrameGeometryCircular.
| const FrameGeometryLinear * asLinear | ( | ) | const |
Convenience cast to the derived type, or nullptr if not possible.
| const FrameGeometryConvex * asConvex | ( | ) | const |
Convenience cast to the derived type, or nullptr if not possible.
| const FrameGeometryConvexSteered * asConvexSteered | ( | ) | const |
| const FrameGeometrySector * asSector | ( | ) | const |
Convenience cast to the derived type, or nullptr if not possible.
| const FrameGeometryCircular * asCircular | ( | ) | const |
Convenience cast to the derived type, or nullptr if not possible.
|
pure virtual |
Compares the frame geometry to another one.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
virtual |
Computes the fan geometry edges and points.
Reimplemented in FrameGeometryConvexSteered.
|
protectedpure virtual |
Internal fan geometry generation to be implemented by subclass.
Implemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
overrideprotectedvirtual |
Sets general properties. Only intended to be called from derived classes. See FrameGeometryMetadata.
Reimplemented from Configurable.
Reimplemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
overrideprotectedvirtual |
Retrieves general properties. Only intended to be called from derived classes. See FrameGeometryMetadata.
Reimplemented from Configurable.
Reimplemented in FrameGeometryCircular, FrameGeometryConvex, FrameGeometryConvexSteered, FrameGeometryLinear, and FrameGeometrySector.
|
protected |
Position of the external orientation indicator.