darsia.RectangleSelectionAssistant#

class RectangleSelectionAssistant(img, **kwargs)[source]#

Bases: BaseAssistant

Assistant for selecting a rectangle in an image.

Similar to the point selection assistant, but for rectangles.

Initialize the assistant.

Parameters:
imgdarsia.Image

Image to select a rectangle in.

**kwargs

Additional arguments.

  • background (darsia.Image): Background image to display.

  • name (str): Name of assistant / short version of instructions.

  • coordinates (bool): Flag controlling whether to return coordinates or voxels.

  • labels (darsia.Image): Labels for the image.

Methods

Attributes

name

Name of assistant / short version of instructions.

rs

Rectangle selector.

box

Selected box in terms of slices.

corners

Selected corners in voxel format with matrix indexing.

return_coordinates

Flag controlling whether to return coordinates or voxels.

labels

Labels for the image.

img

Image to be analyzed.

background

Background image for plotting.

fig

Figure for analysis.

ax

Axes for analysis.

block

Flag controlling whether figure is blocking.

plot_grid

Flag controlling whether grid is plotted (in 2d).

threshold

Threshold for active voxels (in 3d).

relative

Flag controlling whether threshold is relative (in 3d).

scaling

Scaling of points (in 3d).

scatter

Flag controlling whether scatter plot is used (in 3d).

use_coordinates

Flag controlling whether plots use physical coordinates.

verbosity

Flag controlling verbosity.

cmap

Colormap for plotting.

box#

Selected box in terms of slices.

corners#

Selected corners in voxel format with matrix indexing.

labels#

Labels for the image.

name#

Name of assistant / short version of instructions.

return_coordinates#

Flag controlling whether to return coordinates or voxels.

rs#

Rectangle selector.