int width = ip.getWidth();
int height = ip.getHeight();
int colorValue;
if (minIndex > 0) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
colorValue = ip.getPixel(x, y);
ip.putPixel(x, y, colorValue - minIndex );
}
}
maxIndex -= minIndex;
IJ.log("min adjusted");
}