It’s simple. I have a 2D grid image like the pic below, I need to apply the entropy on only ROI that is defined by my object. My object is elliptical so I only need to define this static obj. The obj is always vertical. That would be nice if i could extract the whole parameters too.

I think I should be able to do it without imageJ.

Rectangular ROI is easy to define.

Here is what I wrote, but Put all the value inside of the ROI with 1. I want to only choose this region and show it with a line on my image.

```
public EllipseGrid(int x, int y, double a, double b) {
super(x, y, "EllipseGrid");
// Create ellipse in the grid.
double radiusA = a * x;
double radiusB = b * x;
int xcenter = x / 2;
int ycenter = y / 2;
float val = 1.f;
for (int i = 0; i < x; i++) {
for (int j = 0; j < y; j++) {
if (Math.pow(i - xcenter, 2) / (radiusA * radiusA)
+ Math.pow(j - ycenter, 2) / (radiusB * radiusB) <= 1) {
super.setAtIndex(i, j, val);
}
}
}
}
}
```