SetMDUsingMask v1


SetMDUsingMask dialog.


Algorithm to set a MDHistoWorkspace in points determined by a mask boolean MDHistoWorkspace.


Name Direction Type Default Description
InputWorkspace Input IMDHistoWorkspace Mandatory An input MDHistoWorkspace.
MaskWorkspace Input IMDHistoWorkspace Mandatory A mask MDHistoWorkspace, where true indicates where to set the value.
ValueWorkspace Input IMDHistoWorkspace   Workspace to copy to the output workspace over the input. Optional - specify this or Value.
Value Input number Optional Single number to set in the output workspace. Optional - specify this or ValueWorkspace
OutputWorkspace Output IMDHistoWorkspace Mandatory An output MDHistoWorkspace.


This algorithm is used to replace values in a MDHistoWorkspace but only at particular points.

A mask MDHistoWorkspace is provided, where non-zero values indicate ‘true’. At these points, the corresponding value in the ValueWorkspace will be set. Any ‘false’ points in the MaskWorkspace are skipped.

If ValueWorkspace is not specified, the you must specify Value, which is a a simple number to set.

In matlab, the equivalent function call would be WS[mask] = OtherWS[mask]

See this page on boolean operations for examples of how to create a mask.

Usage (Python)

# This will zero-out any values below the threshold of 123
MaskWS = WS < 123
ModifiedWS = SetMDUsingMask(InputWorkspace=WS, Value="0", MaskWorkspace=MaskWS)

Categories: AlgorithmIndex | MDAlgorithms\MDArithmetic


C++ header: SetMDUsingMask.h

C++ source: SetMDUsingMask.cpp