RectROI#
xrdimageutil.roi.RectROI
#
The RectROI
class provides a 3D “box” region of interest that can be applied
to 3D datasets. Users can define the coordinate bounds for the region, define a
calculation to be carried out on the selected region, and then apply the ROI
to multple datasets. This tool is scriptable, and the region bounds/calculation
can be modified at any point.
In the Image GUI widget (refer to the Viewing Image Data tutorial),
there is a graphical version of the RectROI
object that is built on the backend
class, but it does not provide the same scriptability, only being available for single
datasets at a time.
Tutorial: Using ROI’s
Attributes#
- xrdimageutil.roi.RectROI.bounds: dict#
Coordinate bounds for the rectangular region. These can be defined by using the
set_bounds
function.
- xrdimageutil.roi.RectROI.calculation: dict#
Output calculation and the dims to calculate across. This can be defined by using the
set_calculation
function.
- xrdimageutil.roi.RectROI.output: dict#
Output data and coordinates.
Functions#
- xrdimageutil.roi.RectROI.__init__(self, dims: list = None)#
If
dims
is not specified, the dimensions of the ROI will default to “x”, “y”, and “z” respectively. Order matters.
- xrdimageutil.roi.RectROI.set_bounds(self, bounds: dict)#
Defines the ROI coordinate bounds.
- xrdimageutil.roi.RectROI.set_calculation(self, output: str, dims: list)#
Defines the calculation to be applied.
- xrdimageutil.roi.RectROI.apply(self, data, coords)#
Applies the set calculation to a dataset and its defined coordinates.
- xrdimageutil.roi.RectROI.apply_to_scan(self, scan, data_type)#
Applies the set calculation to a dataset for a
xiu.Scan
object, defining the data type by either “raw” or “gridded”.
- xrdimageutil.roi.RectROI.get_output(self)#
Returns the output data and coordinates.