darsia.CropAssistant#
- class CropAssistant(img, **kwargs)[source]#
Bases:
PointSelectionAssistantGraphical assistant for cropping images as part of CurvatureCorrection.
Constructor.
Based on PointSelectionAssistant configured to use points in Voxel format.
- Parameters:
- img
darsia.Image Input image.
- img
Methods
from_image(color, width, height)Run the assistant in automatic mode.
Attributes
Selected corners to define box after cropping (voxels in matrix indexing).
Named corners as {top_left, bottom_left, bottom_right, top_right}.
Flag controlling whether the user has entered the width and height.
Identified width of the box.
Identified height of the box.
nameName of assistant / short version of instructions.
return_coordinatesFlag controlling whether to return coordinates or voxels.
labelsLabels for the image.
imgImage to be analyzed.
backgroundBackground image for plotting.
figFigure for analysis.
axAxes for analysis.
blockFlag controlling whether figure is blocking.
plot_gridFlag controlling whether grid is plotted (in 2d).
thresholdThreshold for active voxels (in 3d).
relativeFlag controlling whether threshold is relative (in 3d).
scalingScaling of points (in 3d).
scatterFlag controlling whether scatter plot is used (in 3d).
use_coordinatesFlag controlling whether plots use physical coordinates.
verbosityFlag controlling verbosity.
cmapColormap for plotting.
- from_image(color, width, height)[source]#
Run the assistant in automatic mode.
Detect marks and define a box based on them.
- corners#
Named corners as {top_left, bottom_left, bottom_right, top_right}.
- finalized_prompt_input#
Flag controlling whether the user has entered the width and height.
- height#
Identified height of the box.
- pts#
Selected corners to define box after cropping (voxels in matrix indexing).
- width#
Identified width of the box.