forked from npshub/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoordTransformAligned.h
62 lines (50 loc) · 2.29 KB
/
CoordTransformAligned.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
52
53
54
55
56
57
58
59
60
61
62
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 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/CoordTransform.h"
#include "MantidAPI/VectorParameter.h"
#include "MantidKernel/System.h"
namespace Mantid {
namespace DataObjects {
/// Unique type declaration for which dimensions are used in the input workspace
DECLARE_VECTOR_PARAMETER(DimensionsToBinFromParam, size_t)
/// Unique type declaration for the offset of coordinates
DECLARE_VECTOR_PARAMETER(OriginOffsetParam, coord_t)
/// Unique type declaration for the step size in transformation
DECLARE_VECTOR_PARAMETER(ScalingParam, coord_t)
/** A restricted version of CoordTransform which transforms
from one set of dimensions to another, allowing:
- An offset
- A reduction in the number of dimensions
- A scaling
While a normal Affine matrix would handle this case, this special
case is used in order to reduce the number of calculation.
@author Janik Zikovsky
@date 2011-08-29
*/
class DLLExport CoordTransformAligned : public Mantid::API::CoordTransform {
public:
CoordTransformAligned(const size_t inD, const size_t outD, const size_t *dimensionToBinFrom, const coord_t *origin,
const coord_t *scaling);
CoordTransformAligned(const size_t inD, const size_t outD, std::vector<size_t> dimensionToBinFrom,
std::vector<coord_t> origin, std::vector<coord_t> scaling);
CoordTransform *clone() const override;
std::string toXMLString() const override;
std::string id() const override;
void apply(const coord_t *inputVector, coord_t *outVector) const override;
Mantid::Kernel::Matrix<coord_t> makeAffineMatrix() const override;
protected:
/// For each dimension in the output, index in the input workspace of which
/// dimension it is
std::vector<size_t> m_dimensionToBinFrom;
/// Offset (minimum) position in each of the output dimensions, sized [outD]
std::vector<coord_t> m_origin;
/// Scaling from the input to the output dimension, sized [outD]
std::vector<coord_t> m_scaling;
};
} // namespace DataObjects
} // namespace Mantid