the main steps you need to do are:
- Convert the image to 8 or 16 bit (Image>Type>8-bit)
- Set an auto-threshold that separates your object from the background (Image>Adjust>Threshold)
- Create a roi (selection) containig your object (Edit>Selection>Create Selection)
- Measure the roi to get the coordinates, width and height of the bounding box of your object (Analyze>Measure). The interesting columns in the Results table are BX, BY, Width and Height. Make sure that
Bounding Rectangle is selected under Analyze>Set Measurements.
- Create a roi with the upper left corner at BX + Width / 2, BY, the width Width /2 and the height Height/2 (Edit>Selection>Specify)
You can execute the above steps manually and record them using the macro recorder (Plugins>Macros>Record). You only need to add a step to read the bounding rectangle data (BX, BY, Width and Height) from the results table (