Mantid
|
ConnectedComponentLabelling : Implements connected component labeling on MDHistoWorkspaces. More...
#include <ConnectedComponentLabeling.h>
Public Member Functions | |
ConnectedComponentLabeling (const size_t &startId=1, boost::optional< int > nThreads=boost::none) | |
Constructor. More... | |
std::shared_ptr< Mantid::API::IMDHistoWorkspace > | execute (Mantid::API::IMDHistoWorkspace_sptr ws, BackgroundStrategy *const strategy, Mantid::API::Progress &progress) const |
Execute and return clusters. More... | |
ConnectedComponentMappingTypes::ClusterTuple | executeAndFetchClusters (Mantid::API::IMDHistoWorkspace_sptr ws, BackgroundStrategy *const strategy, Mantid::API::Progress &progress) const |
Execute and return clusters, as well as maps to integratable clusters. More... | |
size_t | getStartLabelId () const |
Getter for the start label id. More... | |
void | startLabelingId (const size_t &id) |
Setter for the label id. More... | |
virtual | ~ConnectedComponentLabeling () |
Destructor. More... | |
Private Member Functions | |
ConnectedComponentMappingTypes::ClusterMap | calculateDisjointTree (const Mantid::API::IMDHistoWorkspace_sptr &ws, BackgroundStrategy *const baseStrategy, Mantid::API::Progress &progress) const |
Calculate the disjoint element tree across the image. More... | |
int | getNThreads () const |
Get the number of threads to use. More... | |
Private Attributes | |
const boost::optional< int > | m_nThreads |
Run multithreaded. More... | |
size_t | m_startId |
Start labeling index. More... | |
ConnectedComponentLabelling : Implements connected component labeling on MDHistoWorkspaces.
Definition at line 46 of file ConnectedComponentLabeling.h.
Mantid::Crystal::ConnectedComponentLabeling::ConnectedComponentLabeling | ( | const size_t & | startId = 1 , |
boost::optional< int > | nThreads = boost::none |
||
) |
Constructor.
startId | : Start Id to use for labeling |
nThreads | : Optional argument of number of threads to use. |
Definition at line 215 of file ConnectedComponentLabeling.cpp.
References m_nThreads.
|
virtualdefault |
Destructor.
|
private |
Calculate the disjoint element tree across the image.
Perform the work of the CCL algorithm.
ws | : MDHistoWorkspace to run CCL algorithm on |
baseStrategy | : Background strategy |
progress | : Progress object |
Definition at line 262 of file ConnectedComponentLabeling.cpp.
References Mantid::Crystal::ClusterRegister::add(), Mantid::Crystal::BackgroundStrategy::clone(), Mantid::Crystal::ClusterRegister::clusters(), Mantid::Kernel::Logger::debug(), Mantid::API::Progress::doReport(), Mantid::API::g_log, Mantid::API::IMDIterator::getLinearIndex(), getNThreads(), Mantid::Crystal::BackgroundStrategy::isBackground(), Mantid::API::IMDIterator::jumpTo(), m_startId, Mantid::Crystal::ClusterRegister::merge(), Mantid::API::IMDIterator::next(), and Mantid::Kernel::ProgressBase::resetNumSteps().
Referenced by executeAndFetchClusters().
std::shared_ptr< Mantid::API::IMDHistoWorkspace > Mantid::Crystal::ConnectedComponentLabeling::execute | ( | Mantid::API::IMDHistoWorkspace_sptr | ws, |
BackgroundStrategy *const | strategy, | ||
Mantid::API::Progress & | progress | ||
) | const |
Execute and return clusters.
Execute CCL to produce a cluster output workspace containing labels.
ws | : Workspace to perform CCL on |
strategy | : Background strategy |
progress | : Progress object |
Definition at line 378 of file ConnectedComponentLabeling.cpp.
References executeAndFetchClusters().
ClusterTuple Mantid::Crystal::ConnectedComponentLabeling::executeAndFetchClusters | ( | Mantid::API::IMDHistoWorkspace_sptr | ws, |
BackgroundStrategy *const | strategy, | ||
Mantid::API::Progress & | progress | ||
) | const |
Execute and return clusters, as well as maps to integratable clusters.
Execute.
ws | : Image workspace to integrate |
strategy | : Background strategy |
progress | : Progress object |
Definition at line 394 of file ConnectedComponentLabeling.cpp.
References calculateDisjointTree(), Mantid::Kernel::Logger::debug(), Mantid::API::g_log, and PARALLEL_FOR_NO_WSP_CHECK.
Referenced by Mantid::Crystal::IntegratePeaksHybrid::exec(), Mantid::Crystal::IntegratePeaksUsingClusters::exec(), and execute().
|
private |
Get the number of threads to use.
Get the number of threads available.
Definition at line 244 of file ConnectedComponentLabeling.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), and m_nThreads.
Referenced by calculateDisjointTree().
size_t Mantid::Crystal::ConnectedComponentLabeling::getStartLabelId | ( | ) | const |
Getter for the start label id.
Definition at line 233 of file ConnectedComponentLabeling.cpp.
References m_startId.
Referenced by Mantid::Crystal::IntegratePeaksHybrid::exec(), and Mantid::Crystal::IntegratePeaksUsingClusters::exec().
void Mantid::Crystal::ConnectedComponentLabeling::startLabelingId | ( | const size_t & | id | ) |
Setter for the label id.
Set a custom start id.
This has no bearing on the output of the process other than the initial id used.
id | Id to start with |
Definition at line 228 of file ConnectedComponentLabeling.cpp.
References m_startId.
|
private |
Run multithreaded.
Definition at line 84 of file ConnectedComponentLabeling.h.
Referenced by ConnectedComponentLabeling(), and getNThreads().
|
private |
Start labeling index.
Definition at line 81 of file ConnectedComponentLabeling.h.
Referenced by calculateDisjointTree(), getStartLabelId(), and startLabelingId().