Login  Register

Re: How to change the label on a profile plot?

Posted by Michael Schmid on Nov 29, 2007; 10:59am
URL: http://imagej.273.s1.nabble.com/How-to-change-the-label-on-a-profile-plot-tp3697901p3697902.html

Hi Henry,

spatial calibration (Analyze>Set Scale) allows you to set the
scale, but not the offset.

A SetScale(pixelWidth, pixelHeight, xOrigin, yOrigin, unit)
macro function would be nice,  but far as I know, there is
nothing like this.

So you need a plugin with roughly the following code
(I have not tried it):

         ImagePlus img = WindowManager.getCurrentImage();
         Calibration cal = img.getCalibration();
         cal.xOrigin = pixel_where_x_would_be_zero;
         cal.yOrigin = pixel_where_y_would_be_zero;
         cal.pixelWidth = pixel_with_in_nm;
         cal.pixelHeight = pixel_height_in_whatever_units;

Michael
________________________________________________________________

On 28 Nov 2007, at 23:10, Henry Barwood wrote:

> I am collecting optical spectra from a device I built using a 640 X  
> 480
> pixel webcam as a sensing element. I convert them into spectrograms  
> using
> ImageJ which works nicely; however, I need to produce a profile  
> plot with nm
> instead of pixel labeling and I need to have the scale start at 380 nm
> instead of "0" pixels. Is there an easy way to do this, and then  
> output the
> plot to a printable file? Any help or suggestions as to where to  
> look to
> find an answer would be welcome. Thanks.
>
>
>
> Henry Barwood
>
> Associate Professor of Science, Earth Sciences
>
> Department of Math and Physics
>
> MSCX 312G
>
> Troy University
>
> Troy, Alabama
>
> [hidden email]
>
>