> On Aug 14, 2024, at 9:17 PM, Kenneth Sloan <[email protected]> wrote:
> 
> I have been making more and more use of the Calibration feature to establish 
> custom coordinate systems for images.  I note that when an image is re-sized 
> (and presumably cropped, although I haven't tested this yet), the Calibration 
> remains the same.

The calibration is updated when an image is resized, as this example script 
demonstrates.

 imp = IJ.openImage("http://imagej.net/images/ct.dcm.zip";);
 cal = imp.getCalibration();
 IJ.log("Pixel width (before) = "+cal.pixelWidth+" "+cal.units);
 imp = imp.resize(imp.getWidth()/2,imp.getHeight()/2, 1, "bilinear");
 cal = imp.getCalibration();
 IJ.log("Pixel width (after) = "+cal.pixelWidth+" "+cal.units);
 imp.show();

This is the output:

  Pixel width (before) = 0.5968470955331366 mm
  Pixel width (after) = 1.1936941910662733 mm

> Is it possible for operations such as "resize" to update the Calibration, if 
> one is attached to an image?  It seems obvious to me (perhaps it's not 
> obvious?) that xOrigin, yOrigin, pixelHeight, pixelWidth can all be modified 
> in a straightforward way.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Reply via email to