Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
1b99aeb5
Commit
1b99aeb5
authored
9 years ago
by
Matt King
Browse files
Options
Downloads
Patches
Plain Diff
Doxygen comments added
Refs #13508
parent
87004758
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
+1
-0
1 addition, 0 deletions
Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
Framework/MDAlgorithms/src/CompactMD.cpp
+29
-4
29 additions, 4 deletions
Framework/MDAlgorithms/src/CompactMD.cpp
with
30 additions
and
4 deletions
Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
+
1
−
0
View file @
1b99aeb5
...
@@ -53,6 +53,7 @@ public:
...
@@ -53,6 +53,7 @@ public:
const
std
::
string
category
()
const
{
return
"MDAlgorithms"
;
}
const
std
::
string
category
()
const
{
return
"MDAlgorithms"
;
}
/// Algorithm's version for identification
/// Algorithm's version for identification
int
version
()
const
{
return
1
;
}
int
version
()
const
{
return
1
;
}
/// Finding the extents of the first non-zero signals.
void
void
findFirstNonZeroMinMaxExtents
(
Mantid
::
API
::
IMDHistoWorkspace_sptr
inputWs
,
findFirstNonZeroMinMaxExtents
(
Mantid
::
API
::
IMDHistoWorkspace_sptr
inputWs
,
std
::
vector
<
Mantid
::
coord_t
>
&
minVec
,
std
::
vector
<
Mantid
::
coord_t
>
&
minVec
,
...
...
This diff is collapsed.
Click to expand it.
Framework/MDAlgorithms/src/CompactMD.cpp
+
29
−
4
View file @
1b99aeb5
...
@@ -5,10 +5,19 @@ using namespace Mantid::Geometry;
...
@@ -5,10 +5,19 @@ using namespace Mantid::Geometry;
using
namespace
Mantid
::
Kernel
;
using
namespace
Mantid
::
Kernel
;
namespace
{
namespace
{
// helper method to create a string from min and max extents (with non-zero
/**
// signals)
* helper method to create a string from min and max extents (with non-zero
// ready to be used as the PBins for IntegrateMDHistoWorkspace algorithm in
* signals) ready to be used as the PBins for IntegrateMDHistoWorkspace
// exec.
* algorithm in
* exec
* @param minVector : Vector containing the minimum extents that we will crop
* to.
* @param maxVector : Vector containing the maximum extents that we will crop
* to.
* @param inputWs : Used in the calculation from centre to bin edges
* @return : a string vector of binning parameters for IntegrateMDHistoWorkspace
* to take as input.
*/
std
::
vector
<
std
::
string
>
std
::
vector
<
std
::
string
>
createPBinStringVector
(
std
::
vector
<
Mantid
::
coord_t
>
minVector
,
createPBinStringVector
(
std
::
vector
<
Mantid
::
coord_t
>
minVector
,
std
::
vector
<
Mantid
::
coord_t
>
maxVector
,
std
::
vector
<
Mantid
::
coord_t
>
maxVector
,
...
@@ -39,6 +48,16 @@ namespace MDAlgorithms {
...
@@ -39,6 +48,16 @@ namespace MDAlgorithms {
DECLARE_ALGORITHM
(
CompactMD
)
DECLARE_ALGORITHM
(
CompactMD
)
/**
* Finding the centre points of Bins with non-zero signal values
* we then compare this centre to minimum and maximum centres we have
* to get the minimum and maximum extents of the workspace that has non-zero
* signal values in the Bins.
* @param inputWs : The workspace that will be iterated over to find the extents.
* @param minVec : Vector used to stored the minimum extent in each dimension
* @param maxVec : Vector used to stored the maximum extents in each dimension
*/
void
CompactMD
::
findFirstNonZeroMinMaxExtents
(
void
CompactMD
::
findFirstNonZeroMinMaxExtents
(
IMDHistoWorkspace_sptr
inputWs
,
std
::
vector
<
Mantid
::
coord_t
>
&
minVec
,
IMDHistoWorkspace_sptr
inputWs
,
std
::
vector
<
Mantid
::
coord_t
>
&
minVec
,
std
::
vector
<
Mantid
::
coord_t
>
&
maxVec
)
{
std
::
vector
<
Mantid
::
coord_t
>
&
maxVec
)
{
...
@@ -66,6 +85,9 @@ void CompactMD::findFirstNonZeroMinMaxExtents(
...
@@ -66,6 +85,9 @@ void CompactMD::findFirstNonZeroMinMaxExtents(
}
while
(
ws_iter
->
next
());
}
while
(
ws_iter
->
next
());
}
}
/**
* Initiliase the algorithm's properties.
*/
void
CompactMD
::
init
()
{
void
CompactMD
::
init
()
{
// input workspace to compact
// input workspace to compact
declareProperty
(
new
WorkspaceProperty
<
IMDHistoWorkspace
>
(
"InputWorkspace"
,
""
,
declareProperty
(
new
WorkspaceProperty
<
IMDHistoWorkspace
>
(
"InputWorkspace"
,
""
,
...
@@ -76,6 +98,9 @@ void CompactMD::init() {
...
@@ -76,6 +98,9 @@ void CompactMD::init() {
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"Output compacted workspace"
);
"Output compacted workspace"
);
}
}
/**
* Execute the algorithm.
*/
void
CompactMD
::
exec
()
{
void
CompactMD
::
exec
()
{
const
IMDHistoWorkspace_sptr
input_ws
=
this
->
getProperty
(
"InputWorkspace"
);
const
IMDHistoWorkspace_sptr
input_ws
=
this
->
getProperty
(
"InputWorkspace"
);
IMDWorkspace_sptr
out_ws
;
IMDWorkspace_sptr
out_ws
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment