FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
BoundingBox.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 #include <thread>
7 #include <FAST/ProcessObject.hpp>
8 
9 namespace fast {
10 
11 class FAST_EXPORT BoundingBox : public SpatialDataObject {
13  public:
17  void create(Vector2f position, Vector2f size, uchar label = 1, float score = 0.0f);
18  void setLabel(uchar label);
19  uchar getLabel();
23  void setPosition(Vector2f position);
24  Vector2f getPosition();
28  void setSize(Vector2f size);
29  Vector2f getSize();
30 
31  void setScore(float score);
32  float getScore();
33 
34  void free(ExecutionDevice::pointer device) override {};
35  void freeAll() override {};
36  float intersectionOverUnion(BoundingBox::pointer bbox2) const;
37  protected:
38  BoundingBox();
39 
40  bool m_initialized = false;
41  uchar m_label = 1;
42  Vector2f m_position;
43  Vector2f m_size;
44  float m_score;
45 
46  std::mutex m_mutex;
47 };
48 
49 class FAST_EXPORT BoundingBoxSet : public SpatialDataObject {
51  public:
52  void create();
53  int getNrOfLines();
54  int getNrOfVertices();
56  BoundingBoxSetOpenGLAccess::pointer getOpenGLAccess(accessType type);
57  void freeAll() override;
58  void free(ExecutionDevice::pointer device) override;
59  ~BoundingBoxSet();
60  virtual DataBoundingBox getBoundingBox() const override;
61  protected:
63  void setAllDataToOutOfDate();
64 
65  // OpenGL data
68  GLuint mCoordinateVBO = 0;
69  GLuint mLineEBO = 0;
70  GLuint m_labelVBO = 0;
71 
72  // Host data
75  std::vector<float> mCoordinates;
76  std::vector<uint> mLines;
77  std::vector<uchar> m_labels;
78  std::vector<float> m_scores;
79 
82 
84 };
85 
89 class FAST_EXPORT BoundingBoxSetAccumulator : public ProcessObject {
91  public:
92  protected:
94  void execute() override;
95 
97 };
98 
99 }
fast::BoundingBox
Definition: BoundingBox.hpp:11
fast::BoundingBoxSet::mVBOHasData
bool mVBOHasData
Definition: BoundingBox.hpp:66
fast::ExecutionDevice::pointer
std::shared_ptr< ExecutionDevice > pointer
Definition: ExecutionDevice.hpp:11
fast::BoundingBoxSet::mCoordinates
std::vector< float > mCoordinates
Definition: BoundingBox.hpp:75
fast::BoundingBoxSet::mVBODataIsUpToDate
bool mVBODataIsUpToDate
Definition: BoundingBox.hpp:67
fast
Definition: AffineTransformation.hpp:7
fast::BoundingBoxSet::mLines
std::vector< uint > mLines
Definition: BoundingBox.hpp:76
fast::BoundingBoxSet::mHostDataIsUpToDate
bool mHostDataIsUpToDate
Definition: BoundingBox.hpp:74
BoundingBoxSetAccess.hpp
fast::BoundingBox::m_score
float m_score
Definition: BoundingBox.hpp:44
fast::BoundingBox::free
void free(ExecutionDevice::pointer device) override
Definition: BoundingBox.hpp:34
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::BoundingBoxSet::mNrOfLines
uint mNrOfLines
Definition: BoundingBox.hpp:81
SpatialDataObject.hpp
fast::BoundingBoxSetAccumulator
Definition: BoundingBox.hpp:89
fast::BoundingBoxSet::m_scores
std::vector< float > m_scores
Definition: BoundingBox.hpp:78
fast::BoundingBoxSetAccess::pointer
std::unique_ptr< BoundingBoxSetAccess > pointer
Definition: BoundingBoxSetAccess.hpp:38
accessType
accessType
Definition: Access.hpp:5
fast::BoundingBoxSet::mNrOfVertices
uint mNrOfVertices
Definition: BoundingBox.hpp:80
fast::BoundingBox::freeAll
void freeAll() override
Definition: BoundingBox.hpp:35
SimpleDataObject.hpp
ProcessObject.hpp
fast::BoundingBox::m_size
Vector2f m_size
Definition: BoundingBox.hpp:43
fast::BoundingBoxSet::mIsInitialized
bool mIsInitialized
Definition: BoundingBox.hpp:83
fast::DataObject::pointer
std::shared_ptr< DataObject > pointer
Definition: DataObject.hpp:16
fast::BoundingBoxSet
Definition: BoundingBox.hpp:49
fast::BoundingBox::m_mutex
std::mutex m_mutex
Definition: BoundingBox.hpp:46
uint
unsigned int uint
Definition: DataTypes.hpp:16
fast::BoundingBoxSetAccumulator::m_accumulatedBBset
BoundingBoxSet::pointer m_accumulatedBBset
Definition: BoundingBox.hpp:96
fast::BoundingBoxSet::m_labels
std::vector< uchar > m_labels
Definition: BoundingBox.hpp:77
fast::BoundingBoxSet::mHostHasData
bool mHostHasData
Definition: BoundingBox.hpp:73
uchar
unsigned char uchar
Definition: DataTypes.hpp:14
fast::BoundingBoxSetOpenGLAccess::pointer
std::unique_ptr< BoundingBoxSetOpenGLAccess > pointer
Definition: BoundingBoxSetAccess.hpp:57
fast::SpatialDataObject
Definition: SpatialDataObject.hpp:10
fast::BoundingBox::m_position
Vector2f m_position
Definition: BoundingBox.hpp:42
fast::ProcessObject
Definition: ProcessObject.hpp:22
fast::DataBoundingBox
Definition: DataBoundingBox.hpp:13