MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / adjustCalibration

Method adjustCalibration

ij/src/main/java/ij/gui/Plot.java:1727–1742  ·  view source on GitHub ↗

Adjusts a Calibration object to fit the current axes. For log axes, the calibration refers to the base-10 logarithm of the value

(Calibration cal)

Source from the content-addressed store, hash-verified

1725 /** Adjusts a Calibration object to fit the current axes.
1726 * For log axes, the calibration refers to the base-10 logarithm of the value */
1727 public void adjustCalibration(Calibration cal) {
1728 if (xMin == xMax) //tiff images can't handle infinity in scale, see TiffEncoder.writeScale
1729 xScale = 1e6;
1730 if (yMin == yMax)
1731 yScale = 1e6;
1732 cal.xOrigin = xBasePxl-xMin*xScale;
1733 cal.pixelWidth = 1.0/Math.abs(xScale); //Calibration must not have negative pixel size
1734 cal.yOrigin = yBasePxl+yMin*yScale;
1735 cal.pixelHeight = 1.0/Math.abs(yScale);
1736 cal.setInvertY(yScale >= 0);
1737 cal.setXUnit(" "); // avoid 'pixels' for scaled units
1738 if (xMin == xMax)
1739 xScale = Double.POSITIVE_INFINITY;
1740 if (yMin == yMax)
1741 yScale = Double.POSITIVE_INFINITY;
1742 }
1743
1744 /** Displays the plot in a PlotWindow.
1745 * Plot stacks are shown in a StackWindow, not in a PlotWindow;

Callers 5

PlotMethod · 0.95
getImagePlusMethod · 0.95
setImagePlusMethod · 0.95
updateImageMethod · 0.95
makeHighResolutionMethod · 0.95

Calls 3

setInvertYMethod · 0.80
setXUnitMethod · 0.80
absMethod · 0.45

Tested by

no test coverage detected