![]() |
ImFusion SDK 4.3
|
#include <ImFusion/ML/BoundingBoxSet.h>
Class for managing sets of bounding boxes within a BoundingBoxElement The class is meant to be used in parallel with SharedImageSet. More...
Class for managing sets of bounding boxes within a BoundingBoxElement The class is meant to be used in parallel with SharedImageSet.
For each frame in the set, and for each type of bounding box (i.e. car, airplace, lung, cat), there is a list of boxes that encompass an instance of that type in the reference image. In terms of tensor dimensions, this would be represented as [N, C, B], where N is the batch size, C is the number of channels (i.e. types of boxes), and B is the number of boxes for the same instance type. Each Box has a dimension of [2, 3], consisting of a pair of vec3 for describing center and extent. See the Box class for more information.
Public Member Functions | |
BoundingBoxSet (std::vector< std::vector< std::vector< Box > > > data={}) | |
Constructor from a list of Boxes, the 3 levels of nestedness represent respectively the frame index, the type index and the multiple instances to encompass. | |
BoundingBoxSet (const BoundingBoxSet &other)=default | |
BoundingBoxSet & | operator= (const BoundingBoxSet &other)=default |
BoundingBoxSet (BoundingBoxSet &&other) noexcept | |
BoundingBoxSet & | operator= (BoundingBoxSet &&other) noexcept |
ML::Status | save (const std::string &path) const |
Kind | kind () const override |
Data interface. | |
Pose::TransformationConvention | matrixConvention () const override |
Defines whether the internally stored matrices in derived classes map from or to the world coordinate system. | |
Geometry::AlignedBox | bounds () const override |
Returns the axis-aligned bounding box of this data in world space. | |
std::string | describe () const override |
Human readable description of the data for showing in the info bar. | |
int | size () const override |
Expose some interface of std::vector for convenience. | |
bool | empty () const |
bool | operator== (const BoundingBoxSet &other) const |
bool | operator!= (const BoundingBoxSet &other) const |
auto & | at (size_t n) |
const auto & | at (size_t n) const |
auto & | operator[] (size_t n) |
const auto & | operator[] (size_t n) const |
bool | isEqual (const BoundingBoxSet &other) const |
Strict check that two sets are bit-exact identical. | |
bool | isApprox (const BoundingBoxSet &other) const |
Eigen-style check that each point in a set is approximately equal to each corresponding point in the other set. | |
![]() | |
Data (const std::string &name="") | |
Data (const Data &other) | |
Data & | operator= (const Data &other) |
virtual | ~Data () |
Mandatory virtual destructor. | |
virtual Modality | modality () const |
Return the modality of this data. | |
const std::string & | name () const |
Return the name of this data. | |
void | setName (const std::string &name) |
Sets the name of this data. | |
virtual bool | isAnnotationType () const |
Return whether this data type is visualized through an annotation (e.g. mesh) | |
const DataComponentList & | components () const |
Returns the list of DataComponents for this data. | |
DataComponentList & | components () |
virtual void | setMatrixFromWorld (const mat4 &m) |
Set matrix mapping from the world coordinate system to the data coordinate system. | |
virtual void | setMatrixToWorld (const mat4 &m) |
Set matrix mapping from the data coordinate system to the world coordinate system. | |
virtual mat4 | matrixFromWorld () const |
Get matrix mapping from the world coordinate system to the data coordinate system. | |
virtual mat4 | matrixToWorld () const |
Get matrix mapping from the data coordinate system to the world coordinate system. | |
virtual mat4 | matrix () const |
Return the transformation matrix. | |
virtual void | setMatrix (const mat4 &m) |
Set the transformation matrix. | |
![]() | |
Selectable (const Selectable &) | |
Selectable (Selectable &&) | |
Selectable & | operator= (const Selectable &) |
Selectable & | operator= (Selectable &&) |
virtual Selection | selection () const |
virtual int | focus () const |
virtual void | setSelection (const Selection &sel) |
Set the underlying selection. | |
virtual void | setFocus (int index) |
Set focus of the selection. | |
Static Public Member Functions | |
static ML::Status | save (const BoundingBoxSet &set, const std::string &path) |
Convenience function wrapping ImFusionFileIoAlgorithm for saving a BoundingBoxSet. | |
static std::optional< BoundingBoxSet > | load (const std::string &path) |
Convenience function wrapping ImFusionFileIoAlgorithm for loading a BoundingBoxSet. | |
![]() | |
static std::string | modalityString (Data::Modality m) |
Return the name of an image modality. | |
static Data::Modality | stringToModality (const std::string &s) |
Returns the modality corresponding to a modality string or NA if nothing matches. | |
Public Attributes | |
std::vector< std::vector< std::vector< Box > > > | data |
![]() | |
Signal< const Data * > | signalDeleted |
Signal emitted when this instance is deleted. | |
Signal< const Data * > | signalMatrixChanged |
Signal emitted when the transformation of this Data has changed. | |
Signal< std::string > | signalNameChanged |
Signal emitted when the name changed. | |
![]() | |
ProtectedSignal | signalSelectionChanged |
Signals that the selection or size might have changed. | |
Protected Member Functions | |
void | swapWith (BoundingBoxSet &other) |
![]() | |
void | swapWith (Data &other) |
Swaps the data and emits a matrix and name changed signal for both. | |
Additional Inherited Members | |
![]() | |
enum | Kind { UNKNOWN = 0 , IMAGE = 1 , VOLUME = 2 , IMAGESET = 3 , VOLUMESET = 4 , IMAGESTREAM = 5 , VOLUMESTREAM = 6 , POINTSET = 7 , SURFACE = 8 , TRACKINGSTREAM = 9 , LIVETRACKINGSTREAM = TRACKINGSTREAM , TRACKINGDATA = 10 , TREE = 11 , TENSOR = 12 , POLYDATASTREAM = 13 , STEREOIMAGESET = 14 , STEREOIMAGESTREAM = 15 , VOLUMETRICMESH = 16 } |
Kind of data. More... | |
enum | Modality { NA = 0 , XRAY = 1 , CT = 2 , MRI = 3 , ULTRASOUND = 4 , VIDEO = 5 , NM = 6 , OCT = 7 , LABEL = 8 , DISTANCE = 9 } |
Image modality of the data. More... | |
![]() | |
mat4 | m_matrix |
Transformation matrix. | |
std::recursive_mutex * | m_matrixMutex |
Used to internally synchronize access to the matrix of data. | |
DataComponentList | m_dataComponentList |
The list of DataComponents for this data. | |
![]() | |
std::mutex | m_selectionMutex |
Mutex protecting the selection. | |
Selection | m_sel |
|
inlineoverridevirtual |
Defines whether the internally stored matrices in derived classes map from or to the world coordinate system.
Changes the behavior of the default implementations of matrixToWorld and matrixFromWorld.
Implements Data.
|
overridevirtual |
Returns the axis-aligned bounding box of this data in world space.
Implements Data.
|
inlineoverridevirtual |
Human readable description of the data for showing in the info bar.
Reimplemented from Data.
|
inlineoverridevirtual |
Expose some interface of std::vector for convenience.
Implements Selectable.