This example demonstrates how to move or change a tools' ROI position/size
from a script
Most tools are positioned in the image (the ROI) either as a rectangle
with center/size/angle (e.g. LineFinder) or as a set of polygons (e.g.
Blob3). The ROI can be changed as shown below. One or more points are given;
one point means move ROI center, several points means reshape ROI.
Example 1 - Move rectangle
LF=GetTool('LF') # rectangle tool, e.g. LineFinder
LF.executeCmd('set;object=roi;value=((200;200))') # moves the ROI center
Example 2 - Set rectangle
LF=GetTool('LF') # rectangle tool, e.g. LineFinder
LF.executeCmd('set;object=roi;value=((100;100)(200;100)(200;150)(100;150))')
#specify four corners of the ROI. The angle is calculated from the first two
points
Example 3 - Move first polygon
B3=GetTool('B3') # polygon tool, e.g. Blob3
B3.executeCmd('set;object=roi;value=((200;200))') # moves blob3 first
polygon to new center (defined as center of gravity for polygon)
Example 4 - Set first polygon
B3=GetTool('B3') # polygon tool, e.g. Blob3
B3.executeCmd('set;object=roi;value=((100;100)(200;100)(100;200))') #
polygon defines ROI directly
Example 5 - Move another polygon
B3=GetTool('B3') # polygon tool, e.g. Blob3
B3.executeCmd('set;object=roi;number=2;value=((200;200))') # moves blob3
second polygon to new center (defined as center of gravity for polygon)
|