\(\renewcommand\AA{\unicode{x212B}}\)
MaskMD v1¶
Summary¶
Mask an MDWorkspace in-situ marking specified boxes as masked
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
ClearExistingMasks |
Input |
boolean |
True |
Clears any existing masks before applying the provided masking. |
Workspace |
InOut |
IMDWorkspace |
Mandatory |
An input/output workspace. |
Dimensions |
Input |
str list |
Mandatory |
Dimension ids/names all comma separated. According to the dimensionality of the workspace, these names will be grouped, so the number of entries must be n*(number of dimensions in the workspace). |
Extents |
Input |
dbl list |
Mandatory |
Extents {min, max} corresponding to each of the dimensions specified, according to the order those identifies have been specified. |
Description¶
This algorithm masks a MDWorkspace in-situ.
This algorithm will first clear-out any existing masking and then apply the new masking, unless ClearExistingMasks is set to false. Note that masking removes data; clearing existing masks only removes the mask flag from boxes/bins. For MDEventWorkspaces masking deletes events from masked boxes. Similarly, for MDHistoWorkspaces the signal of masked bins is set to NaN.
Simple Example¶
Mask as single box region in a 3D workspace with Dimension ids X, Y, Z. Suppose that the dimensions extended from -2 to 2 in each dimension and you want to mask the central region.
MaskMD("Workspace"=workspace,Dimensions="X,Y,Z",Exents="-1,1,-1,1,-1,1")
Complex Example¶
Mask two box regions in a 3D workspace, where the input workspace is the same as above. Here we attempt to mask two opposite corners of the 3D workspace.
MaskMD("Workspace"=workspace,Dimensions="X,Y,Z,X,Y,Z",Extents="-2,-1,-2,-1,-2,-1,+1,+2,+1,+2,+1,+2")
In this example, because the dimensionality is 3 and because 6 dimension ids have been provided, the algorithm treats {X,Y,Z} as one masking region and the following {X,Y,Z} as another. Likewise of the 12 extents inputs provided; the first 6 entries {-2,-1,-2,-1,-2,-1} are min/max values for the first {X,Y,Z} and the latter 6 {+1,+2,+1,+2,+1,+2} relate to the last {X,Y,Z}. Applying this masking will result in two completely separate areas masked in a single call to the algorithm.
Categories: AlgorithmIndex | MDAlgorithms\Transforms
Source¶
C++ header: MaskMD.h
C++ source: MaskMD.cpp