-
Notifications
You must be signed in to change notification settings - Fork 121
/
SmoothMD.h
51 lines (43 loc) · 1.88 KB
/
SmoothMD.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2015 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/Algorithm.h"
#include "MantidKernel/System.h"
#include <boost/optional.hpp>
#include <memory>
namespace Mantid {
namespace API {
class IMDHistoWorkspace;
}
namespace MDAlgorithms {
DLLExport std::vector<double> gaussianKernel(const double fwhm);
DLLExport std::vector<double> normaliseKernel(std::vector<double> kernel);
DLLExport std::vector<double> renormaliseKernel(std::vector<double> kernel, const std::vector<bool> &validity);
/** SmoothMD : Algorithm for smoothing MDHistoWorkspaces
*/
class DLLExport SmoothMD : public API::Algorithm {
public:
const std::string name() const override;
int version() const override;
const std::vector<std::string> seeAlso() const override { return {"ThresholdMD"}; }
const std::string category() const override;
const std::string summary() const override;
std::map<std::string, std::string> validateInputs() override;
std::shared_ptr<Mantid::API::IMDHistoWorkspace>
hatSmooth(const std::shared_ptr<const Mantid::API::IMDHistoWorkspace> &toSmooth,
const std::vector<double> &widthVector,
boost::optional<std::shared_ptr<const Mantid::API::IMDHistoWorkspace>> weightingWS);
std::shared_ptr<Mantid::API::IMDHistoWorkspace>
gaussianSmooth(const std::shared_ptr<const Mantid::API::IMDHistoWorkspace> &toSmooth,
const std::vector<double> &widthVector,
boost::optional<std::shared_ptr<const Mantid::API::IMDHistoWorkspace>> weightingWS);
private:
void init() override;
void exec() override;
};
} // namespace MDAlgorithms
} // namespace Mantid