Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Crystal::ConnectedComponentLabeling Class Reference

ConnectedComponentLabelling : Implements connected component labeling on MDHistoWorkspaces. More...

#include <ConnectedComponentLabeling.h>

Public Member Functions

 ConnectedComponentLabeling (const size_t &startId=1, const std::optional< int > &nThreads=std::nullopt)
 Constructor.
 
std::shared_ptr< Mantid::API::IMDHistoWorkspaceexecute (Mantid::API::IMDHistoWorkspace_sptr ws, BackgroundStrategy *const strategy, Mantid::API::Progress &progress) const
 Execute and return clusters.
 
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.
 
size_t getStartLabelId () const
 Getter for the start label id.
 
void startLabelingId (const size_t &id)
 Setter for the label id.
 
virtual ~ConnectedComponentLabeling ()
 Destructor.
 

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.
 

Private Attributes

int m_nThreadsToUse
 Run multithreaded.
 
size_t m_startId
 Start labeling index.
 

Detailed Description

ConnectedComponentLabelling : Implements connected component labeling on MDHistoWorkspaces.

Definition at line 45 of file ConnectedComponentLabeling.h.

Constructor & Destructor Documentation

◆ ConnectedComponentLabeling()

Mantid::Crystal::ConnectedComponentLabeling::ConnectedComponentLabeling ( const size_t &  startId = 1,
const std::optional< int > &  nThreads = std::nullopt 
)

Constructor.

Parameters
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_nThreadsToUse.

◆ ~ConnectedComponentLabeling()

Mantid::Crystal::ConnectedComponentLabeling::~ConnectedComponentLabeling ( )
virtualdefault

Destructor.

Member Function Documentation

◆ calculateDisjointTree()

ClusterMap Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree ( const Mantid::API::IMDHistoWorkspace_sptr ws,
BackgroundStrategy *const  baseStrategy,
Mantid::API::Progress progress 
) const
private

Calculate the disjoint element tree across the image.

Perform the work of the CCL algorithm.

  • Pre filtering of background
  • Labeling using DisjointElements
Parameters
ws: MDHistoWorkspace to run CCL algorithm on
baseStrategy: Background strategy
progress: Progress object
Returns
: Map of label ids to clusters.

Definition at line 256 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(), Mantid::Crystal::BackgroundStrategy::isBackground(), Mantid::API::IMDIterator::jumpTo(), m_nThreadsToUse, m_startId, Mantid::Crystal::ClusterRegister::merge(), Mantid::API::IMDIterator::next(), and Mantid::Kernel::ProgressBase::resetNumSteps().

Referenced by executeAndFetchClusters().

◆ execute()

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.

Parameters
ws: Workspace to perform CCL on
strategy: Background strategy
progress: Progress object
Returns
Cluster output workspace of results

Definition at line 370 of file ConnectedComponentLabeling.cpp.

References executeAndFetchClusters().

◆ 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.

Parameters
ws: Image workspace to integrate
strategy: Background strategy
progress: Progress object
Returns
Image Workspace containing clusters as well as a map of label ids to cluster objects.

Definition at line 386 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().

◆ getStartLabelId()

size_t Mantid::Crystal::ConnectedComponentLabeling::getStartLabelId ( ) const

Getter for the start label id.

Returns
: The start label id.

Definition at line 239 of file ConnectedComponentLabeling.cpp.

References m_startId.

Referenced by Mantid::Crystal::IntegratePeaksHybrid::exec(), and Mantid::Crystal::IntegratePeaksUsingClusters::exec().

◆ startLabelingId()

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.

Parameters
idId to start with

Definition at line 234 of file ConnectedComponentLabeling.cpp.

References m_startId.

Member Data Documentation

◆ m_nThreadsToUse

int Mantid::Crystal::ConnectedComponentLabeling::m_nThreadsToUse
private

Run multithreaded.

Definition at line 80 of file ConnectedComponentLabeling.h.

Referenced by calculateDisjointTree(), and ConnectedComponentLabeling().

◆ m_startId

size_t Mantid::Crystal::ConnectedComponentLabeling::m_startId
private

Start labeling index.

Definition at line 77 of file ConnectedComponentLabeling.h.

Referenced by calculateDisjointTree(), getStartLabelId(), and startLabelingId().


The documentation for this class was generated from the following files: