11using VecElements = std::vector<Mantid::Crystal::DisjointElement>;
58 const size_t label = this->
getLabel();
61 ws->setErrorSquaredAt(
index, 0);
71 double errorIntSQ = 0;
75 sigInt += ws->getSignalAt(
index);
76 double errorSQ = ws->getErrorAt(
index);
78 errorIntSQ += errorSQ;
91 for (
size_t i = 1; i <
m_indexes.size(); ++i) {
92 disjointSet[
m_indexes[i]].unionWith(disjointSet[parentIndex].getParent());
Cluster : Image cluster used by connected component labeling.
void addIndex(const size_t &index) override
Track a linear IMDHistoWorkspace index that belongs to the cluster.
Cluster(const size_t &label)
Constructor.
bool containsLabel(const size_t &label) const override
Does the cluster contain the label.
size_t getRepresentitiveIndex() const override
Get a representative index of the cluster.
size_t m_originalLabel
original label on cluster
bool operator==(const Cluster &other) const
Overloaded equals.
std::vector< size_t > m_indexes
indexes belonging to cluster. This is how we track cluster objects.
size_t getOriginalLabel() const override
Get the original label.
void toUniformMinimum(std::vector< DisjointElement > &disjointSet) override
Resolve the proper label for this cluster.
size_t size() const override
Number of indexes tracked.
size_t getLabel() const override
Get the cluster label.
void setRootCluster(ICluster const *root) override
Set the root cluster.
ICluster const * m_rootCluster
Root cluster.
ClusterIntegratedValues integrate(std::shared_ptr< const Mantid::API::IMDHistoWorkspace > ws) const override
integrate the cluster
void writeTo(std::shared_ptr< Mantid::API::IMDHistoWorkspace > ws) const override
Apply labels to the workspace.
ICluster : Abstract cluster.
virtual size_t getLabel() const =0
Get the cluster label.
boost::tuple< double, double > ClusterIntegratedValues
virtual size_t getRepresentitiveIndex() const =0
Get a represetiative index of the cluster.
std::shared_ptr< IMDHistoWorkspace > IMDHistoWorkspace_sptr
shared pointer to Mantid::API::IMDHistoWorkspace
std::shared_ptr< const IMDHistoWorkspace > IMDHistoWorkspace_const_sptr
shared pointer to Mantid::API::IMDHistoWorkspace (const version)
std::vector< DisjointElement > VecElements
double signal_t
Typedef for the signal recorded in a MDBox, etc.
Peak indexing algorithm, which works by assigning multiple possible HKL values to each peak and then ...