Skip to content

Commit

Permalink
refs #9509. More code documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed May 27, 2014
1 parent bf81434 commit 74fb79e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp
@@ -1,6 +1,6 @@
/*WIKI*
*
Integrates arbitary shaped single crystal peaks defined on an [[MDHistoWorkspace]] using connected component analysis to determine
Integrates arbitrary shaped single crystal peaks defined on an [[MDHistoWorkspace]] using connected component analysis to determine
regions of interest around each peak of the [[PeaksWorkspace]]. The output is an integrated [[PeaksWorkspace]] as well as an image
containing the labels assigned to each cluster for diagnostic and visualisation purposes.
Expand All @@ -18,7 +18,7 @@
number of bins is applied in each dimension.
== Warnings and Logging ==
See [[IntegratePeaksUsingClusters]] for notes on loggs and warnings.
See [[IntegratePeaksUsingClusters]] for notes on logs and warnings.
*WIKI*/

Expand Down Expand Up @@ -51,6 +51,14 @@ using namespace Mantid::DataObjects;

namespace
{
/**
* Create a BinMD dimension input string
* @param dimension : Dimension to use
* @param min : Min extents
* @param max : Max extents
* @param nBins : Number of bins.
* @return
*/
std::string extractFormattedPropertyFromDimension(Mantid::Geometry::IMDDimension_const_sptr& dimension,
const double& min, const double& max, const int& nBins)
{
Expand Down Expand Up @@ -207,7 +215,7 @@ namespace Mantid
Workspace_sptr temp = binMDAlg->getProperty("OutputWorkspace");
IMDHistoWorkspace_sptr localImage = boost::dynamic_pointer_cast<IMDHistoWorkspace>(temp);
API::MDNormalization normalization = NoNormalization;
auto iterator = localImage->createIterator(); // TODO run in parallel if it helps.
auto iterator = localImage->createIterator();
iterator->setNormalization(normalization);
signal_t cumulative = 0;
do
Expand All @@ -220,7 +228,7 @@ namespace Mantid
// CCL. Multi-processor version.
const size_t startId = 1;
const size_t nThreads = 1;
ConnectedComponentLabeling analysis(startId, nThreads);
ConnectedComponentLabeling analysis(startId, nThreads); // CCL executed single threaded.

Progress dummyProgress;
// Perform CCL.
Expand Down
@@ -1,9 +1,9 @@
/*WIKI*
Integrates arbitary shaped single crystal peaks defined on an [[MDHistoWorkspace]] using connected component analysis to determine
Integrates arbitrary shaped single crystal peaks defined on an [[MDHistoWorkspace]] using connected component analysis to determine
regions of interest around each peak of the [[PeaksWorkspace]]. The output is an integrated [[PeaksWorkspace]] as well as an image
containing the labels assigned to each cluster for diagnostic and visualisation purposes.
'''The algorithm makes no assmptions about Peak shape or size''' and can therfore be used where integration over defined shapes
'''The algorithm makes no assumptions about Peak shape or size''' and can therefore be used where integration over defined shapes
[[IntegratePeaksMD]] and [[IntegrateEllipsoids]], for example, will not work.
[[File:ClusterImage.png|400px]]
Expand All @@ -15,8 +15,8 @@
do not affect the background filtering.
This algorithm uses an imaging technique, and it is therefore important that the MDHistoWorkspace you are using is binned to a sufficient
resolution via [[BinMD]]. You can overlay the intergrated peaks workspace in the [[MantidPlot:_SliceViewer#Viewing_Peaks_Workspaces|Slice Viewer]] over
the generated Cluster Labeled OutputWorkspaceMD to see what the interation region used for each peak amounts to.
resolution via [[BinMD]]. You can overlay the integrated peaks workspace in the [[MantidPlot:_SliceViewer#Viewing_Peaks_Workspaces|Slice Viewer]] over
the generated Cluster Labeled OutputWorkspaceMD to see what the integration region used for each peak amounts to.
== Notes for running ==
Expand Down

0 comments on commit 74fb79e

Please sign in to comment.