Mantid
Loading...
Searching...
No Matches
IMDIterator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
15#include "MantidKernel/VMD.h"
16#include <vector>
17
18namespace Mantid {
19
20namespace API {
21
32};
33
39class MANTID_API_DLL IMDIterator {
40public:
42 virtual ~IMDIterator() = default;
43
44 void setNormalization(Mantid::API::MDNormalization normalization);
45 Mantid::API::MDNormalization getNormalization() const;
46
48 virtual size_t getDataSize() const = 0;
49
53 virtual bool next() = 0;
54
56 virtual bool valid() const = 0;
57
59 virtual void jumpTo(size_t index) = 0;
60
62 virtual bool next(size_t skip) = 0;
63
65 virtual signal_t getNormalizedSignal() const = 0;
66
68 virtual signal_t getNormalizedError() const = 0;
69
71 virtual signal_t getSignal() const = 0;
72
74 virtual signal_t getError() const = 0;
75
77 virtual std::unique_ptr<coord_t[]> getVertexesArray(size_t &numVertices) const = 0;
78
81 virtual std::unique_ptr<coord_t[]> getVertexesArray(size_t &numVertices, const size_t outDimensions,
82 const bool *maskDim) const = 0;
83
85 virtual Mantid::Kernel::VMD getCenter() const = 0;
86
88 virtual size_t getNumEvents() const = 0;
89
91 virtual uint16_t getInnerExpInfoIndex(size_t index) const = 0;
92
94 virtual uint16_t getInnerGoniometerIndex(size_t index) const = 0;
95
97 virtual int32_t getInnerDetectorID(size_t index) const = 0;
98
100 virtual coord_t getInnerPosition(size_t index, size_t dimension) const = 0;
101
103 virtual signal_t getInnerSignal(size_t index) const = 0;
104
106 virtual signal_t getInnerError(size_t index) const = 0;
107
109 virtual bool getIsMasked() const = 0;
110
112 virtual std::vector<size_t> findNeighbourIndexes() const = 0;
113
115 virtual std::vector<size_t> findNeighbourIndexesFaceTouching() const = 0;
116
118 virtual size_t getLinearIndex() const = 0;
119
121 virtual bool isWithinBounds(size_t index) const = 0;
122
123protected:
126};
127
128} // namespace API
129} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
This is an interface to an iterator of an IMDWorkspace.
Definition: IMDIterator.h:39
virtual int32_t getInnerDetectorID(size_t index) const =0
For a given event/point in this box, return the detector ID.
virtual std::vector< size_t > findNeighbourIndexes() const =0
Find neighbouring indexes vertex touching.
virtual std::unique_ptr< coord_t[]> getVertexesArray(size_t &numVertices) const =0
Return a list of vertexes defining the volume pointed to.
virtual std::vector< size_t > findNeighbourIndexesFaceTouching() const =0
Find neighbouring indexes face touching.
virtual signal_t getNormalizedError() const =0
Returns the normalized error for this box.
virtual signal_t getError() const =0
Returns the total error for this box.
virtual coord_t getInnerPosition(size_t index, size_t dimension) const =0
Returns the position of a given event for a given dimension.
virtual uint16_t getInnerGoniometerIndex(size_t index) const =0
For a given event/point in this box, return the goniometer index.
virtual bool isWithinBounds(size_t index) const =0
Is index reachable by the iterator.
virtual signal_t getNormalizedSignal() const =0
Returns the normalized signal for this box.
virtual size_t getNumEvents() const =0
Returns the number of events/points contained in this box.
virtual Mantid::Kernel::VMD getCenter() const =0
Returns the position of the center of the box pointed to.
virtual bool valid() const =0
Is the current position of the iterator valid?
virtual ~IMDIterator()=default
virtual uint16_t getInnerExpInfoIndex(size_t index) const =0
For a given event/point in this box, return the associated experiment-info index.
virtual size_t getDataSize() const =0
Get the size of the data (number of entries that will be iterated through)
virtual signal_t getInnerError(size_t index) const =0
Returns the error of a given event.
Mantid::API::MDNormalization m_normalization
Normalization method for getNormalizedSignal()
Definition: IMDIterator.h:125
virtual std::unique_ptr< coord_t[]> getVertexesArray(size_t &numVertices, const size_t outDimensions, const bool *maskDim) const =0
Return a list of vertexes defining the volume pointed to, enable masking of dimensions.
virtual bool next(size_t skip)=0
Advance, skipping a certain number of cells.
virtual bool next()=0
Advance to the next cell.
virtual signal_t getSignal() const =0
Returns the total signal for this box.
virtual signal_t getInnerSignal(size_t index) const =0
Returns the signal of a given event.
virtual size_t getLinearIndex() const =0
Get the linear index.
virtual void jumpTo(size_t index)=0
Jump to the index^th cell.
virtual bool getIsMasked() const =0
Returns true if masking is used.
MDNormalization
Enum describing different ways to normalize the signal in a MDWorkspace.
Definition: IMDIterator.h:25
@ VolumeNormalization
Divide the signal by the volume of the box/bin.
Definition: IMDIterator.h:29
@ NumEventsNormalization
Divide the signal by the number of events that contributed to it.
Definition: IMDIterator.h:31
@ NoNormalization
Don't normalize = return raw counts.
Definition: IMDIterator.h:27
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
Definition: MDTypes.h:27
double signal_t
Typedef for the signal recorded in a MDBox, etc.
Definition: MDTypes.h:36