forked from computationalpathologygroup/ASAP
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduced base classes for annotation and annotationtool
- Added statistics for annotation groups as well - Added canClose options to WorkstationExtensions to enable them to prevent closing of ASAP
- Loading branch information
1 parent
246a69d
commit f3f2211
Showing
40 changed files
with
711 additions
and
700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "AnnotationBase.h" | ||
#include "AnnotationGroup.h" | ||
#include "psimpl.h" | ||
#include <limits> | ||
|
||
AnnotationBase::AnnotationBase() : | ||
_name(""), | ||
_color("#F4FA58"), | ||
_modified(true) | ||
{ | ||
} | ||
|
||
AnnotationBase::~AnnotationBase() { | ||
} | ||
|
||
std::string AnnotationBase::getColor() const { | ||
return _color; | ||
} | ||
|
||
void AnnotationBase::setColor(const std::string& color) { | ||
_color = color; | ||
} | ||
|
||
void AnnotationBase::setName(const std::string& name) | ||
{ | ||
_name = name; | ||
} | ||
|
||
std::string AnnotationBase::getName() const | ||
{ | ||
return _name; | ||
}; | ||
|
||
void AnnotationBase::setGroup(const std::shared_ptr<AnnotationGroup>& group) { | ||
std::shared_ptr<AnnotationGroup> currentGroup = _group.lock(); | ||
if (!currentGroup || currentGroup != group) { | ||
_group.reset(); | ||
if (currentGroup) { | ||
currentGroup->removeMember(this->shared_from_this()); | ||
} | ||
_group = group; | ||
if (group) { | ||
group->addMember(this->shared_from_this()); | ||
} | ||
} | ||
} | ||
|
||
std::shared_ptr<AnnotationGroup> AnnotationBase::getGroup() const { | ||
std::shared_ptr<AnnotationGroup> grp = _group.lock(); | ||
return grp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef ANNOTATIONBASE_H | ||
#define ANNOTATIONBASE_H | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <map> | ||
#include <memory> | ||
#include "core/Point.h" | ||
#include "config/pathology_config.h" | ||
|
||
class AnnotationGroup; | ||
|
||
class EXPORT_PATHOLOGYANNOTATION AnnotationBase : public std::enable_shared_from_this<AnnotationBase> { | ||
public: | ||
|
||
AnnotationBase(); | ||
virtual ~AnnotationBase(); | ||
|
||
void setName(const std::string& name); | ||
std::string getName() const; | ||
|
||
void setGroup(const std::shared_ptr<AnnotationGroup>& group); | ||
std::shared_ptr<AnnotationGroup> getGroup() const; | ||
|
||
std::string getColor() const; | ||
void setColor(const std::string& color); | ||
|
||
virtual std::vector<Point> getImageBoundingBox() const = 0; | ||
virtual std::vector<Point> getLocalBoundingBox() = 0; | ||
virtual Point getCenter() = 0; | ||
|
||
virtual float getArea() const = 0; | ||
virtual unsigned int getNumberOfPoints() const = 0; | ||
|
||
inline bool isModified() { return _modified; } | ||
inline void resetModifiedStatus() { _modified = false; } | ||
|
||
protected: | ||
bool _modified; | ||
std::string _name; | ||
std::weak_ptr<AnnotationGroup> _group; | ||
std::string _color; | ||
}; | ||
#endif |
Oops, something went wrong.