Re: setting pixel width/height NONinteractively
Posted by
Kenneth Sloan-2 on
URL: http://imagej.273.s1.nabble.com/setting-pixel-width-height-NONinteractively-tp5023253p5023254.html
I don't think so.
AS I read the documentation,
imp = IJ.createImage("Untitled", "8-bit black", 1024, 1024, 4);
sets the width, height, and depth of the image.
I want to say that the pixels are x mm wide. I see how to set the units to "mm", but could not find
a way to set the size of the pixels, except through an interactive dialog.
Ah...I think I found it. Calibration has public fields "pixelHeight", "pixelWidth" and "pixelDepth".
I'm not used to such things being exposed as public fields - it violates my personal coding standard - so I don't often look there.
I prefer getX() and setX() methods. Calibration has (for example) getUnits() and setUnits() - but not getPixelWidth() or setPixelWidth()
My mistake. Carry on!
--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html