Module ij
Package ij.process

# Class EllipseFitter

java.lang.Object
ij.process.EllipseFitter

public class EllipseFitter extends Object
This class fits an ellipse to an ROI.

## Field Summary

Fields
Modifier and Type
Field
Description
`double`
`angle`
Angle in degrees
`double`
`major`
Length of major axis
`double`
`minor`
Length of minor axis
`int`
`nCoordinates`
Initialized by makeRoi()
`double`
`theta`
Angle in radians
`double`
`xCenter`
X centroid
`int[]`
`xCoordinates`
Initialized by makeRoi()
`double`
`yCenter`
X centroid
`int[]`
`yCoordinates`
Initialized by makeRoi()

## Constructor Summary

Constructors
Constructor
Description
`EllipseFitter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`drawEllipse(ImageProcessor ip)`
Draws the ellipse on the specified image.
`void`
`fit(ImageProcessor ip, ImageStatistics stats)`
Fits an ellipse to the current ROI.
`void`
`makeRoi(ImageProcessor ip)`
Generates the xCoordinates, yCoordinates public arrays that can be used to create an ROI.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### xCenter

public double xCenter
X centroid

### yCenter

public double yCenter
X centroid

### major

public double major
Length of major axis

### minor

public double minor
Length of minor axis

### angle

public double angle
Angle in degrees

### theta

public double theta
Angle in radians

### xCoordinates

public int[] xCoordinates
Initialized by makeRoi()

### yCoordinates

public int[] yCoordinates
Initialized by makeRoi()

### nCoordinates

public int nCoordinates
Initialized by makeRoi()

## Constructor Details

### EllipseFitter

public EllipseFitter()

## Method Details

### fit

public void fit(ImageProcessor ip, ImageStatistics stats)
Fits an ellipse to the current ROI. The 'stats' argument, currently not used, can be null. The fit parameters are returned in public fields.

### drawEllipse

public void drawEllipse(ImageProcessor ip)
Draws the ellipse on the specified image.

### makeRoi

public void makeRoi(ImageProcessor ip)
Generates the xCoordinates, yCoordinates public arrays that can be used to create an ROI.