32 #include <QtCore/QObject> 34 #include <blitz/array.h> 271 const std::map<ViewWidget*, MarkerRenderer*> &
renderers()
const;
284 std::string
id()
const;
294 void setId(
const std::string&
id);
306 blitz::TinyVector<double,3>
positionUm()
const;
351 const std::vector<double>&
features()
const;
378 blitz::TinyVector<float,3>
const &
randomColor()
const;
389 virtual void saveCSV(std::ofstream &out)
const;
390 virtual void loadFromMap(std::map<std::string,std::string>
const &values);
409 blitz::TinyVector<double,3>
const &
positionUm)
const = 0;
471 blitz::Array<bool,1> &buf,
BlitzH5File const &inFile,
472 std::string
const &dsName,
bool showWarnings =
false);
474 template<
typename DataT>
476 blitz::Array<DataT,1> &buf,
BlitzH5File const &inFile,
477 std::string
const &dsName,
bool showWarnings =
false)
479 size_t targetSize = buf.size();
488 std::cerr <<
"'" << dsName <<
"' not found. Setting it to -1" 491 size_t readSize = buf.size();
492 buf.resizeAndPreserve(targetSize);
493 if (readSize < targetSize)
494 buf(blitz::Range(readSize, targetSize - 1)) = DataT(-1);
541 bool _updatesEnabled;
static MarkerType markerTypeFromString(QString const &name)
Get the MarkerType corresponding to the given string representation.
double radialDistanceUm() const
const std::map< ViewWidget *, MarkerRenderer * > & renderers() const
Get a map containing all ViewWidgets this Marker is currently drawn in and the corresponding MarkerRe...
void setRadialDistanceUm(const double radialDistanceUm)
static void _loadFixedSize(blitz::Array< bool, 1 > &buf, BlitzH5File const &inFile, std::string const &dsName, bool showWarnings=false)
The Nucleus class contains cell nucleus attributes and provides methods to load and save single nucle...
bool updatesEnabled() const
Check whether cache updates for this marker are enabled.
std::map< int, double >::iterator probabilityMapFind(int key)
std::string id() const
Get the marker id.
void setManual(const bool manual)
blitz::TinyVector< double, 3 > boundingBoxUpperBoundUm() const
Get the upper bound of the marker's bounding box for all dimensions.
blitz::TinyVector< double, 3 > relativePositionUm() const
Get the marker position relative to the group transformation.
virtual void copyToATBNucleus(atb::Nucleus &nc) const
Marker(AnnotationChannelSpecs *channel=NULL)
Constructor.
void setSelected(bool selected)
double qcDistanceUm() const
void setPredictedLabel(const int label)
The Marker class specifies the properties of an abstract Marker that can be contained in an Annotatio...
virtual void copyFromATBNucleus(atb::Nucleus const &nc)
virtual void _updateBoundingBox() const =0
MarkerRenderer * renderer(ViewWidget *view) const
Get the rendering engine for this Marker and the given view.
std::vector< double > _features
virtual ~Marker()
Destructor.
void setFeatures(const std::vector< double > &features)
blitz::TinyVector< double, 3 > positionUm() const
Get the absolute marker world position in micrometers.
virtual void loadFromMap(std::map< std::string, std::string > const &values)
virtual void writeCSVHeader(std::ofstream &out) const
void setUpdatesEnabled(bool enable)
Enables/Disables cache updates for this marker.
virtual bool inherits(MarkerType type) const =0
Checks whether this marker is of the given MarkerType or derives from it.
The main error class for the BlitzHDF5 interface.
virtual void saveCSV(std::ofstream &out) const
virtual bool occupiesPositionUm(blitz::TinyVector< double, 3 > const &positionUm) const =0
This methods checks whether the given micrometer world position is within the marker volume and is ma...
blitz::TinyVector< float, 3 > const & randomColor() const
If the view type is set to random use this color to obtain the marker color to use.
virtual MarkerRenderer * addRenderer(ViewWidget *view)=0
Add a rendering engine for the given view to this marker.
Lightweight alternative to libBlitzHDF5 providing its basic functionality.
blitz::TinyVector< double, 3 > _boundingBoxLowerBoundUm
This variable contains the lower bound of this marker in micrometers relative to its world position i...
void setChannel(AnnotationChannelSpecs *channel)
Add this marker to the given channel.
bool needsFeatureUpdate() const
double & feature(size_t index)
void setPositionUm(const blitz::TinyVector< double, 3 > &positionUm)
Set the absolute marker world position in micrometers.
Nucleus class containing cell nucelus specific parameters.
void removeRenderer(ViewWidget *view)
Remove the renderer for the given view.
blitz::TinyVector< double, 3 > _boundingBoxUpperBoundUm
This variable contains the lower bound of this marker in micrometers relative to its world position i...
void update()
Explicitely trigger a cache update for all associated renderers.
blitz::TinyVector< double, 3 > boundingBoxLowerBoundUm() const
Get the lower bound of the marker's bounding box for all dimensions.
Marker & operator=(Marker const &marker)
Copy assignment operator.
int predictedLabel() const
static void _loadFixedSize(blitz::Array< DataT, 1 > &buf, BlitzH5File const &inFile, std::string const &dsName, bool showWarnings=false)
static QString markerTypeToString(Marker::MarkerType m)
Get the string representation of the given MarkerType.
std::vector< double >::iterator featuresEnd()
virtual MarkerType markerType() const =0
Get the MarkerType enum value for this marker.
std::map< ViewWidget *, MarkerRenderer * > _renderers
std::map< int, double >::iterator probabilityMapBegin()
void setNeedsFeatureUpdate(bool needsFeatureUpdate)
static QStringList supportedMarkerTypes()
Get a QStringList containing string representations of all marker types.
void setRelativePositionUm(const blitz::TinyVector< double, 3 > &positionUm)
Set the marker position relative to the group transformation.
std::map< int, double > _probabilityMap
AnnotationChannelSpecs * channel() const
Get the channel this marker belongs to.
void setPhi(const double phi)
std::vector< double >::iterator featuresBegin()
const std::vector< double > & features() const
void setId(const std::string &id)
Set the marker id.
bool _boundingBoxUpToDate
If this variable is set to false, the next query for the marker's bounding box will update it...
const std::map< int, double > & probabilityMap() const
static void load(AnnotationChannelSpecs *channel, BlitzH5File const &inFile, std::string const &group, iRoCS::ProgressReporter *pr=NULL)
void setProbabilityMap(const std::map< int, double > &probabilityMap)
MarkerType
Marker.hh "liblabelling_qt4/Marker.hh".
void setLabel(const int label)
std::map< int, double >::iterator probabilityMapEnd()
void readDataset(FixedNumericT &data, std::string const &name) const
Reads a simple, fixed size numeric data set.
static void save(AnnotationChannelSpecs const *channel, BlitzH5File &outFile, std::string const &group, iRoCS::ProgressReporter *pr=NULL)
AnnotationChannelSpecs * p_channel
void setQcDistanceUm(const double qcDistanceUm)
blitz::TinyVector< float, 3 > _randomColor
blitz::TinyVector< double, 3 > _positionUm