Using the macro code
run("Confocal Series");
getPixelSize(unit, pixelWidth, pixelHeight)
print(unit, pixelWidth, pixelHeight);
run("Size...", "width=200 height=200 depth=25 constrain average
interpolation=Bilinear");
getPixelSize(unit, pixelWidth, pixelHeight)
print(unit, pixelWidth, pixelHeight);
Created some java as well via the recorder. Not so elegant, as I don't know how
to extract the pixel width/height but properties gives the values as well and
the calibration changes
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;
public class resize implements PlugIn {
public void run(String arg) {
ImagePlus imp =
IJ.openImage("http://imagej.net/images/confocal-series.zip");
IJ.run(imp, "Properties...", "");
imp = imp.resize(200, 200, 1, "bilinear");
IJ.run(imp,"Properties...", "");
imp.show();
}
}
Kees
-----Original Message-----
Sent: 16 August 2024 12:55
Subject: Re: Calibration feature request
***CAUTION:*** This email was sent from an EXTERNAL source. Think before
clicking links or opening attachments.
Hmm - I'll have to test again. I use ImagePlus.resize() from within a Java
plugin and didn't see the Calubration change.
I'll try again. Question - how did you change the dimensions? From the GUI?
-Kenneth Sloan
On Fri, Aug 16, 2024 at 07:19 Straatman, Kees (Dr.) <[email protected]>
wrote:
> Hi Kenneth,
>
> Not sure what you mean. If I open Confocal Series I see
> pixel_width=0.0544550 pixel_height=0.0544550. If I change the image
> size from 400 pixels to 200 pixels I get pixel_width=0.1089100
> pixel_height=0.1089100, so the calibration has been adjusted.
>
> Best wishes
> Kees
>
> Advanced Imaging Facility (RRID: SCR_020967)
>
> University of Leicester
>
> http://www.l/
> e.ac.uk%2Fadvanced-imaging-facility&data=05%7C02%7Ckrs5%40leicester.ac
> .uk%7C41531174758546d0830608dcbdec9d64%7Caebecd6a31d44b0195ce8274afe85
> 3d9%7C0%7C0%7C638594071155692630%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sda
> ta=Hp0vl3SNoEPqXZ9FXVep9s1vxPjnGXYxWmAQbVBgqG0%3D&reserved=0<
> http://www.l/
> e.ac.uk%2Fadvanced-imaging-facility&data=05%7C02%7Ckrs5%40leicester.ac
> .uk%7C41531174758546d0830608dcbdec9d64%7Caebecd6a31d44b0195ce8274afe85
> 3d9%7C0%7C0%7C638594071155703639%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sda
> ta=DjJOUlGosquax87D6qPE84ckjiZZkFTrz9fgSjSriWo%3D&reserved=0>
>
>
> ________________________________
> From: Kenneth Sloan <[email protected]>
> Sent: 15 August 2024 02:16
> To: [email protected] <[email protected]>
> Subject: Calibration feature request
>
> ***CAUTION:*** This email was sent from an EXTERNAL source. Think
> before clicking links or opening attachments.
>
> 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.
>
> 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.
>
> --
> Kenneth Sloan
> [email protected]
> Vision is the art of seeing what is invisible to others.
>
> --
> ImageJ mailing list:
> http://image/
> j.nih.gov%2Fij%2Flist.html&data=05%7C02%7Ckrs5%40leicester.ac.uk%7C415
> 31174758546d0830608dcbdec9d64%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7
> C0%7C638594071155710951%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
> JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=NF%2Fu
> c39%2BK3UZX5hIMr1gs4l51Ux0gJad2%2BFsn9N7tL0%3D&reserved=0
> <http://imag/
> ej.nih.gov%2Fij%2Flist.html&data=05%7C02%7Ckrs5%40leicester.ac.uk%7C41
> 531174758546d0830608dcbdec9d64%7Caebecd6a31d44b0195ce8274afe853d9%7C0%
> 7C0%7C638594071155715431%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
> CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=e1az%
> 2BRFfYKBX2CCd8qkkkMelQhbJUduhqa2tuuxkls4%3D&reserved=0>
>
> --
> ImageJ mailing list:
> http://image/
> j.nih.gov%2Fij%2Flist.html&data=05%7C02%7Ckrs5%40leicester.ac.uk%7C415
> 31174758546d0830608dcbdec9d64%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7
> C0%7C638594071155719927%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
> JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Kiphiq
> k6rrC6TBfjbmokgWCFR9kk6S7TMUabSLgm54s%3D&reserved=0
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html