Commit a9b9ee82 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #20355 clang-format

parent 9a5c68cb
......@@ -26,27 +26,27 @@ using namespace Mantid::Crystal;
/** Initialize the algorithm's properties.
*/
void CentroidPeaks::init() {
declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >(
declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>(
"InPeaksWorkspace", "", Direction::Input),
"A PeaksWorkspace containing the peaks to centroid.");
declareProperty(
make_unique<WorkspaceProperty<> >("InputWorkspace", "", Direction::Input),
make_unique<WorkspaceProperty<>>("InputWorkspace", "", Direction::Input),
"An input 2D Workspace.");
declareProperty(
make_unique<PropertyWithValue<int> >("PeakRadius", 10, Direction::Input),
make_unique<PropertyWithValue<int>>("PeakRadius", 10, Direction::Input),
"Fixed radius around each peak position in which to calculate the "
"centroid.");
declareProperty(
make_unique<PropertyWithValue<int> >("EdgePixels", 0, Direction::Input),
make_unique<PropertyWithValue<int>>("EdgePixels", 0, Direction::Input),
"The number of pixels where peaks are removed at edges. Only "
"for instruments with RectangularDetectors. ");
declareProperty(
make_unique<WorkspaceProperty<PeaksWorkspace> >("OutPeaksWorkspace", "",
Direction::Output),
make_unique<WorkspaceProperty<PeaksWorkspace>>("OutPeaksWorkspace", "",
Direction::Output),
"The output PeaksWorkspace will be a copy of the input PeaksWorkspace "
"with the peaks' positions modified by the new found centroids.");
}
......@@ -341,8 +341,8 @@ int CentroidPeaks::findPixelID(std::string bankName, int col, int row) {
}
}
void
CentroidPeaks::removeEdgePeaks(Mantid::DataObjects::PeaksWorkspace &peakWS) {
void CentroidPeaks::removeEdgePeaks(
Mantid::DataObjects::PeaksWorkspace &peakWS) {
int Edge = getProperty("EdgePixels");
std::vector<int> badPeaks;
size_t numPeaks = peakWS.getNumberPeaks();
......
......@@ -156,18 +156,19 @@ void PeaksWorkspace::removePeak(const int peakNum) {
void PeaksWorkspace::removePeaks(std::vector<int> badPeaks) {
if (badPeaks.empty())
return;
// if index of peak is in badPeaks remove
int ip = -1;
auto it = std::remove_if(
peaks.begin(), peaks.end(), [&ip, badPeaks] (Peak &pk) {
(void)pk;
ip++;
for (auto ibp = badPeaks.begin(); ibp != badPeaks.end(); ++ibp) {
if (*ibp == ip) return true;
}
// if index of peak is in badPeaks remove
int ip = -1;
auto it =
std::remove_if(peaks.begin(), peaks.end(), [&ip, badPeaks](Peak &pk) {
(void)pk;
ip++;
for (auto ibp = badPeaks.begin(); ibp != badPeaks.end(); ++ibp) {
if (*ibp == ip)
return true;
}
return false;
});
peaks.erase(it, peaks.end());
});
peaks.erase(it, peaks.end());
}
//---------------------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment